Page MenuHomePhabricator

[test] factor some common block generation code in functional tests
ClosedPublic

Authored by PiRK on Sep 30 2025, 12:47.

Details

Summary

This will make it easier to fix the update_block method in a single place in a following commit

These helper methods only differ by a few lines: feature_block has a custom key to sign the coinbase transactions, abc-mempool-coherence-on-activation sets a specific time for the first block. This is solved by adding an extra generate_coinbase_key method and adding an optional coinbase_time argument to next_block

Test Plan

ninja check-functional-extended

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Sep 30 2025, 12:47
test/functional/abc-replay-protection.py
153 ↗(On Diff #56000)

i kept the move_tip method name used by feature_block to keep the diff minimal.
Renaming self.move_tip to self.set_tip in feature_block would have been more lines to modify, and could potentially make future Core backports slightly more conflict prone.

Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/abc-mempool-coherence-on-activations.py
159 ↗(On Diff #56000)

we should get rid of this at some point, it's only confusing

This revision is now accepted and ready to land.Sep 30 2025, 17:50