From 77b9554fb2a8a8eb3dd9dde5d5c04d51460577e8 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 31 Aug 2024 13:25:32 -0700 Subject: [PATCH] Test legacy account derivation. Test hardened indices. Increase derivation count to stress test. --- test/test.mjs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/test.mjs b/test/test.mjs index 19886f8..4ec829d 100644 --- a/test/test.mjs +++ b/test/test.mjs @@ -157,8 +157,28 @@ describe('derive more accounts from the same seed test', function () { const result2 = wallet.accounts( '0dc285fde768f7ff29b66ce7252d56ed92fe003b605907f7a4f683c3dc8586d34a914d3c71fc099bb38ee4a59e5b081a3497b7a323e90cc68f67b5837690310c', - 1000000, 1000099) - expect(result2.length).to.equal(100) + 0x80000000, 0x800000ff) + expect(result2.length).to.equal(0x100) + }) + +}) + +describe('derive more accounts from the same seed test', function () { + this.slow(0) + + it('should derive accounts from the given seed', () => { + const result = wallet.legacyAccounts( + 'BE3E51EE51BAB11950B2495013512FEB110D9898B4137DA268709621CE2862F4', + 0x0, 0xff) + expect(result.length).to.equal(0x100) + expect(result[0].privateKey).to.exist + expect(result[0].publicKey).to.exist + expect(result[0].address).to.exist + + const result2 = wallet.legacyAccounts( + 'BE3E51EE51BAB11950B2495013512FEB110D9898B4137DA268709621CE2862F4', + 0x80000000, 0x800000ff) + expect(result2.length).to.equal(0x100) }) }) -- 2.34.1