small fix on tests (#625)

* small fix on tests

* Update e2e/src/transaction-exclusion.spec.ts

Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Signed-off-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com>

* Update e2e/src/transaction-exclusion.spec.ts

Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Signed-off-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com>

---------

Signed-off-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
This commit is contained in:
Pedro Novais
2025-01-30 09:42:32 +00:00
committed by GitHub
parent b1c8ec57d6
commit c08e2793cc
2 changed files with 13 additions and 11 deletions

View File

@@ -16,21 +16,23 @@ describe("Transaction exclusion test suite", () => {
const l2Account = await l2AccountManager.generateAccount();
const l2AccountLocal = getWallet(l2Account.privateKey, config.getL2BesuNodeProvider()!);
const testContract = config.getL2TestContract(l2AccountLocal)!;
const txRequest: TransactionRequest = {
to: await testContract.getAddress(),
data: testContract.interface.encodeFunctionData("testAddmod", [13000, 31]),
maxPriorityFeePerGas: etherToWei("0.000000001"), // 1 Gwei
maxFeePerGas: etherToWei("0.00000001"), // 10 Gwei
};
const rejectedTxHash = await getTransactionHash(txRequest, l2AccountLocal);
// This shall be rejected by the Besu node due to traces module limit overflow
let rejectedTxHash;
try {
const txRequest: TransactionRequest = {
to: await testContract.getAddress(),
data: testContract.interface.encodeFunctionData("testAddmod", [13000, 31]),
maxPriorityFeePerGas: etherToWei("0.000000001"), // 1 Gwei
maxFeePerGas: etherToWei("0.00000001"), // 10 Gwei
};
rejectedTxHash = await getTransactionHash(txRequest, l2AccountLocal);
// This shall be rejected by the Besu node due to traces module limit overflow
await l2AccountLocal.sendTransaction(txRequest);
} catch (err) {
// This shall return error with traces limit overflow
logger.debug(`sendTransaction expected. error=${JSON.stringify(err)}`);
logger.debug(`sendTransaction expected rejection: ${JSON.stringify(err)}`);
// assert it was indeed rejected by the traces module limit
// @ts-expect-error error is not typed
expect(err.message).toContain("is above the limit");
}
expect(rejectedTxHash).toBeDefined();