Fix broken build due to conflict between #1340 and #999

I will test merge commits more thoroughly before signing off on them in future, sorry.
This commit is contained in:
Andrew Poelstra 2022-10-25 22:04:38 +00:00
parent 391cfd67bd
commit c4084b91fb
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 5 additions and 5 deletions

View File

@ -90,13 +90,13 @@ use bitcoin::secp256k1::{Message, Secp256k1};
use bitcoin::util::bip32::{ use bitcoin::util::bip32::{
ChildNumber, DerivationPath, ExtendedPrivKey, ExtendedPubKey, Fingerprint, ChildNumber, DerivationPath, ExtendedPrivKey, ExtendedPubKey, Fingerprint,
}; };
use bitcoin::util::sighash; use bitcoin::sighash::{self, SighashCache, SchnorrSighashType};
use bitcoin::util::taproot::{ use bitcoin::util::taproot::{
LeafVersion, TapLeafHash, TapSighashHash, TaprootBuilder, TaprootSpendInfo, LeafVersion, TapLeafHash, TapSighashHash, TaprootBuilder, TaprootSpendInfo,
}; };
use bitcoin::{ use bitcoin::{
absolute, script, Address, Amount, OutPoint, SchnorrSig, SchnorrSighashType, Script, absolute, script, Address, Amount, OutPoint, SchnorrSig, Script,
SighashCache, Transaction, TxIn, TxOut, Txid, Witness, XOnlyPublicKey, Transaction, TxIn, TxOut, Txid, Witness, XOnlyPublicKey,
}; };
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
@ -276,7 +276,7 @@ fn generate_bip86_key_spend_tx(
let hash_ty = input let hash_ty = input
.sighash_type .sighash_type
.and_then(|psbt_sighash_type| psbt_sighash_type.schnorr_hash_ty().ok()) .and_then(|psbt_sighash_type| psbt_sighash_type.schnorr_hash_ty().ok())
.unwrap_or(bitcoin::SchnorrSighashType::All); .unwrap_or(SchnorrSighashType::All);
let hash = SighashCache::new(&unsigned_tx).taproot_key_spend_signature_hash( let hash = SighashCache::new(&unsigned_tx).taproot_key_spend_signature_hash(
vout, vout,
&sighash::Prevouts::All(&[TxOut { &sighash::Prevouts::All(&[TxOut {
@ -649,7 +649,7 @@ impl BeneficiaryWallet {
let secret_key = let secret_key =
self.master_xpriv.derive_priv(&self.secp, &derivation_path)?.to_priv().inner; self.master_xpriv.derive_priv(&self.secp, &derivation_path)?.to_priv().inner;
for lh in leaf_hashes { for lh in leaf_hashes {
let hash_ty = bitcoin::SchnorrSighashType::All; let hash_ty = SchnorrSighashType::All;
let hash = SighashCache::new(&unsigned_tx).taproot_script_spend_signature_hash( let hash = SighashCache::new(&unsigned_tx).taproot_script_spend_signature_hash(
0, 0,
&sighash::Prevouts::All(&[TxOut { &sighash::Prevouts::All(&[TxOut {