Skip to content

Commit

Permalink
Merge branch 'develop' into MMI-5059-ofa-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
albertolive authored May 30, 2024
2 parents f69cc6c + 6bbd6e1 commit 0dd3ba7
Show file tree
Hide file tree
Showing 458 changed files with 42,585 additions and 13,431 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ jobs:
GH_LABEL=team-mmi
if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
echo "Skipping tag check; this is not a PR."
echo "false" > ./RUN_MMI_OPTIONAL
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/guidelines/LABELING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It's essential to ensure that PRs have the appropriate labels before they are co
- **regression-prod-x.y.z**: This label is automatically added to a bug report issue at the time of its creation. The `x.y.z` in the label represents the version in which the bug first appeared. This label is auto-generated by a [GitHub action](../workflows/check-template-and-add-labels.yml), which determines the `x.y.z` value based on the version information provided in the bug report issue form. Manual intervention is only necessary under certain circumstances. For example, if a user submits a bug report and specifies the version they are currently using, but the bug was actually introduced in a prior version, the label would need to be manually updated to accurately reflect the version where the bug originated.

### Optional labels:
- **regression-develop**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on development branch (i.e. `develop`), but is not yet released in production.
- **regression-develop**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on the development branch, i.e., `develop`, but is not yet released in production.
- **needs-qa**: If the PR includes a new features, complex testing steps, or large refactors, this label must be added to indicated PR requires a full manual QA prior being merged and added to a release.

### Labels prohibited when PR needs to be merged:
Expand Down
15 changes: 15 additions & 0 deletions .github/scripts/check-template-and-add-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import { retrieveIssue } from './shared/issue';
import {
Labelable,
LabelableType,
findLabel,
addLabelToLabelable,
removeLabelFromLabelable,
removeLabelFromLabelableIfPresent,
} from './shared/labelable';
import {
Label,
externalContributorLabel,
flakyTestsLabel,
invalidIssueTemplateLabel,
invalidPullRequestTemplateLabel,
} from './shared/label';
Expand Down Expand Up @@ -90,6 +92,19 @@ async function main(): Promise<void> {
}

if (labelable.type === LabelableType.Issue) {

// If labelable is a flaky test report, no template is needed (we just add a link to circle.ci in the description), we skip the template checks
const flakyTestsLabelFound = findLabel(labelable, flakyTestsLabel);
if (flakyTestsLabelFound?.id) {
console.log(`Issue ${labelable?.number} was created to report a flaky test. Issue's description doesn't need to match issue template in that case as the issue's description only includes a link redirecting to circle.ci. Skip template checks.`);
await removeLabelFromLabelableIfPresent(
octokit,
labelable,
invalidIssueTemplateLabel,
);
process.exit(0); // Stop the process and exit with a success status code
}

if (templateType === TemplateType.GeneralIssue) {
console.log("Issue matches 'general-issue.yml' template.");
await removeLabelFromLabelableIfPresent(
Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/shared/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export const externalContributorLabel: Label = {
description: 'Issue or PR created by user outside org',
};

export const flakyTestsLabel: Label = {
name: 'flaky tests',
color: 'BE564E',
description: 'Flaky test report',
};

export const invalidIssueTemplateLabel: Label = {
name: 'INVALID-ISSUE-TEMPLATE',
color: 'EDEDED',
Expand Down
20 changes: 16 additions & 4 deletions .github/scripts/shared/labelable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ export interface Labelable {
}[];
}

// This function tries to find a label on a labelable object (i.e. a pull request or an issue) if present
export function findLabel(
labelable: Labelable,
labelToFind: Label,
): {
id: string;
name: string;
} | undefined {
// Check if label is present on labelable
return labelable.labels.find(
(label) => label.name === labelToFind.name,
);
}

// This function adds label to a labelable object (i.e. a pull request or an issue)
export async function addLabelToLabelable(
octokit: InstanceType<typeof GitHub>,
Expand Down Expand Up @@ -77,10 +91,8 @@ export async function removeLabelFromLabelableIfPresent(
labelable: Labelable,
labelToRemove: Label,
): Promise<void> {
// Check if label is present on issue
const labelFound = labelable?.labels?.find(
(label) => label.name === labelToRemove?.name,
);
// Check if label is present on labelable
const labelFound = findLabel(labelable, labelToRemove);

if (labelFound?.id) {
// Remove label from labelable
Expand Down
6,147 changes: 0 additions & 6,147 deletions .yarn/patches/@reduxjs-toolkit-npm-1.6.2-67af09515f.patch

This file was deleted.

94 changes: 94 additions & 0 deletions .yarn/patches/@reduxjs-toolkit-npm-1.9.7-b14925495c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
diff --git a/dist/index.js b/dist/index.js
index 6b889a8c93e4c546dd2b1905c968ade143435134..8a63cf3cbc152d84864e1cec07da5c0883a98aef 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,6 +1,2 @@
'use strict'
-if (process.env.NODE_ENV === 'production') {
- module.exports = require('./redux-toolkit.cjs.production.min.js')
-} else {
- module.exports = require('./redux-toolkit.cjs.development.js')
-}
\ No newline at end of file
+module.exports = require('./redux-toolkit.cjs.development.js')
diff --git a/dist/redux-toolkit.cjs.development.js b/dist/redux-toolkit.cjs.development.js
index bb433432ec76331e12d6b62e200f06530055cb16..9caf4051aa96bd14ee2890ef6c79bf5b0fb685c6 100644
--- a/dist/redux-toolkit.cjs.development.js
+++ b/dist/redux-toolkit.cjs.development.js
@@ -1,3 +1,13 @@
+var __define = (this && this.__define) || function (obj, key, value) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ return obj[key];
+};
+
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
@@ -9,7 +19,7 @@ var __extends = (this && this.__extends) || (function () {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
- function __() { this.constructor = d; }
+ function __() { __define(this, constructor, d); }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
@@ -316,14 +326,14 @@ var MiddlewareArray = /** @class */ (function (_super) {
enumerable: false,
configurable: true
});
- MiddlewareArray.prototype.concat = function () {
+ __define(MiddlewareArray.prototype, 'concat', function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
return _super.prototype.concat.apply(this, arr);
- };
- MiddlewareArray.prototype.prepend = function () {
+ });
+ __define(MiddlewareArray.prototype, 'prepend', function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
@@ -332,7 +342,7 @@ var MiddlewareArray = /** @class */ (function (_super) {
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
}
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
- };
+ });
return MiddlewareArray;
}(Array));
var EnhancerArray = /** @class */ (function (_super) {
@@ -353,14 +363,14 @@ var EnhancerArray = /** @class */ (function (_super) {
enumerable: false,
configurable: true
});
- EnhancerArray.prototype.concat = function () {
+ __define(EnhancerArray.prototype, 'concat', function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
return _super.prototype.concat.apply(this, arr);
- };
- EnhancerArray.prototype.prepend = function () {
+ });
+ __define(EnhancerArray.prototype, 'prepend', function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
@@ -369,7 +379,7 @@ var EnhancerArray = /** @class */ (function (_super) {
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
}
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
- };
+ });
return EnhancerArray;
}(Array));
function freezeDraftable(val) {
45 changes: 45 additions & 0 deletions .yarn/patches/nock-npm-13.5.4-2c4f77b249.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/lib/common.js b/lib/common.js
index 336bc4d376d07306d6adf79b8e73cffd4dfff4f7..271d50d42a5a370440fd93de00072ddfdd2fcf4b 100644
--- a/lib/common.js
+++ b/lib/common.js
@@ -1,7 +1,17 @@
'use strict'

const debug = require('debug')('nock.common')
-const timers = require('timers')
+/**
+ * PATCH NOTES:
+ *
+ * Replace Node.js `timers` module with global timers, because Jest/Sinon fake timers do not work
+ * with the Node.js timers module in the version we are using.
+ *
+ * This is resolved in `@sinon/fake-timers@11`, which is introduced in the upcoming `jest@30`
+ * release.
+ *
+ * TODO: Remove this patch after updating to `jest@30`.
+ */
const url = require('url')
const util = require('util')

@@ -598,16 +608,16 @@ const intervals = []
const immediates = []

const wrapTimer =
- (timer, ids) =>
+ (timerName, ids) =>
(...args) => {
- const id = timer(...args)
+ const id = globalThis[timerName](...args)
ids.push(id)
return id
}

-const setTimeout = wrapTimer(timers.setTimeout, timeouts)
-const setInterval = wrapTimer(timers.setInterval, intervals)
-const setImmediate = wrapTimer(timers.setImmediate, immediates)
+const setTimeout = wrapTimer('setTimeout', timeouts)
+const setInterval = wrapTimer('setInterval', intervals)
+const setImmediate = wrapTimer('setImmediate', immediates)

function clearTimer(clear, ids) {
while (ids.length) {
85 changes: 84 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,81 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [11.15.6]
### Changed
- Disable smart transaction opt-in modal ([#24715](https://github.com/MetaMask/metamask-extension/pull/24715))

## [11.15.5]
### Changed
- Update copy in Smart Transactions opt-in modal([#24461](https://github.com/MetaMask/metamask-extension/pull/24461))

## [11.15.4]
### Changed
- Update UI for the Smart Transactions Opt In modal ([#24441](https://github.com/MetaMask/metamask-extension/pull/24441))

## [11.15.3]
### Changed
- Smart transaction improvements ([#24340](https://github.com/MetaMask/metamask-extension/pull/24340))
- disable Smart Transactions on Sepolia
- improve Smart Transaction status page layout on full screen view
- Conditionally close the extension when a user clicks on "View transaction" on the Smart Transaction status page
- Update animation UI for non-popup view of Smart Transactions

### Fixed
- Add animation on the smart transaction status page ([#24389](https://github.com/MetaMask/metamask-extension/pull/24389))

## [11.15.2]
### Fixed
- Ensure smart transaction modal is shown for users upgrading from previous versions ([#24377](https://github.com/MetaMask/metamask-extension/pull/24377))

## [11.15.1]
### Changed
- Restores 11.15.0, and also incorporates the 11.14.4 and 11.14.5 changes

## [11.15.0]
### Added
- Expanded Smart Transactions (STX) functionality to include non-Swaps transactions on Ethereum Mainnet for users opted into STX ([#23155](https://github.com/MetaMask/metamask-extension/pull/23155))
- Added Base Mainnet and removed Gnosis and Celo networks from popular networks list ([#23880](https://github.com/MetaMask/metamask-extension/pull/23880))
- Enhanced balance fetching efficiency by supporting bulk balance checks on Linea, Aurora, Base, and ZkSync ([#23436](https://github.com/MetaMask/metamask-extension/pull/23436))
- Introduced a 'Learn more' link to the simulations toggle in privacy and onboarding settings ([#23890](https://github.com/MetaMask/metamask-extension/pull/23890))
- Introduced a confirmation step for approving higher token spending limits ([#23560](https://github.com/MetaMask/metamask-extension/pull/23560))
- Added a dismissible alert for users migrated from OpenSea to Blockaid on unsupported networks ([#23743](https://github.com/MetaMask/metamask-extension/pull/23743))
- Implemented support for signature requests with a redesigned interface ([#23539](https://github.com/MetaMask/metamask-extension/pull/23539))
- Introduced support for the new Linea Sepolia network and deprecated the Linea Goerli network ([#23459](https://github.com/MetaMask/metamask-extension/pull/23459))

### Changed
- Removed outdated announcements for 'Snaps Open Beta' and 'Buy & Sell' features ([#23940](https://github.com/MetaMask/metamask-extension/pull/23940))
- Enhanced Smart Transactions swaps with detailed simulation views ([#23963](https://github.com/MetaMask/metamask-extension/pull/23963))
- Updated the Arbitrum logo ([#23969](https://github.com/MetaMask/metamask-extension/pull/23969))
- Enhanced the appearance of links in Snap dialogs ([#23840](https://github.com/MetaMask/metamask-extension/pull/23840))
- Improved the layout of the security alert option in the settings page ([#23718](https://github.com/MetaMask/metamask-extension/pull/23718))
- Enhanced the appearance of security alerts by fine-tuning their spacing ([#23900](https://github.com/MetaMask/metamask-extension/pull/23900))
- Unified the color scheme for secondary titles in settings ([#23764](https://github.com/MetaMask/metamask-extension/pull/23764))
- Adjusted asset icon display and sizing in simulation details ([#23760](https://github.com/MetaMask/metamask-extension/pull/23760))
- Enhanced display for near-zero amounts and updated native token visuals for all chains ([#23711](https://github.com/MetaMask/metamask-extension/pull/23711))
- Enhanced default token name visibility by always using the remote token list for petnames ([#23919](https://github.com/MetaMask/metamask-extension/pull/23919))
- Improved transaction confirmation clarity by hiding totals for successful simulations ([#23899](https://github.com/MetaMask/metamask-extension/pull/23899))
- Updated transaction controller to display balance changes for wrapped ERC-20 tokens and legacy ERC-721 tokens ([#23915](https://github.com/MetaMask/metamask-extension/pull/23915))

### Fixed
- Enhanced the send flow by fine-tuning input fields to keep trailing zeros and decimals ([#23808](https://github.com/MetaMask/metamask-extension/pull/23808))
- Resolved token detection and import issues ([#23798](https://github.com/MetaMask/metamask-extension/pull/23798))
- Implemented a deprecation warning for users switching to the Mumbai network ([#23846](https://github.com/MetaMask/metamask-extension/pull/23846))
- Corrected the display of crypto balances in the presence of scam network warnings ([#23645](https://github.com/MetaMask/metamask-extension/pull/23645))
- Enhanced UI for simulation details by wrapping and adding tooltips to long asset names and amounts ([#23768](https://github.com/MetaMask/metamask-extension/pull/23768))
- Expanded the deprecation warning for OpenSea security alerts to include typed signature confirmations ([#23743](https://github.com/MetaMask/metamask-extension/pull/23743))
- Fixed an issue in Firefox where security alerts weren't displaying due to permission settings ([#23958](https://github.com/MetaMask/metamask-extension/pull/23958))
- Resolved an issue where the loading indicator overlapped with the UI in security alerts ([#23927](https://github.com/MetaMask/metamask-extension/pull/23927))
- Resolved an issue with an infinite loading spinner on blockaid alerts ([#23480](https://github.com/MetaMask/metamask-extension/pull/23480))
- Improved accessibility in the app's network selection by ensuring screen readers announce network names more clearly ([#23842](https://github.com/MetaMask/metamask-extension/pull/23842))
- Resolved an issue preventing QR code-based hardware wallet connections ([#23903](https://github.com/MetaMask/metamask-extension/pull/23903))
- Resolved an issue where the connected accounts modal would crash if a dApp with an installed Snap was accessed ([#23928](https://github.com/MetaMask/metamask-extension/pull/23928))

## [11.14.5]
### Fixed
- Prevent users from making fund loss errors while editing transactions by removing the edit button when on any confirmation screen for a transaction proposed by a dapp ([#24322](https://github.com/MetaMask/metamask-extension/pull/24322))
- Reduce failed simulations on NFT mint confirmations ([#24350]https://github.com/MetaMask/metamask-extension/pull/24350)

## [11.14.4]
### Fixed
- Fix bug that could cause safe-transfer-from transactions to be converted to transfer-from transactions, by removing the edit button on the safe-transfer-from confirmation screens ([#24287](https://github.com/MetaMask/metamask-extension/pull/24287))
Expand Down Expand Up @@ -4625,7 +4700,15 @@ 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/v11.14.4...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.15.6...HEAD
[11.15.6]: https://github.com/MetaMask/metamask-extension/compare/v11.15.5...v11.15.6
[11.15.5]: https://github.com/MetaMask/metamask-extension/compare/v11.15.4...v11.15.5
[11.15.4]: https://github.com/MetaMask/metamask-extension/compare/v11.15.3...v11.15.4
[11.15.3]: https://github.com/MetaMask/metamask-extension/compare/v11.15.2...v11.15.3
[11.15.2]: https://github.com/MetaMask/metamask-extension/compare/v11.15.1...v11.15.2
[11.15.1]: https://github.com/MetaMask/metamask-extension/compare/v11.15.0...v11.15.1
[11.15.0]: https://github.com/MetaMask/metamask-extension/compare/v11.14.5...v11.15.0
[11.14.5]: https://github.com/MetaMask/metamask-extension/compare/v11.14.4...v11.14.5
[11.14.4]: https://github.com/MetaMask/metamask-extension/compare/v11.14.3...v11.14.4
[11.14.3]: https://github.com/MetaMask/metamask-extension/compare/v11.14.2...v11.14.3
[11.14.2]: https://github.com/MetaMask/metamask-extension/compare/v11.14.1...v11.14.2
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ If you are using VS Code and are unable to make commits from the source control

To start a development build (e.g. with logging and file watching) run `yarn start`.

Alternatively, one can skip wallet onboarding and preload the vault state with a specific SRP by adding `TEST_SRP='<insert SRP here>'` and `PASSWORD='<insert wallet password here>'` to the `.metamaskrc` file and running `yarn start:skip-onboarding`.


#### React and Redux DevTools

To start the [React DevTools](https://github.com/facebook/react-devtools), run `yarn devtools:react` with a development build installed in a browser. This will open in a separate window; no browser extension is required.
Expand Down
Loading

0 comments on commit 0dd3ba7

Please sign in to comment.