refactor(key-wallet): drop FeeLevel#481
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis pull request removes the FeeLevel enum abstraction and replaces it with direct FeeRate usage throughout the transaction building and wallet management layers. The change simplifies fee configuration by eliminating the intermediate mapping level and directly using FeeRate values across the FFI, manager, and transaction building components. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 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)
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.
🧹 Nitpick comments (1)
key-wallet/src/wallet/managed_wallet_info/transaction_builder.rs (1)
48-63: LGTM!Struct field correctly renamed from
fee_level: FeeLeveltofee_rate: FeeRate. The doc comment "Fee rate or level" could be simplified to just "Fee rate" since FeeLevel is being removed.📝 Optional: Update doc comment
/// Change address change_address: Option<Address>, - /// Fee rate or level + /// Fee rate (satoshis per kilobyte) fee_rate: FeeRate,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@key-wallet/src/wallet/managed_wallet_info/transaction_builder.rs` around lines 48 - 63, Update the doc comment for the TransactionBuilder field fee_rate to remove the obsolete "or level" phrasing—replace "Fee rate or level" with simply "Fee rate" in the TransactionBuilder struct definition to reflect that FeeLevel was removed; ensure you edit the doc comment above the fee_rate: FeeRate field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@key-wallet/src/wallet/managed_wallet_info/transaction_builder.rs`:
- Around line 48-63: Update the doc comment for the TransactionBuilder field
fee_rate to remove the obsolete "or level" phrasing—replace "Fee rate or level"
with simply "Fee rate" in the TransactionBuilder struct definition to reflect
that FeeLevel was removed; ensure you edit the doc comment above the fee_rate:
FeeRate field.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
key-wallet-ffi/src/transaction.rskey-wallet-manager/src/wallet_manager/transaction_building.rskey-wallet/src/wallet/managed_wallet_info/fee.rskey-wallet/src/wallet/managed_wallet_info/transaction_builder.rskey-wallet/src/wallet/managed_wallet_info/transaction_building.rskey-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs
💤 Files with no reviewable changes (1)
- key-wallet/src/wallet/managed_wallet_info/fee.rs
7f6c198 to
d560585
Compare
| change_address: Option<Address>, | ||
| /// Fee rate or level | ||
| fee_level: FeeLevel, | ||
| /// Fee rate (satoshis per kilobyte) |
There was a problem hiding this comment.
| /// Fee rate (satoshis per kilobyte) | |
| /// Fee rate (duffs per kilobyte) |
In Dash its duffs. We are anyway not consistent with this yet but generally i think better if we don't introduce more of them.
There was a problem hiding this comment.
I could have fixed that :( I did copy paste a coderabbit suggestion and I didn't notice it used satoshis instead of duffs
This PR drops FeeLEvel, the struct was just a wrapper around FeeRate that, at the same time, is a wrapper around u64 to represent duffs per kb, unnecessary layer imo
Summary by CodeRabbit
Refactor