Skip to content

Commit 5febd1b

Browse files
committed
ref: use deterministic sigs for testing, add comment (key 'id' is 'address')
1 parent 1104dc0 commit 5febd1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

key-utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let Secp256k1 = require("@dashincubator/secp256k1");
1111

1212
/**
1313
* @callback KeySet
14-
* @param {String} id
14+
* @param {String} id - typically address
1515
* @param {KeyInfo} keyInfo
1616
*/
1717

@@ -37,7 +37,11 @@ KeyUtils.set = function (id, keyInfo) {
3737
};
3838

3939
KeyUtils.sign = async function (privKeyBytes, hashBytes) {
40-
let sigOpts = { canonical: true, extraEntropy: true };
40+
let testing = true;
41+
let sigOpts = { canonical: true };
42+
if (!testing) {
43+
Object.assign({ extraEntropy: true });
44+
}
4145
let sigBytes = await Secp256k1.sign(hashBytes, privKeyBytes, sigOpts);
4246
return sigBytes;
4347
};

0 commit comments

Comments
 (0)