From 88874c47dbe37dd9b16c3f23549ab8fcdb3b3ad2 Mon Sep 17 00:00:00 2001 From: jinoosss Date: Mon, 15 Jan 2024 15:14:05 +0900 Subject: [PATCH] feat: [ADN-362] Update Account migration model --- .../v005/storage-migration-v005.spec.ts | 86 +++++ .../migrations/v005/storage-migration-v005.ts | 135 ++++++++ .../migrations/v005/storage-model-v005.ts | 114 +++++++ .../src/migrates/storage-migrator.spec.ts | 4 +- .../src/migrates/storage-migrator.ts | 26 +- packages/adena-module/src/utils/messages.ts | 12 +- .../wallet/keyring/address-keyring.spec.ts | 302 ++++++++++++++++++ .../adena-module/src/wallet/wallet.spec.ts | 3 - 8 files changed, 669 insertions(+), 13 deletions(-) create mode 100644 packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.spec.ts create mode 100644 packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.ts create mode 100644 packages/adena-extension/src/migrates/migrations/v005/storage-model-v005.ts create mode 100644 packages/adena-module/src/wallet/keyring/address-keyring.spec.ts diff --git a/packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.spec.ts b/packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.spec.ts new file mode 100644 index 00000000..f0eca387 --- /dev/null +++ b/packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.spec.ts @@ -0,0 +1,86 @@ +import { decryptAES } from 'adena-module'; +import { StorageMigration005 } from './storage-migration-v005'; + +const mockStorageData = { + NETWORKS: [], + CURRENT_CHAIN_ID: '', + CURRENT_NETWORK_ID: '', + SERIALIZED: 'U2FsdGVkX19eI8kOCI/T9o1Ru0b2wdj5rHxmG4QbLQ0yZH4kDa8/gg6Ac2JslvEm', + ENCRYPTED_STORED_PASSWORD: '', + CURRENT_ACCOUNT_ID: '', + ACCOUNT_NAMES: {}, + ESTABLISH_SITES: {}, + ADDRESS_BOOK: [], + ACCOUNT_TOKEN_METAINFOS: {}, +}; + +describe('serialized wallet migration V004', () => { + it('version', () => { + const migration = new StorageMigration005(); + expect(migration.version).toBe(5); + }); + + it('up success', async () => { + const mockData = { + version: 2, + data: mockStorageData, + }; + const migration = new StorageMigration005(); + const result = await migration.up(mockData); + + expect(result.version).toBe(5); + expect(result.data).not.toBeNull(); + expect(result.data.NETWORKS).toEqual([]); + expect(result.data.CURRENT_CHAIN_ID).toBe(''); + expect(result.data.CURRENT_NETWORK_ID).toBe(''); + expect(result.data.SERIALIZED).toBe( + 'U2FsdGVkX19eI8kOCI/T9o1Ru0b2wdj5rHxmG4QbLQ0yZH4kDa8/gg6Ac2JslvEm', + ); + expect(result.data.ENCRYPTED_STORED_PASSWORD).toBe(''); + expect(result.data.CURRENT_ACCOUNT_ID).toBe(''); + expect(result.data.ACCOUNT_NAMES).toEqual({}); + expect(result.data.ESTABLISH_SITES).toEqual({}); + expect(result.data.ADDRESS_BOOK).toEqual([]); + }); + + it('up password success', async () => { + const mockData = { + version: 1, + data: mockStorageData, + }; + const password = '123'; + const migration = new StorageMigration005(); + const result = await migration.up(mockData); + + expect(result.version).toBe(5); + expect(result.data).not.toBeNull(); + expect(result.data.NETWORKS).toEqual([]); + expect(result.data.CURRENT_CHAIN_ID).toBe(''); + expect(result.data.CURRENT_NETWORK_ID).toBe(''); + expect(result.data.SERIALIZED).not.toBe(''); + expect(result.data.ENCRYPTED_STORED_PASSWORD).toBe(''); + expect(result.data.CURRENT_ACCOUNT_ID).toBe(''); + expect(result.data.ACCOUNT_NAMES).toEqual({}); + expect(result.data.ESTABLISH_SITES).toEqual({}); + expect(result.data.ADDRESS_BOOK).toEqual([]); + + const serialized = result.data.SERIALIZED; + const decrypted = await decryptAES(serialized, password); + const wallet = JSON.parse(decrypted); + + expect(wallet.accounts).toHaveLength(0); + expect(wallet.keyrings).toHaveLength(0); + }); + + it('up failed throw error', async () => { + const mockData: any = { + version: 1, + data: { ...mockStorageData, SERIALIZED: null }, + }; + const migration = new StorageMigration005(); + + await expect(migration.up(mockData)).rejects.toThrow( + 'Storage Data does not match version V004', + ); + }); +}); diff --git a/packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.ts b/packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.ts new file mode 100644 index 00000000..5f3734a5 --- /dev/null +++ b/packages/adena-extension/src/migrates/migrations/v005/storage-migration-v005.ts @@ -0,0 +1,135 @@ +import { Migration } from '@migrates/migrator'; +import { StorageModel } from '@common/storage'; +import { + AccountTokenMetainfoModelV004, + EstablishSitesModelV004, + NetworksModelV004, + StorageModelDataV004, +} from '../v004/storage-model-v004'; +import { + AccountTokenMetainfoModelV005, + EstablishSitesModelV005, + NetworksModelV005, + StorageModelDataV005, +} from './storage-model-v005'; + +export class StorageMigration005 implements Migration { + public readonly version = 5; + + async up( + current: StorageModel, + ): Promise> { + if (!this.validateModelV004(current.data)) { + throw new Error('Storage Data does not match version V004'); + } + const previous: StorageModelDataV004 = current.data; + return { + version: this.version, + data: { + ...previous, + NETWORKS: this.migrateNetworks(previous.NETWORKS), + ACCOUNT_TOKEN_METAINFOS: this.migrateAccountTokenMetainfo(previous.ACCOUNT_TOKEN_METAINFOS), + ESTABLISH_SITES: this.migrateEstablishSites(previous.ESTABLISH_SITES), + }, + }; + } + + private validateModelV004(currentData: StorageModelDataV004): boolean { + const storageDataKeys = [ + 'NETWORKS', + 'CURRENT_CHAIN_ID', + 'CURRENT_NETWORK_ID', + 'SERIALIZED', + 'ENCRYPTED_STORED_PASSWORD', + 'CURRENT_ACCOUNT_ID', + 'ACCOUNT_NAMES', + 'ESTABLISH_SITES', + 'ADDRESS_BOOK', + 'ACCOUNT_TOKEN_METAINFOS', + ]; + const hasKeys = Object.keys(currentData).every((dataKey) => storageDataKeys.includes(dataKey)); + if (!hasKeys) { + return false; + } + if (!Array.isArray(currentData.NETWORKS)) { + return false; + } + if (typeof currentData.CURRENT_CHAIN_ID !== 'string') { + return false; + } + if (typeof currentData.CURRENT_NETWORK_ID !== 'string') { + return false; + } + if (typeof currentData.SERIALIZED !== 'string') { + return false; + } + if (typeof currentData.ENCRYPTED_STORED_PASSWORD !== 'string') { + return false; + } + if (typeof currentData.CURRENT_ACCOUNT_ID !== 'string') { + return false; + } + if (typeof currentData.ACCOUNT_NAMES !== 'object') { + return false; + } + if (typeof currentData.ESTABLISH_SITES !== 'object') { + return false; + } + if (typeof currentData.ADDRESS_BOOK !== 'object') { + return false; + } + return true; + } + + private migrateNetworks(networksDataV004: NetworksModelV004): NetworksModelV005 { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const networks = networksDataV004.map((network: any, index) => { + if (index < 3) { + return { + ...network, + id: network.networkId, + default: true, + main: network.networkId === 'test3', + }; + } + return { + ...network, + id: network.networkId || Date.now(), + default: false, + main: false, + }; + }); + return networks; + } + + private migrateAccountTokenMetainfo( + accountTokenMetainfo: AccountTokenMetainfoModelV004, + ): AccountTokenMetainfoModelV005 { + const changedAccountTokenMetainfo: AccountTokenMetainfoModelV005 = {}; + for (const accountId of Object.keys(accountTokenMetainfo)) { + const tokenMetainfos = accountTokenMetainfo[accountId].map((tokenMetainfo) => ({ + ...tokenMetainfo, + networkId: + tokenMetainfo.type === 'gno-native' && tokenMetainfo.symbol === 'GNOT' + ? 'DEFAULT' + : 'test3', + })); + changedAccountTokenMetainfo[accountId] = tokenMetainfos; + } + return changedAccountTokenMetainfo; + } + + private migrateEstablishSites(establishSites: EstablishSitesModelV004): EstablishSitesModelV005 { + const changedEstablishSites: EstablishSitesModelV005 = {}; + for (const accountId of Object.keys(establishSites)) { + const establishSitesOfAccount = establishSites[accountId].filter( + (establishSite, index) => + establishSites[accountId].findIndex( + (current) => current.hostname === establishSite.hostname, + ) === index, + ); + changedEstablishSites[accountId] = establishSitesOfAccount; + } + return changedEstablishSites; + } +} diff --git a/packages/adena-extension/src/migrates/migrations/v005/storage-model-v005.ts b/packages/adena-extension/src/migrates/migrations/v005/storage-model-v005.ts new file mode 100644 index 00000000..7794bbd0 --- /dev/null +++ b/packages/adena-extension/src/migrates/migrations/v005/storage-model-v005.ts @@ -0,0 +1,114 @@ +export type StorageModelV005 = { + version: 5; + data: StorageModelDataV005; +}; + +export type StorageModelDataV005 = { + NETWORKS: NetworksModelV005; + CURRENT_CHAIN_ID: CurrentChainIdModelV005; + CURRENT_NETWORK_ID: CurrentNetworkIdModelV005; + SERIALIZED: SerializedModelV005; + ENCRYPTED_STORED_PASSWORD: EncryptedStoredPasswordModelV005; + CURRENT_ACCOUNT_ID: CurrentAccountIdModelV005; + ACCOUNT_NAMES: AccountNamesModelV005; + ESTABLISH_SITES: EstablishSitesModelV005; + ADDRESS_BOOK: AddressBookModelV005; + ACCOUNT_TOKEN_METAINFOS: AccountTokenMetainfoModelV005; +}; + +export type NetworksModelV005 = { + id: string; + default: boolean; + main: boolean; + chainId: string; + chainName: string; + networkId: string; + networkName: string; + addressPrefix: string; + rpcUrl: string; + gnoUrl: string; + apiUrl: string; + linkUrl: string; + deleted?: boolean; +}[]; + +export type CurrentChainIdModelV005 = string; + +export type CurrentNetworkIdModelV005 = string; + +export type SerializedModelV005 = string; + +export type WalletModelV005 = { + accounts: AccountDataModelV005[]; + keyrings: KeyringDataModelV005[]; + currentAccountId?: string; +}; + +type AccountDataModelV005 = { + id?: string; + index: number; + type: 'HD_WALLET' | 'PRIVATE_KEY' | 'LEDGER' | 'WEB3_AUTH' | 'AIRGAP'; + name: string; + keyringId: string; + hdPath?: number; + publicKey: number[]; + addressBytes?: number[]; +}; + +type KeyringDataModelV005 = { + id?: string; + type: 'HD_WALLET' | 'PRIVATE_KEY' | 'LEDGER' | 'WEB3_AUTH' | 'AIRGAP'; + publicKey?: number[]; + privateKey?: number[]; + seed?: number[]; + mnemonic?: string; + addressBytes?: number[]; +}; + +export type EncryptedStoredPasswordModelV005 = string; + +export type CurrentAccountIdModelV005 = string; + +export type AccountNamesModelV005 = { [key in string]: string }; + +export type EstablishSitesModelV005 = { + [key in string]: { + hostname: string; + chainId: string; + account: string; + name: string; + favicon: string | null; + establishedTime: string; + }[]; +}; + +export type AddressBookModelV005 = { + id: string; + name: string; + address: string; + createdAt: string; +}[]; + +export type AccountTokenMetainfoModelV005 = { + [key in string]: { + main: boolean; + tokenId: string; + networkId: string; + display: boolean; + type: 'gno-native' | 'grc20' | 'ibc-native' | 'ibc-tokens'; + name: string; + symbol: string; + decimals: number; + description?: string; + websiteUrl?: string; + image: string; + denom?: string; + pkgPath?: string; + originChain?: string; + originDenom?: string; + originType?: string; + path?: string; + channel?: string; + port?: string; + }[]; +}; diff --git a/packages/adena-extension/src/migrates/storage-migrator.spec.ts b/packages/adena-extension/src/migrates/storage-migrator.spec.ts index 5fb170f0..6f0c2251 100644 --- a/packages/adena-extension/src/migrates/storage-migrator.spec.ts +++ b/packages/adena-extension/src/migrates/storage-migrator.spec.ts @@ -67,7 +67,7 @@ describe('StorageMigrator', () => { const migrated = await migrator.migrate(current); expect(migrated).not.toBeNull(); - expect(migrated?.version).toBe(4); + expect(migrated?.version).toBe(5); expect(migrated?.data).not.toBeNull(); expect(migrated?.data.NETWORKS).toHaveLength(0); expect(migrated?.data.CURRENT_CHAIN_ID).toBe(''); @@ -89,7 +89,7 @@ describe('StorageMigrator', () => { const migrated = await migrator.migrate(current); expect(migrated).not.toBeNull(); - expect(migrated?.version).toBe(4); + expect(migrated?.version).toBe(5); expect(migrated?.data).not.toBeNull(); expect(migrated?.data.SERIALIZED).not.toBe(''); expect(migrated?.data.ADDRESS_BOOK).toHaveLength(1); diff --git a/packages/adena-extension/src/migrates/storage-migrator.ts b/packages/adena-extension/src/migrates/storage-migrator.ts index df65c6ff..7afb3b19 100644 --- a/packages/adena-extension/src/migrates/storage-migrator.ts +++ b/packages/adena-extension/src/migrates/storage-migrator.ts @@ -7,6 +7,8 @@ import { StorageModelV003 } from './migrations/v003/storage-model-v003'; import { StorageMigration003 } from './migrations/v003/storage-migration-v003'; import { StorageMigration004 } from './migrations/v004/storage-migration-v004'; import { StorageModelV004 } from './migrations/v004/storage-model-v004'; +import { StorageModelV005 } from './migrations/v005/storage-model-v005'; +import { StorageMigration005 } from './migrations/v005/storage-migration-v005'; const LegacyStorageKeys = [ 'NETWORKS', @@ -21,7 +23,7 @@ const LegacyStorageKeys = [ 'ACCOUNT_TOKEN_METAINFOS', ]; -export type StorageModelLatest = StorageModelV003; +export type StorageModelLatest = StorageModelV005; const defaultData: StorageModelDataV001 = { ACCOUNT_NAMES: {}, @@ -71,7 +73,9 @@ export class StorageMigrator implements Migrator { async deserialize( data: string | undefined, - ): Promise { + ): Promise< + StorageModelV005 | StorageModelV004 | StorageModelV003 | StorageModelV002 | StorageModelV001 + > { let jsonData = null; if (data) { try { @@ -84,6 +88,7 @@ export class StorageMigrator implements Migrator { } async getCurrent(): Promise< + | StorageModelV005 | StorageModelV004 | StorageModelV003 | StorageModelV002 @@ -100,7 +105,7 @@ export class StorageMigrator implements Migrator { }; } - async migrate(current: StorageModel): Promise { + async migrate(current: StorageModel): Promise { let latest = current; try { const currentVersion = current.version || 1; @@ -136,8 +141,14 @@ export class StorageMigrator implements Migrator { } private async mappedJson( + // eslint-disable-next-line @typescript-eslint/no-explicit-any json: any, - ): Promise { + ): Promise< + StorageModelV005 | StorageModelV004 | StorageModelV003 | StorageModelV002 | StorageModelV001 + > { + if (json?.version === 5) { + return json as StorageModelV005; + } if (json?.version === 4) { return json as StorageModelV004; } @@ -175,6 +186,11 @@ export class StorageMigrator implements Migrator { } static migrations(): Migration[] { - return [new StorageMigration002(), new StorageMigration003(), new StorageMigration004()]; + return [ + new StorageMigration002(), + new StorageMigration003(), + new StorageMigration004(), + new StorageMigration005(), + ]; } } diff --git a/packages/adena-module/src/utils/messages.ts b/packages/adena-module/src/utils/messages.ts index b6b8492c..5200354d 100644 --- a/packages/adena-module/src/utils/messages.ts +++ b/packages/adena-module/src/utils/messages.ts @@ -1,7 +1,5 @@ import { Any, Tx, TxFee, TxSignature } from '@gnolang/tm2-js-client'; import { MsgCall, MsgAddPackage, MsgSend, MsgEndpoint } from '@gnolang/gno-js-client'; -import { hexToBytes } from '@noble/hashes/utils'; -import { fromUtf8 } from '../encoding'; export interface Document { chain_id: string; @@ -135,7 +133,15 @@ export const strToSignedTx = (str: string): Tx | null => { gasWanted: sortedDocument.fee.gas_wanted, gasFee: sortedDocument.fee.gas_fee, }), - signatures: rawTx.signatures.map(TxSignature.fromJSON), + signatures: rawTx.signatures.map((signature: any) => + TxSignature.fromJSON({ + ...signature, + pubKey: { + ...signature.pub_key, + typeUrl: signature.pub_key['@type'], + }, + }), + ), memo: sortedDocument.memo, }; } catch (e) { diff --git a/packages/adena-module/src/wallet/keyring/address-keyring.spec.ts b/packages/adena-module/src/wallet/keyring/address-keyring.spec.ts new file mode 100644 index 00000000..b5bd79fd --- /dev/null +++ b/packages/adena-module/src/wallet/keyring/address-keyring.spec.ts @@ -0,0 +1,302 @@ +import { Tx, uint8ArrayToBase64 } from '@gnolang/tm2-js-client'; +import { strToSignedTx } from '../../utils'; +import { AddressKeyring } from './address-keyring'; + +describe('create address keyring', () => { + it('create address keyring from address', async () => { + const address = 'g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5'; + const addressKeyring = await AddressKeyring.fromAddress(address); + + expect(addressKeyring.id).not.toBeNull(); + expect([...addressKeyring.addressBytes]).toStrictEqual([ + 146, + 15, + 181, + 241, + 124, + 45, + 175, + 116, + 187, + 21, + 153, + 183, + 203, + 224, + 41, + 90, + 94, + 30, + 201, + 183, + ]); + expect(addressKeyring.type.toString()).toBe('AIRGAP'); + }); +}); + +describe('tx encode of address keyring', () => { + it('str to signedTx', async () => { + const str = + '{"msg":[{"@type":"/vm.m_call","caller":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","send":"","pkg_path":"gno.land/r/demo/tong","func":"Transfer","args":["g1kcdd3n0d472g2p5l8svyg9t0wq6h5857nq992f","1"]}],"fee":{"gas_wanted":"9000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"6Jk3gs564wGTutNdODztNUlg88/WHmMPmJGRZHDuV00Mc9M5gGWBZDEpGysLsqzjMDxmsTu1PLtTYfTj0KphGQ=="}],"memo":""}'; + const signedTx = strToSignedTx(str)!; + const expectedResult = { + messages: [ + { + typeUrl: '/vm.m_call', + value: new Uint8Array([ + 10, + 40, + 103, + 49, + 106, + 103, + 56, + 109, + 116, + 117, + 116, + 117, + 57, + 107, + 104, + 104, + 102, + 119, + 99, + 52, + 110, + 120, + 109, + 117, + 104, + 99, + 112, + 102, + 116, + 102, + 48, + 112, + 97, + 106, + 100, + 104, + 102, + 118, + 115, + 113, + 102, + 53, + 26, + 20, + 103, + 110, + 111, + 46, + 108, + 97, + 110, + 100, + 47, + 114, + 47, + 100, + 101, + 109, + 111, + 47, + 116, + 111, + 110, + 103, + 34, + 8, + 84, + 114, + 97, + 110, + 115, + 102, + 101, + 114, + 42, + 40, + 103, + 49, + 107, + 99, + 100, + 100, + 51, + 110, + 48, + 100, + 52, + 55, + 50, + 103, + 50, + 112, + 53, + 108, + 56, + 115, + 118, + 121, + 103, + 57, + 116, + 48, + 119, + 113, + 54, + 104, + 53, + 56, + 53, + 55, + 110, + 113, + 57, + 57, + 50, + 102, + 42, + 1, + 49, + ]), + }, + ], + fee: { + gasWanted: { + low: 9000000, + high: 0, + unsigned: false, + }, + gasFee: '1ugnot', + }, + signatures: [ + { + pubKey: { + typeUrl: '/tm.PubKeySecp256k1', + value: new Uint8Array([ + 3, + 225, + 97, + 54, + 219, + 23, + 30, + 50, + 223, + 72, + 153, + 53, + 148, + 31, + 5, + 110, + 34, + 248, + 152, + 99, + 227, + 115, + 157, + 10, + 183, + 205, + 73, + 236, + 66, + 131, + 156, + 157, + 178, + ]), + }, + signature: new Uint8Array([ + 232, + 153, + 55, + 130, + 206, + 122, + 227, + 1, + 147, + 186, + 211, + 93, + 56, + 60, + 237, + 53, + 73, + 96, + 243, + 207, + 214, + 30, + 99, + 15, + 152, + 145, + 145, + 100, + 112, + 238, + 87, + 77, + 12, + 115, + 211, + 57, + 128, + 101, + 129, + 100, + 49, + 41, + 27, + 43, + 11, + 178, + 172, + 227, + 48, + 60, + 102, + 177, + 59, + 181, + 60, + 187, + 83, + 97, + 244, + 227, + 208, + 170, + 97, + 25, + ]), + }, + ], + memo: '', + }; + + expect(signedTx.messages.length).toBe(expectedResult.messages.length); + expect(signedTx.signatures.length).toBe(expectedResult.signatures.length); + }); + + it('str to base64', async () => { + const str = + '{"msg":[{"@type":"/vm.m_call","caller":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","send":"","pkg_path":"gno.land/r/demo/tong","func":"Transfer","args":["g1kcdd3n0d472g2p5l8svyg9t0wq6h5857nq992f","1"]}],"fee":{"gas_wanted":"9000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"6Jk3gs564wGTutNdODztNUlg88/WHmMPmJGRZHDuV00Mc9M5gGWBZDEpGysLsqzjMDxmsTu1PLtTYfTj0KphGQ=="}],"memo":""}'; + const signedTx = strToSignedTx(str)!; + const encodedTx = uint8ArrayToBase64(Tx.encode(signedTx).finish()); + + expect(encodedTx).toBe( + 'CoUBCgovdm0ubV9jYWxsEncKKGcxamc4bXR1dHU5a2hoZndjNG54bXVoY3BmdGYwcGFqZGhmdnNxZjUaFGduby5sYW5kL3IvZGVtby90b25nIghUcmFuc2ZlciooZzFrY2RkM24wZDQ3MmcycDVsOHN2eWc5dDB3cTZoNTg1N25xOTkyZioBMRINCIDRyggSBjF1Z25vdBp8CjgKEy90bS5QdWJLZXlTZWNwMjU2azESIQPhYTbbFx4y30iZNZQfBW4i+Jhj43OdCrfNSexCg5ydshJA6Jk3gs564wGTutNdODztNUlg88/WHmMPmJGRZHDuV00Mc9M5gGWBZDEpGysLsqzjMDxmsTu1PLtTYfTj0KphGQ==', + ); + }); +}); diff --git a/packages/adena-module/src/wallet/wallet.spec.ts b/packages/adena-module/src/wallet/wallet.spec.ts index b07982a3..4ce751a8 100644 --- a/packages/adena-module/src/wallet/wallet.spec.ts +++ b/packages/adena-module/src/wallet/wallet.spec.ts @@ -4,9 +4,6 @@ import { AdenaWallet } from './wallet'; const mnemonic = 'source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast'; -const mnemonic2 = - 'lens balcony basic cherry half purchase balance soccer solar scissors process eager orchard fatigue rural retire approve crouch repair prepare develop clarify milk suffer'; - describe('create wallet by mnemonic', () => { it('create success', async () => { const wallet = await AdenaWallet.createByMnemonic(mnemonic);