Fix remaining revert reasons.

This commit is contained in:
Nicolás Venturo
2019-04-24 11:25:09 -03:00
parent 3682c6575c
commit 2f8e844514
3 changed files with 6 additions and 7 deletions

View File

@ -15,12 +15,12 @@ function shouldBehaveLikeERC20Capped (minter, [other], cap) {
it('should fail to mint if the amount exceeds the cap', async function () {
await this.token.mint(other, cap.subn(1), { from });
await shouldFail.reverting.withMessage(this.token.mint(other, 2, { from }));
await shouldFail.reverting.withMessage(this.token.mint(other, 2, { from }), 'ERC20Capped: cap exceeded');
});
it('should fail to mint after cap is reached', async function () {
await this.token.mint(other, cap, { from });
await shouldFail.reverting.withMessage(this.token.mint(other, 1, { from }));
await shouldFail.reverting.withMessage(this.token.mint(other, 1, { from }), 'ERC20Capped: cap exceeded');
});
});
}

View File

@ -315,9 +315,8 @@ function shouldBehaveLikeERC721 (
describe('to a contract that does not implement the required function', function () {
it('reverts', async function () {
const invalidReceiver = this.token;
await shouldFail.reverting.withMessage(
this.token.safeTransferFrom(owner, invalidReceiver.address, tokenId, { from: owner }),
'VM Exception while processing transaction: revert'
await shouldFail.reverting(
this.token.safeTransferFrom(owner, invalidReceiver.address, tokenId, { from: owner })
);
});
});
@ -406,7 +405,7 @@ function shouldBehaveLikeERC721 (
context('when the address that receives the approval is the owner', function () {
it('reverts', async function () {
await shouldFail.reverting.withMessage(
this.token.approve(owner, tokenId, { from: owner }), 'ERC721: transfer to current owner'
this.token.approve(owner, tokenId, { from: owner }), 'ERC721: approval to current owner'
);
});
});