MetaMask / eth-token-tracker

A JS module for tracking Ethereum token balances over block changes
ISC License
77 stars 43 forks source link

Update dependencies, nodejs to 14, and fix tests #78

Closed legobeat closed 1 year ago

legobeat commented 1 year ago

I was not able to get the original tests passing as-is locally without upgrading some dependencies.

Not sure what's behind the updateCounter diff - perhaps that is indicative of an actual introduced bug?

What's really driving this is also to be able to bump eth-block-tracker and web3-provider-engine, which will be addressed in subsequent PR(s).

Also resolves #50.

EDIT: Something is off here, will have to look into where differing behavior comes from

socket-security[bot] commented 1 year ago

Socket Security Pull Request Report

Dependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again.

📜 Install scripts

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Package Script field Source
@trufflesuite/bigint-buffer@1.1.10 (added) binding.gyp
bufferutil@4.0.5 (added) binding.gyp package.json
leveldown@6.1.0 (added) binding.gyp
utf-8-validate@5.0.7 (added) binding.gyp package.json
@trufflesuite/bigint-buffer@1.1.10 (added) install
keccak@3.0.2 (added) install
secp256k1@4.0.3 (added) install
bufferutil@4.0.5 (added) install package.json
leveldown@6.1.0 (added) install
utf-8-validate@5.0.7 (added) install package.json
🫣 Native code

Contains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs.

Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings.

Package Location Source
@trufflesuite/bigint-buffer@1.1.10 (added) binding.gyp
bufferutil@4.0.5 (added) binding.gyp package.json
leveldown@6.1.0 (added) binding.gyp
utf-8-validate@5.0.7 (added) binding.gyp package.json
Pull request report summary
Issue Status
Install scripts ⚠️ 10 issues
Native code ⚠️ 4 issues
Bin script confusion ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@2.4.2

  • @SocketSecurity ignore @trufflesuite/bigint-buffer@1.1.10
  • @SocketSecurity ignore bufferutil@4.0.5
  • @SocketSecurity ignore leveldown@6.1.0
  • @SocketSecurity ignore utf-8-validate@5.0.7
  • @SocketSecurity ignore keccak@3.0.2

Powered by socket.dev

legobeat commented 1 year ago

From circle. Haven't reproduced locally.

not ok 11 initial balance loaded from last test
  ---
    operator: equal
    expected: '8.9'
    actual:   '890'
    at: TokenTracker.<anonymous> (/home/circleci/project/test/integration/human-standard-token.js:144:16)
    stack: |-
      Error: initial balance loaded from last test
          at Test.assert [as _assert] (/home/circleci/project/node_modules/tape/lib/test.js:226:54)
          at Test.bound [as _assert] (/home/circleci/project/node_modules/tape/lib/test.js:77:32)
          at Test.equal (/home/circleci/project/node_modules/tape/lib/test.js:386:10)
          at Test.bound [as equal] (/home/circleci/project/node_modules/tape/lib/test.js:77:32)
          at TokenTracker.<anonymous> (/home/circleci/project/test/integration/human-standard-token.js:144:16)
          at safeApply (/home/circleci/project/node_modules/safe-event-emitter/index.js:70:5)
          at TokenTracker.SafeEventEmitter.emit (/home/circleci/project/node_modules/safe-event-emitter/index.js:56:5)
          at TokenTracker._update (/home/circleci/project/lib/index.js:107:10)
          at TokenTracker.updateBalances (/home/circleci/project/lib/index.js:63:12)

EDIT: Aha

yarn run v1.22.15
$ tape test/**/*.js
(node:94) V8: /home/circleci/project/node_modules/solc/soljson.js:3 Invalid asm.js: Invalid member of stdlib
(Use `node --trace-warnings ...` to show where the warning was created)yarn run v1.22.15