test: Add BitcoinTestFramework::sync_* methods

pull/764/head
MarcoFalke 6 years ago
parent fafe008cb4
commit fa6dc7c5c3
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -406,10 +406,16 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
connect_nodes_bi(self.nodes, 1, 2) connect_nodes_bi(self.nodes, 1, 2)
self.sync_all() self.sync_all()
def sync_all(self, nodes=None, **kwargs): def sync_blocks(self, nodes=None, **kwargs):
sync_blocks(nodes or self.nodes, **kwargs) sync_blocks(nodes or self.nodes, **kwargs)
def sync_mempools(self, nodes=None, **kwargs):
sync_mempools(nodes or self.nodes, **kwargs) sync_mempools(nodes or self.nodes, **kwargs)
def sync_all(self, nodes=None, **kwargs):
self.sync_blocks(nodes, **kwargs)
self.sync_mempools(nodes, **kwargs)
# Private helper methods. These should not be accessed by the subclass test scripts. # Private helper methods. These should not be accessed by the subclass test scripts.
def _start_logging(self): def _start_logging(self):
@ -494,7 +500,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
# see the tip age check in IsInitialBlockDownload(). # see the tip age check in IsInitialBlockDownload().
for i in range(8): for i in range(8):
self.nodes[0].generatetoaddress(25 if i != 7 else 24, self.nodes[i % 4].get_deterministic_priv_key().address) self.nodes[0].generatetoaddress(25 if i != 7 else 24, self.nodes[i % 4].get_deterministic_priv_key().address)
sync_blocks(self.nodes) self.sync_blocks()
for n in self.nodes: for n in self.nodes:
assert_equal(n.getblockchaininfo()["blocks"], 199) assert_equal(n.getblockchaininfo()["blocks"], 199)

Loading…
Cancel
Save