Skip to content

Commit

Permalink
Fix failing e2e tests in test_viem_tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Kourin1996 committed Dec 10, 2024
1 parent e649949 commit 8ea1377
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions e2e_test/js-tests/test_viem_tx.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ describe("viem send tx", () => {
assert.equal(receipt.status, "success", "receipt status 'failure'");
}).timeout(10_000);

it.skip("send overlapping nonce tx in different currencies", async () => {
it("send overlapping nonce tx in different currencies", async () => {
const priceBump = 1.1;

const rate = await getRate(process.env.FEE_CURRENCY);
// Native to FEE_CURRENCY
const nativeCap = 30_000_000_000;
const bumpCurrencyCap = rate.toFeeCurrency(BigInt(Math.round(nativeCap * priceBump)));
const failToBumpCurrencyCap = rate.toFeeCurrency(BigInt(
Math.round(nativeCap * priceBump) - 1,
Math.round(nativeCap / priceBump)
));
const tokenCurrency = process.env.FEE_CURRENCY;
const nativeCurrency = null;
Expand All @@ -220,7 +220,7 @@ describe("viem send tx", () => {
const currencyCap = 60_000_000_000;
const bumpNativeCap = rate.toNative(BigInt(Math.round(currencyCap * priceBump)));
const failToBumpNativeCap = rate.toNative(BigInt(
Math.round(currencyCap * priceBump) - 1,
Math.round(currencyCap / priceBump)
));
await testNonceBump(
currencyCap,
Expand All @@ -236,7 +236,7 @@ describe("viem send tx", () => {
nativeCurrency,
false,
);
}).timeout(40_000);
}).timeout(60_000);

it("send tx with unregistered fee currency", async () => {
const request = await walletClient.prepareTransactionRequest({
Expand All @@ -263,7 +263,7 @@ describe("viem send tx", () => {
}
}).timeout(10_000);

it.skip("send fee currency tx with just high enough gas price", async () => {
it("send fee currency tx with just high enough gas price", async () => {
// The idea of this test is to check that the fee currency is taken into
// account by the server. We do this by using a fee currency that has a
// value greater than celo, so that the base fee in fee currency becomes a
Expand Down Expand Up @@ -302,8 +302,8 @@ describe("viem send tx", () => {
});
const receipt = await publicClient.waitForTransactionReceipt({ hash });
assert.equal(receipt.status, "success", "receipt status 'failure'");
assert.isAtMost(receipt.effectiveGasPrice, maxFeePerGas, "effective gas price is too high");
assert.isAbove(receipt.effectiveGasPrice, Number(maxFeePerGas) * 0.7, "effective gas price is too low");
assert.isAtMost(Number(receipt.effectiveGasPrice), Number(maxFeePerGas), "effective gas price is too high");
assert.isAbove(Number(receipt.effectiveGasPrice), Number(maxFeePerGas) * 0.7, "effective gas price is too low");
}).timeout(10_000);
});

Expand Down

0 comments on commit 8ea1377

Please sign in to comment.