feat: expose Wallet::get_psbt_input#1032
Conversation
|
rebased, open for review |
| transitively: transitively.map(|txid| txid.0), | ||
| }, | ||
| ChainPosition::Unconfirmed { timestamp } => BdkChainPosition::Unconfirmed { | ||
| first_seen: timestamp, |
There was a problem hiding this comment.
I see we leave out first_seen in our ChainPosition type definition but now we have to use same timestamp when passing back.
Maybe not related to this PR; Asking in general... Do we really not need first seen?
There was a problem hiding this comment.
Good question, cuz we had already exposed first_seen on TxGraphChangeSet, but ChainPosition was still using the older single timestamp field which maps to upstream last_seen. I opened a followup PR to expose both first_seen and last_seen there too: #1039
| utxo: LocalOutput, | ||
| sighash_type: Option<String>, | ||
| only_witness_utxo: bool, | ||
| ) -> Result<Input, GetPsbtInputError> { |
There was a problem hiding this comment.
Nice! Took me a while to see why we are returning GetPsbtInputError here when we have CreateTxError. This is good as we need to handle for string parsing, the 2 possible errors from bdk-wallet (miniscript and unknown), and all others.
| impl From<CreateTxError> for GetPsbtInputError { | ||
| fn from(error: CreateTxError) -> Self { | ||
| match error { | ||
| CreateTxError::UnknownUtxo { outpoint } => GetPsbtInputError::UnknownUtxo { outpoint }, |
There was a problem hiding this comment.
Will there ever be a match on CreateTxError::UnknownUtxo here since we always call from_bdk_create_tx_error which handles the UnknownUtxo?
There was a problem hiding this comment.
Good call, cuz in the current path no, so I simplified this so get_psbt_input maps the upstream errors directly now d9a61d5
|
Thanks for making all the updates! No more comments from me, looks all good. Do you want to merge #1039 and update first_seen last seen here or vice versa. Either way is fine with me. I could approve this now |
I think we gotta wait on 1039 because it's a breaking change. And thanks for the good review comments. |
Description
Exposes Wallet::get_psbt_input so users can derive PSBT input metadata for a wallet owned LocalOutput
Notes to the reviewers
Tests can be minimized/removed before merge if needed.
Documentation
bdk_wallethttps://docs.rs/bdk_wallet/3.0.0/bdk_wallet/struct.Wallet.html#method.get_psbt_input
bitcoinuniffiChangelog
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingchangelog:*labelNew Features:
Bugfixes: