diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-04-10 18:08:01 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-04-16 23:11:27 -0400 |
commit | fadfbd33ab4ea57f1efa2d10a346c25c4ad18b58 (patch) | |
tree | 9e35ac3835ab85dccbaa4024d7993546e214f5ef /test/functional/test_framework/mininode.py | |
parent | 6a278e06400934df0fc6ed81b0d7c645efc50bdf (diff) |
qa: Add test for orphan handling
Diffstat (limited to 'test/functional/test_framework/mininode.py')
-rwxr-xr-x | test/functional/test_framework/mininode.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index aba2841682..0fbb3ce2cd 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -554,13 +554,13 @@ class P2PDataStore(P2PInterface): if reject_reason is not None: wait_until(lambda: self.reject_reason_received == reject_reason, lock=mininode_lock) - def send_txs_and_test(self, txs, rpc, success=True, reject_code=None, reject_reason=None): + def send_txs_and_test(self, txs, rpc, success=True, expect_disconnect=False, reject_code=None, reject_reason=None): """Send txs to test node and test whether they're accepted to the mempool. - add all txs to our tx_store - send tx messages for all txs - - if success is True: assert that the tx is accepted to the mempool - - if success is False: assert that the tx is not accepted to the mempool + - if success is True: assert that the txs are accepted to the mempool + - if expect_disconnect is True: Skip the sync with ping - if reject_code and reject_reason are set: assert that the correct reject message is received.""" with mininode_lock: @@ -573,7 +573,10 @@ class P2PDataStore(P2PInterface): for tx in txs: self.send_message(msg_tx(tx)) - self.sync_with_ping() + if expect_disconnect: + self.wait_for_disconnect() + else: + self.sync_with_ping() raw_mempool = rpc.getrawmempool() if success: |