Skip to content

Commit

Permalink
test: add case for eth_getLogs with more than 16 addresses filtered (#…
Browse files Browse the repository at this point in the history
…2986)

* add test case

* fmt

* increase addresses to new limit

Co-authored-by: Rodrigo Quelhas <[email protected]>

---------

Co-authored-by: Rodrigo Quelhas <[email protected]>
  • Loading branch information
pLabarta and RomarQ authored Oct 7, 2024
1 parent 55a2bbe commit c5f63bd
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions test/suites/smoke/test-old-regressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { encodeFunctionData, Hash } from "viem";
import moonbaseSamples from "../../helpers/moonbase-tracing-samples.json";
import moonbeamSamples from "../../helpers/moonbeam-tracing-samples.json";
import moonriverSamples from "../../helpers/moonriver-tracing-samples.json";
import { generateKeyringPair } from "@moonwall/util";

interface Sample {
network: string;
Expand Down Expand Up @@ -134,11 +135,7 @@ describeSuite({
try {
expect(result.data).to.contain("0x");
} catch (e) {
log(
`Error found for ${testCase.issue} at block ${testCase.block.toString()}: ${
result.data
}`
);
log(`${testCase.issue}: error at block ${testCase.block.toString()}: ${result.data}`);
throw e;
}
}
Expand Down Expand Up @@ -200,6 +197,25 @@ describeSuite({
});
},
});

it({
id: "C004",
title: "Moonriver: eth_getLogs with more than 16 addresses filtered should return logs",
chainType: "moonriver",
test: async function () {
const addresses = Array.from({ length: 1024 }, () => generateKeyringPair()).map(
(a) => a.address as `0x${string}`
);

// Original case identified at this particular block height
const logs = await context.viem().getLogs({
fromBlock: 7970232n,
toBlock: 7970232n,
address: addresses,
});
log(`Logs found: ${logs.length}`);
},
});
},
});

Expand Down

0 comments on commit c5f63bd

Please sign in to comment.