Web3.js: myContract.events.MyEvent is broken in beta.49-51

Created on 29 Mar 2019  路  2Comments  路  Source: ChainSafe/web3.js

Description

I think this issue is related to https://github.com/ethereum/web3.js/issues/2563 but the fix #2574 didn't apply on contract.events methods.

This issue has appeared on beta.49, and still existing on beta.51

Expected behavior

contract.events.Transfer({ fromBlock: fromBlock }, function(error, event) {
  console.log(event);
});

should log events.

Actual behavior

Error log
```
Cannot read property 'currentProvider' of undefined
at GetPastLogsMethod._callee$ (/node_modules/web3-core-method/dist/web3-core-method.cjs.js:97:44)
at tryCatch (/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (/node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at /node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
at new Promise ()
at GetPastLogsMethod. (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
at GetPastLogsMethod.execute (/node_modules/web3-core-method/dist/web3-core-method.cjs.js:122:25)
at EventLogSubscription.subscribe (/node_modules/web3-core-subscriptions/dist/web3-core-subscriptions.cjs.js:106:32)
at EventSubscriptionsProxy.subscribe (/node_modules/web3-eth-contract/dist/web3-eth-contract.cjs.js:602:189)
at Proxy. (/node_modules/web3-eth-contract/dist/web3-eth-contract.cjs.js:583:27)
````

Versions

  • web3.js: 1.0.0-beta.51
  • nodejs: v11.7.0
  • browser: console
  • ethereum node: Infura
bug

Most helpful comment

Thanks for opening this issue! Will fix and release it next week.

All 2 comments

Thanks for opening this issue! Will fix and release it next week.

Thank you for your fast response always :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webersson picture webersson  路  3Comments

ragnu picture ragnu  路  3Comments

praveengupta0895 picture praveengupta0895  路  3Comments

nivida picture nivida  路  3Comments

zamoore picture zamoore  路  3Comments