Skip to content

Commit fcadeb0

Browse files
committed
fix: rename SigHas into Sighash
1 parent 7193f77 commit fcadeb0

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/bitcoin/transaction.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use bitcoin::blockdata::transaction::{EcdsaSighashType, OutPoint, TxIn, TxOut};
88
use bitcoin::util::address;
99
use bitcoin::util::ecdsa::EcdsaSig;
1010
use bitcoin::util::psbt::{self, PartiallySignedTransaction};
11-
use bitcoin::util::sighash::SigHashCache;
11+
use bitcoin::util::sighash::SighashCache;
1212
use bitcoin::util::taproot::TapSighashHash;
1313

1414
#[cfg(feature = "experimental")]
@@ -20,7 +20,7 @@ use bitcoin::{
2020
#[cfg(all(feature = "experimental", feature = "taproot"))]
2121
use bitcoin::{
2222
secp256k1::schnorr, util::schnorr::SchnorrSig, util::sighash::Prevouts,
23-
util::sighash::SchnorrSigHashType, XOnlyPublicKey,
23+
util::sighash::SchnorrSighashType, XOnlyPublicKey,
2424
};
2525

2626
use thiserror::Error;
@@ -45,9 +45,9 @@ pub enum Error {
4545
/// Multi-input transaction is not supported
4646
#[error("Multi-input transaction is not supported")]
4747
MultiUTXOUnsuported,
48-
/// SigHash type is missing
49-
#[error("SigHash type is missing")]
50-
MissingSigHashType,
48+
/// Sighash type is missing
49+
#[error("Sighash type is missing")]
50+
MissingSighashType,
5151
/// Partially signed transaction error
5252
#[error("Partially signed transaction error: `{0}`")]
5353
Psbt(#[from] psbt::Error),
@@ -255,7 +255,7 @@ where
255255
{
256256
// FIXME: this only accounts for key spend and not for script spend
257257
fn generate_witness_message(&self, _path: ScriptPath) -> Result<TapSighashHash, FError> {
258-
let mut sighash = SigHashCache::new(&self.psbt.unsigned_tx);
258+
let mut sighash = SighashCache::new(&self.psbt.unsigned_tx);
259259

260260
let witness_utxo = self.psbt.inputs[0]
261261
.witness_utxo
@@ -272,7 +272,7 @@ where
272272
script_pubkey,
273273
}];
274274
sighash
275-
.taproot_key_spend_signature_hash(0, &Prevouts::All(&txouts), SchnorrSigHashType::All)
275+
.taproot_key_spend_signature_hash(0, &Prevouts::All(&txouts), SchnorrSighashType::All)
276276
.map_err(FError::new)
277277
}
278278

@@ -284,7 +284,7 @@ where
284284
) -> Result<(), FError> {
285285
let sig_all = SchnorrSig {
286286
sig,
287-
hash_ty: SchnorrSigHashType::All,
287+
hash_ty: SchnorrSighashType::All,
288288
};
289289
self.psbt.inputs[0].tap_key_sig = Some(sig_all);
290290
Ok(())

0 commit comments

Comments
 (0)