From f7b130b5ca999bc32f11be1e026ea5daf6a30f92 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 4 May 2021 15:57:54 -0700 Subject: [PATCH] lncli: add dry run flag for wallet account import command --- cmd/lncli/walletrpc_active.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/lncli/walletrpc_active.go b/cmd/lncli/walletrpc_active.go index a8f4c0834..96d3f9fe7 100644 --- a/cmd/lncli/walletrpc_active.go +++ b/cmd/lncli/walletrpc_active.go @@ -966,6 +966,10 @@ var importAccountCommand = cli.Command{ "(derivation path m/) corresponding to the " + "account public key", }, + cli.BoolFlag{ + Name: "dry_run", + Usage: "(optional) perform a dry run", + }, }, Action: actionDecorator(importAccount), } @@ -975,7 +979,7 @@ func importAccount(ctx *cli.Context) error { // Display the command's help message if we do not have the expected // number of arguments/flags. - if ctx.NArg() != 2 || ctx.NumFlags() > 2 { + if ctx.NArg() != 2 || ctx.NumFlags() > 3 { return cli.ShowCommandHelp(ctx, "import") } @@ -996,11 +1000,13 @@ func importAccount(ctx *cli.Context) error { walletClient, cleanUp := getWalletClient(ctx) defer cleanUp() + dryRun := ctx.Bool("dry_run") req := &walletrpc.ImportAccountRequest{ Name: ctx.Args().Get(1), ExtendedPublicKey: ctx.Args().Get(0), MasterKeyFingerprint: masterKeyFingerprint, AddressType: addrType, + DryRun: dryRun, } resp, err := walletClient.ImportAccount(ctxc, req) if err != nil {