refactor(utils): consolidate masternode test helpers - #7536
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (5)
WalkthroughThis change adds shared masternode test utilities for UTXO selection, transaction funding and signing, provider-registration creation, and payout script generation. Existing tests use these shared helpers instead of local implementations. A test verifies that Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MasternodeTest
participant CreateProRegTx
participant FundTransaction
participant SignTransaction
MasternodeTest->>CreateProRegTx: create provider-registration transaction
CreateProRegTx->>FundTransaction: fund collateral
FundTransaction-->>CreateProRegTx: funded inputs and change
CreateProRegTx->>SignTransaction: sign transaction inputs
SignTransaction-->>CreateProRegTx: signed transaction
CreateProRegTx-->>MasternodeTest: provider-registration transaction
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
ℹ️ Review superseded (commit 5d52ff2) |
|
This pull request has conflicts, please rebase. |
bd1e5ca to
84c0a1e
Compare
Potential PR merge conflictsThis is advisory only. It does not block CI, but it marks PRs that will likely need a rebase depending on merge order. If this PR merges firstThese open PRs will likely need a rebase:
|
|
This pull request has conflicts, please rebase. |
84c0a1e to
5d52ff2
Compare
Issue being fixed or feature implemented
Masternode unit tests duplicated the same UTXO selection, transaction funding, signing, and ProRegTx construction helpers. Fixes to this plumbing had to be repeated in every copy, and unspendable coinbase outputs could enter the test UTXO map.
What was done?
test/util/masternode.{h,cpp}as the shared location for the common masternode transaction helpers.block_reward_reallocation_testsandevo_deterministicmns_teststo use the shared utility.BuildSimpleUtxoMapskip unspendable outputs such asOP_RETURN.How Has This Been Tested?
make -C src -j8 test/test_dash./src/test/test_dash --run_test=block_reward_reallocation_tests./src/test/test_dash --run_test=evo_dip3_activation_teststest/lint/lint-whitespace.pytest/lint/lint-includes.pytest/lint/lint-include-guards.pygit diff --checkBreaking Changes
None.
Checklist:
This pull request was created by Codex.