diff --git a/test/test.js b/test/test.js index 3039620..25e4bce 100644 --- a/test/test.js +++ b/test/test.js @@ -310,3 +310,42 @@ describe('Mnemonic Validation', () => { }); }); }); + +// See https://github.com/satoshilabs/slips/blob/master/slip-0039.md#notation +// particularly the table rows: +// "total number of groups, a positive integer, 1 ≤ G ≤ 16" +// "group threshold, a positive integer, 1 ≤ GT ≤ G" +// This test also fails for 15-of-16, 15-of-15, but passes for all other combos +describe('Maximum number of shares ie 16-of-16', () => { + // generate the shares + let masterSecretHex = "d2b5e45b2934281a118ece2ae498514d"; + let masterSecretBuff = Buffer.from(masterSecretHex, 'hex'); + let masterSecret = []; + for (i = 0; i { + let ms = slip39.recoverSecret(mnemonics, passphrase); + assert(masterSecret.every((v, i) => v === ms[i])); + }); +});