Skip to content

Commit

Permalink
Merge pull request #9813 from filecoin-project/jennijuju-patch-4
Browse files Browse the repository at this point in the history
feat: ux: add value option to message invocation cli
  • Loading branch information
jennijuju authored Dec 8, 2022
2 parents 8504401 + 3bb12f4 commit 0026ad8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,9 @@ var ChainInvokeEVMCmd = &cli.Command{
&cli.StringFlag{
Name: "from",
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 {
Expand Down Expand Up @@ -1727,10 +1730,11 @@ var ChainInvokeEVMCmd = &cli.Command{
fromAddr = addr
}

val := abi.NewTokenAmount(cctx.Int64("value"))
msg := &types.Message{
To: addr,
From: fromAddr,
Value: big.Zero(),
Value: val,
Method: abi.MethodNum(2),
Params: params,
}
Expand Down
3 changes: 2 additions & 1 deletion documentation/en/cli-lotus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2454,7 +2454,8 @@ USAGE:
lotus chain invoke-evm-actor [command options] address contract-entry-point [input-data]
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)
```

Expand Down

0 comments on commit 0026ad8

Please sign in to comment.