Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Source: openzeppelin-contracts
// Source: https://github.com/OpenZeppelin/openzeppelin-contracts

const {
BN,
Expand Down Expand Up @@ -106,9 +106,9 @@ function shouldBehaveLikeERC20(
);

expectEvent.inLogs(logs, "Transfer", {
_from: tokenOwner,
_to: to,
_value: amount
from: tokenOwner,
to: to,
value: amount
});
});

Expand All @@ -121,9 +121,9 @@ function shouldBehaveLikeERC20(
);

expectEvent.inLogs(logs, "Approval", {
_owner: tokenOwner,
_spender: spender,
_value: await this.token.allowance(tokenOwner, spender)
owner: tokenOwner,
spender: spender,
value: await this.token.allowance(tokenOwner, spender)
});
});
});
Expand All @@ -132,10 +132,11 @@ function shouldBehaveLikeERC20(
const amount = initialSupply.addn(1);

it("reverts", async function() {
await expectRevert.unspecified(
await expectRevert(
this.token.transferFrom(tokenOwner, to, amount, {
from: spender
})
}),
"SafeMath: subtraction overflow -- Reason given: SafeMath: subtraction overflow."
);
});
});
Expand All @@ -152,10 +153,11 @@ function shouldBehaveLikeERC20(
const amount = initialSupply;

it("reverts", async function() {
await expectRevert.unspecified(
await expectRevert(
this.token.transferFrom(tokenOwner, to, amount, {
from: spender
})
}),
"SafeMath: subtraction overflow -- Reason given: SafeMath: subtraction overflow."
);
});
});
Expand All @@ -164,10 +166,11 @@ function shouldBehaveLikeERC20(
const amount = initialSupply.addn(1);

it("reverts", async function() {
await expectRevert.unspecified(
await expectRevert(
this.token.transferFrom(tokenOwner, to, amount, {
from: spender
})
}),
"SafeMath: subtraction overflow -- Reason given: SafeMath: subtraction overflow."
);
});
});
Expand All @@ -185,7 +188,7 @@ function shouldBehaveLikeERC20(
it("reverts", async function() {
await expectRevert(
this.token.transferFrom(tokenOwner, to, amount, { from: spender }),
`${errorPrefix}: send to the zero address`
`${errorPrefix}: transfer to the zero address`
);
});
});
Expand All @@ -199,7 +202,7 @@ function shouldBehaveLikeERC20(
it("reverts", async function() {
await expectRevert(
this.token.transferFrom(tokenOwner, to, amount, { from: spender }),
`${errorPrefix}: send from the zero address`
`${errorPrefix}: transfer from the zero address`
);
});
});
Expand Down Expand Up @@ -230,7 +233,10 @@ function shouldBehaveLikeERC20Transfer(
const amount = balance.addn(1);

it("reverts", async function() {
await expectRevert.unspecified(transfer.call(this, from, to, amount));
await expectRevert(
transfer.call(this, from, to, amount),
"SafeMath: subtraction overflow -- Reason given: SafeMath: subtraction overflow."
);
});
});

Expand All @@ -249,9 +255,9 @@ function shouldBehaveLikeERC20Transfer(
const { logs } = await transfer.call(this, from, to, amount);

expectEvent.inLogs(logs, "Transfer", {
_from: from,
_to: to,
_value: amount
from,
to,
value: amount
});
});
});
Expand All @@ -271,9 +277,9 @@ function shouldBehaveLikeERC20Transfer(
const { logs } = await transfer.call(this, from, to, amount);

expectEvent.inLogs(logs, "Transfer", {
_from: from,
_to: to,
_value: amount
from,
to,
value: amount
});
});
});
Expand All @@ -283,7 +289,7 @@ function shouldBehaveLikeERC20Transfer(
it("reverts", async function() {
await expectRevert(
transfer.call(this, from, ZERO_ADDRESS, balance),
`${errorPrefix}: send to the zero address`
`${errorPrefix}: transfer to the zero address`
);
});
});
Expand All @@ -304,9 +310,9 @@ function shouldBehaveLikeERC20Approve(
const { logs } = await approve.call(this, owner, spender, amount);

expectEvent.inLogs(logs, "Approval", {
_owner: owner,
_spender: spender,
_value: amount
owner: owner,
spender: spender,
value: amount
});
});

Expand Down Expand Up @@ -342,9 +348,9 @@ function shouldBehaveLikeERC20Approve(
const { logs } = await approve.call(this, owner, spender, amount);

expectEvent.inLogs(logs, "Approval", {
_owner: owner,
_spender: spender,
_value: amount
owner: owner,
spender: spender,
value: amount
});
});

Expand Down
Loading