diff --git a/src/eventSyncer.js b/src/eventSyncer.js index 0b50b17..aa8a732 100644 --- a/src/eventSyncer.js +++ b/src/eventSyncer.js @@ -85,12 +85,11 @@ class EventSyncer { // TODO: use call args from user let method = contractInstance.methods[propName].apply(contractInstance.methods[propName], []) - method.call.apply(method.call, [{}, (err, result) => { sub.next(result) }]) - this.web3.eth.subscribe('newBlockHeaders', (error, result) => { + this.web3.subscribe('newBlockHeaders', (error, result) => { method.call.apply(method.call, [({}), (err, result) => { sub.next(result) }]) diff --git a/test/test3.js b/test/test3.js index c82817c..45706bb 100644 --- a/test/test3.js +++ b/test/test3.js @@ -128,7 +128,6 @@ async function deployContract() { async function run() { let accounts = await eth.getAccounts(); var SimpleStorageContract = await deployContract() - console.dir(SimpleStorageContract) console.dir(SimpleStorageContract.options.address) // var subscription = web3.eth.subscribe('logs', {