fix: msg signing with delegated keys and send cli changes (#10056)

* fix msg signing with delegated keys and send cli changes

* make gen and docsgen

* address comments
This commit is contained in:
Shrenuj Bansal
2023-01-19 17:57:48 -05:00
committed by GitHub
parent 2335bed58a
commit 522e96f016
5 changed files with 68 additions and 12 deletions
+17
View File
@@ -13,6 +13,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
)
var sendCmd = &cli.Command{
@@ -24,6 +25,10 @@ var sendCmd = &cli.Command{
Name: "from",
Usage: "optionally specify the account to send funds from",
},
&cli.StringFlag{
Name: "from-eth-addr",
Usage: "optionally specify the eth addr to send funds from",
},
&cli.StringFlag{
Name: "gas-premium",
Usage: "specify gas price to use in AttoFIL",
@@ -98,6 +103,18 @@ var sendCmd = &cli.Command{
}
params.From = addr
} else if from := cctx.String("from-eth-addr"); from != "" {
eaddr, err := ethtypes.ParseEthAddress(from)
if err != nil {
return err
}
faddr, err := eaddr.ToFilecoinAddress()
if err != nil {
fmt.Println("error on conversion to faddr")
return err
}
fmt.Println("f4 addr: ", faddr)
params.From = faddr
}
if cctx.IsSet("gas-premium") {