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