-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose a whole lot of errors #485
Conversation
WalkthroughThe update introduces new error handling and dependency enhancements across the Changes
Possibly related issues
Recent Review DetailsConfiguration used: CodeRabbit UI Files ignored due to path filters (1)
Files selected for processing (8)
Files skipped from review as they are similar to previous changes (7)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
bdk-ffi/src/wallet.rs
Outdated
@@ -532,13 +532,13 @@ impl TxBuilder { | |||
#[derive(Clone)] | |||
pub(crate) struct BumpFeeTxBuilder { | |||
pub(crate) txid: String, | |||
pub(crate) fee_rate: f32, | |||
pub(crate) fee_rate: Arc<FeeRate>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the fee_rate
field in BumpFeeTxBuilder
to use Arc<FeeRate>
for better type safety and consistency with the rest of the codebase.
- pub(crate) fee_rate: Arc<FeeRate>,
This modification aligns with the PR's objectives to enhance error handling and improve the codebase's consistency. Using Arc<FeeRate>
instead of a primitive type like f32
ensures that the fee rate is handled in a type-safe manner, reducing the risk of errors.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
pub(crate) fee_rate: Arc<FeeRate>, |
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveTxBuilderTest.kt
Outdated
Show resolved
Hide resolved
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveTxBuilderTest.kt
Outdated
Show resolved
Hide resolved
bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/LiveTxBuilderTest.kt
Outdated
Show resolved
Hide resolved
bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/LiveTxBuilderTest.kt
Outdated
Show resolved
Hide resolved
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveWalletTest.kt
Outdated
Show resolved
Hide resolved
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more test cases to cover all the newly added error variants, ensuring comprehensive test coverage.
Would you like me to help by adding some of these test cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Address
and Transaction
related errors79284dc
to
82ce721
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love seeing these new errors exposed!
I see bitcoin-internals
dependency added (which is a part of rust-bitcoin
), I think it was initially added in this commit to convert checksum values into their hexadecimal string representations in lowercase, so it make sense why that dependency was added/selected as the solution.
ACK 97a104f |
Description
This PR adds all the boilerplate code related to 4 new error types: AddressError and TransactionError, PsbtParseError, and DescriptorError.
Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingSummary by CodeRabbit
New Features
AddressError
,TransactionError
,PsbtParseError
,DescriptorError
, andFeeRateError
.FeeRate
struct with methods for more precise fee rate calculations.Bug Fixes
Address
,Transaction
, andDescriptor
components to use specific error types for better clarity and troubleshooting.Refactor
esplora.rs
for clearer code structure.