Skip to content

Commit

Permalink
codefactor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YouStillAlive committed Dec 5, 2024
1 parent 5f55e3d commit db58368
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/3_Fee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ describe('Fee Helper Test', function () {
const oldBal = await ethers.provider.getBalance(await payer.getAddress());
const feePaid = await feeHelper.connect(payer).MethodWithFee.staticCall({ gasPrice: gasPrice });
const tx = await feeHelper.connect(payer).MethodWithFee({ gasPrice: gasPrice });
const txReceipt = (await tx.wait()) as any;
const txReceipt = await tx.wait()
const actualBal = await payer.provider.getBalance(await payer.getAddress());
const gasCost = ethers.toBigInt(txReceipt.gasUsed) * ethers.toBigInt(tx.gasPrice)
const expectedBal = oldBal - gasCost;
expect(actualBal).to.be.equal(expectedBal);
expect(feePaid).to.be.equal(0);
if (txReceipt) {
const gasCost = ethers.toBigInt(txReceipt.gasUsed) * ethers.toBigInt(tx.gasPrice)
const expectedBal = oldBal - gasCost;
expect(actualBal).to.be.equal(expectedBal);
expect(feePaid).to.be.equal(0);
}
});

describe('test ERC20 token', async () => {
Expand Down

0 comments on commit db58368

Please sign in to comment.