lntest: exend newNode method to accept wallet password
This commit is contained in:
parent
441f010295
commit
b62dd09430
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user