diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-03 02:12:39 +0800 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-03 02:12:46 +0800 |
commit | ff53433fe4ed06893d7c497a9687f326b0280d4e (patch) | |
tree | 9279a763b6ea317d05b8db35a535f5e5acbf5fbb /test/functional/p2p_segwit.py | |
parent | b83565625e32b22395e28c1965b2e42fc17f04d7 (diff) | |
parent | 6112a209828c43930f677c45461339cdf68a56e9 (diff) | |
download | bitcoin-ff53433fe4ed06893d7c497a9687f326b0280d4e.tar.xz |
Merge #18494: test: replace (send_message + sync_with_ping) with send_and_ping
6112a209828c43930f677c45461339cdf68a56e9 test: replace (send_message + sync_with_ping) with send_and_ping (Jon Atack)
Pull request description:
This is a follow-up to faf1d047313e71658fb31f6b94fdd5d37705ab85 yesterday.
ACKs for top commit:
vasild:
utACK 6112a20
MarcoFalke:
ACK 6112a209828c43930f677c45461339cdf68a56e9 🎞
Tree-SHA512: 749644ac9a1ef0e1aa6c3ac5e899eb3fa7fb9c0909352f922a80412df2bc0e539692a7757af550eff4d4914cbe57b0c75ce3948f569acc7a52852e91a55ad457
Diffstat (limited to 'test/functional/p2p_segwit.py')
-rwxr-xr-x | test/functional/p2p_segwit.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py index 785c476e19..118f31382a 100755 --- a/test/functional/p2p_segwit.py +++ b/test/functional/p2p_segwit.py @@ -303,8 +303,7 @@ class SegWitTest(BitcoinTestFramework): block = self.build_next_block(version=1) block.solve() - self.test_node.send_message(msg_no_witness_block(block)) - self.test_node.sync_with_ping() # make sure the block was processed + self.test_node.send_and_ping(msg_no_witness_block(block)) # make sure the block was processed txid = block.vtx[0].sha256 self.nodes[0].generate(99) # let the block mature @@ -319,8 +318,7 @@ class SegWitTest(BitcoinTestFramework): # This is a sanity check of our testing framework. assert_equal(msg_no_witness_tx(tx).serialize(), msg_tx(tx).serialize()) - self.test_node.send_message(msg_tx(tx)) - self.test_node.sync_with_ping() # make sure the tx was processed + self.test_node.send_and_ping(msg_tx(tx)) # make sure the block was processed assert tx.hash in self.nodes[0].getrawmempool() # Save this transaction for later self.utxo.append(UTXO(tx.sha256, 0, 49 * 100000000)) @@ -350,8 +348,7 @@ class SegWitTest(BitcoinTestFramework): # But it should not be permanently marked bad... # Resend without witness information. - self.test_node.send_message(msg_no_witness_block(block)) - self.test_node.sync_with_ping() + self.test_node.send_and_ping(msg_no_witness_block(block)) # make sure the block was processed assert_equal(self.nodes[0].getbestblockhash(), block.hash) # Update our utxo list; we spent the first entry. @@ -2054,16 +2051,14 @@ class SegWitTest(BitcoinTestFramework): tx = FromHex(CTransaction(), raw) assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex()) with self.nodes[0].assert_debug_log(['Superfluous witness record']): - self.nodes[0].p2p.send_message(msg_bogus_tx(tx)) - self.nodes[0].p2p.sync_with_ping() + self.nodes[0].p2p.send_and_ping(msg_bogus_tx(tx)) raw = self.nodes[0].signrawtransactionwithwallet(raw) assert raw['complete'] raw = raw['hex'] tx = FromHex(CTransaction(), raw) assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex()) with self.nodes[0].assert_debug_log(['Unknown transaction optional data']): - self.nodes[0].p2p.send_message(msg_bogus_tx(tx)) - self.nodes[0].p2p.sync_with_ping() + self.nodes[0].p2p.send_and_ping(msg_bogus_tx(tx)) if __name__ == '__main__': |