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

Incorrect documentation examples for web3.*.net in v1.2.5. Missing .net. #3348

Closed
ltfschoen opened this issue Jan 30, 2020 · 0 comments · Fixed by #3349
Closed

Incorrect documentation examples for web3.*.net in v1.2.5. Missing .net. #3348

ltfschoen opened this issue Jan 30, 2020 · 0 comments · Fixed by #3349
Labels
1.x 1.0 related issues Documentation Relates to project wiki or documentation

Comments

@ltfschoen
Copy link
Contributor

Expected behavior

When I use the web3.js documentation for version 1.2.5.
If I try this example for isListening, I expect it to tell me to call web3.eth.net.isListening().then(console.log); instead of web3.eth.isListening().then(console.log); (i.e. .net is missing).
Also, I expect this example for getPeerCount() to tell me to call web3.eth.net.getPeerCount().then(console.log); instead of web3.eth.getPeerCount().then(console.log); (i.e. also missing .net)

Actual behavior

The above examples are missing .net in the call, so when a user copies the example they get an error like TypeError: web3.eth.isListening is not a function, since it should be web3.eth.net isListening instead

Steps to reproduce the behavior

View the docs at https://web3js.readthedocs.io/en/v1.2.5/web3-net.html, and try and implement an example.

Logs

Versions

Web3.js 1.2.5
Node 12.7.0
macOS

ltfschoen added a commit to ltfschoen/web3.js that referenced this issue Jan 30, 2020
ltfschoen added a commit to ltfschoen/web3.js that referenced this issue Jan 30, 2020
ltfschoen added a commit to ltfschoen/web3.js that referenced this issue Jan 30, 2020
fix: Fixes web3#3348. Add missing `.net` to documentation examples
@nivida nivida added 1.x 1.0 related issues Documentation Relates to project wiki or documentation labels Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Documentation Relates to project wiki or documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants