diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-11-10 18:02:31 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-10-29 13:34:52 +0200 |
commit | facc352648e4fe1ed9b406400b6e4a9d51f30349 (patch) | |
tree | 7bba05900db761f91c0b416985a3a774984bfd49 /test/functional/wallet_listsinceblock.py | |
parent | 5574881ce329f91cc5bbc2b9585860a45fde7c3c (diff) | |
download | bitcoin-facc352648e4fe1ed9b406400b6e4a9d51f30349.tar.xz |
test: Implicitly sync after generate*, unless opted out
Diffstat (limited to 'test/functional/wallet_listsinceblock.py')
-rwxr-xr-x | test/functional/wallet_listsinceblock.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/test/functional/wallet_listsinceblock.py b/test/functional/wallet_listsinceblock.py index f4a00a8ec8..815e3e6298 100755 --- a/test/functional/wallet_listsinceblock.py +++ b/test/functional/wallet_listsinceblock.py @@ -54,7 +54,6 @@ class ListSinceBlockTest(BitcoinTestFramework): blockhash, = self.generate(self.nodes[2], 1) blockheight = self.nodes[2].getblockheader(blockhash)['height'] - self.sync_all() txs = self.nodes[0].listtransactions() assert_array_result(txs, {"txid": txid}, { @@ -99,7 +98,6 @@ class ListSinceBlockTest(BitcoinTestFramework): self.log.info("Test target_confirmations") blockhash, = self.generate(self.nodes[2], 1) blockheight = self.nodes[2].getblockheader(blockhash)['height'] - self.sync_all() assert_equal( self.nodes[0].getblockhash(0), @@ -147,14 +145,11 @@ class ListSinceBlockTest(BitcoinTestFramework): senttx = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1) # generate on both sides - nodes1_last_blockhash = self.generate(self.nodes[1], 6)[-1] - nodes2_first_blockhash = self.generate(self.nodes[2], 7)[0] + nodes1_last_blockhash = self.generate(self.nodes[1], 6, sync_fun=lambda: self.sync_all(self.nodes[:2]))[-1] + nodes2_first_blockhash = self.generate(self.nodes[2], 7, sync_fun=lambda: self.sync_all(self.nodes[2:]))[0] self.log.debug("nodes[1] last blockhash = {}".format(nodes1_last_blockhash)) self.log.debug("nodes[2] first blockhash = {}".format(nodes2_first_blockhash)) - self.sync_all(self.nodes[:2]) - self.sync_all(self.nodes[2:]) - self.join_network() # listsinceblock(nodes1_last_blockhash) should now include tx as seen from nodes[0] @@ -236,8 +231,8 @@ class ListSinceBlockTest(BitcoinTestFramework): self.nodes[2].createrawtransaction(utxo_dicts, recipient_dict2))['hex']) # generate on both sides - lastblockhash = self.generate(self.nodes[1], 3)[2] - self.generate(self.nodes[2], 4) + lastblockhash = self.generate(self.nodes[1], 3, sync_fun=self.no_op)[2] + self.generate(self.nodes[2], 4, sync_fun=self.no_op) self.join_network() @@ -308,7 +303,7 @@ class ListSinceBlockTest(BitcoinTestFramework): txid1 = self.nodes[1].sendrawtransaction(signedtx) # generate bb1-bb2 on right side - self.generate(self.nodes[2], 2) + self.generate(self.nodes[2], 2, sync_fun=self.no_op) # send from nodes[2]; this will end up in bb3 txid2 = self.nodes[2].sendrawtransaction(signedtx) @@ -316,8 +311,8 @@ class ListSinceBlockTest(BitcoinTestFramework): assert_equal(txid1, txid2) # generate on both sides - lastblockhash = self.generate(self.nodes[1], 3)[2] - self.generate(self.nodes[2], 2) + lastblockhash = self.generate(self.nodes[1], 3, sync_fun=self.no_op)[2] + self.generate(self.nodes[2], 2, sync_fun=self.no_op) self.join_network() |