|
1 | | -import { mnemonicPhraseToBytes } from '@metamask/key-tree'; |
| 1 | +import { TEST_SECRET_RECOVERY_PHRASE_SEED_BYTES } from '@metamask/snaps-utils/test-utils'; |
2 | 2 |
|
3 | 3 | import { getGetMnemonicSeedImplementation } from './get-mnemonic-seed'; |
4 | | -import { DEFAULT_ALTERNATIVE_SRP, DEFAULT_SRP } from '../../constants'; |
| 4 | +import { DEFAULT_ALTERNATIVE_SRP } from '../../constants'; |
5 | 5 |
|
6 | 6 | describe('getGetMnemonicSeedImplementation', () => { |
| 7 | + const alternativeSeedBytes = new Uint8Array([ |
| 8 | + 94, 176, 11, 189, 220, 240, 105, 8, 72, 137, 168, 171, 145, 85, 86, 129, |
| 9 | + 101, 245, 196, 83, 204, 184, 94, 112, 129, 26, 174, 214, 246, 218, 95, 193, |
| 10 | + 154, 90, 196, 11, 56, 156, 211, 112, 208, 134, 32, 109, 236, 138, 166, 196, |
| 11 | + 61, 174, 166, 105, 15, 32, 173, 61, 141, 72, 178, 210, 206, 158, 56, 228, |
| 12 | + ]); |
| 13 | + |
7 | 14 | it('returns the default mnemonic seed', async () => { |
8 | 15 | const getMnemonicSeed = getGetMnemonicSeedImplementation(); |
9 | 16 | expect(await getMnemonicSeed()).toStrictEqual( |
10 | | - mnemonicPhraseToBytes(DEFAULT_SRP), |
| 17 | + TEST_SECRET_RECOVERY_PHRASE_SEED_BYTES, |
11 | 18 | ); |
12 | 19 |
|
13 | 20 | expect(await getMnemonicSeed('default')).toStrictEqual( |
14 | | - mnemonicPhraseToBytes(DEFAULT_SRP), |
| 21 | + TEST_SECRET_RECOVERY_PHRASE_SEED_BYTES, |
15 | 22 | ); |
16 | 23 | }); |
17 | 24 |
|
18 | 25 | it('returns the seed of the provided default mnemonic phrase', async () => { |
19 | 26 | const getMnemonicSeed = getGetMnemonicSeedImplementation( |
20 | 27 | DEFAULT_ALTERNATIVE_SRP, |
21 | 28 | ); |
22 | | - expect(await getMnemonicSeed()).toStrictEqual( |
23 | | - mnemonicPhraseToBytes(DEFAULT_ALTERNATIVE_SRP), |
24 | | - ); |
| 29 | + expect(await getMnemonicSeed()).toStrictEqual(alternativeSeedBytes); |
25 | 30 |
|
26 | 31 | expect(await getMnemonicSeed('default')).toStrictEqual( |
27 | | - mnemonicPhraseToBytes(DEFAULT_ALTERNATIVE_SRP), |
| 32 | + alternativeSeedBytes, |
28 | 33 | ); |
29 | 34 | }); |
30 | 35 |
|
31 | 36 | it('returns the alternative mnemonic seed', async () => { |
32 | 37 | const getMnemonicSeed = getGetMnemonicSeedImplementation(); |
33 | 38 | expect(await getMnemonicSeed('alternative')).toStrictEqual( |
34 | | - mnemonicPhraseToBytes(DEFAULT_ALTERNATIVE_SRP), |
| 39 | + alternativeSeedBytes, |
35 | 40 | ); |
36 | 41 | }); |
37 | 42 |
|
|
0 commit comments