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

Unable to call getTransactionCount when running in Browser network #341

Closed
filippsen opened this issue Jan 14, 2019 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@filippsen
Copy link
Contributor

filippsen commented Jan 14, 2019

Environment/Browser

Version 1.4.3

Description

Unable to call or read back results from web3.eth.getTransactionCount when running in Browser network.

Steps to reproduce

  1. Create a new project starting from Hello World template
  2. In app.js, change HelloWorld.prototype.getBlockNumber from calling getBlockNumber to getTransactionCount:
HelloWorld.prototype.getBlockNumber = function(cb) {
    this.web3.eth.getTransactionCount("0xa48f2e0be8ab5a04a5eb1f86ead1923f03a207fd", function(error, result) {
        console.error(error);
        console.log(result);
        cb(error, result);
    });
};
  1. Deploy
  2. Open Show Preview
  3. Observe the browser console output

Expected result

Expected it to return a number.

Actual result

Uncaught Error: new BigNumber() not a number: [object Object]

Hints and reference

This could be a problem in "superprovider" and/or when dealing with BigNumber data directly. Missing data converstion?

https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgettransactioncount

Requirements

Depends on #343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant