Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kajoseph committed Apr 24, 2024
1 parent b51d9af commit fc7f2ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/bitcore-lib/lib/crypto/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Signature.prototype.toTxFormat = function() {
* @returns {Signature}
*/
Signature.fromSchnorr = function(buf) {
$.checkArgument(_.isBuffer(buf), 'Schnorr signature argument must be a buffer');
$.checkArgument(Buffer.isBuffer(buf), 'Schnorr signature argument must be a buffer');
$.checkArgument(buf.length === 64 || buf.length === 65, 'Schnorr signatures must be 64 or 65 bytes');

const sig = new Signature();
Expand Down
3 changes: 2 additions & 1 deletion packages/bitcore-lib/test/script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,8 @@ describe('Script', function() {
describe(vec.expected.bip350Address, function() {
it(`should buildWitnessV1Out from pub key and script tree`, function() {
const script = Script.buildWitnessV1Out(vec.given.internalPubkey, vec.given.scriptTree);
(PublicKey.prototype.createTapTweak.args[0][0]?.toString('hex') == vec.intermediary.merkleRoot).should.equal(true);
const merkleRoot = PublicKey.prototype.createTapTweak.args[0][0];
((merkleRoot ? merkleRoot.toString('hex') : merkleRoot) == vec.intermediary.merkleRoot).should.equal(true);
const retVals = TaggedHash.prototype.finalize.returnValues.map(v => v.toString('hex'));
for (const leafHash of vec.intermediary.leafHashes || []) {
retVals.should.include(leafHash);
Expand Down

0 comments on commit fc7f2ec

Please sign in to comment.