-
Notifications
You must be signed in to change notification settings - Fork 279
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
base: master
Are you sure you want to change the base?
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.
@@ -4,7 +4,7 @@ use assert_matches::assert_matches; | |||
use bdk::descriptor::{calc_checksum, IntoWalletDescriptor}; | |||
use bdk::psbt::PsbtUtils; | |||
use bdk::signer::{SignOptions, SignerError}; | |||
use bdk::wallet::coin_selection::{self, LargestFirstCoinSelection}; | |||
use bdk::wallet::coin_selection::{self, CoinSelectionError, LargestFirstCoinSelection}; |
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 Does this change still applies?
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.
Please rebase again and fixup commits into one commit then this should be ready to merge. |
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