From 1565e10fff20f25d6dd6177b9dd317664f5195c5 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Fri, 24 Apr 2020 17:55:33 -0400 Subject: [PATCH] Allow users to specify sender when creating multisigs --- cli/multisig.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cli/multisig.go b/cli/multisig.go index 0913c1ff9..fb0294b51 100644 --- a/cli/multisig.go +++ b/cli/multisig.go @@ -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,9 +82,21 @@ 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) - if err != nil { - return err + 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")