Skip to content

Commit ce11e57

Browse files
authored
Merge branch 'main' into ogp/37428
2 parents c825b20 + e39125e commit ce11e57

File tree

34 files changed

+909
-162
lines changed

34 files changed

+909
-162
lines changed

app/_locales/en/messages.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en_GB/messages.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/lib/smart-transaction/smart-transactions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ class SmartTransactionHook {
379379
status: SmartTransactionStatuses.PENDING,
380380
creationTime: Date.now(),
381381
uuid,
382+
chainId: this.#chainId,
382383
},
383384
isDapp: this.#isDapp,
384385
txId: this.#transactionMeta.id,

test/e2e/tests/confirmations/transactions/request-gas-limit.spec.ts

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */
2+
import { loginWithBalanceValidation } from '../../../page-objects/flows/login.flow';
23
import { createDappTransaction } from '../../../page-objects/flows/transaction';
4+
import ActivityListPage from '../../../page-objects/pages/home/activity-list';
5+
import HomePage from '../../../page-objects/pages/home/homepage';
36
import TestDapp from '../../../page-objects/pages/test-dapp';
47
import { Driver } from '../../../webdriver/driver';
58

69
const { strict: assert } = require('assert');
710
const FixtureBuilder = require('../../../fixture-builder');
8-
const {
9-
withFixtures,
10-
unlockWallet,
11-
WINDOW_TITLES,
12-
} = require('../../../helpers');
11+
const { withFixtures, WINDOW_TITLES } = require('../../../helpers');
1312

1413
describe('dApp Request Gas Limit', function () {
1514
it('should update the gas limit in the activity list after submitting a request with custom gas (lower than 21000)', async function () {
@@ -29,7 +28,7 @@ describe('dApp Request Gas Limit', function () {
2928
title: this.test?.fullTitle(),
3029
},
3130
async ({ driver }: { driver: Driver }) => {
32-
await unlockWallet(driver);
31+
await loginWithBalanceValidation(driver);
3332

3433
const testDapp = new TestDapp(driver);
3534
await testDapp.openTestDappPage();
@@ -52,12 +51,13 @@ describe('dApp Request Gas Limit', function () {
5251
);
5352

5453
// Click on Activity tab
55-
await driver.clickElement(
56-
'[data-testid="account-overview__activity-tab"]',
57-
);
54+
const homePage = new HomePage(driver);
55+
await homePage.goToActivityList();
5856

5957
// Wait for the transaction to appear and click on it
60-
await driver.clickElement('[data-testid="activity-list-item"]');
58+
const activityList = new ActivityListPage(driver);
59+
await activityList.checkFailedTxNumberDisplayedInActivity(1);
60+
await activityList.clickTransactionListItem();
6161

6262
// Now on transaction details page, find and verify the gas limit
6363
const rows = await driver.findElements(
@@ -91,7 +91,7 @@ describe('dApp Request Gas Limit', function () {
9191
title: this.test?.fullTitle(),
9292
},
9393
async ({ driver }: { driver: Driver }) => {
94-
await unlockWallet(driver);
94+
await loginWithBalanceValidation(driver);
9595

9696
const testDapp = new TestDapp(driver);
9797
await testDapp.openTestDappPage();
@@ -114,12 +114,13 @@ describe('dApp Request Gas Limit', function () {
114114
);
115115

116116
// Click on Activity tab
117-
await driver.clickElement(
118-
'[data-testid="account-overview__activity-tab"]',
119-
);
117+
const homePage = new HomePage(driver);
118+
await homePage.goToActivityList();
120119

121120
// Wait for the transaction to appear and click on it
122-
await driver.clickElement('[data-testid="activity-list-item"]');
121+
const activityList = new ActivityListPage(driver);
122+
await activityList.checkFailedTxNumberDisplayedInActivity(1);
123+
await activityList.clickTransactionListItem();
123124

124125
// Now on transaction details page, find and verify the gas limit
125126
const rows = await driver.findElements(
@@ -153,7 +154,7 @@ describe('dApp Request Gas Limit', function () {
153154
title: this.test?.fullTitle(),
154155
},
155156
async ({ driver }: { driver: Driver }) => {
156-
await unlockWallet(driver);
157+
await loginWithBalanceValidation(driver);
157158

158159
const testDapp = new TestDapp(driver);
159160
await testDapp.openTestDappPage();
@@ -176,12 +177,13 @@ describe('dApp Request Gas Limit', function () {
176177
);
177178

178179
// Click on Activity tab
179-
await driver.clickElement(
180-
'[data-testid="account-overview__activity-tab"]',
181-
);
180+
const homePage = new HomePage(driver);
181+
await homePage.goToActivityList();
182182

183183
// Wait for the transaction to appear and click on it
184-
await driver.clickElement('[data-testid="activity-list-item"]');
184+
const activityList = new ActivityListPage(driver);
185+
await activityList.checkConfirmedTxNumberDisplayedInActivity(1);
186+
await activityList.clickTransactionListItem();
185187

186188
// Now on transaction details page, find and verify the gas limit
187189
const rows = await driver.findElements(
@@ -215,7 +217,7 @@ describe('dApp Request Gas Limit', function () {
215217
title: this.test?.fullTitle(),
216218
},
217219
async ({ driver }: { driver: Driver }) => {
218-
await unlockWallet(driver);
220+
await loginWithBalanceValidation(driver);
219221

220222
const testDapp = new TestDapp(driver);
221223
await testDapp.openTestDappPage();
@@ -238,12 +240,13 @@ describe('dApp Request Gas Limit', function () {
238240
);
239241

240242
// Click on Activity tab
241-
await driver.clickElement(
242-
'[data-testid="account-overview__activity-tab"]',
243-
);
243+
const homePage = new HomePage(driver);
244+
await homePage.goToActivityList();
244245

245246
// Wait for the transaction to appear and click on it
246-
await driver.clickElement('[data-testid="activity-list-item"]');
247+
const activityList = new ActivityListPage(driver);
248+
await activityList.checkConfirmedTxNumberDisplayedInActivity(1);
249+
await activityList.clickTransactionListItem();
247250

248251
// Now on transaction details page, find and verify the gas limit
249252
const rows = await driver.findElements(

test/e2e/tests/onboarding/onboarding.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('MetaMask onboarding', function () {
257257

258258
const homePage = new HomePage(driver);
259259
await homePage.checkPageIsLoaded();
260-
await homePage.checkExpectedBalanceIsDisplayed('17,000.00', '$');
260+
await homePage.checkExpectedBalanceIsDisplayed('10', 'ETH');
261261
await homePage.checkAddNetworkMessageIsDisplayed(networkName);
262262
},
263263
);

test/jest/mock-store.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ export const createSwapsMockStore = () => {
676676
'0x55ad39634ee10d417b6e190cfd3736098957e958879cffe78f1f00f4fd2654d6',
677677
minedTx: 'success',
678678
},
679+
chainId: CHAIN_IDS.MAINNET,
679680
},
680681
{
681682
uuid: 'uuid2',
@@ -689,6 +690,7 @@ export const createSwapsMockStore = () => {
689690
'0x55ad39634ee10d417b6e190cfd3736098957e958879cffe78f1f00f4fd2654d6',
690691
minedTx: 'success',
691692
},
693+
chainId: CHAIN_IDS.MAINNET,
692694
},
693695
],
694696
},

ui/components/app/assets/token-list/token-list.tsx

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { MetaMetricsContext } from '../../../../contexts/metametrics';
3535
import { SafeChain } from '../../../../pages/settings/networks-tab/networks-form/use-safe-chains';
3636
import { isGlobalNetworkSelectorRemoved } from '../../../../selectors/selectors';
3737
import { isEvmChainId } from '../../../../../shared/lib/asset-utils';
38+
import { sortAssetsWithPriority } from '../util/sortAssetsWithPriority';
3839

3940
type TokenListProps = {
4041
onTokenClick: (chainId: string, address: string) => void;
@@ -102,34 +103,32 @@ function TokenList({ onTokenClick, safeChains }: TokenListProps) {
102103
}
103104

104105
// Mapping necessary to comply with the type. Fields will be overriden with useTokenDisplayInfo
105-
return assets
106-
.filter((asset) => {
107-
if (shouldHideZeroBalanceTokens && asset.balance === '0') {
108-
return false;
109-
}
110-
return true;
111-
})
112-
.map((asset) => {
113-
const token: TokenWithFiatAmount = {
114-
...asset,
115-
tokenFiatAmount: asset.fiat?.balance,
116-
secondary: null,
117-
title: asset.name,
118-
address:
119-
'address' in asset ? asset.address : (asset.assetId as Hex),
120-
chainId: asset.chainId as Hex,
121-
};
122-
123-
return token;
124-
});
106+
return assets.filter((asset) => {
107+
if (shouldHideZeroBalanceTokens && asset.balance === '0') {
108+
return false;
109+
}
110+
return true;
111+
});
125112
},
126113
);
127-
const accountAssets = sortAssets(
128-
[...accountAssetsPreSort],
114+
115+
const accountAssets = sortAssetsWithPriority(
116+
accountAssetsPreSort,
129117
tokenSortConfig,
130118
);
131119

132-
return accountAssets;
120+
return accountAssets.map((asset) => {
121+
const token: TokenWithFiatAmount = {
122+
...asset,
123+
tokenFiatAmount: asset.fiat?.balance,
124+
secondary: null,
125+
title: asset.name,
126+
address: 'address' in asset ? asset.address : (asset.assetId as Hex),
127+
chainId: asset.chainId as Hex,
128+
};
129+
130+
return token;
131+
});
133132

134133
// eslint-disable-next-line react-hooks/exhaustive-deps
135134
}, [

0 commit comments

Comments
 (0)