Skip to content

Commit ea516c1

Browse files
fixup! feat: asset tracker now uses local cache before fetching asset metadata
1 parent 1aae901 commit ea516c1

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

packages/e2e/test/wallet_epoch_0/PersonalWallet/pouchDbWalletStores.test.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,26 @@ describe('PersonalWallet/pouchDbWalletStores', () => {
1717
it('stores and restores BaseWallet, continues sync after initial load', async () => {
1818
const wallet1 = (await getWallet({ env, logger, name: 'Test Wallet', stores: stores1 })).wallet;
1919

20+
// eslint-disable-next-line no-console
21+
console.error('XXXXXXXXXX a');
2022
// wallet1 fetched all responses from wallet provider
2123
await walletReady(wallet1);
22-
24+
// eslint-disable-next-line no-console
25+
console.error('XXXXXXXXXX b');
2326
// give it a second to store data to PouchDb, this is technically a race condition
2427
await delay(1000);
28+
// eslint-disable-next-line no-console
29+
console.error('XXXXXXXXXX c');
2530
// loading reward accounts involves loading many other pieces (transactions, stake pools etc.)
2631
const wallet1RewardAccounts = await firstValueFrom(wallet1.delegation.rewardAccounts$);
32+
// eslint-disable-next-line no-console
33+
console.error('XXXXXXXXXX d');
2734
const wallet1RewardsHistory = await firstValueFrom(wallet1.delegation.rewardsHistory$);
35+
// eslint-disable-next-line no-console
36+
console.error('XXXXXXXXXX e');
2837
wallet1.shutdown();
38+
// eslint-disable-next-line no-console
39+
console.error('XXXXXXXXXX f');
2940
// create a new wallet, with new stores sharing the underlying database
3041
const wallet2 = (
3142
await getWallet({
@@ -35,17 +46,36 @@ describe('PersonalWallet/pouchDbWalletStores', () => {
3546
stores: storage.createPouchDbWalletStores(walletName, { logger })
3647
})
3748
).wallet;
49+
50+
// eslint-disable-next-line no-console
51+
console.error('XXXXXXXXXX g');
3852
const tip = await firstValueFrom(wallet2.tip$);
53+
// eslint-disable-next-line no-console
54+
console.error('XXXXXXXXXX h');
3955
expect(await firstValueFrom(wallet2.delegation.rewardsHistory$)).toEqual(wallet1RewardsHistory);
56+
// eslint-disable-next-line no-console
57+
console.error('XXXXXXXXXX i');
4058
expect(await firstValueFrom(wallet1.delegation.rewardAccounts$)).toEqual(wallet1RewardAccounts);
59+
// eslint-disable-next-line no-console
60+
console.error('XXXXXXXXXX j');
4161
// if it's still syncing and reward accounts matched wallet1, it means it has loaded from storage.
4262
// technically a race condition too...
63+
// eslint-disable-next-line no-console
64+
console.error('XXXXXXXXXX k');
4365
expect(await firstValueFrom(wallet2.syncStatus.isSettled$)).toBe(false);
66+
// eslint-disable-next-line no-console
67+
console.error('XXXXXXXXXX l');
4468
// will time out if it's not syncing after load.
4569
await waitForWalletStateSettle(wallet2);
70+
// eslint-disable-next-line no-console
71+
console.error('XXXXXXXXXX n');
4672
// assert that it's updating wallet properties after fetching new data from the provider (at least the tip)
4773
await firstValueFrom(wallet2.tip$.pipe(filter((newTip) => newTip.slot !== tip.slot)));
74+
// eslint-disable-next-line no-console
75+
console.error('XXXXXXXXXX nxx');
4876
wallet2.shutdown();
77+
// eslint-disable-next-line no-console
78+
console.error('XXXXXXXXXX xxx');
4979
});
5080

5181
afterAll(() => firstValueFrom(stores1.destroy()));

0 commit comments

Comments
 (0)