From 98e7c0b46b5615a8d5af49134c5297c9c354ce01 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Thu, 14 Nov 2024 21:40:34 +0100 Subject: [PATCH] fixup! test(util-dev): chainHistory mock should respect block range --- .../util-dev/src/mockProviders/mockChainHistoryProvider.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/util-dev/src/mockProviders/mockChainHistoryProvider.ts b/packages/util-dev/src/mockProviders/mockChainHistoryProvider.ts index a3212b95df6..7a60bd28fb8 100644 --- a/packages/util-dev/src/mockProviders/mockChainHistoryProvider.ts +++ b/packages/util-dev/src/mockProviders/mockChainHistoryProvider.ts @@ -1,6 +1,6 @@ import * as AssetId from '../assetId'; import * as Crypto from '@cardano-sdk/crypto'; -import { Cardano, Paginated } from '@cardano-sdk/core'; +import { Cardano, Paginated, TransactionsByAddressesArgs } from '@cardano-sdk/core'; import { currentEpoch, handleAssetId, ledgerTip, stakeCredential } from './mockData'; import { somePartialStakePools } from '../createStubStakePoolProvider'; import delay from 'delay'; @@ -230,8 +230,8 @@ export const mockChainHistoryProvider2 = (delayMs: number) => { return { blocksByHashes: delayedJestFn(blocksByHashes), healthCheck: delayedJestFn({ ok: true }), - transactionsByAddresses: jest.fn(({ blockRange: { lowerBound } }: { blockRange: { lowerBound: number } }) => - delay(delayMs).then(() => blockRangeTransactions(lowerBound)) + transactionsByAddresses: jest.fn(({ blockRange }: TransactionsByAddressesArgs) => + delay(delayMs).then(() => blockRangeTransactions(blockRange?.lowerBound || 0)) ), transactionsByHashes: delayedJestFn(queryTransactionsResult2) };