Skip to content

Commit

Permalink
Cleanup TODOs leftover from PR14119 backporting
Browse files Browse the repository at this point in the history
Summary:
Final cleanup after PR14119
https://github.com/bitcoin/bitcoin/pull/14119/files

Depends on D3922, D3923, and others already landed

Test Plan: `test_runner.py --extended`

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D3924
  • Loading branch information
jasonbcox committed Aug 21, 2019
1 parent 317690e commit 2b80f23
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test/functional/test_framework/mininode.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,7 @@ def on_getheaders(self, message):
if response is not None:
self.send_message(response)

def send_blocks_and_test(self, blocks, node, *, success=True, request_block=True, reject_code=None, reject_reason=None, expect_disconnect=False, timeout=60):
# TODO: Migrate all tests off of using `reject_code` and then remove it.
def send_blocks_and_test(self, blocks, node, *, success=True, request_block=True, reject_reason=None, expect_disconnect=False, timeout=60):
"""Send blocks to test node and test whether the tip advances.
- add all blocks to our block_store
Expand All @@ -624,9 +623,6 @@ def send_blocks_and_test(self, blocks, node, *, success=True, request_block=True
self.block_store[block.sha256] = block
self.last_block_hash = block.sha256

# TODO: Remove decode() once all callers are migrated to use strings instead of bytes.
if isinstance(reject_reason, bytes):
reject_reason = reject_reason.decode('utf-8')
reject_reason = [reject_reason] if reject_reason else []
with node.assert_debug_log(expected_msgs=reject_reason):
self.send_message(msg_headers([CBlockHeader(blocks[-1])]))
Expand All @@ -646,8 +642,7 @@ def send_blocks_and_test(self, blocks, node, *, success=True, request_block=True
else:
assert node.getbestblockhash() != blocks[-1].hash

def send_txs_and_test(self, txs, node, *, success=True, expect_disconnect=False, reject_code=None, reject_reason=None):
# TODO: Migrate all tests off of using `reject_code` and then remove it.
def send_txs_and_test(self, txs, node, *, success=True, expect_disconnect=False, reject_reason=None):
"""Send txs to test node and test whether they're accepted to the mempool.
- add all txs to our tx_store
Expand All @@ -660,9 +655,6 @@ def send_txs_and_test(self, txs, node, *, success=True, expect_disconnect=False,
for tx in txs:
self.tx_store[tx.sha256] = tx

# TODO: Remove decode() once all callers are migrated to use strings instead of bytes.
if isinstance(reject_reason, bytes):
reject_reason = reject_reason.decode('utf-8')
reject_reason = [reject_reason] if reject_reason else []
with node.assert_debug_log(expected_msgs=reject_reason):
for tx in txs:
Expand Down

0 comments on commit 2b80f23

Please sign in to comment.