Skip to content

Commit acb8a43

Browse files
committed
fix: remove unrelated changes
1 parent 46f6d91 commit acb8a43

File tree

12 files changed

+30
-21
lines changed

12 files changed

+30
-21
lines changed

packages/account-tree-controller/src/backup-and-sync/utils/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const getLocalGroupForEntropyWallet = (
4141
const walletId = toMultichainAccountWalletId(entropySourceId);
4242
const wallet = context.controller.state.accountTree.wallets[walletId];
4343

44-
if (wallet?.type !== AccountWalletType.Entropy) {
44+
if (!wallet || wallet.type !== AccountWalletType.Entropy) {
4545
backupAndSyncLogger(
4646
`Wallet ${walletId} not found or is not an entropy wallet`,
4747
);
@@ -65,7 +65,7 @@ export function getLocalGroupsForEntropyWallet(
6565
walletId: AccountWalletId,
6666
): AccountGroupMultichainAccountObject[] {
6767
const wallet = context.controller.state.accountTree.wallets[walletId];
68-
if (wallet?.type !== AccountWalletType.Entropy) {
68+
if (!wallet || wallet.type !== AccountWalletType.Entropy) {
6969
backupAndSyncLogger(
7070
`Wallet ${walletId} not found or is not an entropy wallet`,
7171
);

packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ export class DeFiPositionsController extends StaticIntervalPollingController()<
180180
const selectedAddress = this.#getSelectedEvmAdress();
181181

182182
if (
183-
selectedAddress?.toLowerCase() !==
184-
transactionMeta.txParams.from.toLowerCase()
183+
!selectedAddress ||
184+
selectedAddress.toLowerCase() !==
185+
transactionMeta.txParams.from.toLowerCase()
185186
) {
186187
return;
187188
}

packages/assets-controllers/src/TokenBalancesController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,8 @@ export class TokenBalancesController extends StaticIntervalPollingController<{
10251025
const stakingContractAddress =
10261026
STAKING_CONTRACT_ADDRESS_BY_CHAINID[balance.chainId];
10271027
return (
1028-
stakingContractAddress?.toLowerCase() === balance.token.toLowerCase()
1028+
stakingContractAddress &&
1029+
stakingContractAddress.toLowerCase() === balance.token.toLowerCase()
10291030
);
10301031
});
10311032

packages/assets-controllers/src/TokenListController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export class TokenListController extends StaticIntervalPollingController<TokenLi
251251
const prevData = this.#previousTokensChainsCache[chainId];
252252

253253
// Chain is new or timestamp changed (indicating data update)
254-
if (prevData?.timestamp !== newData.timestamp) {
254+
if (!prevData || prevData.timestamp !== newData.timestamp) {
255255
this.#changedChainsToPersist.add(chainId);
256256
}
257257
}

packages/keyring-controller/jest.environment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const NodeEnvironment = require('jest-environment-node').default;
1+
const { TestEnvironment } = require('jest-environment-node');
22

33
/**
44
* KeyringController depends on @noble/hashes, which as of 1.3.2 relies on the
55
* Web Crypto API in Node and browsers.
66
*/
7-
class CustomTestEnvironment extends NodeEnvironment {
7+
class CustomTestEnvironment extends TestEnvironment {
88
async setup() {
99
await super.setup();
1010
if (typeof this.global.crypto === 'undefined') {

packages/multichain-account-service/src/providers/SnapAccountProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ export abstract class SnapAccountProvider extends BaseBip44AccountProvider {
159159
): Promise<void> {
160160
await this.withSnap(async ({ keyring }) => {
161161
const localSnapAccounts = accounts.filter(
162-
(account) => account.metadata.snap?.id === this.snapId,
162+
(account) =>
163+
account.metadata.snap && account.metadata.snap.id === this.snapId,
163164
);
164165
const snapAccounts = new Set(
165166
(await this.#client.listAccounts()).map((account) => account.id),

packages/network-controller/src/NetworkController.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2701,7 +2701,10 @@ export class NetworkController extends BaseController<
27012701
);
27022702
}
27032703

2704-
if (networkFields.chainId !== existingNetworkConfiguration?.chainId) {
2704+
if (
2705+
existingNetworkConfiguration === null ||
2706+
networkFields.chainId !== existingNetworkConfiguration.chainId
2707+
) {
27052708
const existingNetworkConfigurationViaChainId =
27062709
this.state.networkConfigurationsByChainId[networkFields.chainId];
27072710
if (existingNetworkConfigurationViaChainId !== undefined) {

packages/ramps-controller/src/RampsController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,8 @@ export class RampsController extends BaseController<
763763
for (const key of keys) {
764764
const entry = requests[key];
765765
if (
766-
entry?.status === RequestStatus.SUCCESS &&
766+
entry &&
767+
entry.status === RequestStatus.SUCCESS &&
767768
isCacheExpired(entry, ttl)
768769
) {
769770
delete requests[key];

packages/seedless-onboarding-controller/jest.environment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const NodeEnvironment = require('jest-environment-node').default;
1+
const { TestEnvironment } = require('jest-environment-node');
22

33
/**
44
* SeedlessOnboardingController depends on @noble/hashes, which as of 1.7.1 relies on the
55
* Web Crypto API in Node and browsers.
66
*/
7-
class CustomTestEnvironment extends NodeEnvironment {
7+
class CustomTestEnvironment extends TestEnvironment {
88
async setup() {
99
await super.setup();
1010
if (typeof this.global.crypto === 'undefined') {

packages/subscription-controller/src/SubscriptionController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,8 @@ export class SubscriptionController extends StaticIntervalPollingController()<
10411041
value: CachedLastSelectedPaymentMethod | undefined,
10421042
): asserts value is Required<CachedLastSelectedPaymentMethod> {
10431043
if (
1044-
value?.type !== PAYMENT_TYPES.byCrypto ||
1044+
!value ||
1045+
value.type !== PAYMENT_TYPES.byCrypto ||
10451046
!value.paymentTokenAddress ||
10461047
!value.paymentTokenSymbol
10471048
) {

0 commit comments

Comments
 (0)