Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsantosbh committed May 13, 2021
1 parent b436720 commit c0149d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions __test__/CredentialSignerVerifier.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('CredentialSignerVerifier Tests', () => {
},
},
};

expect(signerVerifier.isSignatureValid(toVerify)).toBeTruthy();
});

Expand Down
3 changes: 2 additions & 1 deletion src/creds/CredentialSignerVerifier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const _ = require('lodash');
const { HDNode, ECSignature } = require('bitcoinjs-lib');

const SIGNATURE_ALGO = 'ec256k1';
class CredentialSignerVerifier {
/**
* Creates a new instance of a CredentialSignerVerifier
Expand Down Expand Up @@ -50,7 +51,7 @@ class CredentialSignerVerifier {
const hash = Buffer.from(proof.merkleRoot, 'hex');
const signature = this.keyPair.sign(hash);
return {
algo: 'ec256k1',
algo: SIGNATURE_ALGO,
pubBase58: this.keyPair.neutered().toBase58(),
signature: signature.toDER().toString('hex'),
};
Expand Down

0 comments on commit c0149d1

Please sign in to comment.