Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat(frontend)/sol-txn-service' …
Browse files Browse the repository at this point in the history
…into feat(frontend)/sol-txn-service
  • Loading branch information
loki344 committed Jan 8, 2025
2 parents b954290 + c15f886 commit 37a1ca4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions src/frontend/src/sol/services/sol-transactions.services.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import type { SolAddress } from '$lib/types/address';
import { getSolTransactions } from '$sol/api/solana.api';
import { type SolCertifiedTransaction, solTransactionsStore } from '$sol/stores/sol-transactions.store';
import { SolanaNetworks, type SolanaNetworkType } from '$sol/types/network';
import {
SOLANA_DEVNET_TOKEN_ID,
SOLANA_LOCAL_TOKEN_ID,
SOLANA_TESTNET_TOKEN_ID,
SOLANA_TOKEN_ID
} from '$env/tokens/tokens.sol.env';
import type { SolAddress } from '$lib/types/address';
import { getSolTransactions } from '$sol/api/solana.api';
import {
solTransactionsStore,
type SolCertifiedTransaction
} from '$sol/stores/sol-transactions.store';
import { SolanaNetworks, type SolanaNetworkType } from '$sol/types/network';

export const loadNextSolTransactions = async ({
address,
Expand Down Expand Up @@ -55,7 +58,6 @@ const loadSolTransactions = async ({
before?: string;
limit?: number;
}): Promise<SolCertifiedTransaction[]> => {

const solTokenIdForNetwork = networkToSolTokenIdMap[network];

try {
Expand All @@ -75,10 +77,7 @@ const loadSolTransactions = async ({
} catch (error: unknown) {
solTransactionsStore.reset(solTokenIdForNetwork);

console.error(
`Failed to load transactions for ${solTokenIdForNetwork.description}:`,
error
);
console.error(`Failed to load transactions for ${solTokenIdForNetwork.description}:`, error);
return [];
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as solanaApi from '$sol/api/solana.api';
import { loadNextSolTransactions } from '$sol/services/sol-transactions.services';
import { solTransactionsStore } from '$sol/stores/sol-transactions.store';
import { SolanaNetworks } from '$sol/types/network';
import { mockSolSignature } from '$tests/mocks/sol-signatures.mock';
import { mockSolCertifiedTransactions } from '$tests/mocks/sol-transactions.mock';
import { mockSolAddress } from '$tests/mocks/sol.mock';
import { get } from 'svelte/store';
import type { MockInstance } from 'vitest';
import { mockSolSignature } from '$tests/mocks/sol-signatures.mock';

describe('sol-transactions.services', () => {
let spyGetTransactions: MockInstance;
Expand Down Expand Up @@ -114,4 +114,4 @@ describe('sol-transactions.services', () => {
});
});
});
});
});

0 comments on commit 37a1ca4

Please sign in to comment.