Allow users to specify sender when creating multisigs
This commit is contained in:
parent
0f0589bcf5
commit
1565e10fff
@ -59,6 +59,10 @@ var msigCreateCmd = &cli.Command{
|
||||
Usage: "initial funds to give to multisig",
|
||||
Value: "0",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "sender",
|
||||
Usage: "account to send the create message from",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := GetFullNodeAPI(cctx)
|
||||
@ -78,11 +82,23 @@ var msigCreateCmd = &cli.Command{
|
||||
}
|
||||
|
||||
// get the address we're going to use to create the multisig (can be one of the above, as long as they have funds)
|
||||
sendAddr, err := api.WalletDefaultAddress(ctx)
|
||||
var sendAddr address.Address
|
||||
if send := cctx.String("sender"); send == "" {
|
||||
defaddr, err := api.WalletDefaultAddress(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sendAddr = defaddr
|
||||
} else {
|
||||
addr, err := address.NewFromString(send)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sendAddr = addr
|
||||
}
|
||||
|
||||
val := cctx.String("value")
|
||||
filval, err := types.ParseFIL(val)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user