Check decoding params for new methods
This commit is contained in:
parent
0c33eab20a
commit
f05437d253
@ -603,6 +603,11 @@ workflows:
|
|||||||
suite: itest-deals
|
suite: itest-deals
|
||||||
target: "./itests/deals_test.go"
|
target: "./itests/deals_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-decode_params
|
||||||
|
suite: itest-decode_params
|
||||||
|
target: "./itests/decode_params_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-dup_mpool_messages
|
name: test-itest-dup_mpool_messages
|
||||||
suite: itest-dup_mpool_messages
|
suite: itest-dup_mpool_messages
|
||||||
|
@ -1354,7 +1354,7 @@ func ComputeStateHTMLTempl(w io.Writer, ts *types.TipSet, o *api.ComputeStateOut
|
|||||||
"GetMethod": getMethod,
|
"GetMethod": getMethod,
|
||||||
"ToFil": toFil,
|
"ToFil": toFil,
|
||||||
"JsonParams": JsonParams,
|
"JsonParams": JsonParams,
|
||||||
"JsonReturn": jsonReturn,
|
"JsonReturn": JsonReturn,
|
||||||
"IsSlow": isSlow,
|
"IsSlow": isSlow,
|
||||||
"IsVerySlow": isVerySlow,
|
"IsVerySlow": isVerySlow,
|
||||||
"IntExit": func(i exitcode.ExitCode) int64 { return int64(i) },
|
"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
|
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
|
methodMeta, found := filcns.NewActorRegistry().Methods[code][method] // TODO: use remote
|
||||||
if !found {
|
if !found {
|
||||||
return "", fmt.Errorf("method %d not found on actor %s", method, code)
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
jret, err := jsonReturn(act.Code, m.Method, r.Return)
|
jret, err := JsonReturn(act.Code, m.Method, r.Return)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -1689,7 +1689,7 @@ var StateCallCmd = &cli.Command{
|
|||||||
return xerrors.Errorf("getting actor: %w", err)
|
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 {
|
if err != nil {
|
||||||
return xerrors.Errorf("decoding return: %w", err)
|
return xerrors.Errorf("decoding return: %w", err)
|
||||||
}
|
}
|
||||||
|
92
itests/decode_params_test.go
Normal file
92
itests/decode_params_test.go
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user