cli: handle 'name' named argument in 'wallet import-multisig'

If the provided WIF is encrypted, then we won't get account name from
readAccountInfo.
This commit is contained in:
Anna Shaleva 2021-04-19 17:10:53 +03:00
parent 6af2f3fdec
commit 08e88ce5b2

View file

@ -173,7 +173,7 @@ func NewCommands() []cli.Command {
{
Name: "import-multisig",
Usage: "import multisig contract",
UsageText: "import-multisig --wallet <path> --wif <wif> --min <n>" +
UsageText: "import-multisig --wallet <path> --wif <wif> [--name <account_name>] --min <n>" +
" [<pubkey1> [<pubkey2> [...]]]",
Action: importMultisig,
Flags: []cli.Flag{
@ -410,6 +410,9 @@ func importMultisig(ctx *cli.Context) error {
return cli.NewExitError(err, 1)
}
if acc.Label == "" {
acc.Label = ctx.String("name")
}
if err := addAccountAndSave(wall, acc); err != nil {
return cli.NewExitError(err, 1)
}