Upgrade to bdk 4.0

To achieve this we also:

- upgrade rust-bitcoin to 0.26
- upgrade bitcoin-harness to latest version (which also depends bitcoin 0.26)
- upgrade to latest edcsa-fun
- replace cross_curve_dleq proof with sigma_fun (to avoid an upgrade dance over there)
This commit is contained in:
Thomas Eizinger 2021-02-18 13:33:50 +11:00
parent b3f49cf83e
commit 84bc2c82b7
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
18 changed files with 310 additions and 263 deletions

View file

@ -4,7 +4,7 @@ use crate::bitcoin::{
};
use ::bitcoin::{util::psbt::PartiallySignedTransaction, OutPoint, TxIn, TxOut, Txid};
use anyhow::Result;
use miniscript::{Descriptor, NullCtx};
use miniscript::{Descriptor, DescriptorTrait};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
@ -20,7 +20,7 @@ impl TxLock {
{
let lock_output_descriptor = build_shared_output_descriptor(A.0, B.0);
let address = lock_output_descriptor
.address(wallet.get_network().await, NullCtx)
.address(wallet.get_network().await)
.expect("can derive address from descriptor");
let psbt = wallet.build_tx_lock_psbt(address, amount).await?;
@ -54,9 +54,7 @@ impl TxLock {
.extract_tx()
.output
.iter()
.position(|output| {
output.script_pubkey == self.output_descriptor.script_pubkey(NullCtx)
})
.position(|output| output.script_pubkey == self.output_descriptor.script_pubkey())
.expect("transaction contains lock output")
}