I want to test off chain data input in truffle testing. So basically I kick off a test and then need to wait for another program to do something. In the old web3, this worked great:
function promisifyLogWatch(_event) {
return new Promise((resolve, reject) => {
_event.watch((error, log) => {
_event.stopWatching();
if (error !== null)
reject(error);
resolve(log);
});
});
}
And I test it in my js file like this:
await promisifyLogWatch(oracle.NewValue({ fromBlock: 'latest' }));
But now I get that _event.watch is not a function. How do I update this for web3 v1?