Skip to content

Commit

Permalink
increase gas limits
Browse files Browse the repository at this point in the history
  • Loading branch information
jewei1997 committed Oct 29, 2024
1 parent 1cc0cec commit fc14398
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions contracts/test/ERC20toCW20PointerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ describe("ERC20 to CW20 Pointer", function () {
});

describe("transfer()", function () {
it.only("should transfer", async function () {
it("should transfer", async function () {
let sender = accounts[0];
let recipient = accounts[1];

expect(await pointer.balanceOf(sender.evmAddress)).to.equal(balances.account0);
expect(await pointer.balanceOf(recipient.evmAddress)).to.equal(balances.account1);

const tx = await pointer.transfer(recipient.evmAddress, 1);
const tx = await pointer.transfer(recipient.evmAddress, 1, {
gasPrice: ethers.parseUnits('100', 'gwei'),
gasLimit: 200000
});
const receipt = await tx.wait();
const blockNumber = receipt.blockNumber;

Expand Down Expand Up @@ -156,7 +159,7 @@ describe("ERC20 to CW20 Pointer", function () {

it("transfer to contract address should succeed", async function () {
const contract = await pointer.getAddress();
const tx = await pointer.transfer(contract, 1);
const tx = await pointer.transfer(contract, 1, { gasPrice: ethers.parseUnits('100', 'gwei') });
await tx.wait();
});
});
Expand All @@ -166,8 +169,8 @@ describe("ERC20 to CW20 Pointer", function () {
const owner = accounts[0].evmAddress;
const spender = accounts[1].evmAddress;
const blockNumber = await ethers.provider.getBlockNumber();
const tx = await pointer.approve(spender, 1000000);
const receipt = await tx.wait();
const tx = await pointer.approve(spender, 1000000, { gasPrice: ethers.parseUnits('100', 'gwei'), gasLimit: 400000 });
await tx.wait();
const allowance = await pointer.allowance(owner, spender);
expect(Number(allowance)).to.equal(1000000);

Expand Down

0 comments on commit fc14398

Please sign in to comment.