fix broke invoke (#10031)
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
This commit is contained in:
parent
9463dc4a99
commit
178aaf6ac4
@ -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,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user