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
|
// current instance of the network harness. The created node is running, but
|
||||||
// not yet connected to other nodes within the network.
|
// not yet connected to other nodes within the network.
|
||||||
func (n *NetworkHarness) NewNode(name string, extraArgs []string) (*HarnessNode, error) {
|
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
|
// 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,
|
func (n *NetworkHarness) NewNodeWithSeed(name string, extraArgs []string,
|
||||||
password []byte) (*HarnessNode, []string, error) {
|
password []byte) (*HarnessNode, []string, error) {
|
||||||
|
|
||||||
node, err := n.newNode(name, extraArgs, true)
|
node, err := n.newNode(name, extraArgs, true, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ func (n *NetworkHarness) RestoreNodeWithSeed(name string, extraArgs []string,
|
|||||||
password []byte, mnemonic []string,
|
password []byte, mnemonic []string,
|
||||||
recoveryWindow int32) (*HarnessNode, error) {
|
recoveryWindow int32) (*HarnessNode, error) {
|
||||||
|
|
||||||
node, err := n.newNode(name, extraArgs, true)
|
node, err := n.newNode(name, extraArgs, true, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// can be used immediately. Otherwise, the node will require an additional
|
||||||
// initialization phase where the wallet is either created or restored.
|
// initialization phase where the wallet is either created or restored.
|
||||||
func (n *NetworkHarness) newNode(name string, extraArgs []string,
|
func (n *NetworkHarness) newNode(name string, extraArgs []string,
|
||||||
hasSeed bool) (*HarnessNode, error) {
|
hasSeed bool, password []byte) (*HarnessNode, error) {
|
||||||
|
|
||||||
node, err := newNode(nodeConfig{
|
node, err := newNode(nodeConfig{
|
||||||
Name: name,
|
Name: name,
|
||||||
HasSeed: hasSeed,
|
HasSeed: hasSeed,
|
||||||
|
Password: password,
|
||||||
BackendCfg: n.BackendCfg,
|
BackendCfg: n.BackendCfg,
|
||||||
NetParams: n.netParams,
|
NetParams: n.netParams,
|
||||||
ExtraArgs: extraArgs,
|
ExtraArgs: extraArgs,
|
||||||
|
Loading…
Reference in New Issue
Block a user