Skip to content

Commit

Permalink
Merge branch 'develop' into feat/mmassets-362_update-polygon-native-t…
Browse files Browse the repository at this point in the history
…oken-POL
  • Loading branch information
gambinish authored Aug 29, 2024
2 parents a1092f9 + e8273d8 commit 578e1a5
Show file tree
Hide file tree
Showing 24 changed files with 473 additions and 123 deletions.
71 changes: 70 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [12.1.0]
### Added
- Launched a feature displaying the percentage increase or decrease for tokens within the UI ([#24223](https://github.com/MetaMask/metamask-extension/pull/24223))
- Added a search feature to easily filter through the popular network list ([#25170](https://github.com/MetaMask/metamask-extension/pull/25170))
- Launched a new asset details page ([#24522](https://github.com/MetaMask/metamask-extension/pull/24522))
- Implemented a loader on the confirmation page during Blockaid validation ([#25477](https://github.com/MetaMask/metamask-extension/pull/25477))
- Introduced an advanced details component for transactions ([#24833](https://github.com/MetaMask/metamask-extension/pull/24833))
- Enhanced permit signatures with a simulation section ([#24862](https://github.com/MetaMask/metamask-extension/pull/24862))
- Introduced dynamic support for identifying 'buyable' networks through the Ramps API ([#24041](https://github.com/MetaMask/metamask-extension/pull/24041))
- Introduced a new notification counter over the Fox icon to display unread notifications ([#25093](https://github.com/MetaMask/metamask-extension/pull/25093))
- Improved the display of large and small token values on the permit signature page ([#25720](https://github.com/MetaMask/metamask-extension/pull/25720))
- Replaced "Approve spend limit" with "Spending cap" in the Permit signature redesign ([#25618](https://github.com/MetaMask/metamask-extension/pull/25618))
- Display ellipsis to Permit simulation fiat values ([#26001](https://github.com/MetaMask/metamask-extension/pull/26001))
- Display ellipsis for Permit values with over 15 characters ([#26458](https://github.com/MetaMask/metamask-extension/pull/26458))

### Changed
- Introduced the ability to edit custom networks directly from the modal ([#25272](https://github.com/MetaMask/metamask-extension/pull/25272))
- Launched an initial UI for editing multiple RPC URLs in the network form ([#25219](https://github.com/MetaMask/metamask-extension/pull/25219))
- Added paymaster address display for certain transactions in the contract interaction confirmation ([#25396](https://github.com/MetaMask/metamask-extension/pull/25396))
- Updated the text for permit signatures ([#24975](https://github.com/MetaMask/metamask-extension/pull/24975))

### Fixed
- Updated all help center URLs from the old Zendesk format to the current support.metamask.io domain ([#24286](https://github.com/MetaMask/metamask-extension/pull/24286))
- Improved NFT ownership updates in MetaMask by parsing logs from contract interaction transactions ([#25380](https://github.com/MetaMask/metamask-extension/pull/25380))
- Corrected the display of the delete network icon to only appear on mouseover in the network modal ([#25547](https://github.com/MetaMask/metamask-extension/pull/25547))
- Fixed a UI issue where a non-zero percentage change was displayed next to a $0.00 account balance ([#25550](https://github.com/MetaMask/metamask-extension/pull/25550))
- Improved the display of large token amounts in the wallet ([#25464](https://github.com/MetaMask/metamask-extension/pull/25464))
- Resolved an issue where the Linea mainnet ticker was incorrectly displayed as undefined ([#25436](https://github.com/MetaMask/metamask-extension/pull/25436))
- Deprecated Mumbai and Linea Goerli test networks ([#24994](https://github.com/MetaMask/metamask-extension/pull/24994))
- Fixed an issue where STX was incorrectly used for Swap+Send approvals ([#25510](https://github.com/MetaMask/metamask-extension/pull/25510))
- Addressed and resolved all identified bugs in the Swap+Send feature ([#25100](https://github.com/MetaMask/metamask-extension/pull/25100))
- Enhanced network indicator consistency on the confirmation page by aligning it with the network selection dropdown ([#25518](https://github.com/MetaMask/metamask-extension/pull/25518))
- Implemented a setting to allow users to opt-out of displaying fiat values for testnet transactions ([#25167](https://github.com/MetaMask/metamask-extension/pull/25167))
- Adjusted styling to properly handle long NFT IDs in transaction simulations ([#25252](https://github.com/MetaMask/metamask-extension/pull/25252))
- Enhanced the deadline field formatting on the permit signature page ([#25321](https://github.com/MetaMask/metamask-extension/pull/25321))
- Refined the design of the permit signature confirmation page ([#25383](https://github.com/MetaMask/metamask-extension/pull/25383))
- Updated the text on redesigned Sign-In With Ethereum (SIWE) signature pages ([#25381](https://github.com/MetaMask/metamask-extension/pull/25381))
- Adjusted signature pages to only display simulations when the user has enabled this preference ([#25186](https://github.com/MetaMask/metamask-extension/pull/25186))
- Refined the alerts on typed sign data pages based on feedback ([#25163](https://github.com/MetaMask/metamask-extension/pull/25163))
- Corrected the display of USD amounts in swap notifications ([#25444](https://github.com/MetaMask/metamask-extension/pull/25444))
- Refined notifications UI to only show tabs when relevant ([#25350](https://github.com/MetaMask/metamask-extension/pull/25350))
- Resolved an issue to ensure push notifications are properly received and not delivered as silent notifications ([#25340](https://github.com/MetaMask/metamask-extension/pull/25340))
- Fixed a bug to ensure native currency symbols are correctly displayed in notifications ([#25364](https://github.com/MetaMask/metamask-extension/pull/25364))
- Adjusted the notifications-tag-counter to have a minimum width ([#25322](https://github.com/MetaMask/metamask-extension/pull/25322))
- Resolved an issue where incorrect type assertions led to a crash when splitting an undefined value in notification detail network fees ([#25315](https://chat.consensys.io/chat/jgI56K8PwrDp4d4EERs4l))
- Excluded SNAP notifications from 'Mark all as read' server updates ([#25099](https://github.com/MetaMask/metamask-extension/pull/25099))
- Resolved an issue by ensuring max gas values for swaps are rounded to integers ([#25488](https://github.com/MetaMask/metamask-extension/pull/25488))
- Updated the outdated browser warning to display immediately for new installations ([#25366](https://github.com/MetaMask/metamask-extension/pull/25366))
- Enhanced the Send flow by displaying a network badge next to the chosen asset ([#25470](https://github.com/MetaMask/metamask-extension/pull/25470))
- Fixed various display issues in the asset picker modal and balance display ([#25601](https://github.com/MetaMask/metamask-extension/pull/25601))
- Corrected the display of decimal places for token values on permit pages ([#25718](https://github.com/MetaMask/metamask-extension/pull/25718))
- Added ellipsis for long permit values and fixed errors with very large numbers ([#25741](https://github.com/MetaMask/metamask-extension/pull/25741))
- Fixed an issue where the connected account was missing on the connection page ([#25500](https://github.com/MetaMask/metamask-extension/pull/25500))
- Removed the NFT autodetection modal when the feature is disabled in settings ([#25993](https://github.com/MetaMask/metamask-extension/pull/25993))
- Fixed the Blockaid report URL on redesigned pages ([#25702](https://github.com/MetaMask/metamask-extension/pull/25702))
- Fixed the "Show conversion in testnets" option for Bitcoin and Ethereum test assets ([#26224](https://github.com/MetaMask/metamask-extension/pull/26224))
- Enabled the Save button on the Add Contact page when a valid address or ENS name is entered ([#26456](https://github.com/MetaMask/metamask-extension/pull/26456))
- Fixed fallback conversion rates for token market data to ensure accurate market cap ([#26460](https://github.com/MetaMask/metamask-extension/pull/26460))
- Resolved the issue of selecting the correct network when multiple networks have the same chain ID ([#25805](https://github.com/MetaMask/metamask-extension/pull/25805))
- Updated alignment and padding for permit simulations ([#26186](https://github.com/MetaMask/metamask-extension/pull/26186))
- Updated the pending transactions badge to display a number instead of three dots ([#26116](https://github.com/MetaMask/metamask-extension/pull/26116))
- Adjusted spacing in the send asset picker for proper vertical alignment with other dropdowns ([#25576](https://github.com/MetaMask/metamask-extension/pull/25576))
- Fixed decimal display for Permit values and added a reusable component for displaying token units ([#26105](https://github.com/MetaMask/metamask-extension/pull/26105))
- Fixed precision loss for very large values in signature simulations ([#25968](https://github.com/MetaMask/metamask-extension/pull/25968))
- Included decimals in fiat calculations for Permit simulations and added tooltips for shortened values ([#26523](https://github.com/MetaMask/metamask-extension/pull/26523))
- Fixed the missing deadline timer on the swaps status screen ([#26544](https://github.com/MetaMask/metamask-extension/pull/26544))
- Fixed an issue where account names were out of sync in the account list during the connect account flow ([#26542](https://github.com/MetaMask/metamask-extension/pull/26542))

## [12.0.6]
### Changed
- Improve error diagnostics ([#26482](https://github.com/MetaMask/metamask-extension/pull/26482))
Expand Down Expand Up @@ -4928,7 +4996,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
- Added the ability to restore accounts from seed words.


[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.0.6...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.1.0...HEAD
[12.1.0]: https://github.com/MetaMask/metamask-extension/compare/v12.0.6...v12.1.0
[12.0.6]: https://github.com/MetaMask/metamask-extension/compare/v12.0.5...v12.0.6
[12.0.5]: https://github.com/MetaMask/metamask-extension/compare/v12.0.4...v12.0.5
[12.0.4]: https://github.com/MetaMask/metamask-extension/compare/v12.0.3...v12.0.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ async function addEthereumChainHandler(
} else {
networkClientId = existingNetwork.id ?? existingNetwork.type;
const currentRpcUrl = getCurrentRpcUrl();

if (
currentChainIdForDomain === chainId &&
currentRpcUrl === firstValidRPCUrl
) {
res.result = null;
return end();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,45 @@ describe('addEthereumChainHandler', () => {
}),
);
});

it('should add result set to null to response object if the requested rpcUrl (and chainId) is currently selected', async () => {
const CURRENT_RPC_CONFIG = createMockNonInfuraConfiguration();

const mocks = makeMocks({
permissionsFeatureFlagIsActive: false,
overrides: {
getCurrentChainIdForDomain: jest
.fn()
.mockReturnValue(CURRENT_RPC_CONFIG.chainId),
findNetworkConfigurationBy: jest
.fn()
.mockReturnValue(CURRENT_RPC_CONFIG),
getCurrentRpcUrl: jest.fn().mockReturnValue(CURRENT_RPC_CONFIG.rpcUrl),
},
});
const res = {};

await addEthereumChainHandler(
{
origin: 'example.com',
params: [
{
chainId: CURRENT_RPC_CONFIG.chainId,
chainName: 'Custom Network',
rpcUrls: [CURRENT_RPC_CONFIG.rpcUrl],
nativeCurrency: {
symbol: CURRENT_RPC_CONFIG.ticker,
decimals: 18,
},
blockExplorerUrls: ['https://custom.blockexplorer'],
},
],
},
res,
jest.fn(),
jest.fn(),
mocks,
);
expect(res.result).toBeNull();
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "12.0.6",
"version": "12.1.0",
"private": true,
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion shared/modules/object.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export function maskObject(object, mask) {
} else if (maskKey && typeof maskKey === 'object') {
state[key] = maskObject(object[key], maskKey);
} else if (maskKey === undefined || maskKey === false) {
state[key] = typeof object[key];
// As typeof null (misleadingly) returns “object,” it would be more readable to display “null” instead of “object.”
state[key] = object[key] === null ? null : typeof object[key];
} else {
throw new Error(`Unsupported mask entry: ${maskKey}`);
}
Expand Down
95 changes: 95 additions & 0 deletions test/data/confirmations/helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { ApprovalType } from '@metamask/controller-utils';
import {
TransactionStatus,
TransactionType,
} from '@metamask/transaction-controller';

import mockState from '../mock-state.json';

type RootState = { metamask: Record<string, unknown> } & Record<
string,
unknown
>;

export const getExampleMockSignatureConfirmState = (
args: RootState = { metamask: {} },
) => ({
...mockState,
...args,
metamask: {
...mockState.metamask,
preferences: {
redesignedTransactionsEnabled: true,
redesignedConfirmationsEnabled: true,
isRedesignedConfirmationsDeveloperEnabled: true,
},
pendingApprovals: {
'123': {
id: '123',
type: ApprovalType.EthSignTypedData,
},
},
unapprovedTypedMessages: {
'123': {
id: '123',
chainId:
mockState.metamask.networkConfigurations.testNetworkConfigurationId
.chainId,
type: TransactionType.signTypedData,
status: TransactionStatus.unapproved,
txParams: { from: Object.keys(mockState.metamask.identities)[0] },
msgParams: {
signatureMethod: 'eth_signTypedData_v4',
},
},
},
...args.metamask,
},
});

export const getExampleMockContractInteractionConfirmState = (
args: RootState = { metamask: {} },
) => ({
...mockState,
...args,
metamask: {
...mockState.metamask,
preferences: {
redesignedTransactionsEnabled: true,
redesignedConfirmationsEnabled: true,
isRedesignedConfirmationsDeveloperEnabled: true,
},
pendingApprovals: {
'123': {
id: '123',
type: ApprovalType.Transaction,
},
},
transactions: [
{
id: '123',
type: TransactionType.contractInteraction,
chainId:
mockState.metamask.networkConfigurations.testNetworkConfigurationId
.chainId,
status: TransactionStatus.unapproved,
txParams: { from: Object.keys(mockState.metamask.identities)[0] },
},
],
...args.metamask,
},
});

export const getMockConfirmState = (args: RootState = { metamask: {} }) => ({
...mockState,
...args,
metamask: {
...mockState.metamask,
preferences: {
redesignedTransactionsEnabled: true,
redesignedConfirmationsEnabled: true,
isRedesignedConfirmationsDeveloperEnabled: true,
},
...args.metamask,
},
});
4 changes: 2 additions & 2 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ class FixtureBuilder {
return this;
}

withTokensControllerERC20() {
withTokensControllerERC20({ chainId = 1337 } = {}) {
merge(this.fixture.data.TokensController, {
tokens: [
{
Expand All @@ -764,7 +764,7 @@ class FixtureBuilder {
ignoredTokens: [],
detectedTokens: [],
allTokens: {
[toHex(1337)]: {
[toHex(chainId)]: {
'0x5cfe73b6021e818b776b421b1c4db2474086a7e1': [
{
address: `__FIXTURE_SUBSTITUTION__CONTRACT${SMART_CONTRACTS.HST}`,
Expand Down
11 changes: 2 additions & 9 deletions test/e2e/playwright/mmi/specs/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
getPageAndCloseRepeated,
} from '../helpers/utils';
import { MMIMainMenuPage } from '../pageObjects/mmi-mainMenu-page';
import { Auth0Page } from '../pageObjects/mmi-auth0-page';
import { MMIMainPage } from '../pageObjects/mmi-main-page';

const portfolio = `${process.env.MMI_E2E_MMI_DASHBOARD_URL}/portfolio`;
const stake = `${process.env.MMI_E2E_MMI_DASHBOARD_URL}/stake`;
const portfolio = `${process.env.MMI_E2E_MMI_DASHBOARD_URL}`;
const stake = `${process.env.MMI_E2E_MMI_DASHBOARD_URL}`;
const support = 'https://mmi-support.metamask.io/hc/en-us';
const supportContactUs =
'https://mmi-support.metamask.io/hc/en-us/requests/new';
Expand Down Expand Up @@ -51,12 +50,6 @@ test.describe('MMI Navigation', () => {
// await mainMenuPage.showIncomingTransactionsOff()
await mainMenuPage.closeSettings();

// This is removed to improve test performance
// Signin auth0
const auth0 = new Auth0Page(await context.newPage());
await auth0.signIn();
await auth0.page.close();

// // Close pages not used to remove data from logs
await closePages(context, ['metamask-institutional.io']);
const mainPage = new MMIMainPage(
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/snaps/test-snap-ui-imgs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Test Snap Images', function () {

// deal with OK button
await driver.waitForSelector({ text: 'OK' });
await driver.clickElement({
await driver.clickElementAndWaitForWindowToClose({
text: 'OK',
tag: 'button',
});
Expand All @@ -70,13 +70,15 @@ describe('Test Snap Images', function () {
await driver.clickElement('#showSVGImage');

// switch to notification window
await switchToNotificationWindow(driver, 2);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

// check snaps ui image using waitForSelector
await driver.waitForSelector('[data-testid="snaps-ui-image"]');

// click ok to close window
await driver.clickElement('[data-testid="confirmation-submit-button"]');
await driver.clickElementAndWaitForWindowToClose(
'[data-testid="confirmation-submit-button"]',
);

// switch back to test-snaps window
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestSnaps);
Expand All @@ -85,7 +87,7 @@ describe('Test Snap Images', function () {
await driver.clickElement('#showPNGImage');

// switch to notification window
await switchToNotificationWindow(driver, 2);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

// check snaps ui image using waitForSelector
await driver.waitForSelector('[data-testid="snaps-ui-image"]');
Expand Down
9 changes: 4 additions & 5 deletions test/e2e/tests/bridge/bridge-button-opens-portfolio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@ describe('Click bridge button @no-mmi', function (this: Suite) {

it('loads portfolio tab from asset overview when flag is turned off', async function () {
await withFixtures(
// withErc20 param is false, as we test it manually below
getBridgeFixtures(this.test?.fullTitle(), undefined, false),
async ({ driver, ganacheServer, contractRegistry }) => {
getBridgeFixtures(this.test?.fullTitle(), undefined, true),
async ({ driver, ganacheServer }) => {
const bridgePage = new BridgePage(driver);
await logInWithBalanceValidation(driver, ganacheServer);

// ETH
await bridgePage.navigateToAssetPage(contractRegistry, 'ETH', false);
await bridgePage.navigateToAssetPage('ETH');
await bridgePage.navigateToBridgePage('coin-overview');
await bridgePage.verifyPortfolioTab(2);

await bridgePage.reloadHome();

// TST
await bridgePage.navigateToAssetPage(contractRegistry, 'TST');
await bridgePage.navigateToAssetPage('TST');
await bridgePage.navigateToBridgePage('token-overview');
await bridgePage.verifyPortfolioTab(3);
},
Expand Down
Loading

0 comments on commit 578e1a5

Please sign in to comment.