Skip to content

Commit f3d5e31

Browse files
committed
Fix lint
1 parent e7362fc commit f3d5e31

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

packages/transaction-controller/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Adds ability of re-simulating transaction depending on the `isFocused` property on `transactionMeta` ([#5189](https://github.com/MetaMask/core/pull/5189))
13+
- `isFocused` property is expected to set by client.
14+
1015
## [43.0.0]
1116

1217
### Added

packages/transaction-controller/src/helpers/ResimulateHelper.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
import { NetworkType } from '@metamask/controller-utils';
12
import type {
23
BlockTracker,
34
NetworkClientId,
45
} from '@metamask/network-controller';
5-
import { NetworkType } from '@metamask/controller-utils';
66
import { BN } from 'bn.js';
77

8-
import { CHAIN_IDS } from '../constants';
9-
108
import {
119
type ResimulateHelperOptions,
1210
ResimulateHelper,
@@ -17,6 +15,7 @@ import {
1715
shouldResimulate,
1816
VALUE_COMPARISON_PERCENT_THRESHOLD,
1917
} from './ResimulateHelper';
18+
import { CHAIN_IDS } from '../constants';
2019
import type {
2120
TransactionMeta,
2221
SecurityAlertResponse,

packages/transaction-controller/src/helpers/ResimulateHelper.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import type {
22
BlockTracker,
33
NetworkClientId,
44
} from '@metamask/network-controller';
5-
import { BN } from 'bn.js';
6-
import { isEqual } from 'lodash';
75
import type { Hex } from '@metamask/utils';
86
import { remove0x } from '@metamask/utils';
7+
import { BN } from 'bn.js';
8+
import { isEqual } from 'lodash';
99

1010
import { createModuleLogger, projectLogger } from '../logger';
1111
import { TransactionStatus } from '../types';
@@ -41,7 +41,6 @@ export type ResimulateHelperOptions = {
4141
updateSimulationData: (transactionMeta: TransactionMeta) => void;
4242
};
4343

44-
4544
export class ResimulateHelper {
4645
readonly #activeResimulations: Map<string, ResimulationState> = new Map();
4746

@@ -153,6 +152,7 @@ export class ResimulateHelper {
153152

154153
/**
155154
* Determine if a transaction should be resimulated.
155+
*
156156
* @param originalTransactionMeta - The original transaction metadata.
157157
* @param newTransactionMeta - The new transaction metadata.
158158
* @returns Whether the transaction should be resimulated.
@@ -206,6 +206,7 @@ export function shouldResimulate(
206206

207207
/**
208208
* Determine if the simulation data has changed.
209+
*
209210
* @param originalSimulationData - The original simulation data.
210211
* @param newSimulationData - The new simulation data.
211212
* @returns Whether the simulation data has changed.
@@ -268,6 +269,7 @@ export function hasSimulationDataChanged(
268269

269270
/**
270271
* Determine if the transaction parameters have been updated.
272+
*
271273
* @param originalTransactionMeta - The original transaction metadata.
272274
* @param newTransactionMeta - The new transaction metadata.
273275
* @returns Whether the transaction parameters have been updated.
@@ -301,6 +303,7 @@ function isParametersUpdated(
301303

302304
/**
303305
* Determine if a transaction has a new security alert.
306+
*
304307
* @param originalTransactionMeta - The original transaction metadata.
305308
* @param newTransactionMeta - The new transaction metadata.
306309
* @returns Whether the transaction has a new security alert.
@@ -332,6 +335,7 @@ function hasNewSecurityAlert(
332335

333336
/**
334337
* Determine if a transaction has a value and simulation native balance mismatch.
338+
*
335339
* @param originalTransactionMeta - The original transaction metadata.
336340
* @param newTransactionMeta - The new transaction metadata.
337341
* @returns Whether the transaction has a value and simulation native balance mismatch.
@@ -367,6 +371,7 @@ function hasValueAndNativeBalanceMismatch(
367371

368372
/**
369373
* Determine if a balance change has been updated.
374+
*
370375
* @param originalBalanceChange - The original balance change.
371376
* @param newBalanceChange - The new balance change.
372377
* @returns Whether the balance change has been updated.
@@ -385,6 +390,7 @@ function isBalanceChangeUpdated(
385390

386391
/**
387392
* Determine if the percentage change between two values is within a threshold.
393+
*
388394
* @param originalValue - The original value.
389395
* @param newValue - The new value.
390396
* @param originalNegative - Whether the original value is negative.

0 commit comments

Comments
 (0)