Skip to content

Commit

Permalink
fix gas l2 using v3
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Jun 7, 2024
1 parent 4fc7d61 commit 4a8542e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests-integration/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("Gifting", function () {
for (const useTxV3 of [false, true]) {
it(`Testing simple claim flow using txV3: ${useTxV3}`, async function () {
const { factory } = await setupGiftProtocol();
const { claim, claimPrivateKey } = await defaultDepositTestSetup(factory);
const { claim, claimPrivateKey } = await defaultDepositTestSetup(factory, useTxV3);
const receiver = randomReceiver();
await claimInternal(claim, receiver, claimPrivateKey);

Expand All @@ -30,22 +30,21 @@ describe("Gifting", function () {

it(`Test max fee too high using txV3: ${useTxV3}`, async function () {
const { factory } = await setupGiftProtocol();
const { claim, claimPrivateKey } = await defaultDepositTestSetup(factory);
const { claim, claimPrivateKey } = await defaultDepositTestSetup(factory, useTxV3);
const receiver = randomReceiver();
if (useTxV3) {
const newResourceBounds = {
l2_gas: {
max_amount: num.toHexString(GIFT_MAX_FEE * 1000n),
max_price_per_unit: num.toHexString(10),
max_amount: num.toHexString(GIFT_MAX_FEE),
max_price_per_unit: num.toHexString(1),
},
l1_gas: {
max_amount: num.toHexString(GIFT_MAX_FEE * 1000n),
max_price_per_unit: num.toHexString(10),
max_amount: num.toHexString(10),
max_price_per_unit: num.toHexString(36000000000n), // Current devnet gas price
},
tip: 1,
};
await expectRevertWithErrorMessage("gift-acc/max-fee-too-high-v3", () =>
claimInternal(claim, receiver, claimPrivateKey, { resourceBounds: newResourceBounds }),
claimInternal(claim, receiver, claimPrivateKey, { resourceBounds: newResourceBounds, tip: 1 }),
);
} else {
await expectRevertWithErrorMessage("gift-acc/max-fee-too-high-v1", () =>
Expand Down

0 comments on commit 4a8542e

Please sign in to comment.