Skip to content

Commit a1e80e6

Browse files
committed
fix: use BN from bn.js instead of ethereumjs-util
1 parent 755a2a5 commit a1e80e6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

app/scripts/migrations/088.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { hasProperty, Hex, isObject, isStrictHexString } from '@metamask/utils';
2-
import { BN } from 'ethereumjs-util';
2+
import BN from 'bn.js';
33
import { cloneDeep, mapKeys } from 'lodash';
44
import log from 'loglevel';
55

@@ -302,6 +302,6 @@ function toHex(value: number | string | BN): Hex {
302302
}
303303
const hexString = BN.isBN(value)
304304
? value.toString(16)
305-
: new BN(value.toString(), 10).toString(16);
305+
: new BN(value.toString(10), 10).toString(16);
306306
return `0x${hexString}`;
307307
}

shared/modules/conversion.utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Hex } from '@metamask/utils';
22
import { BigNumber } from 'bignumber.js';
3-
import { addHexPrefix, BN } from 'ethereumjs-util';
3+
import BN from 'bn.js';
4+
import { addHexPrefix } from 'ethereumjs-util';
45
import { EtherDenomination } from '../constants/common';
56
import { Numeric, NumericValue } from './Numeric';
67

ui/helpers/utils/util.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Bowser from 'bowser';
2-
import { BN, toChecksumAddress } from 'ethereumjs-util';
2+
import BN from 'bn.js';
3+
import { toChecksumAddress } from 'ethereumjs-util';
34
import { CHAIN_IDS } from '../../../shared/constants/network';
45
import { addHexPrefixToObjectValues } from '../../../shared/lib/swaps-utils';
56
import { toPrecisionWithoutTrailingZeros } from '../../../shared/lib/transactions-controller-utils';

0 commit comments

Comments
 (0)