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

Fetching nonce for a pristine account returns 0, which is erroneously translated as an error. #110

Closed
bashlund opened this issue Nov 7, 2019 · 0 comments · Fixed by #111
Assignees
Labels
bug Something isn't working

Comments

@bashlund
Copy link
Contributor

bashlund commented Nov 7, 2019

Environment/Browser

Chromium

Description

In the Superprovider there is a function to fetch the nonce of the selected account.
If this is a new account the nonce is 0, and that is interpreted as an error since the if statement is vague.

const nonce = await this.getNonce(this.selectedEnvironment.endpoint, this.selectedAccount.address)
    .catch((err) => console.log(err));
    if (!nonce) {
        alert('The nonce could not be fetched');
        return;
    }

Steps to reproduce

  1. Deploy a CryptoPizza template
  2. Deploy using Default account
  3. Switch to new pristine account
  4. Create a new pizza
  5. See the error alert popup.

Expected result

Nonce for pristine accounts are 0 and that should not be interpreted as an error.

Actual result

For pristine accounts the application fails posting a transaction from preview.

Reproducible

Yes, if using the fixed features where the correct account is set in the preview (#86)

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

Successfully merging a pull request may close this issue.

1 participant