Address more comments
This commit is contained in:
parent
f14eda4468
commit
8baa48256a
20
cli/eth.go
20
cli/eth.go
@ -19,12 +19,12 @@ var EthCmd = &cli.Command{
|
|||||||
Name: "eth",
|
Name: "eth",
|
||||||
Usage: "Query eth contract state",
|
Usage: "Query eth contract state",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
EthGetAddressCmd,
|
EthGetInfoCmd,
|
||||||
EthCallSimulateCmd,
|
EthCallSimulateCmd,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var EthGetAddressCmd = &cli.Command{
|
var EthGetInfoCmd = &cli.Command{
|
||||||
Name: "stat",
|
Name: "stat",
|
||||||
Usage: "Print eth/filecoin addrs and code cid",
|
Usage: "Print eth/filecoin addrs and code cid",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
@ -98,19 +98,19 @@ var EthCallSimulateCmd = &cli.Command{
|
|||||||
ArgsUsage: "[from] [to] [params]",
|
ArgsUsage: "[from] [to] [params]",
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
|
|
||||||
var fromEthAddr ethtypes.EthAddress
|
if cctx.NArg() != 3 {
|
||||||
fromAddr, err := hex.DecodeString(cctx.Args().Get(0))
|
return IncorrectNumArgs(cctx)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
copy(fromEthAddr[:], fromAddr)
|
|
||||||
|
|
||||||
var toEthAddr ethtypes.EthAddress
|
fromEthAddr, err := ethtypes.EthAddressFromHex(cctx.Args().Get(0))
|
||||||
toAddr, err := hex.DecodeString(cctx.Args().Get(1))
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
toEthAddr, err := ethtypes.EthAddressFromHex(cctx.Args().Get(1))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
copy(toEthAddr[:], toAddr)
|
|
||||||
|
|
||||||
params, err := hex.DecodeString(cctx.Args().Get(2))
|
params, err := hex.DecodeString(cctx.Args().Get(2))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user