Skip to content

Commit 232cf50

Browse files
committed
remove convertHexToDecimal
1 parent 1e25d8a commit 232cf50

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

app/core/Engine/Engine.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ import { selectBasicFunctionalityEnabled } from '../../selectors/settings';
127127
import { selectSwapsChainFeatureFlags } from '../../reducers/swaps';
128128
import { ClientId } from '@metamask/smart-transactions-controller/dist/types';
129129
import { zeroAddress } from 'ethereumjs-util';
130-
import {
131-
ApprovalType,
132-
ChainId,
133-
handleFetch,
134-
convertHexToDecimal,
135-
} from '@metamask/controller-utils';
130+
import { ApprovalType, ChainId, handleFetch } from '@metamask/controller-utils';
136131
import { ExtendedControllerMessenger } from '../ExtendedControllerMessenger';
137132
import DomainProxyMap from '../../lib/DomainProxyMap/DomainProxyMap';
138133
import {
@@ -1694,20 +1689,13 @@ export class Engine {
16941689
selectedInternalAccountFormattedAddress
16951690
]
16961691
) {
1697-
// TODO - Non EVM accounts like BTC do not use hex formatted balances. We will need to modify this to use CAIP-2 identifiers in the future.
1698-
const balanceBN = hexToBN(
1692+
const balanceHex =
16991693
accountsByChainId[toHexadecimal(chainId)][
17001694
selectedInternalAccountFormattedAddress
1701-
].balance,
1702-
);
1695+
].balance;
17031696

1704-
totalNativeTokenBalance = renderFromWei(
1705-
convertHexToDecimal(
1706-
accountsByChainId[toHexadecimal(chainId)][
1707-
selectedInternalAccountFormattedAddress
1708-
].balance,
1709-
),
1710-
);
1697+
const balanceBN = hexToBN(balanceHex);
1698+
totalNativeTokenBalance = renderFromWei(balanceHex);
17111699

17121700
// TODO - Non EVM accounts like BTC do not use hex formatted balances. We will need to modify this to use CAIP-2 identifiers in the future.
17131701
const stakedBalanceBN = hexToBN(

0 commit comments

Comments
 (0)