Increase testing coverage (#1195)
* Added non-target bounty test * Increased ERC721 testing coverage. * Addressed review comments. * fix linter error * Fixed linter error * Removed unnecessary bouncer require * Improved Crowdsale tests. * Added missing SuperUser test. * Improved payment tests. * Improved token tests. * Fixed ERC721 test. * Reviewed phrasing.
This commit is contained in:
@ -17,7 +17,7 @@ const sendReward = async (from, to, value) => ethSendTransaction({
|
||||
|
||||
const reward = new web3.BigNumber(web3.toWei(1, 'ether'));
|
||||
|
||||
contract('Bounty', function ([_, owner, researcher]) {
|
||||
contract('Bounty', function ([_, owner, researcher, nonTarget]) {
|
||||
context('against secure contract', function () {
|
||||
beforeEach(async function () {
|
||||
this.bounty = await SecureTargetBounty.new({ from: owner });
|
||||
@ -82,6 +82,12 @@ contract('Bounty', function ([_, owner, researcher]) {
|
||||
researcherCurrBalance.sub(researcherPrevBalance).should.be.bignumber.equal(reward.sub(gasCost));
|
||||
});
|
||||
|
||||
it('cannot claim reward from non-target', async function () {
|
||||
await assertRevert(
|
||||
this.bounty.claim(nonTarget, { from: researcher })
|
||||
);
|
||||
});
|
||||
|
||||
context('reward claimed', function () {
|
||||
beforeEach(async function () {
|
||||
await this.bounty.claim(this.targetAddress, { from: researcher });
|
||||
|
||||
Reference in New Issue
Block a user