Skip to content

Commit

Permalink
strategic waiting
Browse files Browse the repository at this point in the history
Signed-off-by: Danno Ferrin <[email protected]>
  • Loading branch information
shemnon committed Jul 23, 2022
1 parent c312825 commit 3e10ae6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/server/tests/acceptance/erc20.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ describe('ERC20 Acceptance Tests', async function () {

it ('@release contract owner transfers tokens', async function () {
tx = await contract.connect(tokenOwnerWallet).transfer(to, amount);
await tx.wait();
const ownerBalance = await contract.balanceOf(tokenOwner);
const toBalance = await contract.balanceOf(to);
expect(ownerBalance.toString()).to.be.equal('0');
Expand All @@ -165,7 +164,6 @@ describe('ERC20 Acceptance Tests', async function () {

it ('other account transfers tokens back to owner', async function () {
tx = await contract.connect(toWallet).transfer(tokenOwner, amount);
await tx.wait();
const ownerBalance = await contract.balanceOf(tokenOwner);
const toBalance = await contract.balanceOf(to);
expect(ownerBalance.toString()).to.be.equal(amount.toString());
Expand Down Expand Up @@ -281,13 +279,11 @@ describe('ERC20 Acceptance Tests', async function () {

describe('@release when the spender has unlimited allowance', function () {
beforeEach(async function () {
const tx = await contract.connect(tokenOwnerWallet).approve(spender, ethers.constants.MaxUint256);
await tx.wait();
await contract.connect(tokenOwnerWallet).approve(spender, ethers.constants.MaxUint256);
});

it('does not decrease the spender allowance', async function () {
const tx = await contract.connect(spenderWallet).transferFrom(tokenOwner, to, 1);
await tx.wait();
await contract.connect(spenderWallet).transferFrom(tokenOwner, to, 1);
const allowance = await contract.allowance(tokenOwner, spender);
expect(allowance.toString()).to.be.equal(ethers.constants.MaxUint256.toString());
});
Expand All @@ -307,8 +303,7 @@ describe('ERC20 Acceptance Tests', async function () {
amount = initialSupply;
to = ethers.constants.AddressZero;
tokenOwnerWallet = accounts[0].wallet;
const tx = await contract.connect(tokenOwnerWallet).approve(spender, amount);
await tx.wait();
await contract.connect(tokenOwnerWallet).approve(spender, amount);
});

it('reverts', async function () {
Expand Down

0 comments on commit 3e10ae6

Please sign in to comment.