]> git.codecow.com Git - libnemo.git/commitdiff
Remove ts directives.
authorChris Duncan <chris@zoso.dev>
Sat, 5 Jul 2025 10:24:58 +0000 (03:24 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 5 Jul 2025 10:24:58 +0000 (03:24 -0700)
test/test.create-wallet.mjs
test/test.lock-unlock.mjs
test/test.refresh-accounts.mjs

index c535359ea9f0a2163758b421d1b606c80a2c03d2..bafffafa35b5c9cff2f946f7cc1d8c4af6e49e77 100644 (file)
@@ -40,7 +40,6 @@ await suite('Create wallets', async () => {
        await test('BIP-44 replace invalid salt with empty string', async () => {\r
                const invalidArgs = [null, true, false, 0, 1, 2, { foo: 'bar' }]\r
                for (const arg of invalidArgs) {\r
-                       //@ts-expect-error\r
                        const wallet = Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD, arg)\r
                        await assert.resolves(wallet);\r
                        (await wallet).destroy()\r
index 72a7f50bd537d7849c3facff9e316c422b73f840..1c30dceb3e2f190856f398f58c1fa4de7f031e85 100644 (file)
@@ -119,7 +119,6 @@ await suite('Lock and unlock wallets', async () => {
                const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)\r
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.lock(), { message: 'Failed to lock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -128,7 +127,6 @@ await suite('Lock and unlock wallets', async () => {
 \r
                await wallet.lock('password')\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.unlock(), { message: 'Failed to unlock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -142,7 +140,6 @@ await suite('Lock and unlock wallets', async () => {
                const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)\r
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.lock(1), { message: 'Failed to lock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -151,7 +148,6 @@ await suite('Lock and unlock wallets', async () => {
 \r
                await wallet.lock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.unlock(1), { message: 'Failed to unlock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -269,7 +265,6 @@ await suite('Lock and unlock wallets', async () => {
                const wallet = await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1)\r
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.lock(), { message: 'Failed to lock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -278,7 +273,6 @@ await suite('Lock and unlock wallets', async () => {
 \r
                await wallet.lock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.unlock(), { message: 'Failed to unlock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -292,7 +286,6 @@ await suite('Lock and unlock wallets', async () => {
                const wallet = await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1)\r
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.lock(1), { message: 'Failed to lock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
@@ -301,7 +294,6 @@ await suite('Lock and unlock wallets', async () => {
 \r
                await wallet.lock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
-               //@ts-expect-error\r
                await assert.rejects(wallet.unlock(1), { message: 'Failed to unlock wallet' })\r
                assert.ok('mnemonic' in wallet)\r
                assert.ok('seed' in wallet)\r
index 055ef56fee08d3b7c27c58d3da722b847f2944ea..c37f34ba639be91202816b1a86987f220e227866 100644 (file)
@@ -53,6 +53,7 @@ await suite('refreshing account info', { skip: false }, async () => {
        await test('throw when referencing invalid account index', async () => {
                const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
+
                await assert.rejects(wallet.account(0x80000000),
                        { message: 'Invalid child key index 0x80000000' })
 
@@ -113,7 +114,7 @@ await suite('Fetch next unopened account', { skip: false }, async () => {
        await test('should throw on invalid node URL', async () => {
                const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
-               //@ts-expect-error
+
                await assert.rejects(wallet.getNextNewAccount())
                await assert.rejects(wallet.getNextNewAccount(null))
                await assert.rejects(wallet.getNextNewAccount(1))
@@ -126,14 +127,11 @@ await suite('Fetch next unopened account', { skip: false }, async () => {
        await test('should throw on invalid batch size', async () => {
                const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
-               //@ts-expect-error
+
                await assert.rejects(wallet.getNextNewAccount(rpc, null))
                await assert.rejects(wallet.getNextNewAccount(rpc, -1))
-               //@ts-expect-error
                await assert.rejects(wallet.getNextNewAccount(rpc, ''))
-               //@ts-expect-error
                await assert.rejects(wallet.getNextNewAccount(rpc, 'foo'))
-               //@ts-expect-error
                await assert.rejects(wallet.getNextNewAccount(rpc, { 'foo': 'bar' }))
 
                await wallet.destroy()
@@ -147,6 +145,7 @@ await suite('Refreshing wallet accounts', { skip: false }, async () => {
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
                const accounts = await wallet.refresh(rpc)
                const account = accounts[0]
+
                assert.ok(account instanceof Account)
                assert.equals(typeof account.balance, 'bigint')
                assert.exists(account.frontier)
@@ -159,6 +158,7 @@ await suite('Refreshing wallet accounts', { skip: false }, async () => {
                const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
                const accounts = await wallet.refresh(rpc, 0, 2)
+
                assert.equals(accounts.length, 1)
                assert.ok(accounts[0] instanceof Account)