chore(key-wallet): drop unused UtxoSet struct#491
Conversation
📝 WalkthroughWalkthroughThe changes remove the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
key-wallet-manager/src/lib.rskey-wallet/src/lib.rskey-wallet/src/utxo.rs
💤 Files with no reviewable changes (1)
- key-wallet/src/utxo.rs
| pub use mnemonic::Mnemonic; | ||
| pub use seed::Seed; | ||
| pub use utxo::{Utxo, UtxoSet}; | ||
| pub use utxo::Utxo; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for any remaining references to UtxoSet in the codebase
echo "=== Searching for UtxoSet references in Rust files ==="
rg -n 'UtxoSet' --type rust
echo -e "\n=== Searching in markdown/docs ==="
rg -n 'UtxoSet' --type md || echo "No markdown references found"
echo -e "\n=== Checking for any other file types mentioning UtxoSet ==="
rg -n 'UtxoSet' --glob '*.toml' --glob '*.txt' || echo "No toml/txt references found"Repository: dashpay/rust-dashcore
Length of output: 388
🏁 Script executed:
#!/bin/bash
# Check the README content to see how UtxoSet is used in the documentation
echo "=== Checking key-wallet-manager/README.md around lines 154-157 ==="
sed -n '150,160p' key-wallet-manager/README.md
echo -e "\n=== Checking if UtxoSet is exported from key-wallet-manager lib.rs ==="
if [ -f "key-wallet-manager/src/lib.rs" ]; then
rg -n 'UtxoSet' key-wallet-manager/src/lib.rs || echo "No UtxoSet exports in key-wallet-manager/lib.rs"
fi
echo -e "\n=== Checking key-wallet/src/utxo.rs to see if UtxoSet definition still exists ==="
if [ -f "key-wallet/src/utxo.rs" ]; then
rg -n 'pub struct UtxoSet' key-wallet/src/utxo.rs -A 3
fiRepository: dashpay/rust-dashcore
Length of output: 539
🏁 Script executed:
#!/bin/bash
# Check the full key-wallet/src/utxo.rs file
echo "=== Checking key-wallet/src/utxo.rs ==="
wc -l key-wallet/src/utxo.rs
# Search for UtxoSet anywhere in the file
echo -e "\n=== Searching for UtxoSet ==="
cat key-wallet/src/utxo.rs | grep -n -i 'utxoset'
# Show the file structure with pub struct/enum definitions
echo -e "\n=== Public definitions in utxo.rs ==="
rg 'pub (struct|enum|type)' key-wallet/src/utxo.rsRepository: dashpay/rust-dashcore
Length of output: 219
Breaking API change: UtxoSet removed from public exports and entire codebase.
UtxoSet has been completely removed from the crate. However, the example code in key-wallet-manager/README.md (lines 154–157) still imports and uses UtxoSet, which will no longer work. Update the documentation to remove or replace this example with code that only uses Utxo.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@key-wallet/src/lib.rs` at 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`.
thepastaclaw
left a comment
There was a problem hiding this comment.
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.
We are not using this struct internally and I don't see any value on having it for library users
Summary by CodeRabbit