Skip to content

Commit

Permalink
remove unneeded argument from toDER method
Browse files Browse the repository at this point in the history
  • Loading branch information
msalcala11 committed Jun 6, 2021
1 parent a90b8f5 commit 23da28c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/bitcore-lib-cash/lib/crypto/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Signature.prototype.set = function(obj) {
this.i = typeof obj.i !== 'undefined' ? obj.i : this.i; //public key recovery parameter in range [0, 3]
this.compressed = typeof obj.compressed !== 'undefined' ?
obj.compressed : this.compressed; // whether the recovered pubkey is compressed
this.isSchnorr = obj.isSchnorr;
this.isSchnorr = obj.isSchnorr || this.isSchnorr || undefined;
this.nhashtype = obj.nhashtype || this.nhashtype || undefined;
return this;
};
Expand Down Expand Up @@ -207,14 +207,12 @@ Signature.prototype.toCompact = function(i, compressed) {
return Buffer.concat([b1, b2, b3]);
};

Signature.prototype.toBuffer = Signature.prototype.toDER = function(signingMethod) {
Signature.prototype.toBuffer = Signature.prototype.toDER = function() {

// Schnorr signatures use a 64 byte r,s format, where as ECDSA takes the form decribed
// below, above the isDER function signature.

signingMethod = signingMethod || "ecdsa";

if(signingMethod === "schnorr") {
if(this.isSchnorr) {
return Buffer.concat([this.r.toBuffer({size: 32}), this.s.toBuffer({size: 32})]);
}

Expand Down

0 comments on commit 23da28c

Please sign in to comment.