Remove code in preparation for v5.0 (#4258)
Co-authored-by: Ernesto García <ernestognw@gmail.com> Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
@ -182,17 +182,6 @@ contract('SafeERC20', function (accounts) {
|
||||
await this.token.$_approve(this.mock.address, spender, 100);
|
||||
});
|
||||
|
||||
it('safeApprove fails to update approval to non-zero', async function () {
|
||||
await expectRevert(
|
||||
this.mock.$safeApprove(this.token.address, spender, 200),
|
||||
'SafeERC20: approve from non-zero to non-zero allowance',
|
||||
);
|
||||
});
|
||||
|
||||
it('safeApprove can update approval to zero', async function () {
|
||||
await this.mock.$safeApprove(this.token.address, spender, 0);
|
||||
});
|
||||
|
||||
it('safeApprove can increase approval', async function () {
|
||||
await expectRevert(this.mock.$safeIncreaseAllowance(this.token.address, spender, 10), 'USDT approval failure');
|
||||
});
|
||||
@ -217,10 +206,6 @@ function shouldRevertOnAllCalls([receiver, spender], reason) {
|
||||
await expectRevert(this.mock.$safeTransferFrom(this.token.address, this.mock.address, receiver, 0), reason);
|
||||
});
|
||||
|
||||
it('reverts on approve', async function () {
|
||||
await expectRevert(this.mock.$safeApprove(this.token.address, spender, 0), reason);
|
||||
});
|
||||
|
||||
it('reverts on increaseAllowance', async function () {
|
||||
// [TODO] make sure it's reverting for the right reason
|
||||
await expectRevert.unspecified(this.mock.$safeIncreaseAllowance(this.token.address, spender, 0));
|
||||
@ -269,16 +254,6 @@ function shouldOnlyRevertOnErrors([owner, receiver, spender]) {
|
||||
await this.token.$_approve(this.mock.address, spender, 0);
|
||||
});
|
||||
|
||||
it("doesn't revert when approving a non-zero allowance", async function () {
|
||||
await this.mock.$safeApprove(this.token.address, spender, 100);
|
||||
expect(await this.token.allowance(this.mock.address, spender)).to.be.bignumber.equal('100');
|
||||
});
|
||||
|
||||
it("doesn't revert when approving a zero allowance", async function () {
|
||||
await this.mock.$safeApprove(this.token.address, spender, 0);
|
||||
expect(await this.token.allowance(this.mock.address, spender)).to.be.bignumber.equal('0');
|
||||
});
|
||||
|
||||
it("doesn't revert when force approving a non-zero allowance", async function () {
|
||||
await this.mock.$forceApprove(this.token.address, spender, 100);
|
||||
expect(await this.token.allowance(this.mock.address, spender)).to.be.bignumber.equal('100');
|
||||
@ -307,18 +282,6 @@ function shouldOnlyRevertOnErrors([owner, receiver, spender]) {
|
||||
await this.token.$_approve(this.mock.address, spender, 100);
|
||||
});
|
||||
|
||||
it('reverts when approving a non-zero allowance', async function () {
|
||||
await expectRevert(
|
||||
this.mock.$safeApprove(this.token.address, spender, 20),
|
||||
'SafeERC20: approve from non-zero to non-zero allowance',
|
||||
);
|
||||
});
|
||||
|
||||
it("doesn't revert when approving a zero allowance", async function () {
|
||||
await this.mock.$safeApprove(this.token.address, spender, 0);
|
||||
expect(await this.token.allowance(this.mock.address, spender)).to.be.bignumber.equal('0');
|
||||
});
|
||||
|
||||
it("doesn't revert when force approving a non-zero allowance", async function () {
|
||||
await this.mock.$forceApprove(this.token.address, spender, 20);
|
||||
expect(await this.token.allowance(this.mock.address, spender)).to.be.bignumber.equal('20');
|
||||
|
||||
Reference in New Issue
Block a user