Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Jun 13, 2024
1 parent 17833c7 commit 0490902
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/token/ERC20/ERC20.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,18 @@ function shouldBehaveLikeERC20(initialSupply, opts = {}) {
});

it('reverts when the token owner is the zero address', async function () {
// transferFrom does a spendAllowance before moving the assets
// - default behavior (ERC20) is to set the update the approval, which will fail because the approver is
// address(0) that happens even if the amount transfered is zero, and the approval update is not actually

Check failure on line 137 in test/token/ERC20/ERC20.behavior.js

View workflow job for this annotation

GitHub Actions / codespell

transfered ==> transferred
// necessary
// - in ERC20TemporaryAllowance, transfer of 0 value will not update allowance (termporary or persisten)

Check failure on line 139 in test/token/ERC20/ERC20.behavior.js

View workflow job for this annotation

GitHub Actions / codespell

termporary ==> temporary

Check failure on line 139 in test/token/ERC20/ERC20.behavior.js

View workflow job for this annotation

GitHub Actions / codespell

persisten ==> persistent
// therefore the spend allowance does not revert. The transfer of asset will however revert because the sender
// is address(0)
const errorName = this.token.temporaryApprove ? 'ERC20InvalidSender' : 'ERC20InvalidApprover';

const value = 0n;
await expect(this.token.connect(this.recipient).transferFrom(ethers.ZeroAddress, this.recipient, value))
.to.be.revertedWithCustomError(this.token, 'ERC20InvalidSender')
.to.be.revertedWithCustomError(this.token, errorName)
.withArgs(ethers.ZeroAddress);
});
});
Expand Down

0 comments on commit 0490902

Please sign in to comment.