From d7692747f5608679c8ae7410354ad413008c5ad7 Mon Sep 17 00:00:00 2001 From: Rahul Patni Date: Tue, 26 Nov 2024 14:33:58 -0800 Subject: [PATCH] Adds ledger flag to account store --- ironfish-cli/src/commands/wallet/account.ts | 1 + ironfish-cli/src/commands/wallet/burn.ts | 7 +- .../src/commands/wallet/chainport/send.ts | 23 +- ironfish-cli/src/commands/wallet/import.ts | 2 +- ironfish-cli/src/commands/wallet/index.ts | 5 + ironfish-cli/src/commands/wallet/mint.ts | 7 +- .../wallet/multisig/commitment/create.ts | 9 +- .../commands/wallet/multisig/dealer/create.ts | 1 + .../commands/wallet/multisig/dkg/create.ts | 1 + .../commands/wallet/multisig/dkg/round3.ts | 1 + .../src/commands/wallet/multisig/sign.ts | 27 +- ironfish-cli/src/commands/wallet/send.ts | 8 +- ironfish-cli/src/ledger/ledgerMultiSigner.ts | 1 + ironfish-cli/src/ledger/ledgerSingleSigner.ts | 1 + .../rpc/routes/wallet/importAccount.test.ts | 9 + .../multisig/createSignatureShare.test.ts | 1 + .../multisig/createSigningCommitment.test.ts | 1 + .../multisig/createTrustedDealerKeyPackage.ts | 1 + .../rpc/routes/wallet/multisig/dkg/round3.ts | 1 + .../wallet/multisig/integration.test.slow.ts | 1 + ironfish/src/rpc/routes/wallet/serializers.ts | 1 + ironfish/src/rpc/routes/wallet/types.ts | 2 + ironfish/src/wallet/account/account.ts | 4 +- ironfish/src/wallet/exporter/accountImport.ts | 2 + .../exporter/encoders/base64json.test.ts | 8 + .../wallet/exporter/encoders/bech32.test.ts | 8 + .../src/wallet/exporter/encoders/bech32.ts | 1 + .../src/wallet/exporter/encoders/json.test.ts | 4 +- ironfish/src/wallet/exporter/encoders/json.ts | 4 + .../src/wallet/exporter/encoders/mnemonic.ts | 1 + .../wallet/exporter/encoders/spendingKey.ts | 1 + .../src/wallet/exporter/encryption.test.ts | 1 + ironfish/src/wallet/wallet.test.slow.ts | 6 + ironfish/src/wallet/wallet.test.ts | 4 + ironfish/src/wallet/wallet.ts | 8 +- .../__fixtures__/walletdb.test.ts.fixture | 1322 +---------------- .../src/wallet/walletdb/accountValue.test.ts | 3 + ironfish/src/wallet/walletdb/accountValue.ts | 4 + ironfish/src/wallet/walletdb/walletdb.test.ts | 4 + 39 files changed, 154 insertions(+), 1342 deletions(-) diff --git a/ironfish-cli/src/commands/wallet/account.ts b/ironfish-cli/src/commands/wallet/account.ts index 8048a75b57..0e7d33156f 100644 --- a/ironfish-cli/src/commands/wallet/account.ts +++ b/ironfish-cli/src/commands/wallet/account.ts @@ -53,6 +53,7 @@ export class AccountsCommand extends IronfishCommand { Scanning: response.content.account.scanningEnabled ? chalk.green('✓') : '', Sequence: response.content.account.head?.sequence, Head: response.content.account.head?.hash, + Ledger: response.content.account.isLedger ? chalk.green('✓') : '', } this.log(ui.card(status)) diff --git a/ironfish-cli/src/commands/wallet/burn.ts b/ironfish-cli/src/commands/wallet/burn.ts index d6288e60f7..f6f0291694 100644 --- a/ironfish-cli/src/commands/wallet/burn.ts +++ b/ironfish-cli/src/commands/wallet/burn.ts @@ -87,10 +87,6 @@ This will destroy tokens and decrease supply for a given asset.` default: false, description: 'Wait for the transaction to be confirmed', }), - ledger: Flags.boolean({ - default: false, - description: 'Burn a transaction using a Ledger device', - }), } async start(): Promise { @@ -109,6 +105,7 @@ This will destroy tokens and decrease supply for a given asset.` } const account = await useAccount(client, flags.account) + const accountStatus = (await client.wallet.getAccountStatus({ account })).content.account let assetId = flags.assetId @@ -225,7 +222,7 @@ This will destroy tokens and decrease supply for a given asset.` await this.confirm(assetData, amount, raw.fee, account, flags.confirm) - if (flags.ledger) { + if (accountStatus.isLedger) { await ui.sendTransactionWithLedger( client, raw, diff --git a/ironfish-cli/src/commands/wallet/chainport/send.ts b/ironfish-cli/src/commands/wallet/chainport/send.ts index b74437911b..4d9da8c9d3 100644 --- a/ironfish-cli/src/commands/wallet/chainport/send.ts +++ b/ironfish-cli/src/commands/wallet/chainport/send.ts @@ -79,10 +79,6 @@ export class BridgeCommand extends IronfishCommand { description: 'Return a serialized UnsignedTransaction. Use it to create a transaction and build proofs but not post to the network', }), - ledger: Flags.boolean({ - default: false, - description: 'Send a transaction using a Ledger device', - }), } async start(): Promise { @@ -107,7 +103,7 @@ export class BridgeCommand extends IronfishCommand { } } - const { targetToken, from, to, amount, asset, assetData, expiration } = + const { targetToken, from, to, amount, asset, assetData, expiration, isLedger } = await this.getAndValidateInputs(client, networkId) const rawTransaction = await this.constructBridgeTransaction( @@ -132,7 +128,7 @@ export class BridgeCommand extends IronfishCommand { this.exit(0) } - if (flags.ledger) { + if (isLedger) { await ui.sendTransactionWithLedger( client, rawTransaction, @@ -305,7 +301,20 @@ export class BridgeCommand extends IronfishCommand { }, }) } - return { targetToken, from, to, amount, asset, assetData, expiration } + + const accountStatus = (await client.wallet.getAccountStatus({ account: from })).content + .account + + return { + targetToken, + from, + to, + amount, + asset, + assetData, + expiration, + isLedger: accountStatus.isLedger, + } } private async constructBridgeTransaction( diff --git a/ironfish-cli/src/commands/wallet/import.ts b/ironfish-cli/src/commands/wallet/import.ts index 17339c0711..3ef894ded7 100644 --- a/ironfish-cli/src/commands/wallet/import.ts +++ b/ironfish-cli/src/commands/wallet/import.ts @@ -6,8 +6,8 @@ import { Args, Flags, ux } from '@oclif/core' import { IronfishCommand } from '../../command' import { RemoteFlags } from '../../flags' import { LedgerError, LedgerMultiSigner, LedgerSingleSigner } from '../../ledger' -import { checkWalletUnlocked, inputPrompt } from '../../ui' import * as ui from '../../ui' +import { checkWalletUnlocked, inputPrompt } from '../../ui' import { importFile, importPipe, longPrompt } from '../../ui/longPrompt' import { importAccount } from '../../utils' diff --git a/ironfish-cli/src/commands/wallet/index.ts b/ironfish-cli/src/commands/wallet/index.ts index 37f6653122..865db6d0b3 100644 --- a/ironfish-cli/src/commands/wallet/index.ts +++ b/ironfish-cli/src/commands/wallet/index.ts @@ -73,6 +73,11 @@ export class AccountsCommand extends IronfishCommand { header: 'Head', extended: true, }, + isLedger: { + get: (row) => (row.isLedger ? chalk.green('✓') : ''), + header: 'Ledger', + extended: true, + }, }, { ...flags, diff --git a/ironfish-cli/src/commands/wallet/mint.ts b/ironfish-cli/src/commands/wallet/mint.ts index cba11b74a8..1a44df4ac8 100644 --- a/ironfish-cli/src/commands/wallet/mint.ts +++ b/ironfish-cli/src/commands/wallet/mint.ts @@ -108,10 +108,6 @@ This will create tokens and increase supply for a given asset.` 'Return a serialized UnsignedTransaction. Use it to create a transaction and build proofs but not post to the network', exclusive: ['rawTransaction'], }), - ledger: Flags.boolean({ - default: false, - description: 'Mint a transaction using a Ledger device', - }), } async start(): Promise { @@ -130,6 +126,7 @@ This will create tokens and increase supply for a given asset.` } const account = await useAccount(client, flags.account) + const accountStatus = (await client.wallet.getAccountStatus({ account })).content.account const publicKeyResponse = await client.wallet.getAccountPublicKey({ account }) const accountPublicKey = publicKeyResponse.content.publicKey @@ -311,7 +308,7 @@ This will create tokens and increase supply for a given asset.` assetData, ) - if (flags.ledger) { + if (accountStatus.isLedger) { await ui.sendTransactionWithLedger( client, raw, diff --git a/ironfish-cli/src/commands/wallet/multisig/commitment/create.ts b/ironfish-cli/src/commands/wallet/multisig/commitment/create.ts index f35a05cf03..f9a9f3210d 100644 --- a/ironfish-cli/src/commands/wallet/multisig/commitment/create.ts +++ b/ironfish-cli/src/commands/wallet/multisig/commitment/create.ts @@ -38,10 +38,6 @@ export class CreateSigningCommitmentCommand extends IronfishCommand { path: Flags.string({ description: 'Path to a JSON file containing multisig transaction data', }), - ledger: Flags.boolean({ - default: false, - description: 'Create signing commitment using a Ledger device', - }), } async start(): Promise { @@ -58,6 +54,9 @@ export class CreateSigningCommitmentCommand extends IronfishCommand { participantName = await ui.multisigSecretPrompt(client) } + const accountStatus = (await client.wallet.getAccountStatus({ account: participantName })) + .content.account + let identities = options.identity if (!identities || identities.length < 2) { const input = await ui.longPrompt( @@ -94,7 +93,7 @@ export class CreateSigningCommitmentCommand extends IronfishCommand { await ui.confirmOrQuit('Confirm signing commitment creation', flags.confirm) - if (flags.ledger) { + if (accountStatus.isLedger) { await this.createSigningCommitmentWithLedger( client, participantName, diff --git a/ironfish-cli/src/commands/wallet/multisig/dealer/create.ts b/ironfish-cli/src/commands/wallet/multisig/dealer/create.ts index e56e8eeda0..d8e4b25d19 100644 --- a/ironfish-cli/src/commands/wallet/multisig/dealer/create.ts +++ b/ironfish-cli/src/commands/wallet/multisig/dealer/create.ts @@ -98,6 +98,7 @@ export class MultisigCreateDealer extends IronfishCommand { multisigKeys: { publicKeyPackage: response.content.publicKeyPackage, }, + isLedger: false, } await client.wallet.importAccount({ diff --git a/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts b/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts index c150ce4854..03a274ff25 100644 --- a/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts +++ b/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts @@ -527,6 +527,7 @@ export class DkgCreateCommand extends IronfishCommand { }, version: ACCOUNT_SCHEMA_VERSION, name: accountName, + isLedger: true, createdAt: null, spendingKey: null, } diff --git a/ironfish-cli/src/commands/wallet/multisig/dkg/round3.ts b/ironfish-cli/src/commands/wallet/multisig/dkg/round3.ts index 15794f71c6..3499eebde8 100644 --- a/ironfish-cli/src/commands/wallet/multisig/dkg/round3.ts +++ b/ironfish-cli/src/commands/wallet/multisig/dkg/round3.ts @@ -235,6 +235,7 @@ export class DkgRound3Command extends IronfishCommand { }, version: ACCOUNT_SCHEMA_VERSION, name: participantName, + isLedger: true, spendingKey: null, createdAt: null, } diff --git a/ironfish-cli/src/commands/wallet/multisig/sign.ts b/ironfish-cli/src/commands/wallet/multisig/sign.ts index b9a29622d5..4621aa78eb 100644 --- a/ironfish-cli/src/commands/wallet/multisig/sign.ts +++ b/ironfish-cli/src/commands/wallet/multisig/sign.ts @@ -44,10 +44,6 @@ export class SignMultisigTransactionCommand extends IronfishCommand { char: 'a', description: 'Name of the account to use for signing the transaction', }), - ledger: Flags.boolean({ - default: false, - description: 'Perform operation with a ledger device', - }), server: Flags.boolean({ description: 'connect to a multisig broker server', }), @@ -78,12 +74,6 @@ export class SignMultisigTransactionCommand extends IronfishCommand { const client = await this.connectRpc() await ui.checkWalletUnlocked(client) - let ledger: LedgerMultiSigner | undefined = undefined - - if (flags.ledger) { - ledger = new LedgerMultiSigner() - } - let multisigAccountName: string if (!flags.account) { multisigAccountName = await ui.accountPrompt(client) @@ -97,6 +87,18 @@ export class SignMultisigTransactionCommand extends IronfishCommand { } } + const accountStatus = ( + await client.wallet.getAccountStatus({ + account: multisigAccountName, + }) + ).content.account + + let ledger: LedgerMultiSigner | undefined = undefined + + if (accountStatus.isLedger) { + ledger = new LedgerMultiSigner() + } + const accountIdentities = ( await client.wallet.multisig.getAccountIdentities({ account: multisigAccountName }) ).content.identities @@ -149,7 +151,10 @@ export class SignMultisigTransactionCommand extends IronfishCommand { ) // Prompt for confirmation before broker automates signing - if (!flags.ledger && sessionManager instanceof MultisigClientSigningSessionManager) { + if ( + !accountStatus.isLedger && + sessionManager instanceof MultisigClientSigningSessionManager + ) { await ui.confirmOrQuit('Sign this transaction?') } diff --git a/ironfish-cli/src/commands/wallet/send.ts b/ironfish-cli/src/commands/wallet/send.ts index e7cc1a26f2..052a03cff5 100644 --- a/ironfish-cli/src/commands/wallet/send.ts +++ b/ironfish-cli/src/commands/wallet/send.ts @@ -103,10 +103,6 @@ export class Send extends IronfishCommand { description: 'The note hashes to include in the transaction', multiple: true, }), - ledger: Flags.boolean({ - default: false, - description: 'Send a transaction using a Ledger device', - }), } async start(): Promise { @@ -128,6 +124,8 @@ export class Send extends IronfishCommand { } const from = await useAccount(client, flags.account, 'Select an account to send from') + const accountStatus = (await client.wallet.getAccountStatus({ account: from })).content + .account if (assetId == null) { const asset = await ui.assetPrompt(client, from, { @@ -255,7 +253,7 @@ export class Send extends IronfishCommand { this.exit(0) } - if (flags.ledger) { + if (accountStatus.isLedger) { await ui.sendTransactionWithLedger( client, raw, diff --git a/ironfish-cli/src/ledger/ledgerMultiSigner.ts b/ironfish-cli/src/ledger/ledgerMultiSigner.ts index 6595cfd48e..6b8720cfb8 100644 --- a/ironfish-cli/src/ledger/ledgerMultiSigner.ts +++ b/ironfish-cli/src/ledger/ledgerMultiSigner.ts @@ -178,6 +178,7 @@ export class LedgerMultiSigner extends Ledger { publicKeyPackage: publicKeyPackage.toString('hex'), identity: identity.toString('hex'), }, + isLedger: true, version: ACCOUNT_SCHEMA_VERSION, spendingKey: null, createdAt: null, diff --git a/ironfish-cli/src/ledger/ledgerSingleSigner.ts b/ironfish-cli/src/ledger/ledgerSingleSigner.ts index 8dc313a3a7..4e228270d8 100644 --- a/ironfish-cli/src/ledger/ledgerSingleSigner.ts +++ b/ironfish-cli/src/ledger/ledgerSingleSigner.ts @@ -50,6 +50,7 @@ export class LedgerSingleSigner extends Ledger { outgoingViewKey: responseViewKey.ovk.toString('hex'), proofAuthorizingKey: responsePGK.nsk.toString('hex'), spendingKey: null, + isLedger: true, createdAt: null, } diff --git a/ironfish/src/rpc/routes/wallet/importAccount.test.ts b/ironfish/src/rpc/routes/wallet/importAccount.test.ts index b7be8c5be5..7babdb55b6 100644 --- a/ironfish/src/rpc/routes/wallet/importAccount.test.ts +++ b/ironfish/src/rpc/routes/wallet/importAccount.test.ts @@ -43,6 +43,7 @@ describe('Route wallet/importAccount', () => { proofAuthorizingKey: null, version: 1, createdAt: null, + isLedger: false, } const response = await routeTest.client.wallet.importAccount({ @@ -69,6 +70,7 @@ describe('Route wallet/importAccount', () => { publicAddress: trustedDealerPackages.publicAddress, spendingKey: null, createdAt: null, + isLedger: false, proofAuthorizingKey: trustedDealerPackages.proofAuthorizingKey, multisigKeys: { publicKeyPackage: trustedDealerPackages.publicKeyPackage, @@ -102,6 +104,7 @@ describe('Route wallet/importAccount', () => { proofAuthorizingKey: null, version: 1, createdAt: null, + isLedger: false, }), rescan: false, }) @@ -129,6 +132,7 @@ describe('Route wallet/importAccount', () => { proofAuthorizingKey: null, version: 1, createdAt: null, + isLedger: false, }), name: overriddenAccountName, rescan: false, @@ -172,6 +176,7 @@ describe('Route wallet/importAccount', () => { proofAuthorizingKey: null, version: 1, createdAt: null, + isLedger: false, } const response = await routeTest.client.wallet.importAccount({ @@ -203,6 +208,7 @@ describe('Route wallet/importAccount', () => { version: 1, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } } @@ -500,6 +506,7 @@ describe('Route wallet/importAccount', () => { keyPackage: trustedDealerPackages.keyPackages[1].keyPackage.toString(), secret: secrets[1].serialize().toString('hex'), }, + isLedger: false, } try { @@ -582,6 +589,7 @@ describe('Route wallet/importAccount', () => { publicKeyPackage: trustedDealerPackages.publicKeyPackage, identity: nextIdentity, }, + isLedger: false, } try { @@ -625,6 +633,7 @@ describe('Route wallet/importAccount', () => { publicKeyPackage: trustedDealerPackages.publicKeyPackage, identity: identity, }, + isLedger: false, } const response = await routeTest.client.wallet.importAccount({ diff --git a/ironfish/src/rpc/routes/wallet/multisig/createSignatureShare.test.ts b/ironfish/src/rpc/routes/wallet/multisig/createSignatureShare.test.ts index 1091ab900c..0914d59932 100644 --- a/ironfish/src/rpc/routes/wallet/multisig/createSignatureShare.test.ts +++ b/ironfish/src/rpc/routes/wallet/multisig/createSignatureShare.test.ts @@ -34,6 +34,7 @@ describe('Route wallt/multisig/createSignatureShare', () => { version: ACCOUNT_SCHEMA_VERSION, spendingKey: null, createdAt: null, + isLedger: false, } const account = await routeTest.wallet.importAccount(accountImport) diff --git a/ironfish/src/rpc/routes/wallet/multisig/createSigningCommitment.test.ts b/ironfish/src/rpc/routes/wallet/multisig/createSigningCommitment.test.ts index dcdf723c84..05be1d79de 100644 --- a/ironfish/src/rpc/routes/wallet/multisig/createSigningCommitment.test.ts +++ b/ironfish/src/rpc/routes/wallet/multisig/createSigningCommitment.test.ts @@ -53,6 +53,7 @@ describe('Route wallet/multisig/createSigningCommitment', () => { publicKeyPackage: trustedDealerPackage.publicKeyPackage, }, proofAuthorizingKey: null, + isLedger: false, } const importAccountRequest = { diff --git a/ironfish/src/rpc/routes/wallet/multisig/createTrustedDealerKeyPackage.ts b/ironfish/src/rpc/routes/wallet/multisig/createTrustedDealerKeyPackage.ts index 7b7bd170f8..7850637cac 100644 --- a/ironfish/src/rpc/routes/wallet/multisig/createTrustedDealerKeyPackage.ts +++ b/ironfish/src/rpc/routes/wallet/multisig/createTrustedDealerKeyPackage.ts @@ -101,6 +101,7 @@ routes.register< keyPackage, publicKeyPackage, }, + isLedger: false, } const encoder = new JsonEncoder() diff --git a/ironfish/src/rpc/routes/wallet/multisig/dkg/round3.ts b/ironfish/src/rpc/routes/wallet/multisig/dkg/round3.ts index 448ec7fe44..ad81be0a57 100644 --- a/ironfish/src/rpc/routes/wallet/multisig/dkg/round3.ts +++ b/ironfish/src/rpc/routes/wallet/multisig/dkg/round3.ts @@ -92,6 +92,7 @@ routes.register( keyPackage, publicKeyPackage, }, + isLedger: false, } const account = await node.wallet.importAccount(accountImport, { diff --git a/ironfish/src/rpc/routes/wallet/multisig/integration.test.slow.ts b/ironfish/src/rpc/routes/wallet/multisig/integration.test.slow.ts index 190d083e6a..35e9c99faf 100644 --- a/ironfish/src/rpc/routes/wallet/multisig/integration.test.slow.ts +++ b/ironfish/src/rpc/routes/wallet/multisig/integration.test.slow.ts @@ -159,6 +159,7 @@ describe('multisig RPC integration', () => { publicKeyPackage: trustedDealerPackage.publicKeyPackage, }, ...trustedDealerPackage, + isLedger: false, } // import an account to serve as the coordinator diff --git a/ironfish/src/rpc/routes/wallet/serializers.ts b/ironfish/src/rpc/routes/wallet/serializers.ts index 67ea68bba4..00eda4178d 100644 --- a/ironfish/src/rpc/routes/wallet/serializers.ts +++ b/ironfish/src/rpc/routes/wallet/serializers.ts @@ -161,6 +161,7 @@ export async function serializeRpcAccountStatus( return { name: account.name, id: account.id, + isLedger: account.isLedger, head: head ? { hash: head.hash.toString('hex'), diff --git a/ironfish/src/rpc/routes/wallet/types.ts b/ironfish/src/rpc/routes/wallet/types.ts index a692840702..05acedb054 100644 --- a/ironfish/src/rpc/routes/wallet/types.ts +++ b/ironfish/src/rpc/routes/wallet/types.ts @@ -165,6 +165,7 @@ export type RpcMultisigKeys = { export type RpcAccountStatus = { name: string id: string + isLedger: boolean head: { hash: string sequence: number @@ -179,6 +180,7 @@ export const RpcAccountStatusSchema: yup.ObjectSchema = yup .object({ name: yup.string().defined(), id: yup.string().defined(), + isLedger: yup.boolean().defined(), head: yup .object({ hash: yup.string().defined(), diff --git a/ironfish/src/wallet/account/account.ts b/ironfish/src/wallet/account/account.ts index 1450468c79..e56bc7ee34 100644 --- a/ironfish/src/wallet/account/account.ts +++ b/ironfish/src/wallet/account/account.ts @@ -76,7 +76,7 @@ export class Account { readonly prefixRange: DatabaseKeyRange readonly multisigKeys?: MultisigKeys readonly proofAuthorizingKey: string | null - + readonly isLedger: boolean constructor({ accountValue, walletDb, @@ -103,6 +103,7 @@ export class Account { this.scanningEnabled = accountValue.scanningEnabled this.multisigKeys = accountValue.multisigKeys this.proofAuthorizingKey = accountValue.proofAuthorizingKey + this.isLedger = accountValue.isLedger } isSpendingAccount(): this is SpendingAccount { @@ -124,6 +125,7 @@ export class Account { scanningEnabled: this.scanningEnabled, multisigKeys: this.multisigKeys, proofAuthorizingKey: this.proofAuthorizingKey, + isLedger: this.isLedger, } } diff --git a/ironfish/src/wallet/exporter/accountImport.ts b/ironfish/src/wallet/exporter/accountImport.ts index 3652cc0f47..ca3f060a68 100644 --- a/ironfish/src/wallet/exporter/accountImport.ts +++ b/ironfish/src/wallet/exporter/accountImport.ts @@ -29,6 +29,7 @@ export type AccountImport = { } | null multisigKeys?: MultisigKeysImport proofAuthorizingKey: string | null + isLedger: boolean } export function toAccountImport( @@ -54,6 +55,7 @@ export function toAccountImport( createdAt, multisigKeys: account.multisigKeys, proofAuthorizingKey: account.proofAuthorizingKey, + isLedger: account.isLedger, } if (viewOnly) { diff --git a/ironfish/src/wallet/exporter/encoders/base64json.test.ts b/ironfish/src/wallet/exporter/encoders/base64json.test.ts index 745b71ab66..f477f2fd48 100644 --- a/ironfish/src/wallet/exporter/encoders/base64json.test.ts +++ b/ironfish/src/wallet/exporter/encoders/base64json.test.ts @@ -22,6 +22,7 @@ describe('Base64JsonEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -40,6 +41,7 @@ describe('Base64JsonEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -58,6 +60,7 @@ describe('Base64JsonEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -84,6 +87,7 @@ describe('Base64JsonEncoder', () => { sequence: 1, }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -104,6 +108,7 @@ describe('Base64JsonEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -127,6 +132,7 @@ describe('Base64JsonEncoder', () => { publicKeyPackage: 'abcdef0000', }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -152,6 +158,7 @@ describe('Base64JsonEncoder', () => { keyPackage: 'bbbb', }, proofAuthorizingKey: null, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -172,6 +179,7 @@ describe('Base64JsonEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: null, + isLedger: false, } const encoded = encoder.encode(accountImport) diff --git a/ironfish/src/wallet/exporter/encoders/bech32.test.ts b/ironfish/src/wallet/exporter/encoders/bech32.test.ts index 92b6819ff1..d078807be1 100644 --- a/ironfish/src/wallet/exporter/encoders/bech32.test.ts +++ b/ironfish/src/wallet/exporter/encoders/bech32.test.ts @@ -22,6 +22,7 @@ describe('Bech32AccountEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -42,6 +43,7 @@ describe('Bech32AccountEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, }) const decoded = encoder.decode(encoded, { name: 'foo' }) @@ -65,6 +67,7 @@ describe('Bech32AccountEncoder', () => { sequence: 1, }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -85,6 +88,7 @@ describe('Bech32AccountEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -108,6 +112,7 @@ describe('Bech32AccountEncoder', () => { publicKeyPackage: 'abcdef0000', }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -133,6 +138,7 @@ describe('Bech32AccountEncoder', () => { keyPackage: 'bbbb', }, proofAuthorizingKey: null, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -153,6 +159,7 @@ describe('Bech32AccountEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: null, + isLedger: false, } const encoded = encoder.encode(accountImport) @@ -185,6 +192,7 @@ describe('Bech32AccountEncoder', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } encoder.VERSION = 0 diff --git a/ironfish/src/wallet/exporter/encoders/bech32.ts b/ironfish/src/wallet/exporter/encoders/bech32.ts index 07961220ec..dbcb623528 100644 --- a/ironfish/src/wallet/exporter/encoders/bech32.ts +++ b/ironfish/src/wallet/exporter/encoders/bech32.ts @@ -164,6 +164,7 @@ function decoderV1( publicAddress, createdAt, proofAuthorizingKey: null, + isLedger: false, } } diff --git a/ironfish/src/wallet/exporter/encoders/json.test.ts b/ironfish/src/wallet/exporter/encoders/json.test.ts index 69a83ae260..6cbee1df3d 100644 --- a/ironfish/src/wallet/exporter/encoders/json.test.ts +++ b/ironfish/src/wallet/exporter/encoders/json.test.ts @@ -70,7 +70,7 @@ describe('JsonEncoder', () => { version: ACCOUNT_SCHEMA_VERSION, name: 'test', spendingKey: null, - viewKey: key.viewKey, + viewKey: key.viewKey, // viewKey is required incomingViewKey: key.incomingViewKey, outgoingViewKey: key.outgoingViewKey, publicAddress: key.publicAddress, @@ -79,6 +79,7 @@ describe('JsonEncoder', () => { publicKeyPackage: 'cccc', }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoder = new JsonEncoder() @@ -107,6 +108,7 @@ describe('JsonEncoder', () => { keyPackage: 'bbbb', }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const encoder = new JsonEncoder() diff --git a/ironfish/src/wallet/exporter/encoders/json.ts b/ironfish/src/wallet/exporter/encoders/json.ts index 6f36d24be3..04e83c1495 100644 --- a/ironfish/src/wallet/exporter/encoders/json.ts +++ b/ironfish/src/wallet/exporter/encoders/json.ts @@ -66,6 +66,7 @@ type AccountEncodedJSON = { publicKeyPackage: string } proofAuthorizingKey?: string | null + isLedger?: boolean } const AccountEncodedJSONSchema: yup.ObjectSchema = yup @@ -96,6 +97,7 @@ const AccountEncodedJSONSchema: yup.ObjectSchema = yup .optional() .default(undefined), proofAuthorizingKey: yup.string().nullable().optional(), + isLedger: yup.boolean().optional(), }) .defined() @@ -118,6 +120,7 @@ const serializeAccountEncodedJSON = (accountImport: AccountImport): AccountEncod spendingKey: accountImport.spendingKey, multisigKeys: accountImport.multisigKeys, proofAuthorizingKey: accountImport.proofAuthorizingKey, + isLedger: accountImport.isLedger, createdAt: createdAt, } } @@ -150,5 +153,6 @@ function deserializeAccountEncodedJSON(raw: AccountEncodedJSON): AccountImport { multisigKeys: raw.multisigKeys ? deserializeRpcAccountMultisigKeys(raw.multisigKeys) : undefined, + isLedger: raw.isLedger ?? false, } } diff --git a/ironfish/src/wallet/exporter/encoders/mnemonic.ts b/ironfish/src/wallet/exporter/encoders/mnemonic.ts index 633afd105d..18a7b3890b 100644 --- a/ironfish/src/wallet/exporter/encoders/mnemonic.ts +++ b/ironfish/src/wallet/exporter/encoders/mnemonic.ts @@ -61,6 +61,7 @@ export class MnemonicEncoder implements AccountEncoder { createdAt: null, version: ACCOUNT_SCHEMA_VERSION, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } } } diff --git a/ironfish/src/wallet/exporter/encoders/spendingKey.ts b/ironfish/src/wallet/exporter/encoders/spendingKey.ts index 7b27badf65..953e2a95ad 100644 --- a/ironfish/src/wallet/exporter/encoders/spendingKey.ts +++ b/ironfish/src/wallet/exporter/encoders/spendingKey.ts @@ -44,6 +44,7 @@ export class SpendingKeyEncoder implements AccountEncoder { createdAt: null, version: ACCOUNT_SCHEMA_VERSION, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } } } diff --git a/ironfish/src/wallet/exporter/encryption.test.ts b/ironfish/src/wallet/exporter/encryption.test.ts index 69be117b51..e2553a9d15 100644 --- a/ironfish/src/wallet/exporter/encryption.test.ts +++ b/ironfish/src/wallet/exporter/encryption.test.ts @@ -27,6 +27,7 @@ describe('Wallet Export Encryption', () => { publicAddress: key.publicAddress, createdAt: null, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const secret = multisig.ParticipantSecret.random() diff --git a/ironfish/src/wallet/wallet.test.slow.ts b/ironfish/src/wallet/wallet.test.slow.ts index 293baafc2a..196afa5488 100644 --- a/ironfish/src/wallet/wallet.test.slow.ts +++ b/ironfish/src/wallet/wallet.test.slow.ts @@ -645,6 +645,7 @@ describe('Wallet', () => { incomingViewKey: account.incomingViewKey, createdAt: null, proofAuthorizingKey: account.proofAuthorizingKey, + isLedger: false, } const viewOnlyAccount = await viewOnlyNode.wallet.importAccount(accountValue) @@ -1176,6 +1177,7 @@ describe('Wallet', () => { name: trustedDealerPackage.keyPackages[0].identity, spendingKey: null, createdAt: null, + isLedger: false, multisigKeys: getMultisigKeys(0), ...trustedDealerPackage, }) @@ -1184,6 +1186,7 @@ describe('Wallet', () => { name: trustedDealerPackage.keyPackages[1].identity, spendingKey: null, createdAt: null, + isLedger: false, multisigKeys: getMultisigKeys(1), ...trustedDealerPackage, }) @@ -1192,6 +1195,7 @@ describe('Wallet', () => { name: trustedDealerPackage.keyPackages[2].identity, spendingKey: null, createdAt: null, + isLedger: false, multisigKeys: getMultisigKeys(2), ...trustedDealerPackage, }) @@ -1203,6 +1207,7 @@ describe('Wallet', () => { name: 'coordinator', spendingKey: null, createdAt: null, + isLedger: false, multisigKeys: { publicKeyPackage: trustedDealerPackage.publicKeyPackage, }, @@ -1369,6 +1374,7 @@ describe('Wallet', () => { identity: trustedDealerPackage.keyPackages[0].identity, keyPackage: trustedDealerPackage.keyPackages[0].keyPackage, }, + isLedger: false, ...trustedDealerPackage, }) diff --git a/ironfish/src/wallet/wallet.test.ts b/ironfish/src/wallet/wallet.test.ts index 4c3e616faf..b3ff1a63ca 100644 --- a/ironfish/src/wallet/wallet.test.ts +++ b/ironfish/src/wallet/wallet.test.ts @@ -569,6 +569,7 @@ describe('Wallet', () => { version: 1, spendingKey: null, createdAt: null, + isLedger: false, ...key, } const viewonlyAccount = await node.wallet.importAccount(accountValue) @@ -590,6 +591,7 @@ describe('Wallet', () => { version: 1, spendingKey: null, createdAt: null, + isLedger: false, ...key, } const accountImport1 = await node.wallet.importAccount(accountValue) @@ -705,6 +707,7 @@ describe('Wallet', () => { version: 1, createdAt: null, scanningEnabled: false, + isLedger: false, ...key, } @@ -725,6 +728,7 @@ describe('Wallet', () => { name: 'new-account', version: 1, createdAt: null, + isLedger: false, scanningEnabled: false, ...key, } diff --git a/ironfish/src/wallet/wallet.ts b/ironfish/src/wallet/wallet.ts index 58186cffe0..aeae275a92 100644 --- a/ironfish/src/wallet/wallet.ts +++ b/ironfish/src/wallet/wallet.ts @@ -41,8 +41,11 @@ import { TransactionUtils, } from '../utils' import { WorkerPool } from '../workerPool' -import { DecryptedNote, DecryptNotesItem } from '../workerPool/tasks/decryptNotes' -import { DecryptNotesOptions } from '../workerPool/tasks/decryptNotes' +import { + DecryptedNote, + DecryptNotesItem, + DecryptNotesOptions, +} from '../workerPool/tasks/decryptNotes' import { Account, ACCOUNT_SCHEMA_VERSION } from './account/account' import { EncryptedAccount } from './account/encryptedAccount' import { AssetBalances } from './assetBalances' @@ -1400,6 +1403,7 @@ export class Wallet { spendingKey: key.spendingKey, viewKey: key.viewKey, scanningEnabled: true, + isLedger: false, createdAt, }, walletDb: this.walletDb, diff --git a/ironfish/src/wallet/walletdb/__fixtures__/walletdb.test.ts.fixture b/ironfish/src/wallet/walletdb/__fixtures__/walletdb.test.ts.fixture index 61c5f41085..cebfd64085 100644 --- a/ironfish/src/wallet/walletdb/__fixtures__/walletdb.test.ts.fixture +++ b/ironfish/src/wallet/walletdb/__fixtures__/walletdb.test.ts.fixture @@ -1,1117 +1,26 @@ { - "WalletDB loadNoteHashesInSequenceRange loads note hashes in the provided range": [ - { - "value": { - "version": 4, - "id": "0be218f0-129d-4e5f-84e1-0578764d935c", - "name": "test", - "spendingKey": "f5033964fc93e7d46a87cde562567e2ed7747a7e37b10697f8cbef391e0366b4", - "viewKey": "e0e3ba3baf3de784a3c59edb21dbc1964a5d34cad0d667b29e8a6435ef28ac6d4c0da2110adefcd8ae1e48d858792ae9ce054f6bcbc9e8e91a50213fbc87db8b", - "incomingViewKey": "02152b6c75c952e8f3d23339230e60a1101dc51370dd4e1e74197d4d82418703", - "outgoingViewKey": "38d0b71890263f7ae873c834a86cfd8c7debb856d5558eaa17b048dfea52c1dc", - "publicAddress": "df5dd91c46403560964dcc1c4d9462932775bb61dbc469285e2abad6e299f858", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "e4e4b4eafb4c59c6a5990207e3785a6e13af15ab51f4eb73e48a5869c89f910c" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB loadUnspentNotesByValue notes should be returned in order of value": [ - { - "value": { - "version": 4, - "id": "b08f0f76-1cd7-45df-9527-fbefb2e686d5", - "name": "test", - "spendingKey": "e243d6e5d5e081a34b58202e9a2ef23b5ffe28da1cc4be418480471826fbdefa", - "viewKey": "945e3a763a7c7c24b0d94d6da0323326d31885783c63cbbd8d933d0bdfb222f3d80b504dff558a7f1b5efcabe2f2b2b0c3c66cc5bdaa7ce4d1f8eb71cb120b5e", - "incomingViewKey": "90e6732e87e81ce93ddf3981136c010f09ed962509239febb941ba1d40080000", - "outgoingViewKey": "1423d36d9daaa4598a4cdb76fefd6d37822ab0f62a8b58115c37a1aef55d9e3b", - "publicAddress": "457db891b144364f68100eed5936b4f24cb28ca9f2baadf625f0232551ce639e", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "94e1e10ead951d7051e8deed9070f4067976153f2a8b6e39dff7a59865f1fe0b" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "header": { - "sequence": 2, - "previousBlockHash": "4791D7AE9F97DF100EF1558E84772D6A09B43762388283F75C6F20A32A88AA86", - "noteCommitment": { - "type": "Buffer", - "data": "base64:AGN/n7vdSA0cqTGHGylB36I4qggOVd4iamngw/ulexY=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:gluzRSYoPPJ/86DkUz9zQ/RSUtdUBfV1Llt8qidYaNI=" - }, - "target": "9282972777491357380673661573939192202192629606981189395159182914949423", - "randomness": "0", - "timestamp": 1717538193860, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 4, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAcDrdke/Lktu7h7+wC0NkL3vAlI+dvqf1HlHu3cvILhqRt4tyjHuAtkYQIAgSgkzYfxPOIP01jYWrWJJ9TsnrrumRAYGcaYH1eFY+gVjIHFyDEuzqh2+e0dB8wPjRVxAnyWYao8hIUN9YDezLerZC8FkgC3CdQWhgF5E2Ywcw9XAX6flGlQpPtL5KOfw3uwL4X5jReUibA02H+MFFUnTbM1b9kjWc6luXmevFZiuZZgukdwOi0a2B9yA0wHGGXx00JvVMGj2AsUfUdRmaepcOE7aSQZDKeSoEnc8KnQgtfmlYxRYxmTQVjKF/cYXTMcLlZqVq4j78f/D2gC5jn5q2Re61qquxxPnucfNgIIoZsxTdlgektNC4EHZkOebxDx4gbN05HxxZdOfHsibgIuzyvtkg2kF7OSfjtGz8HTBnttHY5y/6nR7iWTLjNxD+jRFU1+w67YIVB9iVwuGYNC1bTm2VTWB/Y5zYt5nFlVqpT1NxwdR3OLiJk8M/WKvTrjVS9QttIUNYksjqjwOX7gzondNS4eglFsgwmA61k21lr7mSnWzNqPANgD6/OXjnJysrTt4ncaa4+mda/TelZJ1zzM3pvNumX2g9vBWEOt12wQpLAXOveRdMYUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw/RLaJYwtarGpEibZkqy3tTYtAqWdYztrzeU3aXy7oeuNHxGZ2LNuBQVqlhP2/di79g5SWb2R8lvpexAtiLaPBA==" - } - ] - }, - { - "type": "Buffer", - "data": "base64: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" - }, - { - "header": { - "sequence": 3, - "previousBlockHash": "61BE541335494559A59BE9A95190832A60EF5C621DDCE281CA898BF572B14FAC", - "noteCommitment": { - "type": "Buffer", - "data": "base64:KYgy0rpMqCLVS+hbylAmqe85nBNlRxKGCoUkRU89Clo=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:vUy9C9374DVEaJ2r/pgi4qoTwrZogxbHil0Dc4gWYBk=" - }, - "target": "9264879167265393346079759017366666868294504436375261565844152486318817", - "randomness": "0", - "timestamp": 1717538210880, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 7, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAATXyUc18zgTHsFlrQvf4T1ry8Rl2BElerFEiWKzvBlJGuR09ToHG0NpaTOsZqMenJt3X6wXO5ScUb265PGWevY5AATXnCMhdovuDmZc9VoA6vRymBdxFc1Vzn1jDeiid9BZgp6EUnpswGd3alEp3dxSH6lBKWeoj9yzb316F4yUIKQqsIM6L4x3gWptyB86NOVePG6Ba5b/xx0VbRD+GZYarZ8RiAK8A8x27y+ViFgqSm92GVkHzeonGok+X3gDXVksGxFIKkqU64oC1a7fe37RzhQ9KdNIqFthFQlQFsbS6hTnB2WRJhLSCxrj1DDM0nnb3Yr9tWVb2kTyOd+tvTxiOJVf2XHthNFsFxuFDZAZpT0O3Ek1AVWTOvewd8ogpjPR1JWj1DEmd5epVu+Esdo1ULjHim0UDdSJk9UwXpcMIXGoEH3/i/mWmPQK7ElfUjhhreUbemM1KUGQvLXP1k509U5upyuTWDPa0wtn8vvkhkQ1ZOG4UJAYJ8wu5xHYJe4QupfC5HGtjt5+nRAWhiooskZ+onFyIURHw1RNTXDzq1xawA00KkbCBMEVeLFKmyHuEbTWUGuepH8lG7aL6wmn1DpQqzyzwvZ5Q2RQZ9MNsJCUPX08/CtUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw7RSyp3ZlB6YOVtipbB7AscRcni0r5Ap9h8dK1FMYHG2+Tfm/8LjVSKhweNpYzyh3ZNpEDgMZb2AUjKGaQmbgCg==" - }, - { - "type": "Buffer", - "data": "base64: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" - } - ] - }, - { - "type": "Buffer", - "data": "base64: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" - }, - { - "header": { - "sequence": 4, - "previousBlockHash": "C9E0BFB48D4E4A321EFD41638DE20A70C8B24D53FB5E2193FB76FDC4D7C35F3D", - "noteCommitment": { - "type": "Buffer", - "data": "base64:lQTJfxmqFYTbR6FbVdZlPpqsdLMY1XQ3xukV+PFS618=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:lD64752QvRju01yacWShfsElTd7m9J8S/eH1Xvisc0E=" - }, - "target": "9242316838154714456240146243610585159502316297651713580306101543756989", - "randomness": "0", - "timestamp": 1717538223674, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 10, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAfhhmvy2K50FTorMtzdaL0Sk0nYXGuKbeB3XYsseBrzCB4/eepPXIG4UY/gOfaE/IriUF8jM/kOiUu1MbHKgxNIArDiXCgfTgxmbLDdIV5PiCyaGQVmoRMPLP5yZ2xewmQZp9cYrcGZBHDNVpwYZTL5QddX5Me6c+TImBqEhTReoRAKf18t8Y7p5DC5EQZ7Q3CbVXTlIt5Sr4GiMJKTLKyBNR8D8GJa6tWt/hYPbnCjqO8oDdN39mJCDOQ5HIG95y/EtihLHQYN0IWP/GADHpKcMcVCHaYS3M0scw52a8Uwdi3Z0ZgEsYSXbccJIdbEhftM/epMFh8OF4MdrUx3el7CeDx/kgQuf49nkkiaHUu2Kr6X1NSQz1rGKgly83PlEBQP+y3IqQuikKFhibUdxXei/oG7MHAPi3c3/kgjxe3UqdXKmJMJs4aAPCh4tA1Wm6v/GzrT8PWiKbVUoQvnzTkwpLJsRCt3CjFd7AlEPzpK8pUJnTTi0Ktd04jgk/JrMJaL6rBxal238iW84ELCf1wy2PSkCZiks/kc/x1tiKsaoQtWWKy3iVg6BSA1DO1ZVBr8fTgKio7X5ekJSMXWsSJvaRDmC/M1XLF5s/9nTWlMHBH2bzPOASK0lyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwInQYpjqYA51YACLX8PVcbdvexfPTRvDQLy+jszOG278rK1WNBKx8s63DsYqyXiOwtBov23fnEu0lv4z7kSTRDQ==" - }, - { - "type": "Buffer", - "data": "base64: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" - } - ] - } - ], - "WalletDB loadUnspentNotesByValue keys should be stored in order": [ - { - "value": { - "version": 4, - "id": "667fc2b8-b34f-43bf-9d99-20753891184c", - "name": "test", - "spendingKey": "7df5ba1f20af22b8f5c1f545dffbaa368ccbf44ceafa7684191c2dea5228a2ca", - "viewKey": "e43e8e441887fc722420d21e786f1a632dac3d006dbb9c9552d88fbf334867aa0e0ca61135d0237d9a25d048915d9c2c24324b6a4fd7d779b54059cdb7847e49", - "incomingViewKey": "23e6ea2ada518eaed70e03d028bec701bc33bc918aea9d962de6904721131202", - "outgoingViewKey": "574db11c63e2a88637257b08be27e5b6c33db6d2c029d289bb4d893a0d34d5ea", - "publicAddress": "da34efa7725c6a6ed32648ed14ab77640e8acebcf521a6908c5f0bd59cc3a3c5", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "73cb58bad461cda2df4ced7844eac7fa0b7a1875dd3c4c38b41328ff82716801" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB loadUnspentNotesByValue deleting and saving unspent note hashes note also does the same with valueToNoteHash": [ - { - "value": { - "version": 4, - "id": "4cc04e68-9c51-468a-aa22-8cf3080be900", - "name": "test", - "spendingKey": "3602d90f0c83dfcc2297387e444e151936de5c2aafcd615e1f1388b7998a96ff", - "viewKey": "329a5276af40f1bcc414c1526b2b9369dc46b693101a14eb372152cebe24aaa9f5b461c1782a5827402cd5448a9ba783e05f350bc3e65fa2eabdf5242a5ff78e", - "incomingViewKey": "4e6fb05d3acc82f974a2cf04c0f51379efeaf9e1c9aa590f38386ec2a2446a04", - "outgoingViewKey": "57cd20ca9df88429f5533e5ad0e450c8c9b72e2be960977ce8bbe9e671ebc149", - "publicAddress": "b782216d4ae965d886f30f8f6c54b76424ad5e4c86f26e87b0f02dce6c5b9fd5", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "5800f73d9f7fcd6345abbd1d7643d79cf2f016f1446be7dfab32f5c3631d120d" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "header": { - "sequence": 2, - "previousBlockHash": "4791D7AE9F97DF100EF1558E84772D6A09B43762388283F75C6F20A32A88AA86", - "noteCommitment": { - "type": "Buffer", - "data": "base64:NNDhtKtDWjNIrJIEm0R2cct2q1VbWYpsEIXrQhaWTxI=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:ZfTzcHifJ+G/jzpj37HHUr8Up0NgV7m+gxSVbxETpnQ=" - }, - "target": "9282972777491357380673661573939192202192629606981189395159182914949423", - "randomness": "0", - "timestamp": 1717538228473, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 4, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAnqH/igXiab+EWTPmhKLM9nqijo7UEKX51avuUprmRGqOsnuSYc72ElVGGbMCUMvfIkPfcjOLxP6+W9Q1k6e2dHB3VomTC+goSzhMwLs7FWCqAljLX1F1ElJQHzIXE9P2iOej5QOQZlCCjrj1kpKzy3jq1ds1wLW4jDxsZUKbilYDBdUV6tArB1psKs5JFdkC0aj1eOmie56yXkie4WBi1Dr7coGa1v6XpMkwa8+oEguZp/Zu3JJZ1SSj5ex0ZmoVOvp1HomGGfrfePnuDyofRLTbq68bLavL1FDFpBiiDYOhLIzRatpW7UaMskKI+6el0Kih73mxTtB8GkDtnOD1cIFIeughoW5iGudylvZRF7bQlvsRVUdw4MHr6i0XgghJHS4MsRnD2YW/+dZk6HA2HufrjknXLuTqWyo7mt4fg4jpaxmlx8Wzj2u6hlgFYPN0S/6CyofPUlWdaV3rODZO8e6qTwv7zoaOqSz4ZRCB/1QQPCzTMcMudH4NgLFG4HhEAvvgVZ7vcUuxcBAWOEXaQjqs5xYcm+G4LFeHNhieututjvFoFxVvllIjVTgUrovsie6TW9LIQWT/9s+uH10ovXaYh0hLq3Yb//WhaSw7ZzSK6PKgwJHN30lyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwIWcZdQOGJJroC+rmMqDfe19DFOMVKfo2MfB7BahoWgVTIeNyIjrc7zPM13YImRI/LriCYmpF+JJXFpBiDCXeBw==" - } - ] - } - ], - "WalletDB loadTransactionHashesInSequenceRange loads transaction hashes in the provided range": [ - { - "value": { - "version": 4, - "id": "515d9273-1e3a-4880-a922-be2bd4241229", - "name": "test", - "spendingKey": "6c4fb8dc2c041937bae0fc817030d6e9e0b4a8f02c9151ae8dd5511ca26b16a9", - "viewKey": "2093f97bd22b37426d5f808c36d78161004550e074ea1641efd4c9695b10bbbfbfea14712da9f9f4b80a6929507e9fdc2d985f3cdf9be8740805c04b712fc2e4", - "incomingViewKey": "51bf8c3e84b8bf6f72eaeb09ca0be2bb42921cb00fc0390bf0c456d944b85107", - "outgoingViewKey": "6ad0420aec2b010fe2b51e81066b8d1f2a000f05473078bd5a15a049957e6515", - "publicAddress": "2350bbe227a6e95ad0c3278a904edffb4ddd19d55de726f2ce7d006919c7119b", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "42a94128143fcdce8442a099799bba187c9dfc2c0962af609e8aeb19403d5100" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB loadExpiredTransactionHashes loads transaction hashes with expiration sequences in the expired range": [ - { - "value": { - "version": 4, - "id": "e13f6431-424e-4c6d-8e79-2b48b0461da2", - "name": "test", - "spendingKey": "beabf66d1e93cc111591ddbc10402c24452c8d5b0629a0226adeea0de7c6c5c4", - "viewKey": "c4c9f7dc2cf0ca1e8733189c920c3898cfccf11f17109fe586dc807927e9f84772fd4f6dd59a38b1818d6855dc708a7178097a92e103345615f3796cabccc797", - "incomingViewKey": "e3f7355e2d6d0b35c6367d1032add10fd78bed6212c1b6efe4331a06246ab201", - "outgoingViewKey": "80db0061643c7a8e1f656a6f157f48bcb12f1dc2cd3c29cc358302d302e2d410", - "publicAddress": "865862686f68cf5a4babc8b53f548d37a9d5eb1946cae93e44f0f3fb9c6ca927", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "86ac2b151d79d7d83b6cc2f1b2a23fc431671bc4a6884592daab2999cb735705" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB loadPendingTransactionHashes loads transaction hashes with expiration sequences outside the expired range": [ - { - "value": { - "version": 4, - "id": "bdbccde3-e0b2-421a-8be8-a517acd15cd5", - "name": "test", - "spendingKey": "fc5aa7a6de8d4df54d7269fbc75c3184d0a73e132e08512bac1a0d1e9cb1afc3", - "viewKey": "ee4f1ed93cbb62839e93c2a08b9ba3c561fa2a03a9ea4fc7f2c9777fa302af021b62e249ae07a745124d41c225886d3287ad5b1f222ee9a76ca3b9402e6106c0", - "incomingViewKey": "01f037b454b53e2785519f636a150a2397b25ae65778431756375b99212ce900", - "outgoingViewKey": "0fc5f6ede6992cf840243ed44fa7366ed96bbb65812ec3d71598fadacecbffb6", - "publicAddress": "03f1411728bdb4635921158c3ef2d1044faf03d3e4febc649f6aca2af027b42a", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "49c4a4f3d49222a918fa42d07c33f66c994fd1f41ad1a15835f3271231df5304" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB loadDecryptedNotes loads decrypted notes greater than or equal to a given key": [ - { - "value": { - "version": 4, - "id": "a496dc01-b357-4bd8-8273-4fe7d69c944d", - "name": "test", - "spendingKey": "2386f9d0f6222a04dfe133aa04fd590a197d3f79c4dcf26df6fc9a5bf3314255", - "viewKey": "f49774c0aa08b3324a0cf4afdca39b2112da0f053a34197beed3f731c074eccea933f46f4c56e513018afe60438a04c64c11f0dad664c1cabeb27e600a9cf0d8", - "incomingViewKey": "37ac46d0e499ba4b90e46fc18e6311b4b4c61f0e05bd4347296d9517a5723806", - "outgoingViewKey": "b7bea33267e82c89d78d0e8385cea9ab57f849a5489c15c1c97ce49d91abf1b3", - "publicAddress": "733e08a1817fcb6c13054c7e4aa21cefbe4e5548c3562dfd07b9dce196fdfc6f", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "ceeb1acc8c69f360af3728e2dd2ccf9dcc347163b3f0bfe95adaed2845055809" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "header": { - "sequence": 2, - "previousBlockHash": "4791D7AE9F97DF100EF1558E84772D6A09B43762388283F75C6F20A32A88AA86", - "noteCommitment": { - "type": "Buffer", - "data": "base64:6CxE9xvKC/8+yGPTUsgy4bD2vzvpKVm4TFAXW2MSIw4=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:LRtRInTOGGf3yOISipmxn/2vxom7HP/CQMP649QXkOw=" - }, - "target": "9282972777491357380673661573939192202192629606981189395159182914949423", - "randomness": "0", - "timestamp": 1717538232286, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 4, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAADx5wQ3bt6jXCNmvCLWd8VSdhGYdm474jJBzj5jk+cGeMudvwYf32sTDLFwIaB70lgKpuhRsE90Wl2LGnuCmvIg2Hsh32R9buEgOXcdeEmdOuWed8zs1t8S5QMxxx4HwOSO4Jrf10XVhnFhzp5z5j3BL/U/xKh00mU58Q2EBDsdoYkP4p6741ZwZHFN2xOQRgb5tbHBA1kGv3xpoi5Kk2PitGSgzBcOZq3HdcFmCxPzS4sGTLWeN2iYYBMthdcdGUuJ9Z+PSIYYvprVsKItvn/vN+rwgHTPN9nNoG9MWy93eL1Mz4irHAg2W86wVtbzcC0nSZ1Sdu2rWHUFDzCFj2JHK2Sf+ZFkNp8KStomPkmaPT600UcykZO0qg2G51RgBvV1bq1C80qp5wrsjje4KZfJQfR2ciRg0k9tXULGuxK0+lBHGmX+sZ4tTUyRDtu1ouIwh1MGzOb9LTNxl0wF5DfgfBf0nJuKrqtbpA3za6Y1UB9RNGUH5yEG9m1DYYdxk2tq83hHt0HiiVd1OB182OOQwQmyJqmiJp0lVdVENKRxTgVreT9vrbCNjj4FvvsbNCs9d2EMnpyTH9V8ZFxJScwyWV7Ta8fdR3MSMP66EuUkgqCww0RpvZjUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwpkR7rbywpaPyhUt3Cwk+32lYJt8f/uxChVwSQq22mIRhCwgvLG+KmWkZt//S1N4zV7z7QRmBcp91Tu9lCEPbBA==" - } - ] - }, - { - "header": { - "sequence": 3, - "previousBlockHash": "33165A7022DC49D79E56B10EBC48E4266AD66FFF5BAD58521CFD9A78557AD5D9", - "noteCommitment": { - "type": "Buffer", - "data": "base64:Im6uiGlO+6Pg2FX4BCfKc6w5ym+SvS8IYs9FacfbGTo=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:ZoQIIxT1wdDzc4e/wYBb6TWZiDez9hAaly+WPZWOuZA=" - }, - "target": "9255858786337818395603165512831024101510453493377417362192396248796027", - "randomness": "0", - "timestamp": 1717538233749, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 5, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAPgAzeCpvG971dN9J5c5DAbsDZWOWZZ//AHT4wCMh5mWqiQQxRwj6ThAKOJDQ1uJTWH8f7Eh9/T23l+IE32Giz8nzrTbEJt9yH1h7SPL2rzGOZpGgcrrU8LUvcoLaxvrTz/0J1RXLO3xL+kFFNd3kjlwunoojNRCAYuzpoZEByegX9j0/HxzGIEtdQNTn7VoccMjtiznUBQksIXgTCJ+KAG2ONqyggyurfjrATPhaDpq4CBGosg4KCCltJH+LsxTOX/bh/c2z8lQ+x9wnDqLrJ1xFXcEFa1SCKhOqRU3OqBPuLCTC59QMJFzMLCzKarIMq/Hwosl2paR0lP/u/69ozMbYQy9Z4MTQ75dEwsLiT8aVXN9ArVOjmMqOOjB++IAaPThGqQkP8BO/FM1CIissNzld+mw1hSbaQphZd7pyH+R/MbFR01pZPYc97zLglnbGc9ZHvYnpnKKFz7hH1+fMCQBXaTyrcW5iuOPHBh8qdmty79XetCJmAj43sg3RKwTYq8KMZXaXohuPoJ0ghtQPuXBK4m0lhY26PCzhxRZ8m+AsvLlkszISPs/TvT7FM6oyLsjNVSqfXZEATKRC1ksEM6dY20xnY1mwkbgTfHQ2Vs8JV4jA5a4DOklyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwcgCBvdNmMdRWL8EumX/yK6XE9FaYReKryvCrSgAusLjUnyUbQIpOEunrAEjnh6YkpOU4strZ9GWy5PFFaLaFBg==" - } - ] - }, - { - "header": { - "sequence": 4, - "previousBlockHash": "768179BF62C4DBE74BEA3105786B89A4B40C99901160ABA05CBE1BA7E11EAC72", - "noteCommitment": { - "type": "Buffer", - "data": "base64:CF9iFqU5jwpMvS+KdS3XaESlaSZGWCLmckbOES8HAV8=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:7VYUvuwCewpw7jJimtDajKdrwh3LyfG0D5DVMQxxpbg=" - }, - "target": "9228823284279306817296266184515742822248210830185427859262273659833347", - "randomness": "0", - "timestamp": 1717538235224, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 6, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAzKH3q6cs13Vb6U8jmagoNxj4NzRJcWHumT7XeGfXYKasiSONLTEATpsrd6WFHRkYivxXGwDWON11BFrQUvnRorv6kilAEYaT6NELYqVMlqGEb19euRcI3RVVhsV9dE6B3x9TEwXXK4CSnXTbqc00PwfyWjsAVAs7sSeD8lpf3sEXPwjl8maBwVTLa9ofkX2devcXuhOnvFVUiDK6Qbg0iIUb+6KTsfa+ahSOXx7Pk5Cy/c+/c3UcUDrsUwoTk0ps7YcrdQRwOc7imlQ9mf8i9SfcJqiBQ4PtcMzoMNjcpw5qSlyCn6Mmxy8xxoqtKm43Am+ySu3D0JW4N9P8UskE11Ecj0qbnEhCHYdh+tNmsu3/iCzIlO3siOGy3g4FrJhXU1527zPP7Km+AR0UmKQJQBD8JORPo1YttQHsMjVe8dNPloJ4C3gVj59pA+9KSrhNyPdyg+QrsNLdrGb/LRMFrET9vOl/cRtIrjnRHGH5HhkIfYvxuoukCQ9+Xncs4gqv0GsxcPio8S0RiZ0/Qx/eGgEhH34xo3z4u/M+KTOQL5ABtBoI4WHjk6NSAz/5DB5tVPLo11E9ncizK4pRKS2/UD02bM9uYaMybzGb0AjVqP/nRAgIlhEZp0lyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwUYZyK5JxKjOG6mG1493XwBk6D97vexxJBp+wS0xL69Js8QticvxmGoirveOLzNQJIJM8eAu39vAb8kc5UJNnDA==" - } - ] - }, - { - "header": { - "sequence": 5, - "previousBlockHash": "47DCB21B27BD51E82C7ECDD4DEDAEF855F8796A578F7CE06CCE315351B264478", - "noteCommitment": { - "type": "Buffer", - "data": "base64:vcclZKJ77CAx5Ade/any4o6NZnr6gvxqyk5x5qJbqnI=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:Hp/Y+ZUJpTi2E1ZmRr1ZKBAOe5niWDBmlgSI9PV3Vjc=" - }, - "target": "9201866281654531936596795386791503876274441021197252859723586932895305", - "randomness": "0", - "timestamp": 1717538236636, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 7, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAZvUOTp67Q8uT9rouixTClTysHqPXI9JZ7ft9OMZtgSyymubbOYrJl48+WbYeG7bUTkpbd6CUJpDcrBAIATFovd1Zq8tZnSVDWspCJNHt0WiEy+NDQR5claYWof3YHE63QeEuzDT2UnGy5WtA98EzOqIkge2bpPmPanigMcwyGM8YDE4ybN8K1R9wP3RVFcyF/R3iz8HR4HPJgiKCJ5osHixTieMC4WbT3q4o/I4+TRq0THeyb3w6Tvi1mLOgV6pYZYLhX9XrWOXfeSduMGuLogN62CB5xyS22PgqWGaa9D1bsqIBdEP0xp6cpaO4xskX/TKaUrgnRmhCg7QzdppF7zptQzAJb3VtVwm+FUJRVqBxrEUst4SJByUQSq2HO6thkKql69fhES0sdpZxY5KyitCL6DVK25n+rt2OrsbdkSVELKsFkGcvO6q6MqXaZgEwi5M65RKoUMNIcYwdeYQsGLLboP1Hq7ELsixigVqK52BssjeAUKqprO6oUzFFRZH83DOSMaRKrLf8HonRofE0oynQNfb1z8V6VW+xhEMNiZ2EWxTarqUY3wOZSiUmqo01dhC3u8dLn+B4LAe1OcjA6LpjVcBsQl1OTVM6fasu4VIfRpQD5kfA20lyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwvpH8HhDvJLx4Ag/G03f2WThDDYIXCyjdBjFl/nBhJgFo9ZwlEJDEEpBSwD4dngc3EqIDnpfasjOG+k5adE5yBQ==" - } - ] - } - ], - "WalletDB loadDecryptedNotes loads decrypted notes less than a given key": [ - { - "value": { - "version": 4, - "id": "53b08b79-580c-40af-80ff-e9704b263b6b", - "name": "test", - "spendingKey": "95612b053a876b3e146230560b620ec4d5e238cf083dddd76828c57f73b3e336", - "viewKey": "f49dd267942ca21934f08e92a51d1af0e8dbc6d6e73f1325bc5913535c9ff28a5fc4fe1cfb77b324800806e2401f864f79e9401d6e506f9093a6948d18a8743c", - "incomingViewKey": "a178913949a1ba9eb230948bcba5ee81e3300443ae8b8f57290f3592dc0aa703", - "outgoingViewKey": "6cc6b324db922e5e7feeb2de7b785a1e883a6282f232101578da354b74ccc32d", - "publicAddress": "a9a915c9c3969b6da27f23ba75b8e60a79ac8265c75b39784d6c8120fd3411e8", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "363eb2503a6d05f3049ccc448b5696b786ccd617fc9076f7160a3e3fde0c2f0d" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "header": { - "sequence": 2, - "previousBlockHash": "4791D7AE9F97DF100EF1558E84772D6A09B43762388283F75C6F20A32A88AA86", - "noteCommitment": { - "type": "Buffer", - "data": "base64:OIzQ2qTMqcGqNO76yAhu3QD8m9xTfUTPO5n4bx28VRA=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:Fuv3X6b8NNU3AaWPs0GwnCP6YccJj4yy4kUVvoSCu+M=" - }, - "target": "9282972777491357380673661573939192202192629606981189395159182914949423", - "randomness": "0", - "timestamp": 1717538239548, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 4, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAApgKCGCzbp8NjXX+1PXQzVPuaIvAQOtraW4fjJceLpqaVBHHtt6UctTtuBaiOBQMadO/vUl7jkuEPnIp/7a9D1fj9bZDdY39D2+vbHEP8MfqoH3GSexdXPt8Nu4eROMCQhyJvjAFyEmAtvge/x6gIir/9F1sV1718XLtokozUp4gW4FTvaMkff7Oqb1A+s7lvkPMjDHa7abFVlBbJQKW52Bp/obo7yohPnblEYskg6OaTs6wlmBnyLc5yOeFkLJ3GTzo74ifbxMH3pDC+9+ZNOZVyBjAZf/RD2E7vKSRVYuq5GaUoP28R5yy8gHutElJGdf8NtKy6tpaU1cN1ArHE1sxPHFdOruHobkQ31pmaAWTE2OHmzPuHKUMxmjw91slXXSmRoc++UvL5noGAjLfxtWWDTDkrDjRgLNoCUgxrK1xNQM6K6vHoGJYnuYCXd7uKlgS6uYFF+tpd2ewf4VpOu5YqmpT/AZUpVYTQ0gXMQseKb8ZZ95RYOO4i7Xz6iO+JSsTBh3gOCabChU1I952EpgEEcYdT+6McoY3fXmXjBZhoFThQnU79eUqaICH6l0HNyO2pVTiunqCw0z5PhK57A6+bglCmTEcjYRx5UkVvviT3uPzNXKWZPklyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwA/N2PcqNkknDaZTIinEZw7zrzcA7ENSGLvs6NVdzMQOJPNxpxdEGbuDrT+fwauJYLWG0ZuGGcItLbsOzOvWRBA==" - } - ] - }, - { - "header": { - "sequence": 3, - "previousBlockHash": "3AD0FAC4C86604C6E2E5AAB0CFA5368E2CFC4EA5BB75770C40387BC204AB5A4F", - "noteCommitment": { - "type": "Buffer", - "data": "base64:UJzcPhE6n6psN4HyHpPOcFzPBtBHHEPxHfIgG1GNBFc=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:dquyMYaCacQLWIU3EW6SwrKBK6IzkJtgDNQp9EjXdMw=" - }, - "target": "9255858786337818395603165512831024101510453493377417362192396248796027", - "randomness": "0", - "timestamp": 1717538241285, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 5, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAA7yZWx73uhu2tn4jgUH8COxz9wvH+/KCTysC2egTjSBWAmvXxTVT2XhxC8CvegpME7qCitbmkc+Wq7a4Z8c634oYPsW6StC5H4b5UX1qO1RSB9dhOAT9+J2MG8Q7LRS3UxoNBJBBHqEcC0qo3JzYTrrErVbQ0dsnvmfTXYB2cdTkUsRdceQZwKE3K7s5gVruDv773g7FOQmRUw6XMoCHoLUIBQJMJWWgJfm/kfbiK5NGy583OP3qTHHJEsQUoVOt4vZodHXVfzRC7zILJ8UlHZMW+/F5qxHuZKBpsHlmEoTF9CXFcRYXUCU+sFDmkKsqRFPAK4iTCjVaZpBPa//AW70f8P4lFLyGx1aQP6a3K8WYN2zqjOFKzqvooAn4hyF4iVnTymf+hK2vpnFM+cZs78DNnJqe2rrINqc1D0W7+vzlTVZO8hkFl3ReLBa9bY5La8pkAqAm1zLOez7d2b4uWyxlYyDLaGc8Hj8gl1346PloKDgzYHMuix4ZbMin16MOO6jn9U1rC43T+x1YCtXKZLifCMB8BTLS/XgLwp1D/Kc83P3CPYYZjtJMe2Y72MWVk/8bwUfKpwgH2TJSTVNSPwDfiuq7aSggBWON9jhAOmqCRe0Q7ddt7RUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw2Wy3PumMzXTRd+7vNbiTgZTH6jX9olVeiawy7MTmWLdK6xR8nOePPR7zhSlyMkBnTjMl7p301khAG8DfKl61Cg==" - } - ] - }, - { - "header": { - "sequence": 4, - "previousBlockHash": "907DC3B818691446AEF865AFC49102C503437D4AA16C08777EF23FC5C306433E", - "noteCommitment": { - "type": "Buffer", - "data": "base64:OhF1uwW4XsI2fJqSJLXYdfr/7FGQhbyJLDJC/3T9jDc=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:KaNPYkFWaHJaUdBpM1pkcfZPspxn+7kiz/c/5ltCrRc=" - }, - "target": "9228823284279306817296266184515742822248210830185427859262273659833347", - "randomness": "0", - "timestamp": 1717538243080, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 6, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAxa/kbWdDOoNL+W7K02GBsCvCZpzlwrFkx8VJONv4Qh+F3P9ktv2DTiRSlx9ygc5UazE7iI+sfOJsTV2Ht0AvlJpRIQ1+CqaNxVRT7FyOMD6sZY+t62pupqsfc63oNvqKeughvBiRgqEaWF3fatOMWo6hx4Z45o1kVBZspfNuUBQTr3T4nX/jSEwdvDUTB+ksn4h9zJECF7XIN7NnDb4s32iSt+BcHytOZxAe+3ueKbyQZvQZHhmpAEmVNYsOcjC6maJf0Mi8pgECpV/ovT3kqgztgGDfpwtFJ91ZYW4JUf3FUEakSRtmy5GNh48v7OWSpAGZo6xHPgf7nCbme4vPW5jW4r8ul4cy9qwL4CTcqUv8hNrMiOp+A4WA4QXtYRlzRqj4Qgjh3Zf+f3UK5KpWgcwybkR/jspWJJ6njW9xQctSnK+55FN2RtyB7/b/zgWO2qDwqk2gqc4UqtD9u185WABSwrzMZe4z7hbZyuoq0eetZgEEUyGzqL54YfCB26Jdghh6wuMgEaXxjjpX5QyyMe7JQgZISimhgvAaxznPVM49saIRsKCBLvjr3loLUpQQszGAHlU4LUn4jHudwhZ98vtnHLDYWc9qNlw6K0UBLtmElXb9mhX6iUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwVJGqG9gSVPbz17HMNt6iZk0GKBz2WmiAlyylTFa6s7Nqkuh1rbsenaNB38j6YpPVUR5L4T6epgBXlVnaDgxRBQ==" - } - ] - }, - { - "header": { - "sequence": 5, - "previousBlockHash": "78A46173A8E8A3E1F862392337D0A28A4AE066F1663770DCEF9EF2956F86174F", - "noteCommitment": { - "type": "Buffer", - "data": "base64:lKi7wMZTC97xqH7jJjnIixjdvj6erNdH+yNdyQ/88yg=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:dz2Km22U0V85OXmzXWwN3J5qLP8yFNqbLirLfO6W1Rg=" - }, - "target": "9201866281654531936596795386791503876274441021197252859723586932895305", - "randomness": "0", - "timestamp": 1717538245491, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 7, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAzJrkBVhyYklF79qa7dcpCcfHYob0llsmyrr1nGt6b8uB6eVTF5xmbIb19iXaXrz/FboExnoBwU1VNvzpkikHm5YF7GSOhdQcMnqdC+FTMaquXrHJEzOhAzT1+H9ChFsTMAnjULKiFSeiVMGI/cOUhB+hfQt/tHaE1x+svoAmJXgYcVVGzhk0vUENVtGBmiEgEeL2bQX5/w60Oqv02QGfpGZxAlG24Q12y86lQKS6swWOmngzUsUfRawooD6di7CaPNwQWjlnGunpSF7Hc+YMY3/J5PBOIN4ShsZRCOVA43ygnhscP/iwDZO1F+vFcY8UjodVwTDfhx7KOrLn2LvF8CcJildQfFQ2IDGpL/Wb2+GL0kTet0Tu4ctbpbrfLRhytI9Ap+fWhQJ8Qt5iOEHnBYV++5bvxCn4BET32vHBp6u2gzQ14/wTa09E/LhQlVPJl+3BWbUs5pFvqbaoVqjtJu4YYMyf//PQX8BG9ccRj9h7fbXCRvxfCHEO+xjLOAfsCDCbnnXb9JiUqS5DK/kmzX7lS2KOGrIyEPcl3mjuR0Z8cnzTyao36MHppa21A8mu3hV++wV2mimYmhNZtIkTlU0shan383Ue+Qnr6ERv6PU58Mtuqmvf9Ulyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwptFVUAEDnHkHMO9jlthE5LMPvtPpcg8P0EujjgfEuTxzljH5F5oHtrD/CgjhMDjQhKo0MDLkOU/nYVohklx5CQ==" - } - ] - } - ], - "WalletDB loadTransactions loads transactions within a given key range": [ - { - "value": { - "version": 4, - "id": "9ae5e497-933a-4977-a15c-49c2f68501b4", - "name": "test", - "spendingKey": "642c3cf06ed7d0d0f85eb2f6ecafb78b61dfdc5ffd85d127f0bc3cf7a6ac6cd6", - "viewKey": "09987512e7a3c140c5fa8c849f8d7e7b18b3e3646d98f19bbd25bbbeb0aa26a0c5b20be3ce2ab0c93a7e9ce0b6c806729e7bf858d927b4a40dc26e2b59926908", - "incomingViewKey": "c62534d44edc5239875e160fc2d4fd6a8f6e843c1114e49ce20675b089552900", - "outgoingViewKey": "3ca324b9bcffcbb6be6ce16bd658075828d17ebd04af239beaf7abd3e9e38f09", - "publicAddress": "5f8b3902b7d4fb1e3673fbc7263a391bea92b8967924075ce36b08a57c461b4b", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "b0211a2643adac73b56c076fcba022fc675b90fcbc9e8f9ef527ca384b3ede0d" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "header": { - "sequence": 2, - "previousBlockHash": "4791D7AE9F97DF100EF1558E84772D6A09B43762388283F75C6F20A32A88AA86", - "noteCommitment": { - "type": "Buffer", - "data": "base64:y23aS4MudM2gRv5ck5TNjY0ZQ8FCvwjUKiT+Bg+e7Go=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:lg++eZlQpGg2cuUSfr4CAavGH9uT2+S/GlFIld0EGiU=" - }, - "target": "9282972777491357380673661573939192202192629606981189395159182914949423", - "randomness": "0", - "timestamp": 1717538248845, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 4, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAASS+9d1gQOlu2axP3BkXoDYlHORcNmvrpfmeAb7WezJCIoR05wqMVteFfAbiMwVTI/viU22ZyOKIFT5xnGlM2jRJfVBWrlTTbJGAJ5jFAXR2RYO8Jqv3lrSW+xUSYfjg6di9RAIHDXEVsRhH4J3xYgq1s4Q6fqJN5zto+EVWGbA4RU4HO3oKj9DKNHHJ+jAARi8ggFwDA93YqYFzeQ+rKvTArhqqZxPD0HOQsqWEsw6iHY5ES8YGbom0yzW4q99IyV89UH2cERtKN0CJWpBiVqVBE6sJob8awPXpNqdkEPOrJRZiW3K+gHCrPyJ8uZTKt9kQC2gEtr5Lm9l57DRS/3GNO+v6kgBKTmGhWDZ9IiOv+fad84J1ecOo34xNPtI0nPD8gA+ahBu50YM5jfRyY54/nMPU/zJPVYvpsbtD1rwaETU/BZD2/Nx8IXFe7044x+MYgKMln4PrfF/kgFX5rFkoYNv2ib1gl8Gm3eT0Q92P6qHj5ke3oS9+/QZcU3tVUyzXRPg2KqNpsCPZ7VdlEKjIcL+9NlHooL4Ojyz9G7Q1/Ii4iWV+Ch4b6aeQkjTAmlqRWdMK7/bK+3ecuUiwQXmQacivcFAlituTnDwQc001wA0+vDGU/pUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw+CGP9qp0lIE7UyKjAjkjQ9E+rJjyH+vUN0vLnL/WqA0inG+L7TJglLyWukxNz2E68GObBJVrPn+LDHv5UZbgDQ==" - } - ] - }, - { - "header": { - "sequence": 3, - "previousBlockHash": "569B18B5A9665F78CBDAB8E8034B6335482E8C44143239D860BEC37E1725D66F", - "noteCommitment": { - "type": "Buffer", - "data": "base64:h/T4R0TX8a+8dXW/6MmU9ON2jHNvC0ekaVD+QbXC2kk=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:a/DYOQScfOT5NaNOTT8lojK6j/dLSKDjkzQnUFK8v4c=" - }, - "target": "9255858786337818395603165512831024101510453493377417362192396248796027", - "randomness": "0", - "timestamp": 1717538251237, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 5, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAt8bfa+6E8qxm69juScCfKdZemXoX3BL15si0slhMUCiEjnWTg6B2QsrzpEYrVNkTxfOFUrBIrNGbxbPe4cnUDaMKZ5hGWc+qjgajOrWwCWa53yC0yFT8sfq5FmTBFITX/Jrfn9wcPVvclVFvk0I6RwNMDcEjFujHUkBpAlAu0PsHkSiqzoulIRPPGYB/8Fx38UC1oUsuwx3nBXYiRoVPprbcWqH8ViIpj0e5yXvxD9KwvC3AmhA7cecRiXPA8myFoTA7gZR7Zrc9WoFgghElbxerkko8pr2CPBIUpDTubzU8jwyfKlJlQR5/50tVBaMeF/hRLNQ4ZqQApClNTXig8JOi6ulDTW1HRvn+VM+rEiJOPz+pTdahMtva7GUtZ2Ys0owvmEILMJdL125xXV6iVjaJJFyECbGhGmTZpsNRzzLT7uIhWM8bIv8ONPb1rrzxWTUN2FqVXCBtwF9RyMbIX9qV00IBfIDbxy0A1YNBeuag5b8ScmWFn3fmgxHqK7W1rKjg3vRfCiqBXqKSZrJ9Ebq+atCI5WkrVShXThJsJjNy6oyIQqXiuDlDZe78sf0Jnp+9gpAwQ6Pq7UkFfCUn2wc84/IBTklKrUDk33BcZ2G9Vs9WDRTmnklyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwUJfKl7ttvcHkClZ3M2O/iDBOz+d7FN4YcpIfg6S02AiUCouJQVUu9Y/A3+eH/ThD/+LvMwEk7AIzqNGHvJ1GDQ==" - } - ] - }, - { - "header": { - "sequence": 4, - "previousBlockHash": "2E12085CF0C387CB21E90C82570DB8C704385FCD5E2DB7EC2F493AAC041F0ABB", - "noteCommitment": { - "type": "Buffer", - "data": "base64:TevSU1yu7iKtRwlmo4CxldWNWlY6jQ7yzAumJtnTFiU=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:IPGa8a6l65tY9pNEKh4/QyfXzg7Xqcbj2lPKtv4hHLc=" - }, - "target": "9228823284279306817296266184515742822248210830185427859262273659833347", - "randomness": "0", - "timestamp": 1717538253824, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 6, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAW3gTuUr8NDGbTz5PP0KAyMx5wgsIi36ChMaDtEbuw9aECeJUpCvdto/GoNgculyfHd757ZxMZ6Qrl690xKl909pfrXYXeDQFaKeyWp0GEF6rx0snyhF4xRW5nPVjFPqqLu6zxNoqAI1j4GLX08CuDWaGX/XuVQdbiFB0H14GijEUOnS7vcFs6knVxQs+cCQWmZnsDlTOZAzTQfx7+WBA5TfV8uDKJVCdNloCXt6wrBmtsq/wV5+7ewHbbCUChT4GIqSsW52INZEydWz7AKK8x1PXRw4KbDzpzJDsSvKA5MFnHI0whMqzXzVydbveHVohSHIN3L5BsC6dZHEdiwloje14k9pmEwQwGEdG7bafOhVTmWsWsJV4LnS3yMk5Ih8e+nTr0ybjP5Kr7bTAzB7100ZCspBiqMgbjz3ro4UwRYfAckzFQGsqN6SyJKWw8fQ8I2P04dTMhfbWvFRr6ZWeE8xzag0mVLnO6AddHu9kOKVbpSik+Ln7dReppOdg0Fsig0v6O6qzLYK6k8O3eON2gYTflg3qtVXJuEgnr533R2ICaZodxXGsoXJm792igEZcPJMh5I/h65Vy3pxrEobbIqy/LPZkt9D+KpnlnAMSvtuGJJnwgvouU0lyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNHiILSMvUi/GiS+349FsIGgeSmogjIB1KmnnMcS+uYwSfsJSLxTc2FEuTWzocyEzCSC16FZ3ltTDo09TTpRSAg==" - } - ] - }, - { - "header": { - "sequence": 5, - "previousBlockHash": "DB013A8E07EB921518C75D6006E8B49E2EEF20CE5AEF1181F2FFD446E04737A9", - "noteCommitment": { - "type": "Buffer", - "data": "base64:LqBjOkiKf4Ghe0dXpFZ+ggQaKdTxbMlxU6mxhqsnDzg=" - }, - "transactionCommitment": { - "type": "Buffer", - "data": "base64:99kakdU13z91qHBFXT+/kwEiLYRGL3LlnSY57P8afUY=" - }, - "target": "9201866281654531936596795386791503876274441021197252859723586932895305", - "randomness": "0", - "timestamp": 1717538256225, - "graffiti": "0000000000000000000000000000000000000000000000000000000000000000", - "noteSize": 7, - "work": "0" - }, - "transactions": [ - { - "type": "Buffer", - "data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAAX0cvkC0QJArfMihmYFPkXrknaKsy1A21V77H9MvIwk6pFIe++L/aKp1bo45jo+3eaM51+ak7dM7OMI0JpgcpU0oBPjo89Ro0gVAc4j7lD4iAcv0+zIonl/66L4+H/tQvmOVlHy6FGnq4qT4MBVXSh2a+4J4iw0Ybe/0vZYw3qD4KcfjwBsbPHOamGefY4vy29xeYM68p6NigxQ429eBCByF3L5KvPrqpg0GdExy+PgaLfxG76/tGRw9JnlAvesqHAnvkt136J3KtrV1gpMfgJA4g9Ml51af1sLDXFfW3JMetSHdoMsZ6CMImbQJ/CGrO3t67jZaJz+4IIqD1QdnEaSUutejHeCbZ55IiqwIfH6zhMt6HBpmaz7pBnzPjfDotRV1gM5OaAEbRbXALWGmxLusAkiWYH4QzxT32F/UqOqt2d8sf/P37yk2nTJFjvAG/G4nvYzZ5PeXNKrRHdJCQdm6MNGm55Lzd9FmC2atmwc/UUpey03CzLEaVfncyvvvuc7/tzGDq1lazvVAWJN1ZC6oraoZi46rDP/sF6IpRSga/ALqvBUUNyeqIaQziyNsdONBWIcYAx/tDUzex5+Wl/d0A9zGXTDCSlmGgF5q43/CYn67m/igjuElyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwoiwwZNIj7SyfeVhwHJP6EIFBqyoPYE61JDjf6wHORLpRFr7vaa0j/PLSGYnOAaoomGFNuAt9Np7U12JM+gLJBA==" - } - ] - } - ], - "WalletDB loadNoteHash loads the hash of a note given its nullifier": [ - { - "value": { - "version": 4, - "id": "16812363-20b7-4d3b-a5f1-d63f9c500e9e", - "name": "test", - "spendingKey": "42c4d417d5a6da2900cbfc8a32bfbedd8c96e1848dc4a22ec6b9386fd30d7f36", - "viewKey": "d220f7afded99beec10b955b4cd9e193f59a9b0cc3a6f0d5d284f606a442cbc52f1fdbfe00b35666fde4b01bddfb5179988d1b521ee318ebe4e7914e0aa080b7", - "incomingViewKey": "ff5905b8bd1238d6e7b48082ec38caa20b3481e4a3cd0ddcbdf4d071b347a406", - "outgoingViewKey": "805590598f08f2f6c3994315b8da4d0810049f010b33c46b5928487357f86250", - "publicAddress": "0a26afc3a56a3cbccd3eae6784885776df78f406235edcbd622feef724329220", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "6a7b7fecfdb8b21f5521e323d7867fd556bdfaffc93679527f099e0118014d0d" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB loadNoteHash avoids hitting the database if the nullifier is known to be not present": [ - { - "value": { - "version": 4, - "id": "de2f768a-27d8-42b1-b23f-50423f469bbb", - "name": "test", - "spendingKey": "c3c9ba31682cab87d2388ad28e3c8a8e1141e802ab69beb1d2024dab7371d95c", - "viewKey": "38bfce8064573739fbe71f220bd1b055d85fa928bb12cab6ea6cec39228524c49011b98abac356d07ce11a9073d5257935459935c704f49189de32f7450cf7d4", - "incomingViewKey": "9ae8ad607e7429180f9c9b5c00c405945d0ece39ebc0bfb7298b7635ce2d9e06", - "outgoingViewKey": "d682f910ae6d4d1f55de2def975d4db0f66f9289fbdb503cd4a12672fdd03063", - "publicAddress": "89380c90a6c6829f7302e919932fa1b8f50c38c92f30f7313f4ce425062ebecc", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "fd03d976919b66a79480321fb7a04076897c7feb5180df93089d78e39503b90a" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB encryptAccounts stores encrypted accounts": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "91edb394-fe0a-4ff9-a94b-cbcffc199b76", - "name": "A", - "spendingKey": "aef3a7e8ea8329f61ae3c54b77f02f4fc94f4dd790f3bfd3d6e745e7d68021df", - "viewKey": "8e1605538c7f0d39a292d825e699c04e93d4e883172bea8ce5cf57e6be35062e745fcba8e06b0370e963ebccb2356eed25e886209cdb4b6c6c9bc1a66652ea57", - "incomingViewKey": "3e7270177fa64cd30835284663ceccb12f800e87e3d465aee824f20a93297306", - "outgoingViewKey": "3b07da84fde489af3af658b20573426a6cd5331eb1d827a5edbf52f5aaeb9d22", - "publicAddress": "13aca6bed0937635aebecc987377729edf63d3ed9576c863d9aa7318a714d7ea", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "e1b8fa4e84363090d49bee08224f8d516410650dfc6aca1e9f3fef4d1358b708" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "value": { - "encrypted": false, - "version": 4, - "id": "57c75b9c-bdb4-4705-8dc7-40847528b5bb", - "name": "B", - "spendingKey": "4377f6743472240a7adba679e5872d58b1e17695662bb384e15984b9ed7eb3ae", - "viewKey": "364d9514508d06da950874cde5cfc1fe2e4d90cd064901e4a73c0f98f82c112fb463fe0a898e3d1976a9c3c7a4e0966d41f75e9a2cbb8767ec05f36b480b80d7", - "incomingViewKey": "4d31ebeefb51dda40f1e9a844321d065794fff7788c675a76699bd6d0a63a402", - "outgoingViewKey": "8b8d94bae8d743938e7940eec2cb3489772a422f3032a3742e8b107dc7bb34ac", - "publicAddress": "61b5033c291a7221a2a35adf7ef2885f5ee3b71ad43e32a6e67be17b3e8d376e", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "308703a8a801c918d4fe6168fba0ca7a4a53aadb2c6d7988031f8f9eb33cec08" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB decryptAccounts stores decrypted accounts": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "99b2f779-24b3-4280-9373-60e754b91c65", - "name": "A", - "spendingKey": "147de6b6b6054328b5409f59e38de933bbdae76d3b6b0bf42dd89b90906a19aa", - "viewKey": "37f35e558e47decd960a65e30ff310c8dc1e726a321dca21532d412c929b4e43a9a645aed8934724bde1fd8f6d1814341efb0e2f7e2edaf821ff7e0a08eee8aa", - "incomingViewKey": "48f5ae1959a4fd4117825fbf6791700c975bc93cc4423c47a77ea96362d1e904", - "outgoingViewKey": "dec94d98c3ec4a4991b7344abd6ccc24bd8857b7605dee2a97fb76d594d9a629", - "publicAddress": "fd02b46d7addd5c6f58ff6d04e560c9be3de64c5361601bb850a94ce8585f5c0", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "9f90335923ded9f0bf8fff2c9a494f5e13c9ff781db239d009e2927f1ee80908" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "value": { - "encrypted": false, - "version": 4, - "id": "16a2badd-c7a6-4bf3-ab5b-3fe79901df20", - "name": "B", - "spendingKey": "5ba5b547ce1009727b66d6e8b1d25815f88611fe04f7b30ae5b447b52b8e7910", - "viewKey": "b7646fefef3547c784a145487683400f238b2d2a97fc22fd4d45a9df1fa3e7a9c4b72f8757cc5aabb5ff8c7ea947833a6ec2368ad0cd5014bd33806c272ea993", - "incomingViewKey": "6e051e304f17ebd4a35d0b35ca9eb39a77009d0d0a92a423be4be3cf341f3d00", - "outgoingViewKey": "07cbedcdb1226d283378f2d48d173384fbd3c39abf10ce796b9bed8543b85407", - "publicAddress": "71fb617acf602a2da55fd4857978a29416903bbd240ab52886097d569b85d41b", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "e425c3f41ed47adb266a210760489cf8c5dc1981fa306ae55a3e3e8283aa0907" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB decryptAccounts throws an error with an invalid passphrase": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "5c0154e9-e7ba-4516-bf89-c94a6a8ee396", - "name": "A", - "spendingKey": "7a64a08fd618327398f612f00d9c53939630e19c0176826585704ed0c4e5cb87", - "viewKey": "a75051978830c2361fd2fe1275a06c5ad8ab266d9da1d608d1ccb639e92f3068f1e99b7037b83498b1250265eb2d695724e646d51f732ffeac5b36a77f982a3f", - "incomingViewKey": "5284789b53acfa30f00e81d28fc1308e7e99e2ef854d514fe6d763f81bb9b007", - "outgoingViewKey": "21bc65190cc9ad6e2c7a32d101246e2caef87a8e323d56868196e8799564d24f", - "publicAddress": "23df85a64f5a2fe410cac9be7b3426e96ce014657d82d9aefb9a92bb063ee08a", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "74fb92bf84c0c871fb9b20b8ec3b7528fc88382a84e72d0506d29cb6ac484b08" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "value": { - "encrypted": false, - "version": 4, - "id": "595ea740-96ea-43e4-8d13-a4f864f08244", - "name": "B", - "spendingKey": "8bc528f23c04739f2083d2367d6b81ba9ca2cc41d2d920dd4c417197ac3bf289", - "viewKey": "cc3c5859bc104fd104cdcfef85ffa9ff5984ea0d2b7aa4843afa0c3268166f05d51eef5f16b081b8dd252c72bf93a4446efa9f0cd6514610d9b18a215874850b", - "incomingViewKey": "a899c9f5d96de698af6ac81831c5470f839baca8d8faf76fa2c8f60b831e3502", - "outgoingViewKey": "d0a6fc11f89cfc40c72699cded70137ce8da9b2236cada30a5ce922627ae12fb", - "publicAddress": "03eb191ec40f5153bae739c162f56a80abc2e819f08b7ff2ee160d64aec24373", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "1a628719c1704b0553ffcf8daab62507c2e5829d878b07b6f1573b7023d4110a" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB accountsEncrypted throws an exception if the encrypted flag is inconsistent": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "229d12aa-8d18-46ed-b831-555627e043ac", - "name": "A", - "spendingKey": "e16e752d0198841c210e2d1ef2fdc42b161224b3b44eab19a5518d9e63ab10aa", - "viewKey": "305b0e13928e722e726e31c381806a07b3d0adee97e8e3d148d5f2da1f0294c8f3d5596e76850c9c3973f0e22aec31227c027d2e1f04a8caf3215a9d6c138ac9", - "incomingViewKey": "faf451a104a6075d0537f23a38ad93717c5514218397c73e67636bbf6791bf01", - "outgoingViewKey": "01f147f4ee1bef6eb1ff55763e9d3a7412c00431061012448c1ceecbe4871dc9", - "publicAddress": "5e01cf3ca471a4e5d29257922317b276d186ad8b3d43305cbb02a63e19c847b9", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "0824b8fc93da369f7674a5cf710eb034d5044e3376bf814ad752ab4ab4f9fb07" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "value": { - "encrypted": false, - "version": 4, - "id": "8134c360-6ffa-4c16-8386-e7fdab2c4a5f", - "name": "B", - "spendingKey": "8b334ca948cc0d19c59c81b0865e123a124d852af92377f9cbd201abbc32ebfc", - "viewKey": "f293872da5f4a248af69c5fe96bfebf919b790376115caa660f90666e007f59e8c8ea059b1375a052a9e9ff7a2af1ecb027ccb894347965cca37cd4f7614506b", - "incomingViewKey": "f06b6de5dbf9bed1684973f121e6f774e81fec44dd1327a295c8e958544daf01", - "outgoingViewKey": "e0d88e8a0c02c101edf2bbd8bf1a0bd3cca2a71e66f031b8bd9f7dd6283accf0", - "publicAddress": "d74d09e7c105e1ef3e70b0db656eebb60b29e2a4d100ffad6f290e8d90ccca6b", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "fee1d439c9f7a64889fd0d31adf161ace728b6c8337e161c449284be1db27905" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB accountsEncrypted returns true if the accounts are encrypted": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "f0f8c027-812e-46ab-bb88-11892712457c", - "name": "A", - "spendingKey": "e34de31cc4cdf650009b4a37a2c26cd1b31dfbbb8017c41efc6b9bce9ae78b62", - "viewKey": "808ce2bb31b0e4979d72171f7610306eb0bc42295870b7e22e9d4a02fc962cd30930c62109d9c2c64b9b0b7c98203cf80c4c590a0110053bd7ef6923cce56e3b", - "incomingViewKey": "394630d0342fca3fee576fcf403a1bd1ed7c0bf10ee6647bc0af61840ad22703", - "outgoingViewKey": "22168293332c8f42e02946c0d175a068e1f3d991f44f7317759c9117e0713b2c", - "publicAddress": "144f29e12d30a6dcedf479f9ffec2cabd61453ff32896b67981d5809a8ae775a", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "66850d6e24b4fd25e4775bb01eeab1707acc66e886bd53f04507002237cabc03" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - }, - { - "value": { - "encrypted": false, - "version": 4, - "id": "33e7a4ed-7f1d-49de-821a-4ed8ebcd093f", - "name": "B", - "spendingKey": "838f322feccdaa86677853da85c8be7d38e795448d78c73d272d340a62959337", - "viewKey": "c9e2a9a4837b6ccc00d7a70e84633820f46eceb841f7e152ad4733fd9742cde6774ec12c2b567ced6f122de3af446f5f766648702c8398801dce070d5ac85915", - "incomingViewKey": "3c355d3246e9b3af43865d2db052443c1f1ccecd26883d1b1f269fea7c95a307", - "outgoingViewKey": "3a2246d964b5b1686caf09b25d1db4cdbd66e24cebd230f37765fb3037560e15", - "publicAddress": "799ec271f7543e1759e369eb4c212d75e26ab33ac3af290b5f851213490ee614", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "412d70322e874e012a1f18362ed086fa33fb8748dff6e995efefbab03dbf1b01" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB accountsEncrypted returns false if the accounts are not encrypted": [ + "WalletDB decryptAccounts stores decrypted accounts": [ { "value": { "encrypted": false, "version": 4, - "id": "4717c1a9-11de-4a78-a141-900fbbcd5c34", + "id": "7f9e0bc4-9392-4c42-9489-e6d751a82263", "name": "A", - "spendingKey": "c99f23c963691038d013f3adf47c067f5ad4b9b194f8049d3da13ba98c790d21", - "viewKey": "b37fe1ab65dac89e23291c18b35317f49bda3a4c158091ce09404b9ec94acbad903b1e4fec2b762e2582e59b72162f9cd804c3c7a3d2ac7408cebf4cd1919ef3", - "incomingViewKey": "aba98116d77d35b7b771961817f15d07342729abebca928a181aa2b4beacf206", - "outgoingViewKey": "6c7e7c4348ebf61d3a04499d84507a2f2ba537f84023a6e8d00d73f8f15d28cd", - "publicAddress": "a8308b45f22ae0728c0430678379a42341ae5e81c818cf254b3e172bec00a54e", + "spendingKey": "be40e1a98cc84a28b5e11df85571b1d632849b1010244418d3513f487760c34e", + "viewKey": "0dc230885ebf3db0d40f85a74cda2663163782c12ad0f3fe7e15672dc21cf76dbe75b904181981d4a032a9201006ca4b5311ff0d21965effeca71c31c7dd8113", + "incomingViewKey": "55d4f2ceba6e291977f3907e9c320b64615cc3dc2e2eddf605e464c66d3bf202", + "outgoingViewKey": "482e568d23c9a3d376c4357559a703f19dbd758115da8905e0c6052fc349ee9f", + "publicAddress": "2110d7dd80edd78790766e95324e13cf6178acc54c48187849fc6aa0b3f15119", "createdAt": { + "sequence": 1, "hash": { "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 + "data": "base64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } }, "scanningEnabled": true, - "proofAuthorizingKey": "b1658d9eacebc094b30771b0cf5d92d81fd6bc58177e9c5ed1318f118f033803" + "proofAuthorizingKey": "171f86363aac54be87f8aceae06fc36f2a5e0477c599630d46b6850cb34d8409", + "isLedger": false }, "head": { "hash": { @@ -1125,208 +34,23 @@ "value": { "encrypted": false, "version": 4, - "id": "c430f181-3159-46ed-973b-2ba03312ed7b", + "id": "6e62d995-3eb5-41c0-afe3-46450fc5c944", "name": "B", - "spendingKey": "3807adc2ce8d897ad83e6c7994d7c5923099cacc75caa1ab1987c8af642f1391", - "viewKey": "528130aa8a609ba4db35c550a1dcaa6e01318afb3df057947ab687aa26a0162e57cd3117540268fd45e5c13e7bb34194518e3c14e2e8fcb37184bb82bca9be21", - "incomingViewKey": "24f27fb4587f7ecdffa77c96477ecf7edf83a199da93bb00d59073a0fb826c01", - "outgoingViewKey": "6e9da7937ef4ba894e6c8c3213b5ec9a7464e4bd6ea0d99bc11bc3219528267d", - "publicAddress": "75bc4e93b08a721faf6385945182f6b78fda93e3a34546e6cc079d5d1afbebf3", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "b9d1122eb1f6c6c87c6a15c3d887dd20ea3debc3bad45e0c4ef62e7c530c4200" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB setAccount throws an error if existing accounts are encrypted": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "1326265d-45b5-4646-8bf1-4434c896bcd1", - "name": "A", - "spendingKey": "d71768604bc37a2cd7b48e194b58c43bee3aeb398d11b9a0ef998ef759a6e08b", - "viewKey": "9a1e4d1d5ea401cb0454e95b4681ddd6acef636f3b406f8664f9d2bcccaa979d0495d1e8372407cbb4505a7167232f1d3436d5723bff554f911d96df1d0e2821", - "incomingViewKey": "64b66b4a68d8eaba6b7bfbd55d59abe794f598750b0dc9f136d2558502c64303", - "outgoingViewKey": "5d40218d1b4da92ec42c0538380b682c179d44fbd25ef999566539dac1d70d4f", - "publicAddress": "204b3270b44e987ba022b5b8eda7f41ebf55eb19ce61b7723a031bec9ed5bfcf", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "4ebcb8cbb3bb735f9421ea40538f24ada921c9736889e2a3384ddd3707c0ad05" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB setEncryptedAccount throws an error if existing accounts are decrypted": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "0327e33a-b3f8-44de-9e31-f62c0b957ff9", - "name": "A", - "spendingKey": "4073e1efc8ca5779108f7e54033aec1d612a8423f0a2e3a4536af6a2223b08fd", - "viewKey": "e26e4085b6c0301b1cd8f0e9115e7eea63de80848b09476f304f002ba7365f5c0ab80794346f4b2185256543a5da0b9223824df459b1ccff8b03cf6ca6e4e5ac", - "incomingViewKey": "6f2ac227d5d4a5704839f4fccea70f2f37016c046e68c60d5234eebfc6eaf903", - "outgoingViewKey": "2b0364b99c1971d8a5cff5333c29b7c5b5b2164d20c6171944009bbb7cae038b", - "publicAddress": "614991cb72e5b0997f1311835aa8f15b723c234a819cf36b09121284a36c6909", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "1197fb366b1e4db881d28adb2aeac1546cb969cc0c2515c9efebfe995bc9a705" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB setEncryptedAccount saves the account": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "2d4ff08d-b895-427f-b08e-7daf670f26a9", - "name": "A", - "spendingKey": "a6977d360e93d4210c8101eee39aa84d291b615f6dbdeb7d463901e4d4604b2b", - "viewKey": "49f2ae0a4f8efb153fdaedf92067f60829ad6c3fe946a08ca54594fd145d63894997083e2e9f20780bff1bf36237d0bf6ab2b0683de8756abe89b18cced457e9", - "incomingViewKey": "cf24a9f69b4179bc336abf6827f493f64d970ddf91b2d121e7af94eedb1dfd07", - "outgoingViewKey": "2e7cd9c8c91e729c1c8f0597838bd34a2292daa3989e3194e12a131e962066ea", - "publicAddress": "9c4afe0900874d1c94955a21eb1bab1fb6e3ae310f79f407423341eaa8ea1467", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "216a960dfcc50b928b8d56cb3eb1e4aa536df07ba9d440dbb21c237e95c1cf02" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB canDecryptAccounts throws an error if the accounts are decrypted": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "acbb2960-da97-4cf8-b66a-8bf01ddaeb67", - "name": "A", - "spendingKey": "86635081a46875b009ad5f525a3b41e66c5ffca00f2ae97864ab4d398398dc7e", - "viewKey": "483f046c9e044e9110f371b6b4b09925d77077fc9df3f5d6510fe9da4e11ce473e9c198a40335c0687a744a49cc4a7c096c32bee370caf7562a3a3c59c6cdf73", - "incomingViewKey": "0d9d2bf42ea2d2f1d656533b9fe6d9797eb646a02f4effe3dcda3bc9d955ed03", - "outgoingViewKey": "f824913fcd864447bfedbcce962ef8e3309623f518b00cd67252267fb0bb3edd", - "publicAddress": "4f0198b74577e1a81fc23aff6f180e386eeabb38c3e5376f526908488a6b1833", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "ee9140e033b9336689556554006fd016153d6bc3bbbeee736fe4a527e66c6a04" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB canDecryptAccounts returns false if the passphrase is invalid": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "6bef8a6e-d6e2-4448-bf24-21662211354d", - "name": "A", - "spendingKey": "ec168ca1316b3bf7cf0cdf0a3adecf9b7972e6ae156a729f2719ac4e157c6da4", - "viewKey": "0ce8d5f8a3c8b2073178f59a3870db54332f93b8ae0d20c773c8128021c6a93771bff1b891392e16feed8ded0f9ca05af870526f4326f6249def2675604653ae", - "incomingViewKey": "81ef82de4bd28b919f710e8782feb30d394d94137eb5a031e4c4f5d003afa404", - "outgoingViewKey": "aaea23ee6e02849596138db4623b59a2303d271c5279e7d0a834804e5a13ae97", - "publicAddress": "686d8506997e2a6ceb5a0b8311e8d4e6d9a273e151168cb0241adbf6df46f75c", - "createdAt": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - }, - "scanningEnabled": true, - "proofAuthorizingKey": "a84451b5708e3349f33c6a9c77e3260409534e9c54f327968a464edff4a00408" - }, - "head": { - "hash": { - "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 - } - } - ], - "WalletDB canDecryptAccounts returns true if the passphrase is valid": [ - { - "value": { - "encrypted": false, - "version": 4, - "id": "29a6dffb-eb57-418d-b748-2cb6b1544350", - "name": "A", - "spendingKey": "6d9175f29df2be3f8c7df0187e0b2197b31001209c22813b289e86894d054564", - "viewKey": "bbefff5ef688ac872511b1e3560dfd81af1d316b34ea177152edc2f31531bf9e50e0df53ab8f0bfde8e6b0f3cd85566cddb745c418fb8f13a10ad8f293b0e36d", - "incomingViewKey": "5d5a144161b657eea271b8d6242b9ba674938adaf10805d159cdf88bf7c18906", - "outgoingViewKey": "89e3e88af3d337bb79ac160c0358261e282bcafdc9fc6473b5cc676107f80b6d", - "publicAddress": "af2ba2cdf2fae3074d30e363e9027fa8bb36ec932cd233fd246d2a623691e612", + "spendingKey": "c5833ff0ef486bf87de989763d7cb0752893ea1013100f849c6e83b44c947ef6", + "viewKey": "751a8f744c12c4614b0df0004541e7fe8cad52d2437195632987df0ae0605b65105630a6e6bc8c77d0c79b3c8c76aace21c1a65d4a01d5179328b7408d675b0d", + "incomingViewKey": "086c9b19a49c410abd8b886f2b76391b60552fc7b8fb876a08a4e6cc6770fc03", + "outgoingViewKey": "04560ad40a82b00b6bda1799acc99a3290370c5b60a2327e142e47a6e8a68999", + "publicAddress": "37f9efce6a70a51dab672ffae12808f128a6324b8073b74bb10fcce2bd109a90", "createdAt": { + "sequence": 1, "hash": { "type": "Buffer", - "data": "base64:R5HXrp+X3xAO8VWOhHctagm0N2I4goP3XG8goyqIqoY=" - }, - "sequence": 1 + "data": "base64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } }, "scanningEnabled": true, - "proofAuthorizingKey": "01dfdc97107f322332ad1300e236f9c377cbc7b5e0c9ed327b403bd6ceb08a03" + "proofAuthorizingKey": "f8f6e8d31090239643f326fc990eafa57c19baa4eba44280e1d8de92e6befe00", + "isLedger": false }, "head": { "hash": { diff --git a/ironfish/src/wallet/walletdb/accountValue.test.ts b/ironfish/src/wallet/walletdb/accountValue.test.ts index ee716a96b5..c5581f9ee2 100644 --- a/ironfish/src/wallet/walletdb/accountValue.test.ts +++ b/ironfish/src/wallet/walletdb/accountValue.test.ts @@ -30,6 +30,7 @@ describe('AccountValueEncoding', () => { }, scanningEnabled: true, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const buffer = encoder.serialize(value) const deserializedValue = encoder.deserialize(buffer) @@ -59,6 +60,7 @@ describe('AccountValueEncoding', () => { keyPackage: 'beef', }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: false, } const buffer = encoder.serialize(value) const deserializedValue = encoder.deserialize(buffer) @@ -87,6 +89,7 @@ describe('AccountValueEncoding', () => { keyPackage: 'beef', }, proofAuthorizingKey: key.proofAuthorizingKey, + isLedger: true, } const passphrase = 'foobarbaz' diff --git a/ironfish/src/wallet/walletdb/accountValue.ts b/ironfish/src/wallet/walletdb/accountValue.ts index 50dc2be1ca..c00971abc6 100644 --- a/ironfish/src/wallet/walletdb/accountValue.ts +++ b/ironfish/src/wallet/walletdb/accountValue.ts @@ -20,6 +20,7 @@ export type EncryptedAccountValue = { export type DecryptedAccountValue = { encrypted: false + isLedger: boolean version: number id: string name: string @@ -66,6 +67,7 @@ export class AccountValueEncoding implements IDatabaseEncoding { flags |= Number(!!value.proofAuthorizingKey) << 3 flags |= Number(!!value.scanningEnabled) << 4 flags |= Number(!!value.encrypted) << 5 + flags |= Number(!!value.isLedger) << 6 bw.writeU8(flags) bw.writeU16(value.version) @@ -137,6 +139,7 @@ export class AccountValueEncoding implements IDatabaseEncoding { const hasMultisigKeys = flags & (1 << 2) const hasProofAuthorizingKey = flags & (1 << 3) const scanningEnabled = Boolean(flags & (1 << 4)) + const isLedger = Boolean(flags & (1 << 6)) const id = reader.readVarString('utf8') const name = reader.readVarString('utf8') const spendingKey = hasSpendingKey ? reader.readBytes(KEY_LENGTH).toString('hex') : null @@ -176,6 +179,7 @@ export class AccountValueEncoding implements IDatabaseEncoding { scanningEnabled, multisigKeys, proofAuthorizingKey, + isLedger, } } diff --git a/ironfish/src/wallet/walletdb/walletdb.test.ts b/ironfish/src/wallet/walletdb/walletdb.test.ts index d24515d7e9..ff9cf354bb 100644 --- a/ironfish/src/wallet/walletdb/walletdb.test.ts +++ b/ironfish/src/wallet/walletdb/walletdb.test.ts @@ -638,6 +638,7 @@ describe('WalletDB', () => { version: 1, createdAt: null, scanningEnabled: false, + isLedger: false, ...key, } const account = new Account({ accountValue, walletDb }) @@ -657,6 +658,7 @@ describe('WalletDB', () => { version: 1, createdAt: null, scanningEnabled: false, + isLedger: false, ...key, } const account = new Account({ accountValue, walletDb }) @@ -687,6 +689,7 @@ describe('WalletDB', () => { version: 1, createdAt: null, scanningEnabled: false, + isLedger: false, ...key, } const account = new Account({ accountValue, walletDb }) @@ -710,6 +713,7 @@ describe('WalletDB', () => { version: 1, createdAt: null, scanningEnabled: false, + isLedger: false, ...key, } const account = new Account({ accountValue, walletDb })