Skip to content

Commit

Permalink
deps: ethereumjs-util@^7.1.5->@ethereumjs/util@^8.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Oct 24, 2024
1 parent e5297a9 commit a6e2bb1
Show file tree
Hide file tree
Showing 37 changed files with 41 additions and 43 deletions.
2 changes: 1 addition & 1 deletion app/components/UI/AccountFromToInfoCard/AddressFrom.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { useSelector } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AddCustomCollectible/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { fontStyles } from '../../../styles/common';
import Engine from '../../../core/Engine';
import { strings } from '../../../../locales/i18n';
import { isValidAddress } from 'ethereumjs-util';
import { isValidAddress } from '@ethereumjs/util';
import ActionView from '../ActionView';
import { isSmartContractAddress } from '../../../util/transactions';
import Device from '../../../util/device';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AddCustomToken/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { fontStyles } from '../../../styles/common';
import Engine from '../../../core/Engine';
import PropTypes from 'prop-types';
import { strings } from '../../../../locales/i18n';
import { isValidAddress } from 'ethereumjs-util';
import { isValidAddress } from '@ethereumjs/util';
import { isSmartContractAddress } from '../../../util/transactions';
import { MetaMetricsEvents } from '../../../core/Analytics';

Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import React, { useEffect, useMemo, useState } from 'react';
import { useSelector } from 'react-redux';

Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetOverview/AboutAsset/AboutAsset.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import React from 'react';
import { DimensionValue, View } from 'react-native';
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetOverview/AssetOverview.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import AssetOverview from './AssetOverview';
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import renderWithProvider from '../../../util/test/renderWithProvider';
import { backgroundState } from '../../../util/test/initial-root-state';
import { NetworkController } from '@metamask/network-controller';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetOverview/AssetOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import React, { useCallback, useEffect } from 'react';
import { Platform, TouchableOpacity, View } from 'react-native';
import { useDispatch, useSelector } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import React from 'react';
import { View } from 'react-native';
import { useSelector } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/PaymentRequest/AssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fontStyles } from '../../../../styles/common';
import Identicon from '../../Identicon';
import NetworkMainAssetLogo from '../../NetworkMainAssetLogo';
import { useSelector } from 'react-redux';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { useTheme } from '../../../../util/theme';
import { selectTokenList } from '../../../../selectors/tokenListController';

Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Swaps/components/TokenSelectModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
import FAIcon from 'react-native-vector-icons/FontAwesome5';
import Fuse from 'fuse.js';
import { connect } from 'react-redux';
import { isValidAddress } from 'ethereumjs-util';
import { isValidAddress } from '@ethereumjs/util';

import Device from '../../../../util/device';
import {
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Tokens/TokenList/TokenListItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { View } from 'react-native';
import { Hex } from '@metamask/utils';
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import { useSelector } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import useTokenBalancesController from '../../../../hooks/useTokenBalancesController/useTokenBalancesController';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionElement/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
TRANSACTION_TYPES,
calculateEIP1559GasFeeHexes,
} from '../../../util/transactions';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { swapsUtils } from '@metamask/swaps-controller';
import { isSwapsNativeAsset } from '../Swaps/utils';
import { toLowerCaseEquals } from '../../../util/general';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/QRScanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';
import { useNavigation } from '@react-navigation/native';
import { parse } from 'eth-url-parser';
import { isValidAddress } from 'ethereumjs-util';
import { isValidAddress } from '@ethereumjs/util';
import React, { useCallback, useRef } from 'react';
import { Alert, Image, InteractionManager, View, Linking } from 'react-native';
import Text, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import PropTypes from 'prop-types';
import { getEditableOptions } from '../../../../UI/Navbar';
import StyledButton from '../../../../UI/StyledButton';
import Engine from '../../../../../core/Engine';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { connect } from 'react-redux';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import { strings } from '../../../../../../locales/i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Account } from '../../../../components/hooks/useAccounts/useAccounts.ty
import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../../util/test/accountsControllerTestUtils';
import { Hex } from '@metamask/utils';
import { KeyringTypes } from '@metamask/keyring-controller';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { RootState } from '../../../../reducers';
import { backgroundState } from '../../../../util/test/initial-root-state';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
renderFromWei,
toHexadecimal,
} from '../../../../../../util/number';
import { isValidAddress, addHexPrefix } from 'ethereumjs-util';
import { isValidAddress, addHexPrefix } from '@ethereumjs/util';
import BN from 'bnjs4';
import { strings } from '../../../../../../../locales/i18n';
import { connect } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/confirmations/Send/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
fromWei,
fromTokenMinimalUnit,
} from '../../../../util/number';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { strings } from '../../../../../locales/i18n';
import { getTransactionOptionsTitle } from '../../../UI/Navbar';
import { connect } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Fragment, PureComponent } from 'react';
import { View, ScrollView, Alert, Platform, BackHandler } from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { SafeAreaView } from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/FontAwesome';
import AddressList from '../AddressList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { useSelector } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import EthereumAddress from '../../../../../UI/EthereumAddress';
import Engine from '../../../../../../core/Engine';
import { MetaMetricsEvents } from '../../../../../../core/Analytics';

import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { connect } from 'react-redux';
import StyledButton from '../../../../../UI/StyledButton';
import Text from '../../../../../../component-library/components/Texts/Text';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/confirmations/hooks/useAccountInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { useMemo } from 'react';
import { useSelector } from 'react-redux';

Expand Down
2 changes: 1 addition & 1 deletion app/components/hooks/useAccounts/useAccounts.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderHook, act } from '@testing-library/react-hooks';
import { KeyringTypes } from '@metamask/keyring-controller';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import useAccounts from './useAccounts';
import { backgroundState } from '../../../util/test/initial-root-state';
import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils';
Expand Down
2 changes: 1 addition & 1 deletion app/components/hooks/useExistingAddress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import { useSelector } from 'react-redux';

import { selectChainId } from '../../selectors/networkController';
Expand Down
2 changes: 1 addition & 1 deletion app/core/Engine.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Engine from './Engine';
import { backgroundState } from '../util/test/initial-root-state';
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import { createMockAccountsControllerState } from '../util/test/accountsControllerTestUtils';
import { mockNetworkState } from '../util/test/network';

Expand Down
2 changes: 1 addition & 1 deletion app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ import { selectShouldUseSmartTransaction } from '../selectors/smartTransactionsC
import { selectSwapsChainFeatureFlags } from '../reducers/swaps';
import { SmartTransactionStatuses } from '@metamask/smart-transactions-controller/dist/types';
import { submitSmartTransactionHook } from '../util/smart-transactions/smart-publish-hook';
import { zeroAddress } from 'ethereumjs-util';
import { zeroAddress } from '@ethereumjs/util';
import { ApprovalType, toChecksumHexAddress } from '@metamask/controller-utils';
import { ExtendedControllerMessenger } from './ExtendedControllerMessenger';
import EthQuery from '@metamask/eth-query';
Expand Down
2 changes: 1 addition & 1 deletion app/core/RPCMethods/wallet_watchAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TOKEN_NOT_VALID,
} from '../../constants/error';
import { selectChainId } from '../../selectors/networkController';
import { isValidAddress } from 'ethereumjs-util';
import { isValidAddress } from '@ethereumjs/util';
import { JsonRpcRequest, PendingJsonRpcResponse } from 'json-rpc-engine';
import { toChecksumHexAddress } from '@metamask/controller-utils';

Expand Down
2 changes: 1 addition & 1 deletion app/core/SanitizationMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JsonRpcMiddleware, JsonRpcRequest } from 'json-rpc-engine';
import { addHexPrefix } from 'ethereumjs-util';
import { addHexPrefix } from '@ethereumjs/util';

// We use this to clean any custom params from the txParams
// TODO: Update this to allow `blockhash` (used by `eth_getLogs`) and EIP-1559
Expand Down
2 changes: 1 addition & 1 deletion app/store/migrations/029.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { toHex } from '@metamask/controller-utils';
import { Hex, hasProperty, isObject } from '@metamask/utils';
import { regex } from '../../../app/util/regex';

import { isHexString } from 'ethereumjs-util';
import { isHexString } from '@ethereumjs/util';
import { TransactionParams } from '@metamask/transaction-controller';
import { captureException } from '@sentry/react-native';
import {
Expand Down
2 changes: 1 addition & 1 deletion app/store/migrations/031.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isHexString } from '@ethereumjs/util';
import { hasProperty, isObject } from '@metamask/utils';
import { captureException } from '@sentry/react-native';
import {
Expand All @@ -6,7 +7,6 @@ import {
TokensControllerState,
} from '@metamask/assets-controllers';
import { toHex } from '@metamask/controller-utils';
import { isHexString } from 'ethereumjs-util';

/**
* This migration is to address the users that were impacted by the tokens missing on their wallet
Expand Down
4 changes: 2 additions & 2 deletions app/util/address/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
addHexPrefix,
isValidChecksumAddress,
isHexPrefixed,
} from 'ethereumjs-util';
} from '@ethereumjs/util';
import punycode from 'punycode/punycode';
import ExtendedKeyringTypes from '../../constants/keyringTypes';
import Engine from '../../core/Engine';
Expand Down Expand Up @@ -342,7 +342,7 @@ export function safeToChecksumAddress(address: string) {

/**
* Validates that the input is a hex address. This utility method is a thin
* wrapper around ethereumjs-util.isValidAddress, with the exception that it
* wrapper around @ethereumjs/util.isValidAddress, with the exception that it
* does not throw an error when provided values that are not hex strings. In
* addition, and by default, this method will return true for hex strings that
* meet the length requirement of a hex address, but are not prefixed with `0x`
Expand Down
2 changes: 1 addition & 1 deletion app/util/checkAddress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AddressBookControllerState } from '@metamask/address-book-controller';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';

/**
* Check whether the recipient of the given transaction is included in
Expand Down
2 changes: 1 addition & 1 deletion app/util/conversion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import BigNumber from 'bignumber.js';
import BN from 'bnjs4';

import { stripHexPrefix } from 'ethereumjs-util';
import { stripHexPrefix } from '@ethereumjs/util';

// Big Number Constants
const BIG_NUMBER_WEI_MULTIPLIER = new BigNumber('1000000000000000000');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable import/no-namespace */
import createMockStore from 'redux-mock-store';
import { act, renderHook } from '@testing-library/react-hooks';
import { toChecksumAddress } from 'ethereumjs-util';
import { toChecksumAddress } from '@ethereumjs/util';
import React from 'react';
import { Provider } from 'react-redux';
import { updateAccountState } from '../../../core/redux/slices/notifications';
Expand Down
2 changes: 1 addition & 1 deletion app/util/number/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Collection of utility functions for consistent formatting and conversion
*/
import { stripHexPrefix } from 'ethereumjs-util';
import { stripHexPrefix } from '@ethereumjs/util';
import BN4 from 'bnjs4';
import { utils as ethersUtils } from 'ethers';
import convert from '@metamask/ethjs-unit';
Expand Down
2 changes: 1 addition & 1 deletion app/util/transactions/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addHexPrefix, toChecksumAddress } from 'ethereumjs-util';
import { addHexPrefix, toChecksumAddress } from '@ethereumjs/util';
import BN from 'bnjs4';
import { rawEncode, rawDecode } from 'ethereumjs-abi';
import BigNumber from 'bignumber.js';
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
},
"dependencies": {
"@consensys/on-ramp-sdk": "1.28.5",
"@ethereumjs/util": "^8.1.0",
"@keystonehq/bc-ur-registry-eth": "^0.19.1",
"@keystonehq/metamask-airgapped-keyring": "^0.13.1",
"@keystonehq/ur-decoder": "^0.12.2",
Expand Down Expand Up @@ -245,7 +246,6 @@
"eth-json-rpc-middleware": "4.3.0",
"eth-url-parser": "1.0.4",
"ethereumjs-abi": "^0.6.8",
"ethereumjs-util": "^7.1.5",
"ethers": "^5.0.14",
"ethjs-ens": "2.0.1",
"eventemitter2": "^6.4.9",
Expand Down Expand Up @@ -560,8 +560,6 @@
"detox": true,
"detox>bunyan>dtrace-provider": false,
"eciesjs>secp256k1": true,
"ethereumjs-util>keccak": true,
"ethereumjs-util>secp256k1": true,
"ganache>@trufflesuite/bigint-buffer": false,
"ganache>bufferutil": false,
"ganache>keccak": true,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9457,9 +9457,9 @@
"@types/node" "*"

"@types/bn.js@^5.1.0", "@types/bn.js@^5.1.5":
version "5.1.5"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0"
integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==
version "5.1.6"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.6.tgz#9ba818eec0c85e4d3c679518428afdf611d03203"
integrity sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==
dependencies:
"@types/node" "*"

Expand Down Expand Up @@ -17253,7 +17253,7 @@ ethereumjs-util@^6.0.0:
ethjs-util "0.1.6"
rlp "^2.2.3"

ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.8, ethereumjs-util@^7.1.2, ethereumjs-util@^7.1.5:
ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.8, ethereumjs-util@^7.1.2:
version "7.1.5"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181"
integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==
Expand Down

0 comments on commit a6e2bb1

Please sign in to comment.