From b62dd09430883a8bfc0933b914c905db0d80334e Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 10 Mar 2019 16:31:43 -0700 Subject: [PATCH] lntest: exend newNode method to accept wallet password --- lntest/harness.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lntest/harness.go b/lntest/harness.go index 6f3351de..10cffe29 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -248,7 +248,7 @@ func (n *NetworkHarness) TearDownAll() error { // current instance of the network harness. The created node is running, but // not yet connected to other nodes within the network. func (n *NetworkHarness) NewNode(name string, extraArgs []string) (*HarnessNode, error) { - return n.newNode(name, extraArgs, false) + return n.newNode(name, extraArgs, false, nil) } // NewNodeWithSeed fully initializes a new HarnessNode after creating a fresh @@ -258,7 +258,7 @@ func (n *NetworkHarness) NewNode(name string, extraArgs []string) (*HarnessNode, func (n *NetworkHarness) NewNodeWithSeed(name string, extraArgs []string, password []byte) (*HarnessNode, []string, error) { - node, err := n.newNode(name, extraArgs, true) + node, err := n.newNode(name, extraArgs, true, password) if err != nil { return nil, nil, err } @@ -308,7 +308,7 @@ func (n *NetworkHarness) RestoreNodeWithSeed(name string, extraArgs []string, password []byte, mnemonic []string, recoveryWindow int32) (*HarnessNode, error) { - node, err := n.newNode(name, extraArgs, true) + node, err := n.newNode(name, extraArgs, true, password) if err != nil { return nil, err } @@ -337,10 +337,12 @@ func (n *NetworkHarness) RestoreNodeWithSeed(name string, extraArgs []string, // can be used immediately. Otherwise, the node will require an additional // initialization phase where the wallet is either created or restored. func (n *NetworkHarness) newNode(name string, extraArgs []string, - hasSeed bool) (*HarnessNode, error) { + hasSeed bool, password []byte) (*HarnessNode, error) { + node, err := newNode(nodeConfig{ Name: name, HasSeed: hasSeed, + Password: password, BackendCfg: n.BackendCfg, NetParams: n.netParams, ExtraArgs: extraArgs,