File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 99 MOCK_ADDRESS_1 ,
1010} from '../../util/test/accountsControllerTestUtils' ;
1111import { mockNetworkState } from '../../util/test/network' ;
12- import { Hex , KnownCaipNamespace } from '@metamask/utils' ;
12+ import { add0x , Hex , KnownCaipNamespace } from '@metamask/utils' ;
1313import { KeyringControllerState } from '@metamask/keyring-controller' ;
1414import { backupVault } from '../BackupVault' ;
1515import { getVersion } from 'react-native-device-info' ;
@@ -399,7 +399,9 @@ describe('Engine', () => {
399399 AccountTrackerController : {
400400 accountsByChainId : {
401401 [ chainId ] : {
402- [ selectedAddress ] : { balance : ( ethBalance * 1e18 ) . toString ( ) } ,
402+ [ selectedAddress ] : {
403+ balance : add0x ( ( ethBalance * 1e18 ) . toString ( 16 ) ) ,
404+ } ,
403405 } ,
404406 } ,
405407 } ,
@@ -428,8 +430,8 @@ describe('Engine', () => {
428430 accountsByChainId : {
429431 [ chainId ] : {
430432 [ selectedAddress ] : {
431- balance : '0 ' ,
432- stakedBalance : '0 ' ,
433+ balance : '0x0 ' ,
434+ stakedBalance : '0x0 ' ,
433435 } ,
434436 } ,
435437 } ,
@@ -602,8 +604,8 @@ describe('Engine', () => {
602604 accountsByChainId : {
603605 [ chainId ] : {
604606 [ selectedAddress ] : {
605- balance : ( ethBalance * 1e18 ) . toString ( ) ,
606- stakedBalance : ( stakedEthBalance * 1e18 ) . toString ( ) ,
607+ balance : add0x ( ( ethBalance * 1e18 ) . toString ( 16 ) ) ,
608+ stakedBalance : add0x ( ( stakedEthBalance * 1e18 ) . toString ( 16 ) ) ,
607609 } ,
608610 } ,
609611 } ,
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ import { getUserStorageControllerMessenger } from './messengers/identity/user-st
9898import { createUserStorageController } from './controllers/identity/create-user-storage-controller' ;
9999///: END:ONLY_INCLUDE_IF
100100import { backupVault } from '../BackupVault' ;
101- import { add0x , Hex , Json , KnownCaipNamespace } from '@metamask/utils' ;
101+ import { Hex , Json , KnownCaipNamespace } from '@metamask/utils' ;
102102import { providerErrors } from '@metamask/rpc-errors' ;
103103
104104import { PPOM , ppomInit } from '../../lib/ppom/PPOMView' ;
@@ -1576,9 +1576,7 @@ export class Engine {
15761576 accountData . stakedBalance || '0x00' ,
15771577 ) ;
15781578
1579- const totalAccountBalance = add0x (
1580- ( balanceBigInt + stakedBalanceBigInt ) . toString ( 16 ) ,
1581- ) ;
1579+ const totalAccountBalance = balanceBigInt + stakedBalanceBigInt ;
15821580
15831581 const chainEthFiat = weiToFiatNumber (
15841582 totalAccountBalance ,
You can’t perform that action at this time.
0 commit comments