+ // Initialize chronik mock with full tx history of test alias address
+ const { type, hash } = cashaddr.decode(
+ config.aliasConstants.address,
+ true,
+ );
+ const mockedChronik = new MockChronikClient(
+ type,
+ hash,
+ allTxHistoryFromChronik,
+ );
const result = await getUnprocessedTxHistory(
- null,
+ mockedChronik,
config.aliasConstants.registrationHash160,
processedBlockheight,
processedTxCount,
- optionalMocks,
);
- const expectedResult = {
- maxTxs: undefined,
- maxUnprocessedTxCount: undefined,
- numPagesToFetch: undefined,
- alreadyHaveAllPotentiallyUnprocessedTxs: true,
- unprocessedTxs: unprocessedTxs,
- };
-
- assert.deepEqual(result, expectedResult);
+
+ assert.deepEqual(result, unprocessedTxs);
});
it(`getUnprocessedTxHistory correctly recognizes when 11 unprocessed unconfirmed transactions are available with a txHistoryPageSize=${config.txHistoryPageSize}`, async () => {
+ const mockedChronik = new MockChronikClient(type, hash, allTxHistory);
const result = await getUnprocessedTxHistory(
- null,
+ mockedChronik,
config.aliasConstants.registrationHash160,
processedBlockheight,
processedTxCount,
- optionalMocks,
);
- const expectedResult = {
- maxTxs: undefined,
- maxUnprocessedTxCount: undefined,
- numPagesToFetch: undefined,
- alreadyHaveAllPotentiallyUnprocessedTxs: true,
- unprocessedTxs: unprocessedTxs,
- };
-
- assert.deepEqual(result, expectedResult);
+
+ assert.deepEqual(result, unprocessedTxs);
});
it(`getUnprocessedTxHistory correctly recognizes when 11 unprocessed confirmed transactions are available with a txHistoryPageSize=${config.txHistoryPageSize}`, async () => {