Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribe to logs is broken in beta.49+ #2563

Closed
csokun opened this issue Mar 25, 2019 · 0 comments · Fixed by #2574
Closed

Subscribe to logs is broken in beta.49+ #2563

csokun opened this issue Mar 25, 2019 · 0 comments · Fixed by #2574
Labels
Bug Addressing a bug

Comments

@csokun
Copy link

csokun commented Mar 25, 2019

Description

Subscribe to logs is broken in beta.49+

Expected behavior

I should be able to subscribe to logs from specified block and specified topics.

Actual behavior

An exception is thrown

Steps to reproduce the behavior

const Web3 = require('web3');
const web3 = new Web3("ws://localhost:8546");

web3.eth.subscribe('logs', { fromBlock: 479095 }, (err, result) => {
  console.log(err, result);
});

Error Logs

TypeError: Cannot read property 'currentProvider' of undefined
    at GetPastLogsMethod._callee$ (/home/sokun/labs/web3js1Test/node_modules/web3-core-method/dist/web3-core-method.cjs.js:97:44)
    at tryCatch (/home/sokun/labs/web3js1Test/node_modules/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (/home/sokun/labs/web3js1Test/node_modules/regenerator-runtime/runtime.js:271:22)
    at Generator.prototype.(anonymous function) [as next] (/home/sokun/labs/web3js1Test/node_modules/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (/home/sokun/labs/web3js1Test/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/home/sokun/labs/web3js1Test/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
    at /home/sokun/labs/web3js1Test/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
    at new Promise (<anonymous>)
    at GetPastLogsMethod.<anonymous> (/home/sokun/labs/web3js1Test/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
    at GetPastLogsMethod.execute (/home/sokun/labs/web3js1Test/node_modules/web3-core-method/dist/web3-core-method.cjs.js:122:25)
    at LogSubscription.subscribe (/home/sokun/labs/web3js1Test/node_modules/web3-core-subscriptions/dist/web3-core-subscriptions.cjs.js:106:32)
    at Proxy.subscribe (/home/sokun/labs/web3js1Test/node_modules/web3-eth/dist/web3-eth.cjs.js:425:77)
    at Object.<anonymous> (/home/sokun/labs/web3js1Test/index.js:4:10)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32) null

Versions

  • web3.js: 1.0.0-beta.49+
  • nodejs: v8.14.0
  • browser: NA
  • ethereum node: geth v1.8.20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants