mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 14:22:47 +02:00
[tests] TestNode: separate add_node from start_node
Separates the act of creating a TestNode object from starting the node. The test_framework now keeps track of its list of TestNodes, and test writers can call start_node() and stop_node() without having to update the self.nodes list.
This commit is contained in:
@@ -34,21 +34,18 @@ class BumpFeeTest(BitcoinTestFramework):
|
||||
super().__init__()
|
||||
self.num_nodes = 2
|
||||
self.setup_clean_chain = True
|
||||
self.extra_args = [["-prematurewitness", "-walletprematurewitness", "-walletrbf={}".format(i)]
|
||||
for i in range(self.num_nodes)]
|
||||
|
||||
def setup_network(self, split=False):
|
||||
extra_args = [["-prematurewitness", "-walletprematurewitness", "-walletrbf={}".format(i)]
|
||||
for i in range(self.num_nodes)]
|
||||
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
|
||||
|
||||
def run_test(self):
|
||||
# Encrypt wallet for test_locked_wallet_fails test
|
||||
self.nodes[1].node_encrypt_wallet(WALLET_PASSPHRASE)
|
||||
self.nodes[1] = self.start_node(1, self.options.tmpdir, extra_args[1])
|
||||
self.start_node(1)
|
||||
self.nodes[1].walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
|
||||
|
||||
connect_nodes_bi(self.nodes, 0, 1)
|
||||
self.sync_all()
|
||||
|
||||
def run_test(self):
|
||||
peer_node, rbf_node = self.nodes
|
||||
rbf_node_address = rbf_node.getnewaddress()
|
||||
|
||||
|
Reference in New Issue
Block a user