Merge pull request #10619 from filecoin-project/fix/10617
fix: make state compute --html work with unknown methods
This commit is contained in:
commit
d2b7d0071d
11
cli/state.go
11
cli/state.go
@ -1268,7 +1268,7 @@ var compStateMsg = `
|
|||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if ne .MsgRct.ExitCode 0}}
|
{{if ne .MsgRct.ExitCode 0}}
|
||||||
<div class="error">Error: <pre>{{.Error}}</pre></div>
|
<div class="error">Exit: <pre>{{.MsgRct.ExitCode}}</pre></div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -1372,7 +1372,14 @@ func isVerySlow(t time.Duration) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func JsonParams(code cid.Cid, method abi.MethodNum, params []byte) (string, error) {
|
func JsonParams(code cid.Cid, method abi.MethodNum, params []byte) (string, error) {
|
||||||
p, err := stmgr.GetParamType(consensus.NewActorRegistry(), code, method) // todo use api for correct actor registry
|
ar := consensus.NewActorRegistry()
|
||||||
|
|
||||||
|
_, found := ar.Methods[code][method]
|
||||||
|
if !found {
|
||||||
|
return fmt.Sprintf("raw:%x", params), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
p, err := stmgr.GetParamType(ar, code, method) // todo use api for correct actor registry
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user