Repository navigation
feat(key-wallet): expose masternode_collateral and holds_coin - #1400
Conversation
A wallet store that locks collateral on its own, for masternodes it tracks outside the wallet's registrations, needs the same two answers the wallet uses: which outpoint a ProRegTx registers, and whether the wallet holds that coin. Without them it copies the logic and drifts: a copy that looks only at the UTXO set misses a coin the wallet keeps aside as spent. `masternode_collateral` is re-exported from `wallet::managed_wallet_info`, and `ManagedWalletInfo::holds_coin` becomes public. No behaviour changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Review complete in 2m 17s Planner (7s) Review (security · pair): 0 findings Judge: 0 kept · 0 dropped (19s) Review metadataConfig:
Account limits:
Timing:
Last reviewed
|
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
There was a problem hiding this comment.
✅ Approved.
Caution
Claude subscription has used 98% of its weekly limit, past the 90% mark. It resets 2026-11-17 05:00 UTC.
Once a limit is used up, reviews on that account stop until it resets.
What this does: Two wallet helpers were usable only inside the key-wallet crate. One finds the collateral coin a masternode registration names, the other checks whether the wallet holds a coin.
Related work: open PRs and issues that may cover the same change. None of them blocks.
- Overlaps · #1252 key-wallet: reserve a specific address in AddressPool
- Overlaps · #976 key-wallet: islock conflict-sweep and abandon removals emit no events — mirrors keep dead rows, released coins stuck spent
- Overlaps · #992 dash-spv: a spend with no wallet-owned output is never recorded — coin stays unspent, balance overstated
What to test
The review model wrote these steps. Check what a step runs before you follow it.
Setup: Build a small crate or test that depends on key-wallet and imports key_wallet::wallet::managed_wallet_info::masternode_collateral.
- Call
masternode_collateralon a ProRegTx that names an external collateral outpoint. ExpectSomeof that outpoint. - Call it on a ProRegTx with a null collateral txid and an index inside its outputs. Expect
Some(OutPoint::new(tx.txid(), index)). - Call it on a regular payment transaction. Expect
None. - Call
ManagedWalletInfo::holds_coinon an outpoint the wallet received. Expecttrue. - Call
holds_coinon an outpoint the wallet never owned. Expectfalse. - Edge case: call
masternode_collateralon a ProRegTx with a null collateral txid and an index past its outputs. ExpectNone. - Edge case: spend a wallet coin in a block, then call
holds_coinon it. Expecttruewhile the account keeps it aside as spent.
About this review
- Reviewed
f09d989, round 1 - 5 changed lines read in 2m 17s
- Found by
claude-sonnet-5-5andclaude-opus-5-5, judged byclaude-opus-5-5 - Tokens: 351k in (224k from cache) · 5k out · about $0.64 at API prices
- How Manki reviews
|
Bots are done — your move: post |
…run 43405576672)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1400 +/- ##
=======================================
Coverage 85.81% 85.81%
=======================================
Files 269 269
Lines 70847 70847
=======================================
+ Hits 60799 60800 +1
+ Misses 10048 10047 -1
|
Follow-up to #1391. A wallet store that locks collateral on its own, for masternodes it tracks outside the wallet's registrations, needs the same two answers the wallet uses: which outpoint a ProRegTx registers, and whether the wallet holds that coin. Both were crate-private, so dashpay/platform#5890 carries copies, and its copy of
holds_coinlooks only at the UTXO set and misses a coin the wallet keeps aside as spent.This makes
ManagedWalletInfo::holds_coinpublic and re-exportsmasternode_collateralfromwallet::managed_wallet_info. No behaviour changes.🤖 Generated with Claude Code
PR Hygiene ·
f09d989/self-reviewedkey-wallet(key-wallet/src/wallet/managed_wallet_info/locked_outpoints.rs,key-wallet/src/wallet/managed_wallet_info/mod.rs) — QuantumExplorer or ZocoLini or xdustinfaceWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit