From fadfbd33ab4ea57f1efa2d10a346c25c4ad18b58 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 10 Apr 2018 18:08:01 -0400 Subject: qa: Add test for orphan handling --- test/functional/test_framework/mininode.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/functional/test_framework') 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: -- cgit v1.2.3 From fa02c5b38b4343e70ddb656c971c9707075f5a8f Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 24 Apr 2018 13:49:56 -0400 Subject: qa: Clarify documentation for send_txs_and_test --- test/functional/test_framework/mininode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/test_framework') diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index 0fbb3ce2cd..7c2125a177 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -559,7 +559,7 @@ class P2PDataStore(P2PInterface): - add all txs to our tx_store - send tx messages for all txs - - if success is True: assert that the txs are accepted to the mempool + - if success is True/False: assert that the txs are/are not 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.""" -- cgit v1.2.3