Merge pull request #203 from ORBAT/fix/bounty-claim-fail-test

Await event handling result in Bounty test
pull/206/head
Manuel Aráoz 8 years ago committed by GitHub
commit 071040f3eb
  1. 5
      test/Bounty.js

@ -52,7 +52,7 @@ contract('Bounty', function(accounts) {
let bounty = await SecureTargetBounty.new();
let event = bounty.TargetCreated({});
event.watch(async function(err, result) {
let watcher = async function(err, result) {
event.stopWatching();
if (err) { throw err; }
@ -77,8 +77,9 @@ contract('Bounty', function(accounts) {
assert.equal(reward,
web3.eth.getBalance(bounty.address).toNumber());
}
});
};
bounty.createTarget({from:researcher});
await awaitEvent(event, watcher);
});
});

Loading…
Cancel
Save