From: Chris Duncan Date: Sun, 10 Aug 2025 02:19:41 +0000 (-0700) Subject: Update tests to call wallet load instead of wallet import. X-Git-Tag: v0.10.5~41^2~138 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=2e491630ba843082ad0733c7bcc88cc3ec0fd52c;p=libnemo.git Update tests to call wallet load instead of wallet import. --- diff --git a/README.md b/README.md index 8b574c7..56a38ee 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,12 @@ usage. import { Wallet } from 'libnemo' const wallet = await Wallet.create(password) -const wallet = await Wallet.import(password, mnemonic, salt?) -const wallet = await Wallet.import(password, seed) +const wallet = await Wallet.load(password, mnemonic, salt?) +const wallet = await Wallet.load(password, seed) const wallet = await Wallet.create(password) -const wallet = await Wallet.import(password, seed) -const wallet = await Wallet.import(password, mnemonic) +const wallet = await Wallet.load(password, seed) +const wallet = await Wallet.load(password, mnemonic) ``` ```javascript diff --git a/test/test.blocks.mjs b/test/test.blocks.mjs index 8c7b331..81fe264 100644 --- a/test/test.blocks.mjs +++ b/test/test.blocks.mjs @@ -98,7 +98,7 @@ await Promise.all([ const { ADDRESS_0, BIP39_SEED, BLAKE2B_ADDRESS_1, BLAKE2B_PUBLIC_1, BLAKE2B_SEED, OPEN_BLOCK, PASSWORD, PRIVATE_0, RECEIVE_BLOCK, SEND_BLOCK } = NANO_TEST_VECTORS await test('sign open block with BLAKE2b wallet', async () => { - const wallet = await Wallet.import('BLAKE2b', PASSWORD, BLAKE2B_SEED) + const wallet = await Wallet.load('BLAKE2b', PASSWORD, BLAKE2B_SEED) await assert.resolves(wallet.unlock(PASSWORD)) const block = new Block(BLAKE2B_ADDRESS_1, '0', OPEN_BLOCK.previous, OPEN_BLOCK.representative) @@ -111,7 +111,7 @@ await Promise.all([ }) await test('sign open block with BIP-44 wallet', async () => { - const wallet = await Wallet.import('BIP-44', PASSWORD, BIP39_SEED) + const wallet = await Wallet.load('BIP-44', PASSWORD, BIP39_SEED) await assert.resolves(wallet.unlock(PASSWORD)) const block = new Block(ADDRESS_0, '0', OPEN_BLOCK.previous, OPEN_BLOCK.representative) @@ -123,7 +123,7 @@ await Promise.all([ }) await test('fail to sign open block with wallet when locked', async () => { - const wallet = await Wallet.import('BIP-44', PASSWORD, BIP39_SEED) + const wallet = await Wallet.load('BIP-44', PASSWORD, BIP39_SEED) const block = new Block(ADDRESS_0, '0', OPEN_BLOCK.previous, OPEN_BLOCK.representative) .receive(OPEN_BLOCK.link, OPEN_BLOCK.balance) diff --git a/test/test.derive-accounts.mjs b/test/test.derive-accounts.mjs index 5a7745d..1fee8fd 100644 --- a/test/test.derive-accounts.mjs +++ b/test/test.derive-accounts.mjs @@ -20,7 +20,7 @@ await Promise.all([ suite('Derive accounts from BIP-44 wallet', async () => { await test('derive the first account from the given BIP-44 seed', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -36,7 +36,7 @@ await Promise.all([ }) await test('derive low indexed accounts from the given BIP-44 seed', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(1, 2) @@ -52,7 +52,7 @@ await Promise.all([ }) await test('derive high indexed accounts from the given seed', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(0x70000000, 0x7000000f) @@ -72,7 +72,7 @@ await Promise.all([ suite('Derive accounts from BLAKE2b wallet', async () => { await test('derive the second account from the given BLAKE2b seed', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BLAKE2B_SEED) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BLAKE2B_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account(1) @@ -90,7 +90,7 @@ await Promise.all([ }) await test('derive low indexed accounts from the given BLAKE2B seed', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BLAKE2B_SEED) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BLAKE2B_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(2, 3) @@ -106,7 +106,7 @@ await Promise.all([ }) await test('derive high indexed accounts from the given seed', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BLAKE2B_SEED) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BLAKE2B_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(0x70000000, 0x7000000f) diff --git a/test/test.import-wallet.mjs b/test/test.import-wallet.mjs index e5b7ff1..784199c 100644 --- a/test/test.import-wallet.mjs +++ b/test/test.import-wallet.mjs @@ -24,7 +24,7 @@ await Promise.all([ suite('Import wallets', async () => { await test('nano.org BIP-44 test vector mnemonic', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -38,7 +38,7 @@ await Promise.all([ }) await test('nano.org BIP-44 test vector seed with no mnemonic', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -54,7 +54,7 @@ await Promise.all([ }) await test('Trezor-derived BIP-44 entropy for 12-word mnemonic', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_0) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_0) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -67,7 +67,7 @@ await Promise.all([ }) await test('Trezor-derived BIP-44 entropy for 15-word mnemonic', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_1) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_1) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -80,7 +80,7 @@ await Promise.all([ }) await test('Trezor-derived BIP-44 entropy for 18-word mnemonic', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_2) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_2) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -93,7 +93,7 @@ await Promise.all([ }) await test('Trezor-derived BIP-44 entropy for 21-word mnemonic', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_3) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.MNEMONIC_3) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -106,7 +106,7 @@ await Promise.all([ }) await test('BIP-44 zero-string entropy', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_0, TREZOR_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_0, TREZOR_TEST_VECTORS.PASSWORD) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(0, 3) @@ -126,7 +126,7 @@ await Promise.all([ }) await test('BLAKE2b zero-string seed', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_0) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_0) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(0, 3) @@ -148,7 +148,7 @@ await Promise.all([ }) await test('Trezor-derived BLAKE2b test vectors verified with third-party libraries', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_1) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_1) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const accounts = await wallet.accounts(0, 1) @@ -167,14 +167,14 @@ await Promise.all([ }) await test('BLAKE2b seed creates identical wallet as its derived mnemonic', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_2) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_2) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const walletAccount = await wallet.account() assert.ok(await wallet.verify(TREZOR_TEST_VECTORS.MNEMONIC_2)) assert.ok(await wallet.verify(TREZOR_TEST_VECTORS.ENTROPY_2)) - const imported = await Wallet.import('BLAKE2b', TREZOR_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_2) + const imported = await Wallet.load('BLAKE2b', TREZOR_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_2) await imported.unlock(TREZOR_TEST_VECTORS.PASSWORD) const importedAccount = await imported.account() @@ -187,7 +187,7 @@ await Promise.all([ }) await test('BLAKE2b mnemonic for maximum seed value', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_3) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_3) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() @@ -201,27 +201,27 @@ await Promise.all([ }) await test('Reject invalid seed', async () => { - await assert.rejects(Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C797')) - await assert.rejects(Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C79701')) - await assert.rejects(Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0.replaceAll(/./g, 'x'))) + await assert.rejects(Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C797')) + await assert.rejects(Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C79701')) + await assert.rejects(Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0.replaceAll(/./g, 'x'))) }) await test('Reject invalid length seed', async () => { - await assert.rejects(Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED + 'f'), + await assert.rejects(Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED + 'f'), `Expected a ${NANO_TEST_VECTORS.BIP39_SEED.length}-character seed, but received ${NANO_TEST_VECTORS.BIP39_SEED.length + 1}-character string.`) - await assert.rejects(Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED.slice(0, -1)), + await assert.rejects(Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED.slice(0, -1)), `Expected a ${NANO_TEST_VECTORS.BIP39_SEED.length}-character seed, but received ${NANO_TEST_VECTORS.BIP39_SEED.length - 1}-character string.`) }) await test('Reject seed containing non-hex characters', async () => { - await assert.rejects(Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.SEED_0.replace(/./, 'g')), + await assert.rejects(Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.SEED_0.replace(/./, 'g')), 'Seed contains invalid hexadecimal characters.') - await assert.rejects(Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1.replace(/./, 'g')), + await assert.rejects(Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1.replace(/./, 'g')), 'Seed contains invalid hexadecimal characters.') }) await test('Import BIP-44 wallet from storage using a wallet-generated ID', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) const restored = await Wallet.restore(wallet.id) assert.ok('mnemonic' in restored) @@ -242,7 +242,7 @@ await Promise.all([ }) await test('Import BLAKE2B wallet from storage using a wallet-generated ID', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0) const restored = await Wallet.restore(wallet.id) assert.ok('mnemonic' in restored) @@ -263,7 +263,7 @@ await Promise.all([ }) await test('export wallet IDs from storage and reimport them', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) const backups = await Wallet.export() assert.ok(backups.some(record => record.id === wallet.id)) diff --git a/test/test.lock-unlock.mjs b/test/test.lock-unlock.mjs index 623e7db..727cf02 100644 --- a/test/test.lock-unlock.mjs +++ b/test/test.lock-unlock.mjs @@ -24,7 +24,7 @@ await Promise.all([ suite('Lock and unlock wallets', async () => { await test('locking and unlocking a Bip44Wallet with a password', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) assert.ok('mnemonic' in wallet) assert.ok('seed' in wallet) @@ -41,7 +41,7 @@ await Promise.all([ }) await test('fail to unlock a Bip44Wallet with different passwords', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const lockResult = await wallet.lock() @@ -58,7 +58,7 @@ await Promise.all([ }) await test('fail to unlock a Bip44Wallet with invalid input', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) //@ts-expect-error @@ -70,7 +70,7 @@ await Promise.all([ }) await test('locking and unlocking a Blake2bWallet with a password', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0) assert.ok('mnemonic' in wallet) assert.ok('seed' in wallet) @@ -87,7 +87,7 @@ await Promise.all([ }) await test('fail to unlock a Blake2bWallet with different passwords', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1) await assert.rejects(wallet.unlock(TREZOR_TEST_VECTORS.PASSWORD), { message: 'Failed to unlock wallet' }) assert.ok('mnemonic' in wallet) @@ -101,7 +101,7 @@ await Promise.all([ }) await test('fail to unlock a Blake2bWallet with no input', async () => { - const wallet = await Wallet.import('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1) + const wallet = await Wallet.load('BLAKE2b', NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1) //@ts-expect-error await assert.rejects(wallet.unlock(), { message: 'Failed to unlock wallet' }) diff --git a/test/test.tools.mjs b/test/test.tools.mjs index d90037b..b9b1f5c 100644 --- a/test/test.tools.mjs +++ b/test/test.tools.mjs @@ -137,7 +137,7 @@ await Promise.all([ }) await test('should verify a block using the public key', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() if (account.index == null) { @@ -152,7 +152,7 @@ await Promise.all([ }) await test('should reject a block using the wrong public key', async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() if (account.index == null) { @@ -178,7 +178,7 @@ await Promise.all([ }) await test('sweeper fails gracefully for ineligible accounts', { skip: true }, async () => { - const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) + const wallet = await Wallet.load('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const results = await Tools.sweep(rpc, wallet, NANO_TEST_VECTORS.ADDRESS_1)