tree wide: upgrade to Miniscript 8.0.0
This also updates the indirect rust-bitcoin dependency to 0.29. Major changes are in the descriptors management: - The rust-miniscript descriptors don't support raw hashes within the pk_h() fragments, so we don't need all the boutique management for this. - The key translator API changed. - We now take a u16 for the timelock instead of our previous checks. This was inspired by the new rust-bitcoin Sequence type. - We now take a path instead of just a derivation index in DerivedKey. We might use paths after all... As for rust-bitcoin it's just a few nits: - No more 'global' field on PSBTs (yay) - Couple more trait derivation on types - Some APIs were renamed.
This commit is contained in:
9 files changed
+180
-151
No files matched your search
@@ -288,7 +288,7 @@ impl SqliteConn {
|
||||
WALLET_ID,
|
||||
coin.outpoint.txid.to_vec(),
|
||||
coin.outpoint.vout,
|
||||
coin.amount.as_sat(),
|
||||
coin.amount.to_sat(),
|
||||
deriv_index,
|
||||
],
|
||||
)?;
|
||||
@@ -405,7 +405,7 @@ impl SqliteConn {
|
||||
|
||||
/// Insert a new Spend transaction or replace an existing one.
|
||||
pub fn store_spend(&mut self, psbt: &Psbt) {
|
||||
let txid = psbt.global.unsigned_tx.txid().to_vec();
|
||||
let txid = psbt.unsigned_tx.txid().to_vec();
|
||||
let psbt = encode::serialize(psbt);
|
||||
|
||||
db_exec(&mut self.conn, |db_tx| {
|
||||
|
||||
@@ -218,7 +218,7 @@ impl TryFrom<&rusqlite::Row<'_>> for DbAddress {
|
||||
}
|
||||
|
||||
/// A row in the "spend_transactions" table
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct DbSpendTransaction {
|
||||
pub id: i64,
|
||||
pub psbt: Psbt,
|
||||
@@ -236,7 +236,7 @@ impl TryFrom<&rusqlite::Row<'_>> for DbSpendTransaction {
|
||||
|
||||
let txid: Vec<u8> = row.get(2)?;
|
||||
let txid: bitcoin::Txid = encode::deserialize(&txid).expect("We only store valid txids");
|
||||
assert_eq!(txid, psbt.global.unsigned_tx.txid());
|
||||
assert_eq!(txid, psbt.unsigned_tx.txid());
|
||||
|
||||
Ok(DbSpendTransaction { id, psbt, txid })
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user