@bennyblader/ddk-rn 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ddk-ffi/Cargo.lock +1 -1
- package/ddk-ffi/Cargo.toml +1 -1
- package/ddk-ffi/src/lib.rs +5 -4
- package/package.json +1 -1
package/ddk-ffi/Cargo.lock
CHANGED
package/ddk-ffi/Cargo.toml
CHANGED
package/ddk-ffi/src/lib.rs
CHANGED
|
@@ -628,7 +628,7 @@ pub fn verify_fund_tx_signature(
|
|
|
628
628
|
let script = bitcoin::ScriptBuf::new_p2wpkh(&wpkh);
|
|
629
629
|
|
|
630
630
|
// Parse signature
|
|
631
|
-
let sig = EcdsaSignature::
|
|
631
|
+
let sig = EcdsaSignature::from_compact(&signature).map_err(|_| DLCError::InvalidSignature)?;
|
|
632
632
|
|
|
633
633
|
let secp = Secp256k1::verification_only();
|
|
634
634
|
match dlc::verify_tx_input_sig(
|
|
@@ -690,7 +690,7 @@ pub fn get_raw_funding_transaction_input_signature(
|
|
|
690
690
|
)
|
|
691
691
|
.map_err(DLCError::from)?;
|
|
692
692
|
|
|
693
|
-
Ok(sig.
|
|
693
|
+
Ok(sig.serialize_compact().to_vec())
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
/// Sign a funding transaction input
|
|
@@ -1593,7 +1593,8 @@ mod tests {
|
|
|
1593
1593
|
let script = ScriptBuf::from_bytes(script_pubkey);
|
|
1594
1594
|
let sig_hash_msg =
|
|
1595
1595
|
dlc::util::get_sig_hash_msg(&btc_txn, input_index, &script, Amount::from_sat(value))?;
|
|
1596
|
-
let sig =
|
|
1596
|
+
let sig =
|
|
1597
|
+
EcdsaSignature::from_compact(&signature).map_err(|_| DLCError::InvalidSignature)?;
|
|
1597
1598
|
let pk = PublicKey::from_slice(&pk).map_err(|_| DLCError::InvalidPublicKey)?;
|
|
1598
1599
|
secp.verify_ecdsa(&sig_hash_msg, &sig, &pk)
|
|
1599
1600
|
.map_err(|_| DLCError::InvalidSignature)?;
|
|
@@ -1749,7 +1750,7 @@ mod tests {
|
|
|
1749
1750
|
)));
|
|
1750
1751
|
sign_res.expect("Error signing CET");
|
|
1751
1752
|
verify_tx_input_sig(
|
|
1752
|
-
adapted_sig.
|
|
1753
|
+
adapted_sig.serialize_compact().to_vec(),
|
|
1753
1754
|
cets[0].clone(),
|
|
1754
1755
|
0,
|
|
1755
1756
|
funding_script_pubkey.clone().into_bytes(),
|