Merge pull request #9813 from filecoin-project/jennijuju-patch-4

feat: ux: add value option to message invocation cli
This commit is contained in:
Jiaying Wang 2022-12-08 03:05:13 -05:00 committed by GitHub
commit 0026ad8c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1667,6 +1667,9 @@ var ChainInvokeEVMCmd = &cli.Command{
&cli.StringFlag{ &cli.StringFlag{
Name: "from", Name: "from",
Usage: "optionally specify the account to use for sending the exec message", Usage: "optionally specify the account to use for sending the exec message",
}, &cli.IntFlag{
Name: "value",
Usage: "optionally specify the value to be sent with the invokation message",
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
@ -1727,10 +1730,11 @@ var ChainInvokeEVMCmd = &cli.Command{
fromAddr = addr fromAddr = addr
} }
val := abi.NewTokenAmount(cctx.Int64("value"))
msg := &types.Message{ msg := &types.Message{
To: addr, To: addr,
From: fromAddr, From: fromAddr,
Value: big.Zero(), Value: val,
Method: abi.MethodNum(2), Method: abi.MethodNum(2),
Params: params, Params: params,
} }

View File

@ -2454,7 +2454,8 @@ USAGE:
lotus chain invoke-evm-actor [command options] address contract-entry-point [input-data] lotus chain invoke-evm-actor [command options] address contract-entry-point [input-data]
OPTIONS: OPTIONS:
--from value optionally specify the account to use for sending the exec message --from value optionally specify the account to use for sending the exec message
--value value optionally specify the value to be sent with the invokation message (default: 0)
``` ```