@bennyblader/ddk-rn 0.3.14 → 0.3.16

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.
@@ -282,7 +282,7 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
282
282
 
283
283
  [[package]]
284
284
  name = "ddk_ffi"
285
- version = "0.3.14"
285
+ version = "0.3.16"
286
286
  dependencies = [
287
287
  "bip39",
288
288
  "bitcoin",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "ddk_ffi"
3
- version = "0.3.14"
3
+ version = "0.3.16"
4
4
  edition = "2021"
5
5
  license = "MIT"
6
6
  description = "rust-dlc language bindings"
@@ -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::from_der(&signature).map_err(|_| DLCError::InvalidSignature)?;
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(
@@ -680,17 +680,18 @@ pub fn get_raw_funding_transaction_input_signature(
680
680
  let wpkh = WPubkeyHash::hash(&pk.serialize());
681
681
  let script = bitcoin::ScriptBuf::new_p2wpkh(&wpkh);
682
682
 
683
- let sig = dlc::util::get_raw_sig_for_tx_input(
683
+ let sig = dlc::util::get_sig_for_tx_input(
684
684
  secp,
685
685
  &btc_tx,
686
686
  input_index,
687
687
  &script,
688
688
  Amount::from_sat(value),
689
+ EcdsaSighashType::All,
689
690
  &sk,
690
691
  )
691
692
  .map_err(DLCError::from)?;
692
693
 
693
- Ok(sig.serialize_der().to_vec())
694
+ Ok(sig)
694
695
  }
695
696
 
696
697
  /// Sign a funding transaction input
@@ -1593,7 +1594,8 @@ mod tests {
1593
1594
  let script = ScriptBuf::from_bytes(script_pubkey);
1594
1595
  let sig_hash_msg =
1595
1596
  dlc::util::get_sig_hash_msg(&btc_txn, input_index, &script, Amount::from_sat(value))?;
1596
- let sig = EcdsaSignature::from_der(&signature).map_err(|_| DLCError::InvalidSignature)?;
1597
+ let sig =
1598
+ EcdsaSignature::from_compact(&signature).map_err(|_| DLCError::InvalidSignature)?;
1597
1599
  let pk = PublicKey::from_slice(&pk).map_err(|_| DLCError::InvalidPublicKey)?;
1598
1600
  secp.verify_ecdsa(&sig_hash_msg, &sig, &pk)
1599
1601
  .map_err(|_| DLCError::InvalidSignature)?;
@@ -1749,7 +1751,7 @@ mod tests {
1749
1751
  )));
1750
1752
  sign_res.expect("Error signing CET");
1751
1753
  verify_tx_input_sig(
1752
- adapted_sig.serialize_der().to_vec(),
1754
+ adapted_sig.serialize_compact().to_vec(),
1753
1755
  cets[0].clone(),
1754
1756
  0,
1755
1757
  funding_script_pubkey.clone().into_bytes(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bennyblader/ddk-rn",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "dlcdevkit bindings for react-native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",