Skip to content

Commit c3508e2

Browse files
committed
chore: migration: remove custom EcdsaSig
1 parent 8ec53d3 commit c3508e2

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

bitcoin/src/light/wallet.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bitcoincore_rpc::bitcoin::{
22
blockdata::{constants::WITNESS_SCALE_FACTOR, transaction::NonStandardSighashType},
3-
PackedLockTime, PublicKey, Witness,
3+
PackedLockTime, PublicKey, Witness, EcdsaSig,
44
};
55

66
use super::{electrs::ElectrsClient, error::Error};
@@ -390,23 +390,6 @@ impl Wallet {
390390
.secp
391391
.sign(&Message::from_slice(&sig_hash.into_inner()[..])?, &private_key.inner);
392392

393-
pub struct EcdsaSig {
394-
pub sig: Signature,
395-
pub hash_ty: SigHashType,
396-
}
397-
398-
impl EcdsaSig {
399-
// https://github.com/rust-bitcoin/rust-bitcoin/blob/deb867e33d30873c44c1d0c9917630ed52388d59/src/util/ecdsa.rs#L50
400-
pub fn to_vec(&self) -> Vec<u8> {
401-
self.sig
402-
.serialize_der()
403-
.iter()
404-
.copied()
405-
.chain(std::iter::once(self.hash_ty as u8))
406-
.collect()
407-
}
408-
}
409-
410393
let final_signature = EcdsaSig {
411394
sig,
412395
hash_ty: sighash_ty,
@@ -415,7 +398,7 @@ impl Wallet {
415398
// TODO: can we write directly to final_script_witness here?
416399
psbt.inputs[inp]
417400
.partial_sigs
418-
.insert(private_key.public_key(&self.secp), final_signature.to_vec());
401+
.insert(private_key.public_key(&self.secp), final_signature);
419402
}
420403

421404
for psbt_input in psbt.inputs.iter_mut() {

0 commit comments

Comments
 (0)