Skip to content

Commit

Permalink
Rename sig_witness -> create_witness
Browse files Browse the repository at this point in the history
  • Loading branch information
diehuxx committed Jul 26, 2024
1 parent 9410397 commit 5816505
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 5816505

Please # to comment.