From 56b6b96679b35bf957fd06ca9008afcf667fdc83 Mon Sep 17 00:00:00 2001 From: Owen Craston Date: Wed, 6 Mar 2024 23:35:59 -0800 Subject: [PATCH] downgrade ethereumjs-util 7.0.1 to resolve BN.js issues --- app/components/Nav/App/index.js | 2 ++ app/util/number/index.test.ts | 2 +- package.json | 2 +- yarn.lock | 15 ++++++++------- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/components/Nav/App/index.js b/app/components/Nav/App/index.js index 63643ce2a645..a0fd73665c91 100644 --- a/app/components/Nav/App/index.js +++ b/app/components/Nav/App/index.js @@ -256,10 +256,12 @@ const App = ({ userLoggedIn }) => { // TODO remove this useEffect before merging useEffect(() => { + // eslint-disable-next-line no-console console.log( 'Accounts/ AccountController', JSON.stringify(Engine.context.AccountsController.state, null, 2), ); + // eslint-disable-next-line no-console console.log( 'Accounts/ PreferencesController', JSON.stringify(Engine.context.PreferencesController, null, 2), diff --git a/app/util/number/index.test.ts b/app/util/number/index.test.ts index 4fbbcc0edff0..4f85fe775aa0 100644 --- a/app/util/number/index.test.ts +++ b/app/util/number/index.test.ts @@ -97,7 +97,7 @@ describe('Number utils :: toWei', () => { expect(() => toWei(new BN(1.337e18))).toThrow(Error); expect(() => toWei(new BN(1337000000000000000))).toThrow(Error); // For some reason this returns 8338418000000000000000000 wei - expect(() => toWei(new BN('1.337e18'))).not.toEqual( + expect(toWei(new BN('1.337e18'))).not.toEqual( '1337000000000000000000000000000000000', ); }); diff --git a/package.json b/package.json index 1ad0aea395d6..51ed3f5d9698 100644 --- a/package.json +++ b/package.json @@ -222,7 +222,7 @@ "eth-rpc-errors": "^4.0.3", "eth-url-parser": "1.0.4", "ethereumjs-abi": "0.6.6", - "ethereumjs-util": "7.0.10", + "ethereumjs-util": "7.0.1", "ethers": "^5.0.14", "ethjs-contract": "0.2.3", "ethjs-ens": "2.0.1", diff --git a/yarn.lock b/yarn.lock index d7ff1cb34e4a..d2bc6555a544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15759,17 +15759,18 @@ ethereumjs-tx@^2.1.1: ethereumjs-common "^1.5.0" ethereumjs-util "^6.0.0" -ethereumjs-util@7.0.10: - version "7.0.10" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz#5fb7b69fa1fda0acc59634cf39d6b0291180fc1f" - integrity sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw== +ethereumjs-util@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.1.tgz#6545ec23924eb1e3bd476bfa1f90de5f87bdfbad" + integrity sha512-qp5ZwQEUC+ZV9ESeQT3gBHivGjygYVrNc2xR170HabUFQiOSb9t+Kby0FinOAPq+/pxKkiib8HfoIAy+BEi91Q== dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" + "@types/bn.js" "^4.11.3" + bn.js "^4.11.8" create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" ethjs-util "0.1.6" + keccak "^3.0.0" rlp "^2.2.4" + secp256k1 "^4.0.1" ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.5: version "5.2.1"