fix broke invoke (#10031)

Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
This commit is contained in:
ZenGround0 2023-01-19 11:41:11 -05:00 committed by GitHub
parent 9463dc4a99
commit 178aaf6ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,8 +345,8 @@ var EvmInvokeCmd = &cli.Command{
defer closer() defer closer()
ctx := ReqContext(cctx) ctx := ReqContext(cctx)
if argc := cctx.Args().Len(); argc < 2 || argc > 3 { if argc := cctx.Args().Len(); argc != 2 {
return xerrors.Errorf("must pass the address, entry point and (optionally) input data") return xerrors.Errorf("must pass the address and calldata")
} }
addr, err := address.NewFromString(cctx.Args().Get(0)) addr, err := address.NewFromString(cctx.Args().Get(0))
@ -355,7 +355,7 @@ var EvmInvokeCmd = &cli.Command{
} }
var calldata []byte var calldata []byte
calldata, err = hex.DecodeString(cctx.Args().Get(2)) calldata, err = hex.DecodeString(cctx.Args().Get(1))
if err != nil { if err != nil {
return xerrors.Errorf("decoding hex input data: %w", err) return xerrors.Errorf("decoding hex input data: %w", err)
} }
@ -388,7 +388,7 @@ var EvmInvokeCmd = &cli.Command{
To: addr, To: addr,
From: fromAddr, From: fromAddr,
Value: val, Value: val,
Method: abi.MethodNum(2), Method: builtintypes.MethodsEVM.InvokeContract,
Params: calldata, Params: calldata,
} }