Skip to content

Commit 945e9f2

Browse files
committed
added comments and cleanups
1 parent 6fdcd36 commit 945e9f2

File tree

3 files changed

+246
-127
lines changed

3 files changed

+246
-127
lines changed

yarn-project/p2p/src/services/reqresp/batch-tx-requester/batch_tx_requester.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ describe('BatchTxRequester', () => {
11741174
const validationCalls: Array<{ tx: TxHash; peerId: string }> = [];
11751175
const invalidTxIndices = new Set([2, 3, 7]); // Mark transactions at indices 2, 3, and 7 as invalid
11761176

1177+
// eslint-disable-next-line require-await
11771178
const customTxValidator = jest.fn(async (tx: Tx, peerId: PeerId) => {
11781179
validationCalls.push({ tx: tx.txHash, peerId: peerId.toString() });
11791180
const txIndex = missing.findIndex(h => h.equals(tx.txHash));
@@ -1250,6 +1251,7 @@ describe('BatchTxRequester', () => {
12501251

12511252
// Validator that rejects transactions based on peer
12521253
// This simulates different peers having different validity for same transaction
1254+
// eslint-disable-next-line require-await
12531255
const peerSpecificValidator = jest.fn(async (tx: Tx, peerId: PeerId) => {
12541256
const txIndex = missing.findIndex(h => h.equals(tx.txHash));
12551257

@@ -1313,6 +1315,7 @@ describe('BatchTxRequester', () => {
13131315
connectionSampler.getPeerListSortedByConnectionCountAsc.mockReturnValue([peer]);
13141316

13151317
// Validator that throws errors for specific transactions
1318+
// eslint-disable-next-line require-await
13161319
const throwingValidator = jest.fn(async (tx: Tx, _peerId: PeerId) => {
13171320
const txIndex = missing.findIndex(h => h.equals(tx.txHash));
13181321

@@ -1496,6 +1499,7 @@ describe('BatchTxRequester', () => {
14961499
]);
14971500

14981501
let pinnedPeerRequestCount = 0;
1502+
// eslint-disable-next-line require-await
14991503
reqresp.sendRequestToPeer.mockImplementation(async (peerId: any, _sub: any, data: any) => {
15001504
const peerStr = peerId.toString();
15011505

@@ -1629,6 +1633,7 @@ describe('BatchTxRequester', () => {
16291633
const validationCalls: Array<{ tx: TxHash; peerId: string }> = [];
16301634
const invalidTxIndices = new Set([1, 6]); // Mark some transactions as invalid
16311635

1636+
// eslint-disable-next-line require-await
16321637
const customTxValidator = jest.fn(async (tx: Tx, peerId: PeerId) => {
16331638
validationCalls.push({ tx: tx.txHash, peerId: peerId.toString() });
16341639
const txIndex = missing.findIndex(h => h.equals(tx.txHash));

0 commit comments

Comments
 (0)