Page MenuHomePhabricator

miner_tests: pass chainman and active_chainstate to helper functions
ClosedPublic

Authored by PiRK on Jun 21 2022, 08:42.

Details

Summary

This removes usage of global chainstate for Bitcoin ABC specific code.
Also make the functions static.

Test Plan

ninja check

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Jun 21 2022, 08:42
PiRK retitled this revision from pass NodeContext to helper functions to miner_tests: pass NodeContext to helper functions.Jun 21 2022, 08:44
Fabien requested changes to this revision.Jun 21 2022, 11:01
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/test/miner_tests.cpp
226 ↗(On Diff #34073)

Don't pass the whole node context when all you need is the chain manager and the mempool. This is more robust because you don't have to assume that they are non null.

This revision now requires changes to proceed.Jun 21 2022, 11:01
PiRK retitled this revision from miner_tests: pass NodeContext to helper functions to miner_tests: pass chainman and active_chainstate to helper functions.

don't pass the whole context, pass only the required subobjects

This revision is now accepted and ready to land.Jun 21 2022, 14:08