Check decoding params for new methods

This commit is contained in:
Geoff Stuart 2023-02-01 16:44:44 -05:00
parent 0c33eab20a
commit f05437d253
3 changed files with 101 additions and 4 deletions

View File

@ -603,6 +603,11 @@ workflows:
suite: itest-deals
target: "./itests/deals_test.go"
- test:
name: test-itest-decode_params
suite: itest-decode_params
target: "./itests/decode_params_test.go"
- test:
name: test-itest-dup_mpool_messages
suite: itest-dup_mpool_messages

View File

@ -1354,7 +1354,7 @@ func ComputeStateHTMLTempl(w io.Writer, ts *types.TipSet, o *api.ComputeStateOut
"GetMethod": getMethod,
"ToFil": toFil,
"JsonParams": JsonParams,
"JsonReturn": jsonReturn,
"JsonReturn": JsonReturn,
"IsSlow": isSlow,
"IsVerySlow": isVerySlow,
"IntExit": func(i exitcode.ExitCode) int64 { return int64(i) },
@ -1440,7 +1440,7 @@ func JsonParams(code cid.Cid, method abi.MethodNum, params []byte) (string, erro
return string(b), err
}
func jsonReturn(code cid.Cid, method abi.MethodNum, ret []byte) (string, error) {
func JsonReturn(code cid.Cid, method abi.MethodNum, ret []byte) (string, error) {
methodMeta, found := filcns.NewActorRegistry().Methods[code][method] // TODO: use remote
if !found {
return "", fmt.Errorf("method %d not found on actor %s", method, code)
@ -1549,7 +1549,7 @@ func printReceiptReturn(ctx context.Context, api v0api.FullNode, m *types.Messag
return err
}
jret, err := jsonReturn(act.Code, m.Method, r.Return)
jret, err := JsonReturn(act.Code, m.Method, r.Return)
if err != nil {
return err
}
@ -1689,7 +1689,7 @@ var StateCallCmd = &cli.Command{
return xerrors.Errorf("getting actor: %w", err)
}
retStr, err := jsonReturn(act.Code, abi.MethodNum(method), ret.MsgRct.Return)
retStr, err := JsonReturn(act.Code, abi.MethodNum(method), ret.MsgRct.Return)
if err != nil {
return xerrors.Errorf("decoding return: %w", err)
}

File diff suppressed because one or more lines are too long