Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error testing in DelayClaimable tests #677

Merged
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
18 changes: 4 additions & 14 deletions test/DelayedClaimble.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

import assertRevert from './helpers/assertRevert';

var DelayedClaimable = artifacts.require('../contracts/ownership/DelayedClaimable.sol');

contract('DelayedClaimable', function (accounts) {
Expand Down Expand Up @@ -42,25 +44,13 @@ contract('DelayedClaimable', function (accounts) {
assert.equal(start, 100);
let pendingOwner = await delayedClaimable.pendingOwner();
assert.equal(pendingOwner, accounts[1]);
var err = null;
try {
await delayedClaimable.claimOwnership({ from: accounts[1] });
} catch (error) {
err = error;
}
assert.isFalse(err.message.search('revert') === -1);
await assertRevert(delayedClaimable.claimOwnership({ from: accounts[1] }));
let owner = await delayedClaimable.owner();
assert.isTrue(owner !== accounts[1]);
});

it('set end and start invalid values fail', async function () {
await delayedClaimable.transferOwnership(accounts[1]);
var err = null;
try {
await delayedClaimable.setLimits(1001, 1000);
} catch (error) {
err = error;
}
assert.isFalse(err.message.search('revert') === -1);
await assertRevert(delayedClaimable.setLimits(1001, 1000));
});
});