Upgrade miniscript/bitcoin dependency
Upgrade: - bitcoin to v0.31.0 - miniscript to v11.0.0 Note: The bitcoin upgrade includes improvements to the `Transaction::weight()` function, it appears those guys did good, we no longer need to add the 2 additional weight units "just in case".
This commit is contained in:
@@ -96,7 +96,7 @@ impl CoinSelectorOpt {
|
||||
) -> Self {
|
||||
let mut tx = Transaction {
|
||||
input: vec![],
|
||||
version: 1,
|
||||
version: transaction::Version::ONE,
|
||||
lock_time: absolute::LockTime::ZERO,
|
||||
output: txouts.to_vec(),
|
||||
};
|
||||
@@ -112,7 +112,7 @@ impl CoinSelectorOpt {
|
||||
target_value: if txouts.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(txouts.iter().map(|txout| txout.value).sum())
|
||||
Some(txouts.iter().map(|txout| txout.value.to_sat()).sum())
|
||||
},
|
||||
..Self::from_weights(
|
||||
base_weight.to_wu() as u32,
|
||||
|
||||
@@ -12,7 +12,7 @@ use bdk_chain::{
|
||||
bitcoin,
|
||||
collections::{BTreeSet, HashMap},
|
||||
};
|
||||
use bitcoin::{absolute, Transaction, TxOut};
|
||||
use bitcoin::{absolute, transaction, Transaction, TxOut};
|
||||
use core::fmt::{Debug, Display};
|
||||
|
||||
mod coin_selector;
|
||||
@@ -29,5 +29,5 @@ pub const TXIN_BASE_WEIGHT: u32 = (32 + 4 + 4) * 4;
|
||||
// Shamelessly copied from
|
||||
// https://github.com/rust-bitcoin/rust-miniscript/blob/d5615acda1a7fdc4041a11c1736af139b8c7ebe8/src/util.rs#L8
|
||||
pub(crate) fn varint_size(v: usize) -> u32 {
|
||||
bitcoin::VarInt(v as u64).len() as u32
|
||||
bitcoin::VarInt(v as u64).size() as u32
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user