-
Notifications
You must be signed in to change notification settings - Fork 280
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
Remove duplicated InsufficientFunds error member #1441
Remove duplicated InsufficientFunds error member #1441
Conversation
I tend to favor the name |
Please also setup commit signing, see: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification |
Maybe this belongs here better, basically, can this be disabled in anything but Network::Bitcoin? |
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.
Concept ACK, I do agree with Value's comment, and mind Steve's comment above.
I personally don't think it's a good idea to "error-gate" based on the bitcoin::Network type, I would expect all behaviors that happen on mainnet (production per se) to happen on others, and even some nasty behaviors we may catch while testing on testnet/signet being prevented to land on mainnet code 😅. |
That's a good point, @oleonardolima maybe the juice is not worth the squeeze on making this change. |
2cfae0b
to
9410137
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.
Looking good! I left some comments, and I also think that it could be squashed into a single commit.
crates/bdk/src/wallet/mod.rs
Outdated
available: remaining_amount.saturating_sub(*change_fee), | ||
}); | ||
return Err(CreateTxError::CoinSelection( | ||
Error::InsufficientFunds { |
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.
@e1a0a0ea You could probably use a qualified version: coin_selection::Error::InsufficientFunds
instead 🤔
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.
Or just import the InsufficientFunds
variant itself.
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.
I'm not a fan of importing the enum variant (can become confusing imo). I prefer the more verbose, but clearer option.
Please rebase again and fixup commits into one commit then this should be ready to merge. |
fb0be23
to
cc1b417
Compare
…CreateTxError review: move back to old error naming
cc1b417
to
29c8a00
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.
ACK 29c8a00
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 29c8a00
closes #1440
Description
CreateTxError::InsufficientFunds
use bycoin_selection::Error::InsufficientFunds
InsufficientFunds
member fromCreateTxError
enumcoin_selection::Error
tocoin_selection::CoinSelectionError
Notes to the reviewers
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing