Skip to content

Commit 3a601ff

Browse files
committed
fix: mempool test
1 parent 5ccbf25 commit 3a601ff

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

tests/api/socket-io.test.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,15 @@ describe('socket-io', () => {
230230
});
231231

232232
test('socket-io > mempool txs', async () => {
233-
process.env.STACKS_MEMPOOL_TX_GARBAGE_COLLECTION_THRESHOLD = '0';
234-
235233
const address = apiServer.address;
236234
const socket = io(`http://${address}`, {
237235
reconnection: false,
238236
query: { subscriptions: 'mempool' },
239237
});
240-
const txWaiters: Waiter<MempoolTransaction | Transaction>[] = [waiter(), waiter()];
238+
const txWaiters: Waiter<MempoolTransaction>[] = [waiter()];
241239
socket.on('mempool', tx => {
242240
if (tx.tx_status === 'pending') {
243241
txWaiters[0].finish(tx);
244-
} else {
245-
txWaiters[1].finish(tx);
246242
}
247243
});
248244

@@ -258,21 +254,9 @@ describe('socket-io', () => {
258254
await db.updateMempoolTxs({ mempoolTxs: [mempoolTx] });
259255
const pendingResult = await txWaiters[0];
260256

261-
const block2 = new TestBlockBuilder({
262-
block_height: 2,
263-
index_block_hash: '0x02',
264-
parent_index_block_hash: '0x01',
265-
})
266-
.addTx({ tx_id: '0x0201' })
267-
.build();
268-
await db.update(block2);
269-
const droppedResult = await txWaiters[1];
270-
271257
try {
272258
expect(pendingResult.tx_id).toEqual('0x01');
273259
expect(pendingResult.tx_status).toEqual('pending');
274-
expect(droppedResult.tx_id).toEqual('0x01');
275-
expect(droppedResult.tx_status).toEqual('dropped_stale_garbage_collect');
276260
} finally {
277261
socket.emit('unsubscribe', 'mempool');
278262
socket.close();

0 commit comments

Comments
 (0)