Allow users to specify sender when creating multisigs

This commit is contained in:
Aayush Rajasekaran 2020-04-24 17:55:33 -04:00
parent 0f0589bcf5
commit 1565e10fff

View File

@ -59,6 +59,10 @@ var msigCreateCmd = &cli.Command{
Usage: "initial funds to give to multisig", Usage: "initial funds to give to multisig",
Value: "0", Value: "0",
}, },
&cli.StringFlag{
Name: "sender",
Usage: "account to send the create message from",
},
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) 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) // 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 { if err != nil {
return err return err
} }
sendAddr = defaddr
} else {
addr, err := address.NewFromString(send)
if err != nil {
return err
}
sendAddr = addr
}
val := cctx.String("value") val := cctx.String("value")
filval, err := types.ParseFIL(val) filval, err := types.ParseFIL(val)
if err != nil { if err != nil {