-
Notifications
You must be signed in to change notification settings - Fork 102
Initial project layout, errors, and utils #8
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
Initial project layout, errors, and utils #8
Conversation
a8ca461
to
74142a7
Compare
d4a0e9d
to
3f25117
Compare
3f25117
to
d384ef9
Compare
src/error.rs
Outdated
/// better safe than sorry.. | ||
FundingTxNonWitnessOuputSpend, | ||
/// The funding transaction could not be finalized. | ||
FundingTxNotFinalized, |
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.
Why couldnt we finalize it? What does this mean?
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.
IIUC, it would fail to be finalized if it includes inputs that cannot be satisfied at the current time, e.g., due to being timelocked. Replaced this with a more generic FundingTxCreationFailed
error.
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.
But shouldn't that be handled by not selecting those inputs? Presumably the error should just be "we don't have enough (available) funds (right now)", no?
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.
Well, IIUC they go through all previously unsigned inputs, try to derive the right wallet descriptor, and sign them. So in our case you're probably right, but while the word 'finalize' appears quite a lot it's kinda poorly documented what it actually does/why it's an extra step. I'll try to clarify with the BDK folks and will probably open an issue..
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.
So, it seems that while individual inputs are signed before, the witness is just created and added in the finalization step. I'm still not quite sure when this step would ever fail in our case, since not having enough funds should already become apparent during input selection, i.e., during tx_builder.finish()
. So, I'll probably just capture all that via the FundingTxCreationFailed
error.
LGTM, feel free to squash + merge. |
8c15092
to
1a81027
Compare
This PR provides the initial project layout, initial
error
types, and basichex
andlogger
utils.