diff options
author | stickies-v <stickies-v@protonmail.com> | 2023-06-23 11:02:59 +0100 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2023-06-23 16:46:02 +0100 |
commit | afc0224cdbe73e326addf5fb98a3e95d941f2104 (patch) | |
tree | 3111f67ffe194cf48e904a65902d145c40a5ccf6 /test/functional/interface_usdt_validation.py | |
parent | 6a473373d4953cabbb219eae8b709150a45796e6 (diff) | |
download | bitcoin-afc0224cdbe73e326addf5fb98a3e95d941f2104.tar.xz |
test: refactor: remove unnecessary blocks_checked counter
Since we already store all the blocks in `events`, keeping an
additional counter is redundant.
Diffstat (limited to 'test/functional/interface_usdt_validation.py')
-rwxr-xr-x | test/functional/interface_usdt_validation.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/functional/interface_usdt_validation.py b/test/functional/interface_usdt_validation.py index f9d9b525cd..f32d83a50c 100755 --- a/test/functional/interface_usdt_validation.py +++ b/test/functional/interface_usdt_validation.py @@ -86,7 +86,6 @@ class ValidationTracepointTest(BitcoinTestFramework): self.duration) BLOCKS_EXPECTED = 2 - blocks_checked = 0 expected_blocks = dict() events = [] @@ -98,11 +97,10 @@ class ValidationTracepointTest(BitcoinTestFramework): usdt_contexts=[ctx], debug=0) def handle_blockconnected(_, data, __): - nonlocal events, blocks_checked + nonlocal events event = ctypes.cast(data, ctypes.POINTER(Block)).contents self.log.info(f"handle_blockconnected(): {event}") events.append(event) - blocks_checked += 1 bpf["block_connected"].open_perf_buffer( handle_blockconnected) @@ -127,7 +125,7 @@ class ValidationTracepointTest(BitcoinTestFramework): # only plausibility checks assert event.duration > 0 del expected_blocks[block_hash] - assert_equal(BLOCKS_EXPECTED, blocks_checked) + assert_equal(BLOCKS_EXPECTED, len(events)) assert_equal(0, len(expected_blocks)) bpf.cleanup() |