-
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
Add bumpfee finish related error #516
Conversation
WalkthroughThe recent updates involve replacing the Changes
Possibly related issues
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (4)
Files skipped from review as they are similar to previous changes (4)
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 (
|
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.
Actionable comments posted: 1
impl From<BuildFeeBumpError> for CreateTxError { | ||
fn from(error: BuildFeeBumpError) -> Self { | ||
match error { | ||
BuildFeeBumpError::UnknownUtxo(outpoint) => CreateTxError::UnknownUtxo { | ||
outpoint: outpoint.to_string(), | ||
}, | ||
BuildFeeBumpError::TransactionNotFound(txid) => CreateTxError::UnknownUtxo { | ||
outpoint: txid.to_string(), | ||
}, | ||
BuildFeeBumpError::TransactionConfirmed(txid) => CreateTxError::UnknownUtxo { | ||
outpoint: txid.to_string(), | ||
}, | ||
BuildFeeBumpError::IrreplaceableTransaction(txid) => CreateTxError::UnknownUtxo { | ||
outpoint: txid.to_string(), | ||
}, | ||
BuildFeeBumpError::FeeRateUnavailable => CreateTxError::FeeRateTooLow { | ||
required: "unavailable".to_string(), | ||
}, | ||
} | ||
} |
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.
Refine error mappings from BuildFeeBumpError
to CreateTxError
.
The current implementation maps several distinct errors to CreateTxError::UnknownUtxo
, which could be confusing. Consider providing more specific error messages for different scenarios such as transaction not found, transaction confirmed, and irreplaceable transaction.
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.
My first thought is to remove the allow_shrinking() method. See #457 and bitcoindevkit/bdk#1386. The method is being removed/rewritten. Would you mind doing this as part of this PR?
absolutely, will update the PR with that change- |
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.
ACK 99889c5.
Description
This removes
Alpha3Error
completely by updating this last method that used it. ✅BumpFeeTxBuilder
has afinish
method with a few things it hits under the hood like:TxId
from a stringallow_shrinking
Psbt
I added a few
From
s, but did not add one for this line:... because if
Txid::from_str
fails it seems likely it's because the string provided does not correctly represent a transaction identifier, and which is why I choseUnknownUtxo
(and didn't create aFrom
) to indicate that. But let me know if you think there is a better way to handle this (How to handle failing onfrom_str
and/or if aFrom
makes sense on that line of code)? Totally open to something better.Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes:
Summary by CodeRabbit
Alpha3Error
withCreateTxError
to provide more specific error feedback.