Skip to content

Commit

Permalink
fix(extension): tx history limit 10 and input resolution timeout incr…
Browse files Browse the repository at this point in the history
…ease (#1666)
  • Loading branch information
mirceahasegan authored and rhyslbw committed Jan 26, 2025
1 parent 0dece94 commit 7690da7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ const mapWalletActivities = memoize(
Pick<IBlockchainProvider, 'inputResolver'> &
Pick<WalletInfoSlice, 'isSharedWallet'>
) => {
const TX_LIMIT_SIZE = 10;
const txHistorySlice = transactions.history.slice(-TX_LIMIT_SIZE);
const epochRewardsMapper = (earnedEpoch: Wallet.Cardano.EpochNo, rewards: Reward[]): ExtendedActivityProps => {
const REWARD_SPENDABLE_DELAY_EPOCHS = 2;
const spendableEpoch = (earnedEpoch + REWARD_SPENDABLE_DELAY_EPOCHS) as Wallet.Cardano.EpochNo;
Expand Down Expand Up @@ -276,8 +278,8 @@ const mapWalletActivities = memoize(
const getHistoricalTransactions = async () => {
const filtered =
!assetDetails || assetDetails?.id === cardanoCoin.id
? transactions.history.map((tx) => ({ tx }))
: await filterTransactionByAssetId(transactions.history);
? txHistorySlice.map((tx) => ({ tx }))
: await filterTransactionByAssetId(txHistorySlice);
return flatten(await Promise.all(filtered.map((tx) => historicTransactionMapper(tx))));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { hasPhase2ValidationFailed } from '@src/utils/phase2-validation';
import { createTxInspector, Milliseconds, transactionSummaryInspector } from '@cardano-sdk/core';

// eslint-disable-next-line no-magic-numbers
const TIMEOUT = 1000 as Milliseconds;
const TIMEOUT = 2000 as Milliseconds;

export interface TxTransformerInput {
tx: Wallet.TxInFlight | Wallet.Cardano.HydratedTx | Wallet.KeyManagement.WitnessedTx;
Expand Down

0 comments on commit 7690da7

Please sign in to comment.