Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
OGPoyraz committed Jan 24, 2025
1 parent e7362fc commit f3d5e31
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Adds ability of re-simulating transaction depending on the `isFocused` property on `transactionMeta` ([#5189](https://github.com/MetaMask/core/pull/5189))
- `isFocused` property is expected to set by client.

## [43.0.0]

### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { NetworkType } from '@metamask/controller-utils';
import type {
BlockTracker,
NetworkClientId,
} from '@metamask/network-controller';
import { NetworkType } from '@metamask/controller-utils';
import { BN } from 'bn.js';

import { CHAIN_IDS } from '../constants';

import {
type ResimulateHelperOptions,
ResimulateHelper,
Expand All @@ -17,6 +15,7 @@ import {
shouldResimulate,
VALUE_COMPARISON_PERCENT_THRESHOLD,
} from './ResimulateHelper';
import { CHAIN_IDS } from '../constants';
import type {
TransactionMeta,
SecurityAlertResponse,
Expand Down
12 changes: 9 additions & 3 deletions packages/transaction-controller/src/helpers/ResimulateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type {
BlockTracker,
NetworkClientId,
} from '@metamask/network-controller';
import { BN } from 'bn.js';
import { isEqual } from 'lodash';
import type { Hex } from '@metamask/utils';
import { remove0x } from '@metamask/utils';
import { BN } from 'bn.js';
import { isEqual } from 'lodash';

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


export class ResimulateHelper {
readonly #activeResimulations: Map<string, ResimulationState> = new Map();

Expand Down Expand Up @@ -153,6 +152,7 @@ export class ResimulateHelper {

/**
* Determine if a transaction should be resimulated.
*
* @param originalTransactionMeta - The original transaction metadata.
* @param newTransactionMeta - The new transaction metadata.
* @returns Whether the transaction should be resimulated.
Expand Down Expand Up @@ -206,6 +206,7 @@ export function shouldResimulate(

/**
* Determine if the simulation data has changed.
*
* @param originalSimulationData - The original simulation data.
* @param newSimulationData - The new simulation data.
* @returns Whether the simulation data has changed.
Expand Down Expand Up @@ -268,6 +269,7 @@ export function hasSimulationDataChanged(

/**
* Determine if the transaction parameters have been updated.
*
* @param originalTransactionMeta - The original transaction metadata.
* @param newTransactionMeta - The new transaction metadata.
* @returns Whether the transaction parameters have been updated.
Expand Down Expand Up @@ -301,6 +303,7 @@ function isParametersUpdated(

/**
* Determine if a transaction has a new security alert.
*
* @param originalTransactionMeta - The original transaction metadata.
* @param newTransactionMeta - The new transaction metadata.
* @returns Whether the transaction has a new security alert.
Expand Down Expand Up @@ -332,6 +335,7 @@ function hasNewSecurityAlert(

/**
* Determine if a transaction has a value and simulation native balance mismatch.
*
* @param originalTransactionMeta - The original transaction metadata.
* @param newTransactionMeta - The new transaction metadata.
* @returns Whether the transaction has a value and simulation native balance mismatch.
Expand Down Expand Up @@ -367,6 +371,7 @@ function hasValueAndNativeBalanceMismatch(

/**
* Determine if a balance change has been updated.
*
* @param originalBalanceChange - The original balance change.
* @param newBalanceChange - The new balance change.
* @returns Whether the balance change has been updated.
Expand All @@ -385,6 +390,7 @@ function isBalanceChangeUpdated(

/**
* Determine if the percentage change between two values is within a threshold.
*
* @param originalValue - The original value.
* @param newValue - The new value.
* @param originalNegative - Whether the original value is negative.
Expand Down

0 comments on commit f3d5e31

Please sign in to comment.