Skip to content

Commit

Permalink
fix code fence
Browse files Browse the repository at this point in the history
  • Loading branch information
owencraston committed Jan 20, 2025
1 parent ae62459 commit c31b5de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/core/Engine/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ import {
import { snapKeyringBuilder } from '../SnapKeyring';
import { removeAccountsFromPermissions } from '../Permissions';
import { keyringSnapPermissionsBuilder } from '../SnapKeyring/keyringSnapsPermissions';
import { createMultichainBalancesController } from './controllers/MultichainBalancesController/utils';
import { createMultichainRatesController } from './controllers/RatesController/utils';
///: END:ONLY_INCLUDE_IF
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
import { HandleSnapRequestArgs } from '../Snaps/types';
import { handleSnapRequest } from '../Snaps/utils';
import { createMultichainBalancesController } from './controllers/MultichainBalancesController/utils';
import { createMultichainRatesController } from './controllers/RatesController/utils';
///: END:ONLY_INCLUDE_IF
import { getSmartTransactionMetricsProperties } from '../../util/smart-transactions';
import { trace } from '../../util/trace';
Expand Down
11 changes: 7 additions & 4 deletions app/selectors/multichain/multichainNonEvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ export const selectMultichainNetwork = createSelector(
// For non-EVM, we know we have a selected account, since the logic `isEvm` is based
// on having a non-EVM account being selected!
const nonEvmNetworks = getMultichainNetworkProviders();
const nonEvmNetwork = nonEvmNetworks.find((provider) =>
provider.isAddressCompatible(selectedAccount.address),
);
const nonEvmNetwork = selectedAccount
? nonEvmNetworks.find((provider) =>
provider.isAddressCompatible(selectedAccount.address),
)
: undefined;

if (!nonEvmNetwork) {
throw new Error(
Expand Down Expand Up @@ -249,6 +251,7 @@ const selectBtcCachedBalance = createDeepEqualSelector(
? MultichainNativeAssets.Bitcoin
: MultichainNativeAssets.BitcoinTestnet;

if (!selectedInternalAccount) return undefined;
return multichainBalances?.[selectedInternalAccount.id]?.[asset]?.amount;
},
);
Expand All @@ -268,7 +271,7 @@ export const selectMultichainSelectedAccountCachedBalanceIsZero =
selectMultichainIsEvm,
(balance, isEvm) => {
const base = isEvm ? 16 : 10;
const numericValue = parseInt(balance, base);
const numericValue = parseInt(balance || '0', base);
return numericValue === 0;
},
);
Expand Down

0 comments on commit c31b5de

Please sign in to comment.