Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Randomly wrong order of magnitude in balance tests

Open
#135 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js

Research direction

Start with test/integration/human-standard-token.js around line 143 and review the failing CI run across Node.js 16, 18, and 20. Trace the balance update through lib/index.js, especially updateBalances and _update, and determine whether the failure is caused by the test setup or token balance handling. Done means the cause is identified and the integration test reliably expects the correct balance.

Written by the indexing model from the issue text.

Description

bug help wanted team-wallet-framework

This occurs randomly in CI, and has been for some time. I can not say I'm sure this was ever not happening:

# HumanStandardToken balance changes are emitted
eth_call
eth_call
eth_call
eth_blockNumber
eth_call
not ok 11 initial balance loaded from last test
  ---
    operator: equal
    expected: '8.9'
    actual:   '890'
    at: TokenTracker.<anonymous> (/home/runner/work/eth-token-tracker/eth-token-tracker/test/integration/human-standard-token.js:143:16)
    stack: |-
      Error: initial balance loaded from last test
          at Test.assert [as _assert] (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:312:48)
          at Test.bound [as _assert] (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:95:17)
          at Test.strictEqual (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:476:7)
          at Test.bound [as equal] (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:95:17)
          at TokenTracker.<anonymous> (/home/runner/work/eth-token-tracker/eth-token-tracker/test/integration/human-standard-token.js:143:16)
          at safeApply (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/@metamask/safe-event-emitter/index.js:6:17)
          at TokenTracker.emit (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/@metamask/safe-event-emitter/index.js:54:13)
          at TokenTracker._update (/home/runner/work/eth-token-tracker/eth-token-tracker/lib/index.js:106:10)
          at TokenTracker.updateBalances (/home/runner/work/eth-token-tracker/eth-token-tracker/lib/index.js:62:12)
  ...

As can be seen in that CI run, the same test that fail in the Node.js 18 run passes on both 16 and 20. If retried, it will usually pass. Not currently clear if this is an actual bug or just an issue with the test setup.

Related
  • #128
Dominant language
JavaScript
Stars
81
Forks
41
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MetaMask/eth-token-tracker

All issues in MetaMask/eth-token-tracker

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.