Created
December 8, 2017 14:44
-
-
Save celeduc/42c89f317ac313f66390b465fab3ace2 to your computer and use it in GitHub Desktop.
How to watch a solidity event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a bonded verifier should be able to publish a verification | |
it('should let a bonded verifier publish a verification', async function(){ | |
var debugEvent = verifierDb.Debug(); | |
debugEvent.watch((err, e) => { | |
console.log('verifierRegistry.address:'); | |
console.log(verifierRegistry.address); | |
console.log('verifier.address:'); | |
console.log(verifier.address); | |
console.log('verifier1:'); | |
console.log(verifier1); | |
console.log(err); | |
console.log(e); | |
}); | |
var amount = new web3.BigNumber(web3.toWei(.01, 'ether')); | |
// starting with a new deposition | |
var depo = await verifier.publishDeposition("QmVpYa8krJAdwDEcHcWVwyg2vznS3MoAXycaLHmqPWkn8j", {from: verifier1, value: amount}); | |
console.log(depo); | |
console.log(depo.receipt.logs[0]); | |
console.log(depo.receipt.logs[1]); | |
console.log(depo.receipt.logs[2]); | |
console.log(depo.receipt.logs[3]); | |
console.log(depo.receipt.logs[4]); | |
// debugEvent.stopWatching(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment