Skip to content

chore(key-wallet): drop unused UtxoSet struct#491

Open
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/drop-unused-utxoset
Open

chore(key-wallet): drop unused UtxoSet struct#491
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/drop-unused-utxoset

Conversation

@ZocoLini
Copy link
Collaborator

@ZocoLini ZocoLini commented Mar 3, 2026

We are not using this struct internally and I don't see any value on having it for library users

Summary by CodeRabbit

  • Breaking Changes

    • Removed UtxoSet from the public API; Utxo remains available.
  • Documentation

    • Removed UTXO management examples and guidance that referenced UtxoSet from the README.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f1a72197-180a-4db0-bede-d63135e92f4d

📥 Commits

Reviewing files that changed from the base of the PR and between ef1333c and 6e1a884.

📒 Files selected for processing (4)
  • key-wallet-manager/README.md
  • key-wallet-manager/src/lib.rs
  • key-wallet/src/lib.rs
  • key-wallet/src/utxo.rs
💤 Files with no reviewable changes (2)
  • key-wallet-manager/README.md
  • key-wallet/src/utxo.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • key-wallet-manager/src/lib.rs

📝 Walkthrough

Walkthrough

Removed the UtxoSet type and its implementation (methods, Default, tests) from the key-wallet crate and removed UtxoSet from public re-exports in both key-wallet/src/lib.rs and key-wallet-manager/src/lib.rs. The Utxo type remains exported and unchanged.

Changes

Cohort / File(s) Summary
Public re-exports updated
key-wallet/src/lib.rs, key-wallet-manager/src/lib.rs
Removed UtxoSet from the crates' pub use lists; Utxo remains publicly exported.
UtxoSet implementation removed
key-wallet/src/utxo.rs
Deleted the UtxoSet struct, ~20 associated methods (add, remove, get, contains, spendable, balances, lock/unlock, update_confirmation, etc.), the Default impl, and unit tests. Utxo type and its methods remain.
Docs/README
key-wallet-manager/README.md
Removed UTXO management example and guidance referencing UtxoSet (examples and Best Practices note removed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code with nimble feet,
One set removed — the change was neat.
Now single hops of Utxo glide,
Simpler burrow, clearer stride. 🎈

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the UtxoSet struct from the codebase as indicated across multiple files and modules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/drop-unused-utxoset

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@key-wallet/src/lib.rs`:
- Line 72: The public API removed UtxoSet but the README example still imports
and uses it; update the example to stop referencing UtxoSet and show usage with
Utxo only. Edit the README example that currently does `use ...::UtxoSet` and
replace the snippet with code that constructs/iterates/manipulates Utxo
instances (e.g., creating Utxo values, collecting them into a Vec or other local
container, and using the existing Utxo APIs) so documentation compiles against
the current public export `Utxo`.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c8e81f and ef1333c.

📒 Files selected for processing (3)
  • key-wallet-manager/src/lib.rs
  • key-wallet/src/lib.rs
  • key-wallet/src/utxo.rs
💤 Files with no reviewable changes (1)
  • key-wallet/src/utxo.rs

Copy link

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — removing unused abstractions keeps the API surface clean. 👍

One thing to address: as CodeRabbit flagged, key-wallet-manager/README.md still references UtxoSet in the UTXO Management example (lines 154-167). That example will need updating to only use Utxo directly, or the section can be simplified/removed if there's no meaningful standalone Utxo usage example to show.

@ZocoLini ZocoLini force-pushed the chore/drop-unused-utxoset branch from ef1333c to 6e1a884 Compare March 5, 2026 19:17
@ZocoLini ZocoLini requested a review from xdustinface March 5, 2026 19:19
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v0.42-dev@8d2f76d). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff              @@
##             v0.42-dev     #491   +/-   ##
============================================
  Coverage             ?   64.48%           
============================================
  Files                ?      330           
  Lines                ?    65157           
  Branches             ?        0           
============================================
  Hits                 ?    42018           
  Misses               ?    23139           
  Partials             ?        0           
Flag Coverage Δ
core 74.42% <ø> (?)
ffi 21.85% <ø> (?)
rpc 4.30% <ø> (?)
spv 27.19% <ø> (?)
wallet 45.92% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants