]> zoso.dev Git - libnemo.git/commitdiff
Test legacy account derivation. Test hardened indices. Increase derivation count... deps-only
authorChris Duncan <chris@zoso.dev>
Sat, 31 Aug 2024 20:25:32 +0000 (13:25 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 31 Aug 2024 20:25:32 +0000 (13:25 -0700)
test/test.mjs

index 19886f8a27d3c1d52d2af016d4cb2a9bf734a645..4ec829d37c6f2b94b76adc73e5b3f7ba37ff0798 100644 (file)
@@ -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)
        })
 
 })