Page MenuHomePhabricator

test: various style improvements to abc-segwit-recovery.py
ClosedPublic

Authored by PiRK on Oct 13 2021, 15:54.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCb214ab7d374d: test: various style improvements to abc-segwit-recovery.py
Summary
  • remove unused functions check_mempool_equal
  • remove single liner functions save_spendable_output (a simple append to a local list) and get_spendable_output (only one callsite)
  • rename next_block to make_block, and remove block shorthand (block is also used a variable name in update_block)
  • remove the need to keep a dictionary of blocks (with arbitrary magic int as a key), a dictionary of block heights, and a reference to the tip block, by simply adding a tip_height counter and passing a block parameter to method make_block and function update_block.
  • use the block returned by make_block instead of self.tip.

-20 lines of codes with no change in behavior and more clarity.

Depends on D10321

Test Plan

test/functional/test_runner.py abc-segwit-recovery.py

Diff Detail