]> Untitled Git - bdk/commit
[wallet] Overhaul TxBuilder internals and externals
authorLLFourn <lloyd.fourn@gmail.com>
Fri, 1 Jan 2021 02:35:05 +0000 (13:35 +1100)
committerLLFourn <lloyd.fourn@gmail.com>
Fri, 22 Jan 2021 03:33:37 +0000 (14:33 +1100)
commit7553b905c41d529ef5a57ab309d51bb2c8363b60
tree403a7d988ac9efc06ac60f6228a98720af4c6951
parentf74f17e22768991d4cb76bfb4e5f4d68cd5db4a0
[wallet] Overhaul TxBuilder internals and externals

Fixes #251

TxBuilders are now not created directly but are created through the
wallet with `build_tx` and `build_fee_bump`.
The advantages of this realised in this commit are:

1. Normal tx creation and fee bumping use the code internally. The only
difference between normal tx and fee bump is how the builder is created.
2. The TxBuilder now has a refernce to the wallet and can therefore
lookup things as methods are called on it. `add_utxo` now uses this to
look up UTXO deta when it is called (rather than having to do it and
possibly error later on).

To support these changes `get_utxo` and `get_descriptor_for_keychain`
public methods have been added to Wallet. I could have kept them
pub(crate) but they seem like fine APIs to have publicly.
README.md
src/lib.rs
src/wallet/address_validator.rs
src/wallet/coin_selection.rs
src/wallet/mod.rs
src/wallet/tx_builder.rs
testutils-macros/src/lib.rs