Open
Description
Describe the bug
Since add_utxo of build_tx in 1.2.0 uses hashmap to contain input, TxOrdrering cannot ensure that the order is not changed.
To Reproduce
let utxos = wallet1
.list_unspent()
.map(|o| o.outpoint)
.collect::<Vec<_>>();
let builder = wallet1.build_tx();
builder
.ordering(bdk_wallet::TxOrdering::Untouched)
.fee_rate(FeeRate::from_sat_per_vb(5).unwrap())
.add_utxo(utxos[0])
.unwrap()
.add_utxo(utxos[1])
.unwrap()
.add_recipient(
wallet1.peek_address(External, 0).address.script_pubkey(),
bitcoin::Amount::from_sat(1000),
);
let inputs = builder.finish().unwrap().unsigned_tx.input;
// can't assert
assert!(inputs[0].previous_output == utxos[0]);
assert!(inputs[1].previous_output == utxos[1]);
Expected behavior
assert!(inputs[0].previous_output == utxos[0]);
assert!(inputs[1].previous_output == utxos[1]);
Build environment
- BDK tag/commit: 1.2.0
- OS+version:
- Rust/Cargo version: *
- Rust/Cargo target: *
Additional context
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress