diff --git a/src/sign.rs b/src/sign.rs index 3b3b672..26d1bc2 100644 --- a/src/sign.rs +++ b/src/sign.rs @@ -24,7 +24,7 @@ fn to_sign_psbt( Ok(psbt) } -fn sig_witness(to_spend_tx: Transaction, to_sign: Psbt, private_key: PrivateKey) -> Witness { +fn create_witness(to_spend_tx: Transaction, to_sign: Psbt, private_key: PrivateKey) -> Witness { let mut to_sign = to_sign.clone(); let secp = Secp256k1::new(); @@ -78,7 +78,7 @@ pub fn simple_sign(address: &Address, message: &str, wallet: &Wallet) -> String let to_sign_tx = blank_to_sign(to_spend_tx.clone()); let psbt = to_sign_psbt(to_spend_tx.clone(), to_sign_tx).unwrap(); - let witness = sig_witness(to_spend_tx, psbt, wallet.private_key); + let witness = create_witness(to_spend_tx, psbt, wallet.private_key); let mut buffer = Vec::new(); witness.consensus_encode(&mut buffer).unwrap(); @@ -91,7 +91,7 @@ pub fn full_sign(address: &Address, message: &str, wallet: &Wallet) -> String { let mut to_sign_tx = blank_to_sign(to_spend_tx.clone()); let psbt = to_sign_psbt(to_spend_tx.clone(), to_sign_tx.clone()).unwrap(); - to_sign_tx.input[0].witness = sig_witness(to_spend_tx, psbt, wallet.private_key); + to_sign_tx.input[0].witness = create_witness(to_spend_tx, psbt, wallet.private_key); let mut buffer = Vec::new(); to_sign_tx.consensus_encode(&mut buffer).unwrap();