aboutsummaryrefslogtreecommitdiff
path: root/test/functional/assumevalid.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-06-09 16:35:17 -0400
committerMarcoFalke <falke.marco@gmail.com>2017-10-03 18:43:15 +0200
commit4d3ba18386c7a09086d06c8b640c19343ff34188 (patch)
tree93de2e0a806af1d76f8b36faf1bf3f3a5677a684 /test/functional/assumevalid.py
parent11a5992c90d4cc9a3823ea08dab2c078bcbf15d2 (diff)
downloadbitcoin-4d3ba18386c7a09086d06c8b640c19343ff34188.tar.xz
[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. Github-Pull: #11121 Rebased-From: 36b626867087e9fae6d85f926248997ebff327b7
Diffstat (limited to 'test/functional/assumevalid.py')
-rwxr-xr-xtest/functional/assumevalid.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/functional/assumevalid.py b/test/functional/assumevalid.py
index 9d17faac51..63e6a384a4 100755
--- a/test/functional/assumevalid.py
+++ b/test/functional/assumevalid.py
@@ -60,10 +60,11 @@ class AssumeValidTest(BitcoinTestFramework):
self.num_nodes = 3
def setup_network(self):
+ self.add_nodes(3, self.options.tmpdir)
# Start node0. We don't start the other nodes yet since
# we need to pre-mine a block with an invalid transaction
# signature so we can pass in the block hash as assumevalid.
- self.nodes = [self.start_node(0, self.options.tmpdir)]
+ self.start_node(0)
def send_blocks_until_disconnected(self, node):
"""Keep sending blocks to the node until we're disconnected."""
@@ -162,15 +163,13 @@ class AssumeValidTest(BitcoinTestFramework):
height += 1
# Start node1 and node2 with assumevalid so they accept a block with a bad signature.
- self.nodes.append(self.start_node(1, self.options.tmpdir,
- ["-assumevalid=" + hex(block102.sha256)]))
+ self.start_node(1, extra_args=["-assumevalid=" + hex(block102.sha256)])
node1 = BaseNode() # connects to node1
connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1], node1))
node1.add_connection(connections[1])
node1.wait_for_verack()
- self.nodes.append(self.start_node(2, self.options.tmpdir,
- ["-assumevalid=" + hex(block102.sha256)]))
+ self.start_node(2, extra_args=["-assumevalid=" + hex(block102.sha256)])
node2 = BaseNode() # connects to node2
connections.append(NodeConn('127.0.0.1', p2p_port(2), self.nodes[2], node2))
node2.add_connection(connections[2])