1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 09:23:21 +01:00

update prettier (#15360)

This commit is contained in:
Brad Decker 2022-07-31 13:26:40 -05:00 committed by GitHub
parent 9e7c75d06d
commit c72199a1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
185 changed files with 1343 additions and 1712 deletions

View File

@ -615,11 +615,11 @@ function setupController(initState, initLangCode, remoteSourcePort) {
const { unapprovedMsgCount } = controller.messageManager;
const { unapprovedPersonalMsgCount } = controller.personalMessageManager;
const { unapprovedDecryptMsgCount } = controller.decryptMessageManager;
const {
unapprovedEncryptionPublicKeyMsgCount,
} = controller.encryptionPublicKeyManager;
const { unapprovedEncryptionPublicKeyMsgCount } =
controller.encryptionPublicKeyManager;
const { unapprovedTypedMessagesCount } = controller.typedMessageManager;
const pendingApprovalCount = controller.approvalController.getTotalApprovalCount();
const pendingApprovalCount =
controller.approvalController.getTotalApprovalCount();
const waitingForUnlockCount =
controller.appStateController.waitingForUnlock.length;
return (

View File

@ -174,13 +174,8 @@ export default class DetectTokensController {
if (result) {
const nonZeroTokenAddresses = Object.keys(result);
for (const nonZeroTokenAddress of nonZeroTokenAddresses) {
const {
address,
symbol,
decimals,
iconUrl,
aggregators,
} = tokenList[nonZeroTokenAddress];
const { address, symbol, decimals, iconUrl, aggregators } =
tokenList[nonZeroTokenAddress];
eventTokensDetails.push(`${symbol} - ${address}`);

View File

@ -291,9 +291,8 @@ describe('DetectTokensController', function () {
const contractAddressesToDetect = erc20ContractAddresses.filter(
(address) => address !== existingTokenAddress,
);
const indexOfTokenToAdd = contractAddressesToDetect.indexOf(
tokenAddressToAdd,
);
const indexOfTokenToAdd =
contractAddressesToDetect.indexOf(tokenAddressToAdd);
const balances = new Array(contractAddressesToDetect.length);
balances[indexOfTokenToAdd] = new BigNumber(10);
@ -353,9 +352,8 @@ describe('DetectTokensController', function () {
const contractAddressesToDetect = erc20ContractAddresses.filter(
(address) => address !== existingTokenAddress,
);
const indexOfTokenToAdd = contractAddressesToDetect.indexOf(
tokenAddressToAdd,
);
const indexOfTokenToAdd =
contractAddressesToDetect.indexOf(tokenAddressToAdd);
const balances = new Array(contractAddressesToDetect.length);
balances[indexOfTokenToAdd] = new BigNumber(10);

View File

@ -190,9 +190,8 @@ describe('IncomingTransactionsController', function () {
);
assert(mockedNetworkMethods.onNetworkDidChange.calledOnce);
const networkControllerListenerCallback = mockedNetworkMethods.onNetworkDidChange.getCall(
0,
).args[0];
const networkControllerListenerCallback =
mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0];
assert.strictEqual(incomingTransactionsController._update.callCount, 0);
networkControllerListenerCallback('testNetworkType');
assert.strictEqual(incomingTransactionsController._update.callCount, 1);
@ -253,8 +252,10 @@ describe('IncomingTransactionsController', function () {
initState: getNonEmptyInitState(),
},
);
const startBlock = getNonEmptyInitState()
.incomingTxLastFetchedBlockByChainId[ROPSTEN_CHAIN_ID];
const startBlock =
getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[
ROPSTEN_CHAIN_ID
];
nock('https://api-ropsten.etherscan.io')
.get(
`/api?module=account&action=txlist&address=${MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`,
@ -546,8 +547,10 @@ describe('IncomingTransactionsController', function () {
},
);
const NEW_MOCK_SELECTED_ADDRESS = `${MOCK_SELECTED_ADDRESS}9`;
const startBlock = getNonEmptyInitState()
.incomingTxLastFetchedBlockByChainId[ROPSTEN_CHAIN_ID];
const startBlock =
getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[
ROPSTEN_CHAIN_ID
];
nock('https://api-ropsten.etherscan.io')
.get(
`/api?module=account&action=txlist&address=${NEW_MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`,
@ -572,9 +575,10 @@ describe('IncomingTransactionsController', function () {
incomingTransactionsController.store,
);
const subscription = incomingTransactionsController.preferencesController.store.subscribe.getCall(
1,
).args[0];
const subscription =
incomingTransactionsController.preferencesController.store.subscribe.getCall(
1,
).args[0];
// The incoming transactions controller will always skip the first event
// We need to call subscription twice to test the event handling
// TODO: stop skipping the first event
@ -658,9 +662,10 @@ describe('IncomingTransactionsController', function () {
incomingTransactionsController.store,
);
const subscription = incomingTransactionsController.preferencesController.store.subscribe.getCall(
1,
).args[0];
const subscription =
incomingTransactionsController.preferencesController.store.subscribe.getCall(
1,
).args[0];
// The incoming transactions controller will always skip the first event
// We need to call subscription twice to test the event handling
// TODO: stop skipping the first event
@ -682,9 +687,8 @@ describe('IncomingTransactionsController', function () {
});
it('should update when switching to a supported network', async function () {
const mockedNetworkMethods = getMockNetworkControllerMethods(
ROPSTEN_CHAIN_ID,
);
const mockedNetworkMethods =
getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID);
const incomingTransactionsController = new IncomingTransactionsController(
{
blockTracker: getMockBlockTracker(),
@ -693,8 +697,10 @@ describe('IncomingTransactionsController', function () {
initState: getNonEmptyInitState(),
},
);
const startBlock = getNonEmptyInitState()
.incomingTxLastFetchedBlockByChainId[ROPSTEN_CHAIN_ID];
const startBlock =
getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[
ROPSTEN_CHAIN_ID
];
nock('https://api-ropsten.etherscan.io')
.get(
`/api?module=account&action=txlist&address=${MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`,
@ -715,8 +721,8 @@ describe('IncomingTransactionsController', function () {
incomingTransactionsController.store,
);
const subscription = mockedNetworkMethods.onNetworkDidChange.getCall(0)
.args[0];
const subscription =
mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0];
await subscription(ROPSTEN_CHAIN_ID);
await updateStateCalled();
@ -763,9 +769,8 @@ describe('IncomingTransactionsController', function () {
});
it('should not update when switching to an unsupported network', async function () {
const mockedNetworkMethods = getMockNetworkControllerMethods(
ROPSTEN_CHAIN_ID,
);
const mockedNetworkMethods =
getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID);
const incomingTransactionsController = new IncomingTransactionsController(
{
blockTracker: getMockBlockTracker(),
@ -796,8 +801,8 @@ describe('IncomingTransactionsController', function () {
incomingTransactionsController.store,
);
const subscription = mockedNetworkMethods.onNetworkDidChange.getCall(0)
.args[0];
const subscription =
mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0];
incomingTransactionsController.getCurrentChainId = () => FAKE_CHAIN_ID;
await subscription();
@ -820,15 +825,14 @@ describe('IncomingTransactionsController', function () {
describe('_update', function () {
describe('when state is empty (initialized)', function () {
it('should use provided block number and update the latest block seen', async function () {
const incomingTransactionsController = new IncomingTransactionsController(
{
const incomingTransactionsController =
new IncomingTransactionsController({
blockTracker: getMockBlockTracker(),
...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID),
preferencesController: getMockPreferencesController(),
initState: getEmptyInitState(),
getCurrentChainId: () => ROPSTEN_CHAIN_ID,
},
);
});
sinon.spy(incomingTransactionsController.store, 'updateState');
incomingTransactionsController._getNewIncomingTransactions = sinon
@ -857,15 +861,14 @@ describe('IncomingTransactionsController', function () {
});
it('should update the last fetched block for network to highest block seen in incoming txs', async function () {
const incomingTransactionsController = new IncomingTransactionsController(
{
const incomingTransactionsController =
new IncomingTransactionsController({
blockTracker: getMockBlockTracker(),
...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID),
preferencesController: getMockPreferencesController(),
initState: getEmptyInitState(),
getCurrentChainId: () => ROPSTEN_CHAIN_ID,
},
);
});
const NEW_TRANSACTION_ONE = {
id: 555,
@ -911,15 +914,14 @@ describe('IncomingTransactionsController', function () {
describe('when state is populated with prior data for network', function () {
it('should use the last fetched block for the current network and increment by 1 in state', async function () {
const incomingTransactionsController = new IncomingTransactionsController(
{
const incomingTransactionsController =
new IncomingTransactionsController({
blockTracker: getMockBlockTracker(),
...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID),
preferencesController: getMockPreferencesController(),
initState: getNonEmptyInitState(),
getCurrentChainId: () => ROPSTEN_CHAIN_ID,
},
);
});
sinon.spy(incomingTransactionsController.store, 'updateState');
incomingTransactionsController._getNewIncomingTransactions = sinon
.stub()
@ -1105,11 +1107,12 @@ describe('IncomingTransactionsController', function () {
},
);
const result = await incomingTransactionsController._getNewIncomingTransactions(
ADDRESS_TO_FETCH_FOR,
'789',
ROPSTEN_CHAIN_ID,
);
const result =
await incomingTransactionsController._getNewIncomingTransactions(
ADDRESS_TO_FETCH_FOR,
'789',
ROPSTEN_CHAIN_ID,
);
assert(mockFetch.calledOnce);
assert.deepStrictEqual(result, [
@ -1137,11 +1140,12 @@ describe('IncomingTransactionsController', function () {
},
);
const result = await incomingTransactionsController._getNewIncomingTransactions(
ADDRESS_TO_FETCH_FOR,
'789',
ROPSTEN_CHAIN_ID,
);
const result =
await incomingTransactionsController._getNewIncomingTransactions(
ADDRESS_TO_FETCH_FOR,
'789',
ROPSTEN_CHAIN_ID,
);
assert.deepStrictEqual(result, []);
window.fetch = tempFetchStatusZero;
mockFetchStatusZero.reset();
@ -1164,11 +1168,12 @@ describe('IncomingTransactionsController', function () {
},
);
const result = await incomingTransactionsController._getNewIncomingTransactions(
ADDRESS_TO_FETCH_FOR,
'789',
ROPSTEN_CHAIN_ID,
);
const result =
await incomingTransactionsController._getNewIncomingTransactions(
ADDRESS_TO_FETCH_FOR,
'789',
ROPSTEN_CHAIN_ID,
);
assert.deepStrictEqual(result, []);
window.fetch = tempFetchEmptyResult;
mockFetchEmptyResult.reset();

View File

@ -558,15 +558,16 @@ export default class MetaMetricsController {
[TRAITS.NETWORKS_ADDED]: metamaskState.frequentRpcListDetail.map(
(rpc) => rpc.chainId,
),
[TRAITS.NETWORKS_WITHOUT_TICKER]: metamaskState.frequentRpcListDetail.reduce(
(networkList, currentNetwork) => {
if (!currentNetwork.ticker) {
networkList.push(currentNetwork.chainId);
}
return networkList;
},
[],
),
[TRAITS.NETWORKS_WITHOUT_TICKER]:
metamaskState.frequentRpcListDetail.reduce(
(networkList, currentNetwork) => {
if (!currentNetwork.ticker) {
networkList.push(currentNetwork.chainId);
}
return networkList;
},
[],
),
[TRAITS.NFT_AUTODETECTION_ENABLED]: metamaskState.useCollectibleDetection,
[TRAITS.NUMBER_OF_ACCOUNTS]: Object.values(metamaskState.identities)
.length,

View File

@ -132,12 +132,10 @@ function getMetaMetricsController({
} = {}) {
return new MetaMetricsController({
segment,
getNetworkIdentifier: networkController.getNetworkIdentifier.bind(
networkController,
),
getCurrentChainId: networkController.getCurrentChainId.bind(
networkController,
),
getNetworkIdentifier:
networkController.getNetworkIdentifier.bind(networkController),
getCurrentChainId:
networkController.getCurrentChainId.bind(networkController),
onNetworkDidChange: networkController.on.bind(
networkController,
NETWORK_EVENTS.NETWORK_DID_CHANGE,

View File

@ -34,8 +34,8 @@ describe('NetworkController', () => {
describe('#provider', () => {
it('provider should be updatable without reassignment', () => {
networkController.initializeProvider(networkControllerProviderConfig);
const providerProxy = networkController.getProviderAndBlockTracker()
.provider;
const providerProxy =
networkController.getProviderAndBlockTracker().provider;
expect(providerProxy.test).toBeUndefined();
providerProxy.setTarget({ test: true });
expect(providerProxy.test).toStrictEqual(true);
@ -79,7 +79,8 @@ describe('NetworkController', () => {
describe('#getEIP1559Compatibility', () => {
it('should return false when baseFeePerGas is not in the block header', async () => {
networkController.initializeProvider(networkControllerProviderConfig);
const supportsEIP1559 = await networkController.getEIP1559Compatibility();
const supportsEIP1559 =
await networkController.getEIP1559Compatibility();
expect(supportsEIP1559).toStrictEqual(false);
});
@ -88,7 +89,8 @@ describe('NetworkController', () => {
getLatestBlockStub.callsFake(() =>
Promise.resolve({ baseFeePerGas: '0xa ' }),
);
const supportsEIP1559 = await networkController.getEIP1559Compatibility();
const supportsEIP1559 =
await networkController.getEIP1559Compatibility();
expect(supportsEIP1559).toStrictEqual(true);
});
@ -98,7 +100,8 @@ describe('NetworkController', () => {
Promise.resolve({ baseFeePerGas: '0xa ' }),
);
await networkController.getEIP1559Compatibility();
const supportsEIP1559 = await networkController.getEIP1559Compatibility();
const supportsEIP1559 =
await networkController.getEIP1559Compatibility();
expect(getLatestBlockStub.calledOnce).toStrictEqual(true);
expect(supportsEIP1559).toStrictEqual(true);
});

View File

@ -68,8 +68,7 @@ describe('PendingNonceMiddleware', () => {
from: '0xf231d46dd78806e1dd93442cf33c7671f8538748',
gas: GAS_LIMITS.SIMPLE,
gasPrice: '0x1e8480',
hash:
'0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09',
hash: '0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09',
input: '0x',
nonce: '0x4',
type: TRANSACTION_ENVELOPE_TYPES.LEGACY,

View File

@ -25,8 +25,7 @@ describe('network utils', () => {
chainId: '0x3',
time: 1624408066355,
metamaskNetworkId: '3',
hash:
'0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
r: '0x4c3111e42ed5eec3dcecba1e234700f387e8693c373c61c3e54a762a26f1570e',
s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff',
v: '0x29',
@ -38,8 +37,7 @@ describe('network utils', () => {
from: '0xc684832530fcbddae4b4230a47e991ddcec2831d',
gas: '0x7b0d',
gasPrice: '0x77359400',
hash:
'0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
input: '0x',
maxFeePerGas: '0x77359400',
maxPriorityFeePerGas: '0x77359400',
@ -72,8 +70,7 @@ describe('network utils', () => {
chainId: '0x3',
time: 1624408066355,
metamaskNetworkId: '3',
hash:
'0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
r: '0x4c3111e42ed5eec3dcecba1e234700f387e8693c373c61c3e54a762a26f1570e',
s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff',
v: '0x29',
@ -84,8 +81,7 @@ describe('network utils', () => {
blockNumber: null,
from: '0xc684832530fcbddae4b4230a47e991ddcec2831d',
gas: '0x7b0d',
hash:
'0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7',
input: '0x',
gasPrice: '0x77359400',
nonce: '0x4b',

View File

@ -4,9 +4,8 @@ import { CaveatMutatorFactories } from './caveat-mutators';
describe('caveat mutators', () => {
describe('restrictReturnedAccounts', () => {
const { removeAccount } = CaveatMutatorFactories[
CaveatTypes.restrictReturnedAccounts
];
const { removeAccount } =
CaveatMutatorFactories[CaveatTypes.restrictReturnedAccounts];
describe('removeAccount', () => {
it('returns the no-op operation if the target account is not permitted', () => {

View File

@ -90,7 +90,8 @@ const initialState = {
swapsQuoteRefreshTime: FALLBACK_QUOTE_REFRESH_TIME,
swapsQuotePrefetchingRefreshTime: FALLBACK_QUOTE_REFRESH_TIME,
swapsStxBatchStatusRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
swapsStxGetTransactionsRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
swapsStxGetTransactionsRefreshTime:
FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
swapsStxMaxFeeMultiplier: FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER,
swapsFeatureFlags: {},
},
@ -336,10 +337,8 @@ export default class SwapsController {
if (Object.values(newQuotes).length === 0) {
this.setSwapsErrorKey(QUOTES_NOT_AVAILABLE_ERROR);
} else {
const [
_topAggId,
quotesWithSavingsAndFeeData,
] = await this._findTopQuoteAndCalculateSavings(newQuotes);
const [_topAggId, quotesWithSavingsAndFeeData] =
await this._findTopQuoteAndCalculateSavings(newQuotes);
topAggId = _topAggId;
newQuotes = quotesWithSavingsAndFeeData;
}
@ -486,10 +485,8 @@ export default class SwapsController {
const quoteToUpdate = { ...swapsState.quotes[initialAggId] };
const {
gasLimit: newGasEstimate,
simulationFails,
} = await this.timedoutGasReturn(quoteToUpdate.trade);
const { gasLimit: newGasEstimate, simulationFails } =
await this.timedoutGasReturn(quoteToUpdate.trade);
if (newGasEstimate && !simulationFails) {
const gasEstimateWithRefund = calculateGasEstimateWithRefund(
@ -637,9 +634,8 @@ export default class SwapsController {
}
async _findTopQuoteAndCalculateSavings(quotes = {}) {
const {
contractExchangeRates: tokenConversionRates,
} = this.getTokenRatesState();
const { contractExchangeRates: tokenConversionRates } =
this.getTokenRatesState();
const {
swapsState: { customGasPrice, customMaxPriorityFeePerGas },
} = this.store.getState();
@ -652,10 +648,8 @@ export default class SwapsController {
const newQuotes = cloneDeep(quotes);
const {
gasFeeEstimates,
gasEstimateType,
} = await this._getEIP1559GasFeeEstimates();
const { gasFeeEstimates, gasEstimateType } =
await this._getEIP1559GasFeeEstimates();
let usedGasPrice = '0x0';
@ -756,9 +750,8 @@ export default class SwapsController {
const tokenPercentageOfPreFeeDestAmount = new BigNumber(100, 10)
.minus(metaMaskFee, 10)
.div(100);
const destinationAmountBeforeMetaMaskFee = decimalAdjustedDestinationAmount.div(
tokenPercentageOfPreFeeDestAmount,
);
const destinationAmountBeforeMetaMaskFee =
decimalAdjustedDestinationAmount.div(tokenPercentageOfPreFeeDestAmount);
const metaMaskFeeInTokens = destinationAmountBeforeMetaMaskFee.minus(
decimalAdjustedDestinationAmount,
);

View File

@ -42,8 +42,7 @@ const TEST_AGG_ID_APPROVAL = 'TEST_AGG_APPROVAL';
const POLLING_TIMEOUT = SECOND * 1000;
const MOCK_APPROVAL_NEEDED = {
data:
'0x095ea7b300000000000000000000000095e6f48254609a6ee006f7d493c8e5fb97094cef0000000000000000000000000000000000000000004a817c7ffffffdabf41c00',
data: '0x095ea7b300000000000000000000000095e6f48254609a6ee006f7d493c8e5fb97094cef0000000000000000000000000000000000000000004a817c7ffffffdabf41c00',
to: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
amount: '0',
from: '0x2369267687A84ac7B494daE2f1542C40E37f4455',
@ -139,7 +138,8 @@ const EMPTY_INIT_STATE = {
swapsQuoteRefreshTime: 60000,
swapsQuotePrefetchingRefreshTime: 60000,
swapsStxBatchStatusRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
swapsStxGetTransactionsRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
swapsStxGetTransactionsRefreshTime:
FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
swapsStxMaxFeeMultiplier: FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER,
swapsUserFeeLevel: '',
saveFetchedQuotes: false,
@ -370,13 +370,10 @@ describe('SwapsController', function () {
baseGasEstimate,
);
const {
gasLimit: bufferedGasLimit,
} = await swapsController.getBufferedGasLimit();
const {
gasEstimate,
gasEstimateWithRefund,
} = swapsController.store.getState().swapsState.quotes[initialAggId];
const { gasLimit: bufferedGasLimit } =
await swapsController.getBufferedGasLimit();
const { gasEstimate, gasEstimateWithRefund } =
swapsController.store.getState().swapsState.quotes[initialAggId];
assert.strictEqual(gasEstimate, bufferedGasLimit);
assert.strictEqual(
gasEstimateWithRefund,
@ -416,12 +413,10 @@ describe('SwapsController', function () {
});
it('returns the top aggId and quotes with savings and fee values if passed necessary data and an even number of quotes', async function () {
const [
topAggId,
resultQuotes,
] = await swapsController._findTopQuoteAndCalculateSavings(
getTopQuoteAndSavingsMockQuotes(),
);
const [topAggId, resultQuotes] =
await swapsController._findTopQuoteAndCalculateSavings(
getTopQuoteAndSavingsMockQuotes(),
);
assert.equal(topAggId, TEST_AGG_ID_1);
assert.deepStrictEqual(
resultQuotes,
@ -442,10 +437,8 @@ describe('SwapsController', function () {
medianMetaMaskFee: '0.0202',
};
const [
topAggId,
resultQuotes,
] = await swapsController._findTopQuoteAndCalculateSavings(testInput);
const [topAggId, resultQuotes] =
await swapsController._findTopQuoteAndCalculateSavings(testInput);
assert.equal(topAggId, TEST_AGG_ID_1);
assert.deepStrictEqual(resultQuotes, expectedResultQuotes);
});
@ -485,10 +478,8 @@ describe('SwapsController', function () {
},
};
const [
topAggId,
resultQuotes,
] = await swapsController._findTopQuoteAndCalculateSavings(testInput);
const [topAggId, resultQuotes] =
await swapsController._findTopQuoteAndCalculateSavings(testInput);
assert.equal(topAggId, TEST_AGG_ID_1);
assert.deepStrictEqual(resultQuotes, expectedResultQuotes);
});
@ -503,7 +494,8 @@ describe('SwapsController', function () {
trade: { value: '0x8ac7230489e80000' },
}),
);
const baseExpectedResultQuotes = getTopQuoteAndSavingsBaseExpectedResults();
const baseExpectedResultQuotes =
getTopQuoteAndSavingsBaseExpectedResults();
const expectedResultQuotes = {
[TEST_AGG_ID_1]: {
...baseExpectedResultQuotes[TEST_AGG_ID_1],
@ -549,10 +541,8 @@ describe('SwapsController', function () {
},
};
const [
topAggId,
resultQuotes,
] = await swapsController._findTopQuoteAndCalculateSavings(testInput);
const [topAggId, resultQuotes] =
await swapsController._findTopQuoteAndCalculateSavings(testInput);
assert.equal(topAggId, TEST_AGG_ID_1);
assert.deepStrictEqual(resultQuotes, expectedResultQuotes);
});
@ -569,7 +559,8 @@ describe('SwapsController', function () {
);
// 0.04 ETH fee included in trade value
testInput[TEST_AGG_ID_1].trade.value = '0x8b553ece48ec0000';
const baseExpectedResultQuotes = getTopQuoteAndSavingsBaseExpectedResults();
const baseExpectedResultQuotes =
getTopQuoteAndSavingsBaseExpectedResults();
const expectedResultQuotes = {
[TEST_AGG_ID_1]: {
...baseExpectedResultQuotes[TEST_AGG_ID_1],
@ -626,10 +617,8 @@ describe('SwapsController', function () {
delete expectedResultQuotes[TEST_AGG_ID_1].isBestQuote;
delete expectedResultQuotes[TEST_AGG_ID_1].savings;
const [
topAggId,
resultQuotes,
] = await swapsController._findTopQuoteAndCalculateSavings(testInput);
const [topAggId, resultQuotes] =
await swapsController._findTopQuoteAndCalculateSavings(testInput);
assert.equal(topAggId, TEST_AGG_ID_2);
assert.deepStrictEqual(resultQuotes, expectedResultQuotes);
});
@ -638,7 +627,8 @@ describe('SwapsController', function () {
const testInput = getTopQuoteAndSavingsMockQuotes();
// 0.04 ETH fee included in trade value
testInput[TEST_AGG_ID_1].trade.value = '0x8e1bc9bf040000';
const baseExpectedResultQuotes = getTopQuoteAndSavingsBaseExpectedResults();
const baseExpectedResultQuotes =
getTopQuoteAndSavingsBaseExpectedResults();
const expectedResultQuotes = {
...baseExpectedResultQuotes,
[TEST_AGG_ID_1]: {
@ -662,10 +652,8 @@ describe('SwapsController', function () {
delete expectedResultQuotes[TEST_AGG_ID_1].isBestQuote;
delete expectedResultQuotes[TEST_AGG_ID_1].savings;
const [
topAggId,
resultQuotes,
] = await swapsController._findTopQuoteAndCalculateSavings(testInput);
const [topAggId, resultQuotes] =
await swapsController._findTopQuoteAndCalculateSavings(testInput);
assert.equal(topAggId, TEST_AGG_ID_2);
assert.deepStrictEqual(resultQuotes, expectedResultQuotes);
});

View File

@ -225,9 +225,8 @@ export default class ThreeBoxController {
PreferencesController: preferences,
AddressBookController: addressBook,
};
const initialMigrationState = migrator.generateInitialState(
formattedStateBackup,
);
const initialMigrationState =
migrator.generateInitialState(formattedStateBackup);
const migratedState = await migrator.migrateData(initialMigrationState);
return {
preferences: migratedState.data.PreferencesController,

View File

@ -174,9 +174,8 @@ export default class TransactionController extends EventEmitter {
);
return [...pendingTransactions, ...externalPendingTransactions];
},
getConfirmedTransactions: this.txStateManager.getConfirmedTransactions.bind(
this.txStateManager,
),
getConfirmedTransactions:
this.txStateManager.getConfirmedTransactions.bind(this.txStateManager),
});
this.pendingTxTracker = new PendingTransactionTracker({
@ -189,9 +188,8 @@ export default class TransactionController extends EventEmitter {
return [...pending, ...approved];
},
approveTransaction: this.approveTransaction.bind(this),
getCompletedTransactions: this.txStateManager.getConfirmedTransactions.bind(
this.txStateManager,
),
getCompletedTransactions:
this.txStateManager.getConfirmedTransactions.bind(this.txStateManager),
});
this.txStateManager.store.subscribe(() =>
@ -227,10 +225,10 @@ export default class TransactionController extends EventEmitter {
}
async getEIP1559Compatibility(fromAddress) {
const currentNetworkIsCompatible = await this._getCurrentNetworkEIP1559Compatibility();
const fromAccountIsCompatible = await this._getCurrentAccountEIP1559Compatibility(
fromAddress,
);
const currentNetworkIsCompatible =
await this._getCurrentNetworkEIP1559Compatibility();
const fromAccountIsCompatible =
await this._getCurrentAccountEIP1559Compatibility(fromAddress);
return currentNetworkIsCompatible && fromAccountIsCompatible;
}
@ -815,10 +813,8 @@ export default class TransactionController extends EventEmitter {
maxFeePerGas: defaultMaxFeePerGas,
maxPriorityFeePerGas: defaultMaxPriorityFeePerGas,
} = await this._getDefaultGasFees(txMeta, eip1559Compatibility);
const {
gasLimit: defaultGasLimit,
simulationFails,
} = await this._getDefaultGasLimit(txMeta, getCodeResponse);
const { gasLimit: defaultGasLimit, simulationFails } =
await this._getDefaultGasLimit(txMeta, getCodeResponse);
// eslint-disable-next-line no-param-reassign
txMeta = this.txStateManager.getTransaction(txMeta.id);
@ -960,10 +956,8 @@ export default class TransactionController extends EventEmitter {
}
try {
const {
gasFeeEstimates,
gasEstimateType,
} = await this._getEIP1559GasFeeEstimates();
const { gasFeeEstimates, gasEstimateType } =
await this._getEIP1559GasFeeEstimates();
if (
eip1559Compatibility &&
gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET
@ -1038,11 +1032,8 @@ export default class TransactionController extends EventEmitter {
return { gasLimit: GAS_LIMITS.SIMPLE };
}
const {
blockGasLimit,
estimatedGasHex,
simulationFails,
} = await this.txGasUtil.analyzeGasUsage(txMeta);
const { blockGasLimit, estimatedGasHex, simulationFails } =
await this.txGasUtil.analyzeGasUsage(txMeta);
// add additional gas buffer to our estimation for safety
const gasLimit = this.txGasUtil.addGasBuffer(
@ -1545,9 +1536,8 @@ export default class TransactionController extends EventEmitter {
const metricsParams = { gas_used: gasUsed };
if (submittedTime) {
metricsParams.completion_time = this._getTransactionCompletionTime(
submittedTime,
);
metricsParams.completion_time =
this._getTransactionCompletionTime(submittedTime);
}
if (txReceipt.status === '0x0') {
@ -1606,9 +1596,8 @@ export default class TransactionController extends EventEmitter {
const metricsParams = { gas_used: gasUsed };
if (submittedTime) {
metricsParams.completion_time = this._getTransactionCompletionTime(
submittedTime,
);
metricsParams.completion_time =
this._getTransactionCompletionTime(submittedTime);
}
if (txReceipt.status === '0x0') {
@ -1673,10 +1662,8 @@ export default class TransactionController extends EventEmitter {
*/
async createTransactionEventFragment(transactionId, event) {
const txMeta = this.txStateManager.getTransaction(transactionId);
const {
properties,
sensitiveProperties,
} = await this._buildEventFragmentProperties(txMeta);
const { properties, sensitiveProperties } =
await this._buildEventFragmentProperties(txMeta);
this._createTransactionEventFragment(
txMeta,
event,
@ -2052,7 +2039,8 @@ export default class TransactionController extends EventEmitter {
if (gasFeeEstimates?.[estimateType]?.suggestedMaxPriorityFeePerGas) {
defaultMaxPriorityFeePerGas =
gasFeeEstimates[estimateType]?.suggestedMaxPriorityFeePerGas;
gasParams.default_max_priority_fee_per_gas = defaultMaxPriorityFeePerGas;
gasParams.default_max_priority_fee_per_gas =
defaultMaxPriorityFeePerGas;
}
}
}
@ -2272,10 +2260,8 @@ export default class TransactionController extends EventEmitter {
if (!txMeta) {
return;
}
const {
properties,
sensitiveProperties,
} = await this._buildEventFragmentProperties(txMeta, extraParams);
const { properties, sensitiveProperties } =
await this._buildEventFragmentProperties(txMeta, extraParams);
// Create event fragments for event types that spawn fragments, and ensure
// existence of fragments for event types that act upon them.

View File

@ -2291,8 +2291,7 @@ describe('Transaction Controller', function () {
providerResultStub.eth_getCode = '0xab';
// test update gasFees
await txController.updateEditableParams('1', {
data:
'0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000',
data: '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000',
});
const result = txStateManager.getTransaction('1');
assert.equal(
@ -2316,8 +2315,7 @@ describe('Transaction Controller', function () {
// maxFeePerGas: '0x004',
to: VALID_ADDRESS,
from: VALID_ADDRESS,
data:
'0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000',
data: '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000',
},
estimateUsed: '0x005',
estimatedBaseFee: '0x006',

View File

@ -198,13 +198,8 @@ export default class PendingTransactionTracker extends EventEmitter {
try {
const transactionReceipt = await this.query.getTransactionReceipt(txHash);
if (transactionReceipt?.blockNumber) {
const {
baseFeePerGas,
timestamp: blockTimestamp,
} = await this.query.getBlockByHash(
transactionReceipt?.blockHash,
false,
);
const { baseFeePerGas, timestamp: blockTimestamp } =
await this.query.getBlockByHash(transactionReceipt?.blockHash, false);
this.emit(
'tx:confirmed',

View File

@ -154,8 +154,7 @@ describe('PendingTransactionTracker', function () {
it('should call _checkPendingTx for each pending transaction', async function () {
const txMeta = {
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SIGNED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -212,8 +211,7 @@ describe('PendingTransactionTracker', function () {
it('should publish a new transaction', async function () {
const txMeta = {
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SIGNED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -257,8 +255,7 @@ describe('PendingTransactionTracker', function () {
it('should publish the given transaction if more than 2**retryCount blocks have passed', async function () {
const txMeta = {
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SIGNED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -304,8 +301,7 @@ describe('PendingTransactionTracker', function () {
it('should NOT publish the given transaction if fewer than 2**retryCount blocks have passed', async function () {
const txMeta = {
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SIGNED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -404,8 +400,7 @@ describe('PendingTransactionTracker', function () {
assert.ok(
await pendingTxTracker._checkIfTxWasDropped({
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SUBMITTED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -437,8 +432,7 @@ describe('PendingTransactionTracker', function () {
const dropped = await pendingTxTracker._checkIfTxWasDropped({
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SUBMITTED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -458,8 +452,7 @@ describe('PendingTransactionTracker', function () {
const confirmedTxList = [
{
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.CONFIRMED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -471,8 +464,7 @@ describe('PendingTransactionTracker', function () {
},
{
id: 2,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.CONFIRMED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -517,8 +509,7 @@ describe('PendingTransactionTracker', function () {
const confirmedTxList = [
{
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.CONFIRMED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -530,8 +521,7 @@ describe('PendingTransactionTracker', function () {
},
{
id: 2,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.CONFIRMED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -577,8 +567,7 @@ describe('PendingTransactionTracker', function () {
it("should emit 'tx:warning' if getTransactionReceipt rejects", async function () {
const txMeta = {
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SUBMITTED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
@ -730,8 +719,7 @@ describe('PendingTransactionTracker', function () {
txParams: { nonce: '0x1' },
id: '123',
value: '0x02',
hash:
'0x2a919d2512ec963f524bfd9730fb66b6d5a2e399d1dd957abb5e2b544a12644b',
hash: '0x2a919d2512ec963f524bfd9730fb66b6d5a2e399d1dd957abb5e2b544a12644b',
},
];
const pendingTxTracker = new PendingTransactionTracker({
@ -774,8 +762,7 @@ describe('PendingTransactionTracker', function () {
const nonceBN = new BN(2);
const txMeta = {
id: 1,
hash:
'0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
status: TRANSACTION_STATUSES.SUBMITTED,
txParams: {
from: '0x1678a085c290ebd122dc42cba69373b5953b831d',

View File

@ -102,11 +102,8 @@ export default class TxGasUtil {
}
async getBufferedGasLimit(txMeta, multiplier) {
const {
blockGasLimit,
estimatedGasHex,
simulationFails,
} = await this.analyzeGasUsage(txMeta);
const { blockGasLimit, estimatedGasHex, simulationFails } =
await this.analyzeGasUsage(txMeta);
// add additional gas buffer to our estimation for safety
const gasLimit = this.addGasBuffer(

View File

@ -82,9 +82,8 @@ const createTransakUrl = (walletAddress, chainId) => {
* @returns String
*/
const createMoonPayUrl = async (walletAddress, chainId) => {
const {
moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {},
} = BUYABLE_CHAINS_MAP[chainId];
const { moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {} } =
BUYABLE_CHAINS_MAP[chainId];
const moonPayQueryParams = new URLSearchParams({
apiKey: MOONPAY_API_KEY,
walletAddress,

View File

@ -116,9 +116,8 @@ describe('buy-url', () => {
});
it('returns a MoonPay url with a prefilled wallet address for the Ethereum network', async () => {
const {
moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {},
} = BUYABLE_CHAINS_MAP[MAINNET.chainId];
const { moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {} } =
BUYABLE_CHAINS_MAP[MAINNET.chainId];
const moonPayQueryParams = new URLSearchParams({
apiKey: MOONPAY_API_KEY,
walletAddress: MAINNET.address,

View File

@ -35,9 +35,8 @@ export default async function resolveEnsToIpfsContentId({ provider, name }) {
const type = contentHash.getCodec(rawContentHash);
if (type === 'ipfs-ns' || type === 'ipns-ns') {
decodedContentHash = contentHash.helpers.cidV0ToV1Base32(
decodedContentHash,
);
decodedContentHash =
contentHash.helpers.cidV0ToV1Base32(decodedContentHash);
}
return { type, hash: decodedContentHash };

View File

@ -314,8 +314,9 @@ export default class PersonalMessageManager extends EventEmitter {
*/
_saveMsgList() {
const unapprovedPersonalMsgs = this.getUnapprovedMsgs();
const unapprovedPersonalMsgCount = Object.keys(unapprovedPersonalMsgs)
.length;
const unapprovedPersonalMsgCount = Object.keys(
unapprovedPersonalMsgs,
).length;
this.memStore.updateState({
unapprovedPersonalMsgs,
unapprovedPersonalMsgCount,

View File

@ -391,8 +391,9 @@ export default class TypedMessageManager extends EventEmitter {
*/
_saveMsgList() {
const unapprovedTypedMessages = this.getUnapprovedMsgs();
const unapprovedTypedMessagesCount = Object.keys(unapprovedTypedMessages)
.length;
const unapprovedTypedMessagesCount = Object.keys(
unapprovedTypedMessages,
).length;
this.memStore.updateState({
unapprovedTypedMessages,
unapprovedTypedMessagesCount,

File diff suppressed because it is too large Load Diff

View File

@ -221,9 +221,10 @@ describe('MetaMaskController', function () {
});
it('adds private key to keyrings in KeyringController', async function () {
const simpleKeyrings = metamaskController.keyringController.getKeyringsByType(
'Simple Key Pair',
);
const simpleKeyrings =
metamaskController.keyringController.getKeyringsByType(
'Simple Key Pair',
);
const privKeyBuffer = simpleKeyrings[0].wallets[0].privateKey;
const pubKeyBuffer = simpleKeyrings[0].wallets[0].publicKey;
const addressBuffer = pubToAddress(pubKeyBuffer);
@ -234,7 +235,8 @@ describe('MetaMaskController', function () {
});
it('adds 1 account', async function () {
const keyringAccounts = await metamaskController.keyringController.getAccounts();
const keyringAccounts =
await metamaskController.keyringController.getAccounts();
assert.equal(
keyringAccounts[keyringAccounts.length - 1],
'0xe18035bf8712672935fdb4e5e431b1a0183d2dfc',
@ -259,7 +261,8 @@ describe('MetaMaskController', function () {
const identities = Object.keys(
metamaskController.preferencesController.store.getState().identities,
);
const addresses = await metamaskController.keyringController.getAccounts();
const addresses =
await metamaskController.keyringController.getAccounts();
identities.forEach((identity) => {
assert.ok(
@ -486,7 +489,8 @@ describe('MetaMaskController', function () {
});
it('changes preferences controller select address', function () {
const preferenceControllerState = metamaskController.preferencesController.store.getState();
const preferenceControllerState =
metamaskController.preferencesController.store.getState();
assert.equal(preferenceControllerState.selectedAddress, address);
});
@ -517,9 +521,10 @@ describe('MetaMaskController', function () {
await metamaskController
.connectHardware(DEVICE_NAMES.TREZOR, 0)
.catch(() => null);
const keyrings = await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
const keyrings =
await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
assert.deepEqual(
metamaskController.keyringController.addNewKeyring.getCall(0).args,
[KEYRING_TYPES.TREZOR],
@ -532,9 +537,10 @@ describe('MetaMaskController', function () {
await metamaskController
.connectHardware(DEVICE_NAMES.LEDGER, 0)
.catch(() => null);
const keyrings = await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.LEDGER,
);
const keyrings =
await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.LEDGER,
);
assert.deepEqual(
metamaskController.keyringController.addNewKeyring.getCall(0).args,
[KEYRING_TYPES.LEDGER],
@ -586,9 +592,10 @@ describe('MetaMaskController', function () {
.connectHardware(DEVICE_NAMES.TREZOR, 0)
.catch(() => null);
await metamaskController.forgetDevice(DEVICE_NAMES.TREZOR);
const keyrings = await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
const keyrings =
await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
assert.deepEqual(keyrings[0].accounts, []);
assert.deepEqual(keyrings[0].page, 0);
@ -645,9 +652,10 @@ describe('MetaMaskController', function () {
});
it('should set unlockedAccount in the keyring', async function () {
const keyrings = await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
const keyrings =
await metamaskController.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
assert.equal(keyrings[0].unlockedAccount, accountToUnlock);
});
@ -690,7 +698,8 @@ describe('MetaMaskController', function () {
CUSTOM_RPC_URL,
CUSTOM_RPC_CHAIN_ID,
);
const networkControllerState = metamaskController.networkController.store.getState();
const networkControllerState =
metamaskController.networkController.store.getState();
assert.equal(networkControllerState.provider.rpcUrl, CUSTOM_RPC_URL);
});
});
@ -726,7 +735,8 @@ describe('MetaMaskController', function () {
it('#addNewAccount', async function () {
await metamaskController.addNewAccount();
const getAccounts = await metamaskController.keyringController.getAccounts();
const getAccounts =
await metamaskController.keyringController.getAccounts();
assert.equal(getAccounts.length, 2);
});
});
@ -959,7 +969,8 @@ describe('MetaMaskController', function () {
// handle the promise so it doesn't throw an unhandledRejection
promise.then(noop).catch(noop);
metamaskPersonalMsgs = metamaskController.personalMessageManager.getUnapprovedMsgs();
metamaskPersonalMsgs =
metamaskController.personalMessageManager.getUnapprovedMsgs();
personalMessages = metamaskController.personalMessageManager.messages;
msgId = Object.keys(metamaskPersonalMsgs)[0];
personalMessages[0].msgParams.metamaskId = parseInt(msgId, 10);
@ -1250,9 +1261,8 @@ describe('MetaMaskController', function () {
describe('markNotificationsAsRead', function () {
it('marks the notification as read', function () {
metamaskController.markNotificationsAsRead([NOTIFICATION_ID]);
const readNotification = metamaskController.getState().notifications[
NOTIFICATION_ID
];
const readNotification =
metamaskController.getState().notifications[NOTIFICATION_ID];
assert.notEqual(readNotification.readDate, null);
});
});

View File

@ -18,11 +18,8 @@ const storage = {
describe('storage is migrated successfully where transactions that are submitted have submittedTimes', () => {
it('should add submittedTime key on the txMeta if appropriate', async () => {
const migratedData = await migration22.migrate(storage);
const [
txMeta1,
txMeta2,
txMeta3,
] = migratedData.data.TransactionController.transactions;
const [txMeta1, txMeta2, txMeta3] =
migratedData.data.TransactionController.transactions;
expect(migratedData.meta.version).toStrictEqual(22);
// should have written a submitted time

View File

@ -33,7 +33,8 @@ function transformState(state) {
delete frequentRpcListDetail[index].chainId;
}
});
newState.PreferencesController.frequentRpcListDetail = frequentRpcListDetail;
newState.PreferencesController.frequentRpcListDetail =
frequentRpcListDetail;
}
}
if (state.NetworkController) {

View File

@ -21,7 +21,8 @@ function transformState(state) {
if (Array.isArray(transactions)) {
transactions.forEach((transaction) => {
if (typeof transaction.metamaskNetworkId === 'number') {
transaction.metamaskNetworkId = transaction.metamaskNetworkId.toString();
transaction.metamaskNetworkId =
transaction.metamaskNetworkId.toString();
}
});
}

View File

@ -18,11 +18,8 @@ export default {
function transformState(state = {}) {
if (state.PreferencesController) {
const {
metaMetricsId,
participateInMetaMetrics,
metaMetricsSendCount,
} = state.PreferencesController;
const { metaMetricsId, participateInMetaMetrics, metaMetricsSendCount } =
state.PreferencesController;
state.MetaMetricsController = state.MetaMetricsController ?? {};
if (metaMetricsId !== undefined) {
@ -31,7 +28,8 @@ function transformState(state = {}) {
}
if (participateInMetaMetrics !== undefined) {
state.MetaMetricsController.participateInMetaMetrics = participateInMetaMetrics;
state.MetaMetricsController.participateInMetaMetrics =
participateInMetaMetrics;
delete state.PreferencesController.participateInMetaMetrics;
}

View File

@ -34,11 +34,8 @@ export default {
function transformState(state = {}) {
if (state.PreferencesController) {
const {
accountTokens,
accountHiddenTokens,
frequentRpcListDetail,
} = state.PreferencesController;
const { accountTokens, accountHiddenTokens, frequentRpcListDetail } =
state.PreferencesController;
const newAccountTokens = {};
const newAccountHiddenTokens = {};

View File

@ -23,13 +23,16 @@ function transformState(state) {
if (
state?.IncomingTransactionsController?.incomingTxLastFetchedBlocksByNetwork
) {
state.IncomingTransactionsController.incomingTxLastFetchedBlockByChainId = mapKeys(
state.IncomingTransactionsController.incomingTxLastFetchedBlocksByNetwork,
// using optional chaining in case user's state has fetched blocks for
// RPC network types (which don't map to a single chainId). This should
// not be possible, but it's safer
(_, key) => NETWORK_TYPE_TO_ID_MAP[key]?.chainId ?? UNKNOWN_CHAIN_ID_KEY,
);
state.IncomingTransactionsController.incomingTxLastFetchedBlockByChainId =
mapKeys(
state.IncomingTransactionsController
.incomingTxLastFetchedBlocksByNetwork,
// using optional chaining in case user's state has fetched blocks for
// RPC network types (which don't map to a single chainId). This should
// not be possible, but it's safer
(_, key) =>
NETWORK_TYPE_TO_ID_MAP[key]?.chainId ?? UNKNOWN_CHAIN_ID_KEY,
);
// Now that mainnet and test net last fetched blocks are keyed by their
// respective chainIds, we can safely delete anything we had for custom
// networks. Any custom network that shares a chainId with one of the

View File

@ -30,11 +30,10 @@ export default {
PreferencesController.accountTokens[account],
);
chains.forEach((chain) => {
PreferencesController.accountTokens[account][
chain
] = PreferencesController.accountTokens[account][chain].filter(
({ address }) => address,
);
PreferencesController.accountTokens[account][chain] =
PreferencesController.accountTokens[account][chain].filter(
({ address }) => address,
);
});
});
}

View File

@ -95,8 +95,7 @@ describe('migration #64', () => {
s: '0x49f74084dd8c517b305a2e60b39ae9002176a5244cb06de8f9ea3757811f5ec6',
status: 'confirmed',
estimatedBaseFee: 'b',
hash:
'0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12',
hash: '0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12',
},
1: {
type: SENT_ETHER,
@ -118,8 +117,7 @@ describe('migration #64', () => {
status: 'unapproved',
time: 1631118004776,
txParams: {
data:
'0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029',
data: '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029',
from: '0x0f002c95c041f003be01c3e4f52cae1f6ab3ba6e',
gas: '0x31413',
value: '0x0',
@ -159,8 +157,7 @@ describe('migration #64', () => {
gas: '0xa9fe',
},
estimatedBaseFee: 'b',
hash:
'0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b',
hash: '0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b',
origin: 'https://metamask.github.io',
r: '0xc2b2901f3593536d21e9b136c469b9b8f91a944f18a29a3cdf3a2eaadf660e71',
rawTx:
@ -277,8 +274,7 @@ describe('migration #64', () => {
s: '0x49f74084dd8c517b305a2e60b39ae9002176a5244cb06de8f9ea3757811f5ec6',
status: 'confirmed',
estimatedBaseFee: 'b',
hash:
'0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12',
hash: '0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12',
},
1: {
type: TRANSACTION_TYPES.SIMPLE_SEND,
@ -300,8 +296,7 @@ describe('migration #64', () => {
status: 'unapproved',
time: 1631118004776,
txParams: {
data:
'0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029',
data: '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029',
from: '0x0f002c95c041f003be01c3e4f52cae1f6ab3ba6e',
gas: '0x31413',
value: '0x0',
@ -341,8 +336,7 @@ describe('migration #64', () => {
gas: '0xa9fe',
},
estimatedBaseFee: 'b',
hash:
'0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b',
hash: '0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b',
origin: 'https://metamask.github.io',
r: '0xc2b2901f3593536d21e9b136c469b9b8f91a944f18a29a3cdf3a2eaadf660e71',
rawTx:

View File

@ -19,10 +19,8 @@ export default {
function transformState(state) {
if (state.PreferencesController) {
const {
completedOnboarding,
firstTimeFlowType,
} = state.PreferencesController;
const { completedOnboarding, firstTimeFlowType } =
state.PreferencesController;
state.OnboardingController = state.OnboardingController ?? {};
if (completedOnboarding !== undefined) {

View File

@ -36,14 +36,13 @@ function transformState(state) {
const cachedBalances = state.CachedBalancesController?.cachedBalances || {};
const userIsCurrentlyOnATestNet = TEST_CHAINS.includes(provider?.chainId);
const userHasMadeATestNetTransaction = Object.values(
transactions,
).some(({ chainId }) => TEST_CHAINS.includes(chainId));
const userHasMadeATestNetTransaction = Object.values(transactions).some(
({ chainId }) => TEST_CHAINS.includes(chainId),
);
const userHasACachedBalanceOnATestnet = TEST_CHAINS.some((chainId) => {
const cachedBalancesForChain = Object.values(cachedBalances[chainId] || {});
const userHasABalanceGreaterThanZeroOnThisChain = cachedBalancesForChain.some(
hexNumberIsGreaterThanZero,
);
const userHasABalanceGreaterThanZeroOnThisChain =
cachedBalancesForChain.some(hexNumberIsGreaterThanZero);
return userHasABalanceGreaterThanZeroOnThisChain;
});
const userHasUsedATestnet =

View File

@ -38,9 +38,8 @@ function transformState(state) {
permissionActivityLog: permissionsLog,
permissionHistory: permissionsHistory,
},
SubjectMetadataController: getSubjectMetadataControllerState(
domainMetadata,
),
SubjectMetadataController:
getSubjectMetadataControllerState(domainMetadata),
};
}

View File

@ -119,10 +119,8 @@ describe('migration #68', () => {
};
const newStorage = await migration68.migrate(oldStorage);
const {
PermissionLogController,
SubjectMetadataController,
} = newStorage.data;
const { PermissionLogController, SubjectMetadataController } =
newStorage.data;
const expected = getOldState().PermissionsMetadata;
expect(PermissionLogController.permissionHistory).toStrictEqual(

View File

@ -80,10 +80,8 @@ export default class ExtensionPlatform {
}
getVersion() {
const {
version,
version_name: versionName,
} = browser.runtime.getManifest();
const { version, version_name: versionName } =
browser.runtime.getManifest();
const versionParts = version.split('.');
if (versionName) {

View File

@ -320,9 +320,8 @@ function removeFencedCode(filePath, typeOfCurrentBuild, fileContent) {
let currentCommand;
for (let i = 0; i < parsedDirectives.length; i++) {
const { line, indices, terminus, command, parameters } = parsedDirectives[
i
];
const { line, indices, terminus, command, parameters } =
parsedDirectives[i];
if (i % 2 === 0) {
if (terminus !== DirectiveTerminuses.BEGIN) {
throw new Error(
@ -368,9 +367,8 @@ function removeFencedCode(filePath, typeOfCurrentBuild, fileContent) {
}
// Forbid empty fences
const { line: previousLine, indices: previousIndices } = parsedDirectives[
i - 1
];
const { line: previousLine, indices: previousIndices } =
parsedDirectives[i - 1];
if (fileContent.substring(previousIndices[1], indices[0]).trim() === '') {
throw new Error(
`Empty fence found in file "${filePath}":\n${previousLine}\n${line}\n`,

View File

@ -289,9 +289,8 @@ describe('build/transforms/remove-fenced-code', () => {
),
).toStrictEqual([ignoredLine, true]);
const modifiedInputWithoutFences = testData.validInputs.withoutFences.concat(
ignoredLine,
);
const modifiedInputWithoutFences =
testData.validInputs.withoutFences.concat(ignoredLine);
// These inputs will not be transformed
expect(

View File

@ -183,7 +183,8 @@ async function verifyEnglishLocale() {
ignore: [testGlob],
});
const strictSearchRegex = /\bt\(\s*'(\w+)'\s*\)|\btranslationKey:\s*'(\w+)'/gu;
const strictSearchRegex =
/\bt\(\s*'(\w+)'\s*\)|\btranslationKey:\s*'(\w+)'/gu;
// match "t(`...`)" because constructing message keys from template strings
// prevents this script from finding the messages, and then inappropriately
// deletes them

View File

@ -296,7 +296,7 @@
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.22.1",
@ -304,7 +304,7 @@
"eslint-plugin-jsdoc": "^39.3.3",
"eslint-plugin-mocha": "^8.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0",
"fancy-log": "^1.3.3",
@ -343,7 +343,7 @@
"nyc": "^15.0.0",
"patch-package": "^6.4.7",
"polyfill-crypto.getrandomvalues": "^1.0.0",
"prettier": "^2.2.1",
"prettier": "^2.7.1",
"prettier-plugin-sort-json": "^0.0.1",
"proxyquire": "^2.1.3",
"pumpify": "^2.0.1",

View File

@ -5,9 +5,9 @@ import contractMap from '@metamask/contract-metadata';
* `@metamask/contract-metadata`. Used primarily to validate if manually entered
* contract addresses do not match one of our listed tokens
*/
export const LISTED_CONTRACT_ADDRESSES = Object.keys(
contractMap,
).map((address) => address.toLowerCase());
export const LISTED_CONTRACT_ADDRESSES = Object.keys(contractMap).map(
(address) => address.toLowerCase(),
);
/**
* @typedef {object} TokenDetails

View File

@ -19,12 +19,11 @@ describe('Contract Utils', () => {
},
};
const {
isContractAddress: isNotContractAddress,
} = await readAddressAsContract(
mockEthQuery,
'0x76B4aa9Fc4d351a0062c6af8d186DF959D564A84',
);
const { isContractAddress: isNotContractAddress } =
await readAddressAsContract(
mockEthQuery,
'0x76B4aa9Fc4d351a0062c6af8d186DF959D564A84',
);
expect(isNotContractAddress).toStrictEqual(false);
});
});

View File

@ -157,10 +157,8 @@ export async function determineTransactionType(txParams, query) {
if (data && !to) {
result = TRANSACTION_TYPES.DEPLOY_CONTRACT;
} else {
const {
contractCode: resultCode,
isContractAddress,
} = await readAddressAsContract(query, to);
const { contractCode: resultCode, isContractAddress } =
await readAddressAsContract(query, to);
contractCode = resultCode;

View File

@ -149,8 +149,7 @@ describe('Transaction.utils', function () {
const result = await determineTransactionType(
{
to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9',
data:
'0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a',
data: '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a',
},
new EthQuery(_provider),
);
@ -174,8 +173,7 @@ describe('Transaction.utils', function () {
const result = await determineTransactionType(
{
to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9',
data:
'0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a',
data: '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a',
},
new EthQuery(_provider),
);
@ -199,8 +197,7 @@ describe('Transaction.utils', function () {
const result = await determineTransactionType(
{
to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9',
data:
'0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005',
data: '0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005',
},
new EthQuery(_provider),
);

View File

@ -405,8 +405,7 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector(
{
css:
'.transaction-list__completed-transactions .transaction-list-item__primary-currency',
css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency',
text: '-1 TST',
},
{ timeout: 10000 },
@ -488,8 +487,7 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector({
css:
'.transaction-list__completed-transactions .transaction-list-item__primary-currency',
css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency',
text: '-1.5 TST',
});
@ -545,8 +543,7 @@ describe('MetaMask', function () {
await driver.waitForSelector({
// Selects only the very first transaction list item immediately following the 'Pending' header
css:
'.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
text: 'Approve TST spend limit',
});
@ -638,8 +635,7 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector({
// Select only the heading of the first entry in the transaction list.
css:
'.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
text: 'Approve TST spend limit',
});
});
@ -691,14 +687,12 @@ describe('MetaMask', function () {
await driver.waitForSelector({
// Select the heading of the first transaction list item in the
// completed transaction list with text matching Send TST
css:
'.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
text: 'Send TST',
});
await driver.waitForSelector({
css:
'.transaction-list__completed-transactions .transaction-list-item:first-child .transaction-list-item__primary-currency',
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .transaction-list-item__primary-currency',
text: '-1.5 TST',
});
});
@ -735,8 +729,7 @@ describe('MetaMask', function () {
await driver.waitForSelector({
// Selects only the very first transaction list item immediately following the 'Pending' header
css:
'.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
text: 'Approve TST spend limit',
});
@ -760,8 +753,7 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector({
css:
'.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
text: 'Approve TST spend limit',
});
});

View File

@ -39,11 +39,8 @@ describe('Chain Interactions', function () {
);
// verify chain details
const [
networkName,
networkUrl,
chainIdElement,
] = await driver.findElements('.definition-list dd');
const [networkName, networkUrl, chainIdElement] =
await driver.findElements('.definition-list dd');
assert.equal(await networkName.getText(), `Localhost ${port}`);
assert.equal(await networkUrl.getText(), `http://127.0.0.1:${port}`);
assert.equal(await chainIdElement.getText(), chainId.toString());

View File

@ -132,8 +132,7 @@ describe('Stores custom RPC history', function () {
await chainIdInput.clear();
await chainIdInput.sendKeys(duplicateChainId);
await driver.findElement({
text:
'This Chain ID is currently used by the Localhost 8545 network.',
text: 'This Chain ID is currently used by the Localhost 8545 network.',
tag: 'h6',
});

View File

@ -171,8 +171,7 @@ describe.skip('Create token, approve token and approve token without gas', funct
await driver.waitForSelector({
// Selects only the very first transaction list item immediately following the 'Pending' header
css:
'.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
text: 'Approve Token spend limit',
});
},
@ -230,8 +229,7 @@ describe.skip('Create token, approve token and approve token without gas', funct
await driver.clickElement({ text: 'Save', tag: 'button' });
await driver.waitForSelector({
css:
'.confirm-approve-content__transaction-details-content__secondary-fee',
css: '.confirm-approve-content__transaction-details-content__secondary-fee',
text: '0.0006 ETH',
});
@ -269,8 +267,7 @@ describe.skip('Create token, approve token and approve token without gas', funct
await driver.clickElement({ tag: 'button', text: 'Activity' });
await driver.waitForSelector({
// Select only the heading of the first entry in the transaction list.
css:
'.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
text: 'Approve Token spend limit',
});
},
@ -331,8 +328,7 @@ describe.skip('Create token, approve token and approve token without gas', funct
await driver.waitForSelector({
// Selects only the very first transaction list item immediately following the 'Pending' header
css:
'.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',
text: 'Approve Token spend limit',
});
@ -347,8 +343,7 @@ describe.skip('Create token, approve token and approve token without gas', funct
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.waitForSelector({
css:
'.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
text: 'Approve Token spend limit',
});
},

View File

@ -58,14 +58,13 @@ const AddNetwork = () => {
const [showPopover, setShowPopover] = useState(false);
useEffect(() => {
const anAddNetworkConfirmationFromMetaMaskExists = unapprovedConfirmations?.find(
(confirmation) => {
const anAddNetworkConfirmationFromMetaMaskExists =
unapprovedConfirmations?.find((confirmation) => {
return (
confirmation.origin === 'metamask' &&
confirmation.type === MESSAGE_TYPE.ADD_ETHEREUM_CHAIN
);
},
);
});
if (!showPopover && anAddNetworkConfirmationFromMetaMaskExists) {
setShowPopover(true);
}

View File

@ -22,11 +22,8 @@ import { useI18nContext } from '../../../../hooks/useI18nContext';
const AdvancedGasFeeDefaults = () => {
const t = useI18nContext();
const dispatch = useDispatch();
const {
gasErrors,
maxBaseFee,
maxPriorityFeePerGas,
} = useAdvancedGasFeePopoverContext();
const { gasErrors, maxBaseFee, maxPriorityFeePerGas } =
useAdvancedGasFeePopoverContext();
const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues);
const { updateTransactionEventFragment } = useTransactionEventFragment();
const { editGasMode } = useGasFeeContext();

View File

@ -20,14 +20,10 @@ const validateGasLimit = (gasLimit, minimumGasLimitDec) => {
const AdvancedGasFeeGasLimit = () => {
const t = useI18nContext();
const {
setGasLimit: setGasLimitInContext,
setErrorValue,
} = useAdvancedGasFeePopoverContext();
const {
gasLimit: gasLimitInTransaction,
minimumGasLimitDec,
} = useGasFeeContext();
const { setGasLimit: setGasLimitInContext, setErrorValue } =
useAdvancedGasFeePopoverContext();
const { gasLimit: gasLimitInTransaction, minimumGasLimitDec } =
useGasFeeContext();
const [isEditing, setEditing] = useState(false);
const [gasLimit, setGasLimit] = useState(gasLimitInTransaction);
const [gasLimitError, setGasLimitError] = useState();

View File

@ -45,12 +45,8 @@ const validateBaseFee = (value, gasFeeEstimates, maxPriorityFeePerGas) => {
const BaseFeeInput = () => {
const t = useI18nContext();
const {
gasFeeEstimates,
estimateUsed,
maxFeePerGas,
editGasMode,
} = useGasFeeContext();
const { gasFeeEstimates, estimateUsed, maxFeePerGas, editGasMode } =
useGasFeeContext();
const {
gasLimit,
maxPriorityFeePerGas,
@ -59,11 +55,8 @@ const BaseFeeInput = () => {
setMaxBaseFee,
} = useAdvancedGasFeePopoverContext();
const {
estimatedBaseFee,
historicalBaseFeeRange,
baseFeeTrend,
} = gasFeeEstimates;
const { estimatedBaseFee, historicalBaseFeeRange, baseFeeTrend } =
gasFeeEstimates;
const [baseFeeError, setBaseFeeError] = useState();
const { currency, numberOfDecimals } = useUserPreferencedCurrency(PRIMARY);

View File

@ -46,17 +46,10 @@ const validatePriorityFee = (value, gasFeeEstimates) => {
const PriorityFeeInput = () => {
const t = useI18nContext();
const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues);
const {
gasLimit,
setErrorValue,
setMaxPriorityFeePerGas,
} = useAdvancedGasFeePopoverContext();
const {
editGasMode,
estimateUsed,
gasFeeEstimates,
maxPriorityFeePerGas,
} = useGasFeeContext();
const { gasLimit, setErrorValue, setMaxPriorityFeePerGas } =
useAdvancedGasFeePopoverContext();
const { editGasMode, estimateUsed, gasFeeEstimates, maxPriorityFeePerGas } =
useGasFeeContext();
const {
latestPriorityFeeRange,
historicalPriorityFeeRange,

View File

@ -15,12 +15,8 @@ const AdvancedGasFeeSaveButton = () => {
const { updateTransactionEventFragment } = useTransactionEventFragment();
const { updateTransaction } = useGasFeeContext();
const t = useI18nContext();
const {
gasLimit,
hasErrors,
maxFeePerGas,
maxPriorityFeePerGas,
} = useAdvancedGasFeePopoverContext();
const { gasLimit, hasErrors, maxFeePerGas, maxPriorityFeePerGas } =
useAdvancedGasFeePopoverContext();
const onSave = () => {
updateTransaction({

View File

@ -57,13 +57,11 @@ const AssetList = ({ onClickAsset }) => {
},
);
const [
secondaryCurrencyDisplay,
secondaryCurrencyProperties,
] = useCurrencyDisplay(selectedAccountBalance, {
numberOfDecimals: secondaryNumberOfDecimals,
currency: secondaryCurrency,
});
const [secondaryCurrencyDisplay, secondaryCurrencyProperties] =
useCurrencyDisplay(selectedAccountBalance, {
numberOfDecimals: secondaryNumberOfDecimals,
currency: secondaryCurrency,
});
const primaryTokenImage = useSelector(getNativeCurrencyImage);
const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork) || [];

View File

@ -36,7 +36,8 @@ export default function CancelButton({
type="secondary"
className={classnames({
'transaction-list-item__header-button': !detailsModal,
'transaction-list-item-details__header-button-rounded-button': detailsModal,
'transaction-list-item-details__header-button-rounded-button':
detailsModal,
})}
disabled={!hasEnoughCancelGas}
>

View File

@ -24,10 +24,8 @@ const MAXGASCOST_ABOVE_MOCK_MEDIUM_BN = new BigNumber(
MAXFEEPERGAS_ABOVE_MOCK_MEDIUM_HEX,
16,
).times(21000, 10);
const MAXGASCOST_ABOVE_MOCK_MEDIUM_BN_PLUS_TEN_PCT_HEX = MAXGASCOST_ABOVE_MOCK_MEDIUM_BN.times(
1.1,
10,
).toString(16);
const MAXGASCOST_ABOVE_MOCK_MEDIUM_BN_PLUS_TEN_PCT_HEX =
MAXGASCOST_ABOVE_MOCK_MEDIUM_BN.times(1.1, 10).toString(16);
const EXPECTED_ETH_FEE_1 = hexWEIToDecETH(
MAXGASCOST_ABOVE_MOCK_MEDIUM_BN_PLUS_TEN_PCT_HEX,
@ -40,18 +38,15 @@ const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI = new BigNumber(
decGWEIToHexWEI(MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_DEC_GWEI),
16,
);
const MAXFEEPERGAS_BELOW_MOCK_MEDIUM_HEX = MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.div(
10,
10,
).toString(16);
const MAXFEEPERGAS_BELOW_MOCK_MEDIUM_HEX =
MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.div(10, 10).toString(16);
const EXPECTED_ETH_FEE_2 = hexWEIToDecETH(
MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.times(21000, 10).toString(16),
);
const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_HEX_WEI = MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.toString(
16,
);
const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_HEX_WEI =
MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.toString(16);
jest.mock('../../../store/actions', () => ({
disconnectGasFeeEstimatePoller: jest.fn(),

View File

@ -6,10 +6,8 @@ import { Menu, MenuItem } from '../../ui/menu';
const CollectibleOptions = ({ onRemove, onViewOnOpensea }) => {
const t = useContext(I18nContext);
const [
collectibleOptionsButtonElement,
setCollectibleOptionsButtonElement,
] = useState(null);
const [collectibleOptionsButtonElement, setCollectibleOptionsButtonElement] =
useState(null);
const [collectibleOptionsOpen, setCollectibleOptionsOpen] = useState(false);
return (

View File

@ -118,9 +118,8 @@ export default function CollectiblesItems({
[key]: !isExpanded,
};
collectiblesDropdownState[selectedAddress][
chainId
] = newCurrentAccountState;
collectiblesDropdownState[selectedAddress][chainId] =
newCurrentAccountState;
dispatch(updateCollectibleDropDownState(collectiblesDropdownState));
};
@ -186,13 +185,8 @@ export default function CollectiblesItems({
{isExpanded ? (
<Box display={DISPLAY.FLEX} flexWrap={FLEX_WRAP.WRAP} gap={4}>
{collectibles.map((collectible, i) => {
const {
image,
address,
tokenId,
backgroundColor,
name,
} = collectible;
const { image, address, tokenId, backgroundColor, name } =
collectible;
const collectibleImage = getAssetImageURL(image, ipfsGateway);
const handleImageClick = () =>
history.push(`${ASSET_ROUTE}/${address}/${tokenId}`);
@ -249,11 +243,8 @@ export default function CollectiblesItems({
>
<>
{collectionsKeys.map((key) => {
const {
collectibles,
collectionName,
collectionImage,
} = collections[key];
const { collectibles, collectionName, collectionImage } =
collections[key];
return renderCollection({
collectibles,

View File

@ -36,11 +36,8 @@ export default function CollectiblesTab({ onAddNFT }) {
const t = useI18nContext();
const dispatch = useDispatch();
const {
collectiblesLoading,
collections,
previouslyOwnedCollection,
} = useCollectiblesCollections();
const { collectiblesLoading, collections, previouslyOwnedCollection } =
useCollectiblesCollections();
const onEnableAutoDetect = () => {
history.push(EXPERIMENTAL_ROUTE);

View File

@ -182,10 +182,12 @@ describe('Collectible Items', () => {
const checkAndUpdateAllCollectiblesOwnershipStatusStub = jest.fn();
const updateCollectibleDropDownStateStub = jest.fn();
setBackgroundConnection({
setCollectiblesDetectionNoticeDismissed: setCollectiblesDetectionNoticeDismissedStub,
setCollectiblesDetectionNoticeDismissed:
setCollectiblesDetectionNoticeDismissedStub,
detectCollectibles: detectCollectiblesStub,
getState: getStateStub,
checkAndUpdateAllCollectiblesOwnershipStatus: checkAndUpdateAllCollectiblesOwnershipStatusStub,
checkAndUpdateAllCollectiblesOwnershipStatus:
checkAndUpdateAllCollectiblesOwnershipStatusStub,
updateCollectibleDropDownState: updateCollectibleDropDownStateStub,
});
const historyPushMock = jest.fn();

View File

@ -42,9 +42,8 @@ const ConfirmPageContainerSummary = (props) => {
TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM,
TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM,
];
const isContractTypeTransaction = contractInitiatedTransactionType.includes(
transactionType,
);
const isContractTypeTransaction =
contractInitiatedTransactionType.includes(transactionType);
let contractAddress;
if (isContractTypeTransaction) {
// If the transaction is TOKEN_METHOD_TRANSFER or TOKEN_METHOD_TRANSFER_FROM

View File

@ -125,11 +125,8 @@ export default class ConnectedAccountsList extends PureComponent {
}
render() {
const {
connectedAccounts,
selectedAddress,
shouldRenderListOptions,
} = this.props;
const { connectedAccounts, selectedAddress, shouldRenderListOptions } =
this.props;
const { t } = this.context;
return (

View File

@ -36,7 +36,8 @@ const ConnectedAccountsPermissions = ({ permissions }) => {
className={classnames(
'connected-accounts-permissions__list-container',
{
'connected-accounts-permissions__list-container--expanded': expanded,
'connected-accounts-permissions__list-container--expanded':
expanded,
},
)}
>

View File

@ -37,10 +37,8 @@ export default function RecipientGroup({
address,
selectedAddress,
),
'send__select-recipient-wrapper__group-item--selected': addressesEqual(
address,
selectedAddress,
),
'send__select-recipient-wrapper__group-item--selected':
addressesEqual(address, selectedAddress),
})}
>
<Identicon address={address} diameter={28} />

View File

@ -27,9 +27,8 @@ const DetectedTokenSelectionPopover = ({
const trackEvent = useContext(MetaMetricsContext);
const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork);
const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection(
tokensListDetected,
);
const { selected: selectedTokens = [] } =
sortingBasedOnTokenSelection(tokensListDetected);
const numOfTokensImporting =
selectedTokens.length === detectedTokens.length
? `All`

View File

@ -45,10 +45,8 @@ const DetectedToken = ({ setShowDetectedTokens }) => {
return tokenObj;
}, {}),
);
const [
showDetectedTokenIgnoredPopover,
setShowDetectedTokenIgnoredPopover,
] = useState(false);
const [showDetectedTokenIgnoredPopover, setShowDetectedTokenIgnoredPopover] =
useState(false);
const importSelectedTokens = async (selectedTokens) => {
selectedTokens.forEach((importedToken) => {
@ -71,10 +69,8 @@ const DetectedToken = ({ setShowDetectedTokens }) => {
};
const handleClearTokensSelection = async () => {
const {
selected: selectedTokens = [],
deselected: deSelectedTokens = [],
} = sortingBasedOnTokenSelection(tokensListDetected);
const { selected: selectedTokens = [], deselected: deSelectedTokens = [] } =
sortingBasedOnTokenSelection(tokensListDetected);
if (deSelectedTokens.length < detectedTokens.length) {
await importSelectedTokens(selectedTokens);
@ -115,9 +111,8 @@ const DetectedToken = ({ setShowDetectedTokens }) => {
};
const onImport = async () => {
const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection(
tokensListDetected,
);
const { selected: selectedTokens = [] } =
sortingBasedOnTokenSelection(tokensListDetected);
if (selectedTokens.length < detectedTokens.length) {
setShowDetectedTokenIgnoredPopover(true);

View File

@ -295,9 +295,8 @@ class NetworkDropdown extends Component {
onClickOutside={(event) => {
const { classList } = event.target;
const isInClassList = (className) => classList.contains(className);
const notToggleElementIndex = notToggleElementClassnames.findIndex(
isInClassList,
);
const notToggleElementIndex =
notToggleElementClassnames.findIndex(isInClassList);
if (notToggleElementIndex === -1) {
event.stopPropagation();

View File

@ -99,9 +99,8 @@ export default function EditGasDisplay({
}
}, [showAdvancedForm]);
const dappSuggestedAndTxParamGasFeesAreTheSame = areDappSuggestedAndTxParamGasFeesTheSame(
transaction,
);
const dappSuggestedAndTxParamGasFeesAreTheSame =
areDappSuggestedAndTxParamGasFeesTheSame(transaction);
const requireDappAcknowledgement = Boolean(
transaction?.dappSuggestedGasFees &&

View File

@ -21,12 +21,8 @@ import NetworkStatistics from './network-statistics';
const EditGasFeePopover = () => {
const { balanceError, editGasMode } = useGasFeeContext();
const t = useI18nContext();
const {
closeAllModals,
closeModal,
currentModal,
openModalCount,
} = useTransactionModalContext();
const { closeAllModals, closeModal, currentModal, openModalCount } =
useTransactionModalContext();
if (currentModal !== 'editGasFee') {
return null;

View File

@ -29,9 +29,8 @@ export const useGasItemFeeDetails = (priorityLevel) => {
maxPriorityFeePerGas: maxPriorityFeePerGasValue,
transaction,
} = useGasFeeContext();
const [estimateGreaterThanGasUse, setEstimateGreaterThanGasUse] = useState(
false,
);
const [estimateGreaterThanGasUse, setEstimateGreaterThanGasUse] =
useState(false);
const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues);
let maxFeePerGas;

View File

@ -63,10 +63,8 @@ export default function EditGasPopover({
supportsEIP1559;
const [showEducationContent, setShowEducationContent] = useState(false);
const [
dappSuggestedGasFeeAcknowledged,
setDappSuggestedGasFeeAcknowledged,
] = useState(false);
const [dappSuggestedGasFeeAcknowledged, setDappSuggestedGasFeeAcknowledged] =
useState(false);
const minimumGasLimitDec = hexToDecimal(minimumGasLimit);
const updatedCustomGasSettings = useIncrementedGasFees(transaction);

View File

@ -15,7 +15,8 @@ function lineBreaksToBr(source) {
});
}
const METAMASK_LOGO = lineBreaksToBr(`MMm*mmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmm*mMM
const METAMASK_LOGO =
lineBreaksToBr(`MMm*mmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmm*mMM
MM*./***mMMMMMMMMMMMMMMMMMMMMMMMMMMm***/.*MM
MM/...///*mMMMMMMMMMMMMMMMMMMMMMMm*///.../MM
Mm.....//../*mMMMMMMMMMMMMMMMMm*/..//.....mM
@ -57,7 +58,8 @@ MMMMMMMMMMMMMMMMMm/....../mMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMmmmmmmmmMMMMMMMMMMMMMMMMMM`);
/* eslint-disable no-irregular-whitespace */
const EXPERIMENTAL_AREA = lineBreaksToBr(`█▄█ █▀█ █░█ ▀ █▀█ █▀▀   █▀▀ █▄░█ ▀█▀ █▀▀ █▀█ █ █▄░█ █▀▀   ▄▀█ █▄░█
const EXPERIMENTAL_AREA =
lineBreaksToBr(`█▄█ █▀█ █░█ ▀ █▀█ █▀▀   █▀▀ █▄░█ ▀█▀ █▀▀ █▀█ █ █▄░█ █▀▀   ▄▀█ █▄░█

View File

@ -166,7 +166,8 @@ export default class AdvancedGasInputs extends Component {
errorType === 'error',
'advanced-gas-inputs__gas-edit-row__input--warning':
errorType === 'warning',
'advanced-gas-inputs__gas-edit-row__input-arrows--hidden': disabled,
'advanced-gas-inputs__gas-edit-row__input-arrows--hidden':
disabled,
},
)}
>
@ -210,16 +211,14 @@ export default class AdvancedGasInputs extends Component {
return null;
}
const {
errorText: gasPriceErrorText,
errorType: gasPriceErrorType,
} = this.gasPriceError({
insufficientBalance,
customPriceIsSafe,
isSpeedUp,
gasPrice,
customPriceIsExcessive,
});
const { errorText: gasPriceErrorText, errorType: gasPriceErrorType } =
this.gasPriceError({
insufficientBalance,
customPriceIsSafe,
isSpeedUp,
gasPrice,
customPriceIsExcessive,
});
const gasPriceErrorComponent = gasPriceErrorType ? (
<div
className={`advanced-gas-inputs__gas-edit-row__${gasPriceErrorType}-text`}
@ -228,10 +227,8 @@ export default class AdvancedGasInputs extends Component {
</div>
) : null;
const {
errorText: gasLimitErrorText,
errorType: gasLimitErrorType,
} = this.gasLimitError({ insufficientBalance, gasLimit, minimumGasLimit });
const { errorText: gasLimitErrorText, errorType: gasLimitErrorType } =
this.gasLimitError({ insufficientBalance, gasLimit, minimumGasLimit });
const gasLimitErrorComponent = gasLimitErrorType ? (
<div
className={`advanced-gas-inputs__gas-edit-row__${gasLimitErrorType}-text`}

View File

@ -49,9 +49,8 @@ describe('AdvancedTabContent Component', () => {
});
it('should call renderDataSummary with the expected params', () => {
const renderDataSummaryArgs = AdvancedTabContent.prototype.renderDataSummary.getCall(
0,
).args;
const renderDataSummaryArgs =
AdvancedTabContent.prototype.renderDataSummary.getCall(0).args;
expect(renderDataSummaryArgs).toStrictEqual(['$0.25']);
});
});

View File

@ -138,9 +138,8 @@ const mapStateToProps = (state, ownProps) => {
conversionRate,
});
const isGasEstimate = getIsGasEstimatesFetched(state);
const customNetworkEstimateWasFetched = getIsCustomNetworkGasPriceFetched(
state,
);
const customNetworkEstimateWasFetched =
getIsCustomNetworkGasPriceFetched(state);
let customPriceIsSafe = true;
if ((isMainnet || process.env.IN_TEST) && isGasEstimate) {

View File

@ -69,11 +69,8 @@ describe('GasPriceButtonGroup Component', () => {
});
it('should render the correct props on the ButtonGroup', () => {
const {
className,
defaultActiveButtonIndex,
noButtonActiveByDefault,
} = wrapper.props();
const { className, defaultActiveButtonIndex, noButtonActiveByDefault } =
wrapper.props();
expect(className).toStrictEqual('gas-price-button-group');
expect(defaultActiveButtonIndex).toStrictEqual(2);
expect(noButtonActiveByDefault).toStrictEqual(true);
@ -195,14 +192,15 @@ describe('GasPriceButtonGroup Component', () => {
});
it('should render a feeInPrimaryCurrency if passed a feeInPrimaryCurrency', () => {
const renderButtonContentResult = GasPriceButtonGroup.prototype.renderButtonContent(
{
feeInPrimaryCurrency: 'mockFeeInPrimaryCurrency',
},
{
className: 'someClass',
},
);
const renderButtonContentResult =
GasPriceButtonGroup.prototype.renderButtonContent(
{
feeInPrimaryCurrency: 'mockFeeInPrimaryCurrency',
},
{
className: 'someClass',
},
);
const wrappedRenderButtonContentResult = shallowWithContext(
renderButtonContentResult,
);
@ -217,14 +215,15 @@ describe('GasPriceButtonGroup Component', () => {
});
it('should render a feeInSecondaryCurrency if passed a feeInSecondaryCurrency', () => {
const renderButtonContentResult = GasPriceButtonGroup.prototype.renderButtonContent(
{
feeInSecondaryCurrency: 'mockFeeInSecondaryCurrency',
},
{
className: 'someClass',
},
);
const renderButtonContentResult =
GasPriceButtonGroup.prototype.renderButtonContent(
{
feeInSecondaryCurrency: 'mockFeeInSecondaryCurrency',
},
{
className: 'someClass',
},
);
const wrappedRenderButtonContentResult = shallowWithContext(
renderButtonContentResult,
);
@ -239,14 +238,15 @@ describe('GasPriceButtonGroup Component', () => {
});
it('should render a timeEstimate if passed a timeEstimate', () => {
const renderButtonContentResult = GasPriceButtonGroup.prototype.renderButtonContent(
{
timeEstimate: 'mockTimeEstimate',
},
{
className: 'someClass',
},
);
const renderButtonContentResult =
GasPriceButtonGroup.prototype.renderButtonContent(
{
timeEstimate: 'mockTimeEstimate',
},
{
className: 'someClass',
},
);
const wrappedRenderButtonContentResult = shallowWithContext(
renderButtonContentResult,
);
@ -261,13 +261,14 @@ describe('GasPriceButtonGroup Component', () => {
});
it('should render a check if showCheck is true', () => {
const renderButtonContentResult = GasPriceButtonGroup.prototype.renderButtonContent(
{},
{
className: 'someClass',
showCheck: true,
},
);
const renderButtonContentResult =
GasPriceButtonGroup.prototype.renderButtonContent(
{},
{
className: 'someClass',
showCheck: true,
},
);
const wrappedRenderButtonContentResult = shallowWithContext(
renderButtonContentResult,
);
@ -296,10 +297,8 @@ describe('GasPriceButtonGroup Component', () => {
});
it('should render no elements if all args passed', () => {
const renderButtonContentResult = GasPriceButtonGroup.prototype.renderButtonContent(
{},
{},
);
const renderButtonContentResult =
GasPriceButtonGroup.prototype.renderButtonContent({}, {});
const wrappedRenderButtonContentResult = shallowWithContext(
renderButtonContentResult,
);

View File

@ -61,21 +61,23 @@ const DEFAULT_OPTS = {
isGasEstimatesLoading: true,
};
const generateUseSelectorRouter = (opts = DEFAULT_OPTS) => (selector) => {
if (selector === checkNetworkAndAccountSupports1559) {
return true;
}
if (selector === getGasEstimateType) {
return opts.gasEstimateType ?? DEFAULT_OPTS.gasEstimateType;
}
if (selector === getGasFeeEstimates) {
return opts.gasFeeEstimates ?? DEFAULT_OPTS.gasFeeEstimates;
}
if (selector === getIsGasEstimatesLoading) {
return opts.isGasEstimatesLoading ?? DEFAULT_OPTS.isGasEstimatesLoading;
}
return undefined;
};
const generateUseSelectorRouter =
(opts = DEFAULT_OPTS) =>
(selector) => {
if (selector === checkNetworkAndAccountSupports1559) {
return true;
}
if (selector === getGasEstimateType) {
return opts.gasEstimateType ?? DEFAULT_OPTS.gasEstimateType;
}
if (selector === getGasFeeEstimates) {
return opts.gasFeeEstimates ?? DEFAULT_OPTS.gasFeeEstimates;
}
if (selector === getIsGasEstimatesLoading) {
return opts.isGasEstimatesLoading ?? DEFAULT_OPTS.isGasEstimatesLoading;
}
return undefined;
};
describe('Gas timing', () => {
beforeEach(() => {

View File

@ -173,11 +173,10 @@ export default function LedgerInstructionField({ showDataInstruction }) {
type="link"
onClick={async () => {
if (environmentTypeIsFullScreen) {
const connectedDevices = await window.navigator.hid.requestDevice(
{
const connectedDevices =
await window.navigator.hid.requestDevice({
filters: [{ vendorId: LEDGER_USB_VENDOR_ID }],
},
);
});
const webHidIsConnected = connectedDevices.some(
(device) =>
device.vendorId === Number(LEDGER_USB_VENDOR_ID),

View File

@ -59,11 +59,8 @@ export default class LoadingNetworkScreen extends PureComponent {
};
renderErrorScreenContent = () => {
const {
showNetworkDropdown,
setProviderArgs,
setProviderType,
} = this.props;
const { showNetworkDropdown, setProviderArgs, setProviderType } =
this.props;
return (
<div className="loading-overlay__error-screen">

View File

@ -17,10 +17,8 @@ export default function MenuBar() {
const t = useI18nContext();
const trackEvent = useContext(MetaMetricsContext);
const history = useHistory();
const [
accountOptionsButtonElement,
setAccountOptionsButtonElement,
] = useState(null);
const [accountOptionsButtonElement, setAccountOptionsButtonElement] =
useState(null);
const [accountOptionsMenuOpen, setAccountOptionsMenuOpen] = useState(false);
const origin = useSelector(getOriginOfCurrentTab);

View File

@ -40,8 +40,7 @@ const SECTIONS = {
key: 'TDL',
props: {
dictionary: {
term:
'a word or phrase used to describe a thing or to express a concept, especially in a particular kind of language or branch of study.',
term: 'a word or phrase used to describe a thing or to express a concept, especially in a particular kind of language or branch of study.',
definition:
'a statement of the exact meaning of a word, especially in a dictionary.',
dl: 'HTML tag denoting a definition list',

View File

@ -6,12 +6,8 @@ import CancelTransaction from './cancel-transaction.component';
const mapStateToProps = (state, ownProps) => {
const { metamask } = state;
const {
transactionId,
originalGasPrice,
newGasFee,
customGasSettings,
} = ownProps;
const { transactionId, originalGasPrice, newGasFee, customGasSettings } =
ownProps;
const { currentNetworkTxList } = metamask;
const transaction = currentNetworkTxList.find(
({ id }) => id === transactionId,

View File

@ -87,8 +87,10 @@ export default class EditApprovalPermission extends PureComponent {
>
<div
className={classnames({
'edit-approval-permission__edit-section__radio-button-outline': !selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__radio-button-outline--selected': selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__radio-button-outline':
!selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__radio-button-outline--selected':
selectedOptionIsUnlimited,
})}
/>
<div className="edit-approval-permission__edit-section__radio-button-fill" />
@ -99,8 +101,10 @@ export default class EditApprovalPermission extends PureComponent {
<div className="edit-approval-permission__edit-section__option-text">
<div
className={classnames({
'edit-approval-permission__edit-section__option-label': !selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__option-label--selected': selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__option-label':
!selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__option-label--selected':
selectedOptionIsUnlimited,
})}
>
{new BigNumber(tokenAmount).equals(
@ -126,8 +130,10 @@ export default class EditApprovalPermission extends PureComponent {
>
<div
className={classnames({
'edit-approval-permission__edit-section__radio-button-outline': selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__radio-button-outline--selected': !selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__radio-button-outline':
selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__radio-button-outline--selected':
!selectedOptionIsUnlimited,
})}
/>
<div className="edit-approval-permission__edit-section__radio-button-fill" />
@ -138,8 +144,10 @@ export default class EditApprovalPermission extends PureComponent {
<div className="edit-approval-permission__edit-section__option-text">
<div
className={classnames({
'edit-approval-permission__edit-section__option-label': selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__option-label--selected': !selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__option-label':
selectedOptionIsUnlimited,
'edit-approval-permission__edit-section__option-label--selected':
!selectedOptionIsUnlimited,
})}
>
{t('customSpendLimit')}

View File

@ -16,8 +16,7 @@ export default class PermissionsConnectFooter extends Component {
className="permissions-connect-footer__text--link"
onClick={() => {
global.platform.openTab({
url:
'https://metamask.zendesk.com/hc/en-us/articles/4405506066331-User-guide-Dapps',
url: 'https://metamask.zendesk.com/hc/en-us/articles/4405506066331-User-guide-Dapps',
});
}}
>

View File

@ -228,8 +228,7 @@ export default class SignatureRequestOriginal extends Component {
className="request-signature__help-link"
onClick={() => {
global.platform.openTab({
url:
'https://consensys.net/blog/metamask/the-seal-of-approval-know-what-youre-consenting-to-with-permissions-and-approvals-in-metamask/',
url: 'https://consensys.net/blog/metamask/the-seal-of-approval-know-what-youre-consenting-to-with-permissions-and-approvals-in-metamask/',
});
}}
>

View File

@ -26,10 +26,8 @@ function mapStateToProps(state, ownProps) {
msgParams: { from },
} = ownProps.txData;
const hardwareWalletRequiresConnection = doesAddressRequireLedgerHidConnection(
state,
from,
);
const hardwareWalletRequiresConnection =
doesAddressRequireLedgerHidConnection(state, from);
const isLedgerWallet = isAddressLedger(state, from);
const messagesList = unconfirmedMessagesHashSelector(state);
const messagesCount = getTotalUnapprovedMessagesCount(state);

View File

@ -13,10 +13,8 @@ function mapStateToProps(state, ownProps) {
const {
msgParams: { from },
} = txData;
const hardwareWalletRequiresConnection = doesAddressRequireLedgerHidConnection(
state,
from,
);
const hardwareWalletRequiresConnection =
doesAddressRequireLedgerHidConnection(state, from);
const isLedgerWallet = isAddressLedger(state, from);
return {
@ -28,11 +26,8 @@ function mapStateToProps(state, ownProps) {
}
function mergeProps(stateProps, dispatchProps, ownProps) {
const {
allAccounts,
isLedgerWallet,
hardwareWalletRequiresConnection,
} = stateProps;
const { allAccounts, isLedgerWallet, hardwareWalletRequiresConnection } =
stateProps;
const {
signPersonalMessage,
signTypedMessage,

View File

@ -40,8 +40,7 @@ describe('Signature Request', () => {
txData: {
msgParams: {
id: 1,
data:
'{"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Person":[{"name":"name","type":"string"},{"name":"wallet","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person"},{"name":"contents","type":"string"}]},"primaryType":"Mail","domain":{"name":"Ether Mail","version":"1","chainId":"4","verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},"message":{"from":{"name":"Cow","wallet":"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},"to":{"name":"Bob","wallet":"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},"contents":"Hello, Bob!"}}',
data: '{"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Person":[{"name":"name","type":"string"},{"name":"wallet","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person"},{"name":"contents","type":"string"}]},"primaryType":"Mail","domain":{"name":"Ether Mail","version":"1","chainId":"4","verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},"message":{"from":{"name":"Cow","wallet":"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},"to":{"name":"Bob","wallet":"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},"contents":"Hello, Bob!"}}',
from: '0xd8f6a2ffb0fc5952d16c9768b71cfd35b6399aa5',
origin: 'test.domain',
},

View File

@ -1738,16 +1738,13 @@ describe('srp-input', () => {
it('should be updated on paste to allow room for a longer SRP', async () => {
const onChange = jest.fn();
const {
getByTestId,
queryByTestId,
queryByRole,
} = renderWithLocalization(
<SrpInput
onChange={onChange}
srpText={enLocale.secretRecoveryPhrase.message}
/>,
);
const { getByTestId, queryByTestId, queryByRole } =
renderWithLocalization(
<SrpInput
onChange={onChange}
srpText={enLocale.secretRecoveryPhrase.message}
/>,
);
getByTestId('import-srp__srp-word-0').focus();
await userEvent.paste(new Array(15).fill('test').join(' '));
@ -1764,17 +1761,13 @@ describe('srp-input', () => {
it('should be updated on paste to match the size of a shorter SRP', async () => {
const onChange = jest.fn();
const {
getByRole,
getByTestId,
queryByTestId,
queryByRole,
} = renderWithLocalization(
<SrpInput
onChange={onChange}
srpText={enLocale.secretRecoveryPhrase.message}
/>,
);
const { getByRole, getByTestId, queryByTestId, queryByRole } =
renderWithLocalization(
<SrpInput
onChange={onChange}
srpText={enLocale.secretRecoveryPhrase.message}
/>,
);
await userEvent.selectOptions(getByRole('combobox'), '15');
getByTestId('import-srp__srp-word-0').focus();
await userEvent.paste(correct);
@ -1792,16 +1785,13 @@ describe('srp-input', () => {
it('should round up to nearest valid size on paste when SRP has an invalid number of words', async () => {
const onChange = jest.fn();
const {
getByTestId,
queryByTestId,
queryByRole,
} = renderWithLocalization(
<SrpInput
onChange={onChange}
srpText={enLocale.secretRecoveryPhrase.message}
/>,
);
const { getByTestId, queryByTestId, queryByRole } =
renderWithLocalization(
<SrpInput
onChange={onChange}
srpText={enLocale.secretRecoveryPhrase.message}
/>,
);
getByTestId('import-srp__srp-word-0').focus();
await userEvent.paste(invalidWordCount);

View File

@ -7,32 +7,28 @@ describe('TransactionActivityLog Component', () => {
const activities = [
{
eventKey: 'transactionCreated',
hash:
'0xe46c7f9b39af2fbf1c53e66f72f80343ab54c2c6dba902d51fb98ada08fe1a63',
hash: '0xe46c7f9b39af2fbf1c53e66f72f80343ab54c2c6dba902d51fb98ada08fe1a63',
id: 2005383477493174,
timestamp: 1543957986150,
value: '0x2386f26fc10000',
},
{
eventKey: 'transactionSubmitted',
hash:
'0xe46c7f9b39af2fbf1c53e66f72f80343ab54c2c6dba902d51fb98ada08fe1a63',
hash: '0xe46c7f9b39af2fbf1c53e66f72f80343ab54c2c6dba902d51fb98ada08fe1a63',
id: 2005383477493174,
timestamp: 1543957987853,
value: '0x1319718a5000',
},
{
eventKey: 'transactionResubmitted',
hash:
'0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
hash: '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
id: 2005383477493175,
timestamp: 1543957991563,
value: '0x1502634b5800',
},
{
eventKey: 'transactionConfirmed',
hash:
'0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
hash: '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
id: 2005383477493175,
timestamp: 1543958029960,
value: '0x1502634b5800',
@ -75,16 +71,14 @@ describe('TransactionActivityLog Component', () => {
},
{
eventKey: 'transactionResubmitted',
hash:
'0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
hash: '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
id: 2,
timestamp: 3,
value: '0x1',
},
{
eventKey: 'transactionCancelAttempted',
hash:
'0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
hash: '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
id: 3,
timestamp: 4,
value: '0x1',
@ -131,16 +125,14 @@ describe('TransactionActivityLog Component', () => {
},
{
eventKey: 'transactionResubmitted',
hash:
'0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
hash: '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
id: 2,
timestamp: 3,
value: '0x1',
},
{
eventKey: 'transactionCancelAttempted',
hash:
'0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
hash: '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87',
id: 3,
timestamp: 4,
value: '0x1',

View File

@ -12,8 +12,10 @@ import {
TRANSACTION_CANCEL_ATTEMPTED_EVENT,
} from './transaction-activity-log.constants';
const matchesEventKey = (matchEventKey) => ({ eventKey }) =>
eventKey === matchEventKey;
const matchesEventKey =
(matchEventKey) =>
({ eventKey }) =>
eventKey === matchEventKey;
const mapStateToProps = (state) => {
return {

View File

@ -21,8 +21,7 @@ describe('TransactionActivityLog utils', () => {
it('should return activities for an array of transactions', () => {
const transactions = [
{
hash:
'0xa14f13d36b3901e352ce3a7acb9b47b001e5a3370f06232a0953c6fc6fad91b3',
hash: '0xa14f13d36b3901e352ce3a7acb9b47b001e5a3370f06232a0953c6fc6fad91b3',
history: [
{
id: 6400627574331058,
@ -92,8 +91,7 @@ describe('TransactionActivityLog utils', () => {
type: TRANSACTION_TYPES.STANDARD,
},
{
hash:
'0xecbe181ee67c4291d04a7cb9ffbf1d5d831e4fbaa89994fd06bab5dd4cc79b33',
hash: '0xecbe181ee67c4291d04a7cb9ffbf1d5d831e4fbaa89994fd06bab5dd4cc79b33',
history: [
{
id: 6400627574331060,
@ -195,8 +193,7 @@ describe('TransactionActivityLog utils', () => {
id: 6400627574331058,
metamaskNetworkId: ROPSTEN_NETWORK_ID,
chainId: ROPSTEN_CHAIN_ID,
hash:
'0xa14f13d36b3901e352ce3a7acb9b47b001e5a3370f06232a0953c6fc6fad91b3',
hash: '0xa14f13d36b3901e352ce3a7acb9b47b001e5a3370f06232a0953c6fc6fad91b3',
eventKey: 'transactionCreated',
timestamp: 1543958845581,
value: '0x2386f26fc10000',
@ -205,8 +202,7 @@ describe('TransactionActivityLog utils', () => {
id: 6400627574331058,
metamaskNetworkId: ROPSTEN_NETWORK_ID,
chainId: ROPSTEN_CHAIN_ID,
hash:
'0xa14f13d36b3901e352ce3a7acb9b47b001e5a3370f06232a0953c6fc6fad91b3',
hash: '0xa14f13d36b3901e352ce3a7acb9b47b001e5a3370f06232a0953c6fc6fad91b3',
eventKey: 'transactionSubmitted',
timestamp: 1543958848147,
value: '0x1319718a5000',
@ -215,8 +211,7 @@ describe('TransactionActivityLog utils', () => {
id: 6400627574331060,
metamaskNetworkId: ROPSTEN_NETWORK_ID,
chainId: ROPSTEN_CHAIN_ID,
hash:
'0xecbe181ee67c4291d04a7cb9ffbf1d5d831e4fbaa89994fd06bab5dd4cc79b33',
hash: '0xecbe181ee67c4291d04a7cb9ffbf1d5d831e4fbaa89994fd06bab5dd4cc79b33',
eventKey: 'transactionResubmitted',
timestamp: 1543958860061,
value: '0x171c3a061400',
@ -225,8 +220,7 @@ describe('TransactionActivityLog utils', () => {
id: 6400627574331060,
metamaskNetworkId: ROPSTEN_NETWORK_ID,
chainId: ROPSTEN_CHAIN_ID,
hash:
'0xecbe181ee67c4291d04a7cb9ffbf1d5d831e4fbaa89994fd06bab5dd4cc79b33',
hash: '0xecbe181ee67c4291d04a7cb9ffbf1d5d831e4fbaa89994fd06bab5dd4cc79b33',
eventKey: 'transactionConfirmed',
timestamp: 1543958897165,
value: '0x171c3a061400',

View File

@ -40,7 +40,8 @@ export default function TransactionDetailItem({
</Typography>
<div
className={classnames('transaction-detail-item__detail-values', {
'transaction-detail-item__detail-values--flex-width': flexWidthValues,
'transaction-detail-item__detail-values--flex-width':
flexWidthValues,
})}
>
{detailText && (

View File

@ -27,18 +27,10 @@ export default function SmartTransactionListItem({
const t = useI18nContext();
const [cancelSwapLinkClicked, setCancelSwapLinkClicked] = useState(false);
const [showDetails, setShowDetails] = useState(false);
const {
primaryCurrency,
recipientAddress,
isPending,
senderAddress,
} = useTransactionDisplayData(transactionGroup);
const {
sourceTokenSymbol,
destinationTokenSymbol,
time,
status,
} = smartTransaction;
const { primaryCurrency, recipientAddress, isPending, senderAddress } =
useTransactionDisplayData(transactionGroup);
const { sourceTokenSymbol, destinationTokenSymbol, time, status } =
smartTransaction;
const category = TRANSACTION_GROUP_CATEGORIES.SWAP;
const title = t('swapTokenToToken', [
sourceTokenSymbol,

View File

@ -50,9 +50,8 @@ function TransactionListItemInner({
const history = useHistory();
const { hasCancelled } = transactionGroup;
const [showDetails, setShowDetails] = useState(false);
const [showCancelEditGasPopover, setShowCancelEditGasPopover] = useState(
false,
);
const [showCancelEditGasPopover, setShowCancelEditGasPopover] =
useState(false);
const [showRetryEditGasPopover, setShowRetryEditGasPopover] = useState(false);
const { supportsEIP1559V2 } = useGasFeeContext();
const { openModal } = useTransactionModalContext();

View File

@ -23,8 +23,7 @@ function getActionFunctionById(id, history) {
const actionFunctions = {
2: () => {
global.platform.openTab({
url:
'https://survey.alchemer.com/s3/6173069/MetaMask-Extension-NPS-January-2021',
url: 'https://survey.alchemer.com/s3/6173069/MetaMask-Extension-NPS-January-2021',
});
},
3: () => {

View File

@ -7,8 +7,7 @@ import {
import DefinitionList from './definition-list';
const basic = {
term:
'a word or phrase used to describe a thing or to express a concept, especially in a particular kind of language or branch of study.',
term: 'a word or phrase used to describe a thing or to express a concept, especially in a particular kind of language or branch of study.',
definition:
'a statement of the exact meaning of a word, especially in a dictionary.',
dl: 'HTML tag denoting a definition list',

Some files were not shown because too many files have changed in this diff Show More