Skip to content

Commit

Permalink
Merge branch '1779-switch-networks-dapp' into 1779-switch-networks-da…
Browse files Browse the repository at this point in the history
…pp-windows
  • Loading branch information
darkwing authored Mar 21, 2024
2 parents 5689ae6 + e411630 commit d43fd7d
Show file tree
Hide file tree
Showing 218 changed files with 10,670 additions and 3,363 deletions.
3 changes: 2 additions & 1 deletion .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { NetworkStatus } from '@metamask/network-controller';
import { EthAccountType, EthMethod } from '@metamask/keyring-api';
import { CHAIN_IDS } from '../shared/constants/network';
import { copyable, divider, heading, panel, text } from '@metamask/snaps-sdk';
import { FirstTimeFlowType } from '../shared/constants/onboarding';

const state = {
invalidCustomNetwork: {
Expand Down Expand Up @@ -670,7 +671,7 @@ const state = {
[CHAIN_IDS.OPTIMISM_TESTNET]: false,
[CHAIN_IDS.AVALANCHE_TESTNET]: true,
},
firstTimeFlowType: 'create',
firstTimeFlowType: FirstTimeFlowType.create,
completedOnboarding: true,
knownMethodData: {
'0x60806040': {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
diff --git a/helpers/construct.js b/helpers/construct.js
index 3d3c232dcb226892cdf6181c6f4f4f40f2325fcc..da7e2696a244fadd35f0eeb5cae5f577ee3c7442 100644
index 771e1d7952e80f11619424fbabb3744b959ffa49..5fe152bc1129bd8c8b7bb217ca1972ac4e089051 100644
--- a/helpers/construct.js
+++ b/helpers/construct.js
@@ -1,18 +1,21 @@
@@ -1,10 +1,21 @@
-var setPrototypeOf = require("./setPrototypeOf.js");
-var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
-function _construct(Parent, args, Class) {
- if (isNativeReflectConstruct()) {
- module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
- } else {
- module.exports = _construct = function _construct(Parent, args, Class) {
- var a = [null];
- a.push.apply(a, args);
- var Constructor = Function.bind.apply(Parent, a);
- var instance = new Constructor();
- if (Class) setPrototypeOf(instance, Class.prototype);
- return instance;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- }
- return _construct.apply(null, arguments);
-function _construct(t, e, r) {
- if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
- var o = [null];
- o.push.apply(o, e);
- var p = new (t.bind.apply(t, o))();
- return r && setPrototypeOf(p, r.prototype), p;
-}
-module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
\ No newline at end of file
+// All of MetaMask's supported browsers include `Reflect.construct` support, so
+// we don't need this polyfill.
+
+// This Proxy preseves the two properties that were added by `@babel/runtime`.
+// This Proxy preserves the two properties that were added by `@babel/runtime`.
+// I am not entire sure what these properties are for (maybe ES5/ES6
+// interoperability?) but they have been preserved just in case.
+const reflectProxy = new Proxy(
+const reflectProxy = new Proxy(
+ Reflect.construct,
+ {
+ get: function (target, property) {
Expand All @@ -39,7 +31,7 @@ index 3d3c232dcb226892cdf6181c6f4f4f40f2325fcc..da7e2696a244fadd35f0eeb5cae5f577
+ }
+ return Reflect.get(...arguments);
+ }
+ }
+ }
+);
+
+module.exports = reflectProxy;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/dist/util.js b/dist/util.js
index b9d1a7cca20c9da0d5d72010868dd84a58ea7442..6133b38ff6d584e3682eab627f9404d3e157c162 100644
--- a/dist/util.js
+++ b/dist/util.js
@@ -246,6 +246,9 @@ exports.safelyExecuteWithTimeout = safelyExecuteWithTimeout;
* @returns A 0x-prefixed hexidecimal checksummed address, if address is valid. Otherwise original input 0x-prefixe, if address is valid. Otherwise original input 0x-prefixed.
*/
function toChecksumHexAddress(address) {
+ if (address === undefined || address === null) {
+ return address;
+ }
const hexPrefixed = (0, utils_1.add0x)(address);
if (!(0, utils_1.isHexString)(hexPrefixed)) {
// Version 5.1 of ethereumjs-utils would have returned '0xY' for input 'y'
13 changes: 13 additions & 0 deletions .yarn/patches/@trezor-schema-utils-npm-1.0.1-70c2a68232.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/index.js b/lib/index.js
index b7a810396d6c0dad839fc08f1e192f5df134879f..93cb54be0f33c77e9f801f1c23330eb0fc65bb38 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -4,7 +4,7 @@ exports.Optional = exports.Type = exports.AssertWeak = exports.Assert = exports.
const typebox_1 = require("@sinclair/typebox");
Object.defineProperty(exports, "Optional", { enumerable: true, get: function () { return typebox_1.Optional; } });
const errors_1 = require("@sinclair/typebox/errors");
-const ts_mixer_1 = require("ts-mixer");
+const ts_mixer_1 = require("ts-mixer/dist/cjs/index");
const custom_types_1 = require("./custom-types");
const errors_2 = require("./errors");
const utils_1 = require("./utils");
66 changes: 65 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [11.12.3]
### Fixed
- [MMI] Fixes an error related with a missing code fence, when the MMI build didn't have the blockaid feature ([#23516](https://github.com/MetaMask/metamask-extension/pull/23516))
- [MMI] Fixes a bug for some custodians that don't send us the env property when connection to MMI ([#23494](https://github.com/MetaMask/metamask-extension/pull/23494))

## [11.12.2]
### Fixed
- Fix transaction confirmations so that they correctly show estimated fees instead of max possible fees
- For non-layer 2 network, and non-token send, transactions([#23203](https://github.com/MetaMask/metamask-extension/pull/23203))
- For layer 2 networks and for erc20 transfers ([#23511](https://github.com/MetaMask/metamask-extension/pull/23511))

## [11.12.1]
### Changed
- Updated styling for missing petnames to prevent misinterpretation as malicious ([#23458](https://github.com/MetaMask/metamask-extension/pull/23458))

## [11.12.0]
### Added
- Introduced deprecation warnings for Arbitrum Goerli and OP Goerli test networks ([#23071](https://github.com/MetaMask/metamask-extension/pull/23071))
- Added origin details to personal sign page ([#22763](https://github.com/MetaMask/metamask-extension/pull/22763))
- Enhanced snap functionality with dynamic interfaces, customizable timeouts, and faster installations ([#22828](https://github.com/MetaMask/metamask-extension/pull/22828))
- Added a 'Connect Account' button in the account list menu for easier account connections ([#22941](https://github.com/MetaMask/metamask-extension/pull/22941))
- [FLASK] Added signature insights ([#22485](https://github.com/MetaMask/metamask-extension/pull/22485))
- [MMI] Enhanced error tracking in MMI controllers ([#22994](https://github.com/MetaMask/metamask-extension/pull/22994))
- [MMI] Updated MMI dependencies and refactored code ([#22546](https://github.com/MetaMask/metamask-extension/pull/22546))

### Changed
- Updated Confirm/Sign button to red for malicious requests ([#23004](https://github.com/MetaMask/metamask-extension/pull/23004))
- Updated the 'Discover Snaps' link to direct users to snaps.metamask.io ([#22909](https://github.com/MetaMask/metamask-extension/pull/22909))
- Displayed total account balances on Accounts Menu and home screen ([#22186](https://github.com/MetaMask/metamask-extension/pull/22186))
- Updated style of app header ([#22637](https://github.com/MetaMask/metamask-extension/pull/22637))
- Enhanced settings search for better navigation ([#22967](https://github.com/MetaMask/metamask-extension/pull/22967))
- Enhanced Send Flow by displaying account names during search ([#22824](https://github.com/MetaMask/metamask-extension/pull/22824))
- Improved send flow by directly showing NFTs tab when sending an NFT ([#23033](https://github.com/MetaMask/metamask-extension/pull/23033))
- Simplified send flow by removing outdated gas options ([#22951](https://github.com/MetaMask/metamask-extension/pull/22951))
- [MMI] Improved custodian search by using environment names for unique identification ([#23073](https://github.com/MetaMask/metamask-extension/pull/23073))
- [MMI] Enhanced MMI keyring configuration for improved mv3 version compatibility ([#22968](https://github.com/MetaMask/metamask-extension/pull/22968))

### Fixed
- Improved accuracy of fee details for Optimism transactions ([#22997](https://github.com/MetaMask/metamask-extension/pull/22997))
- Ensured password prompt appears every time 'Show private key' is selected ([#22867](https://github.com/MetaMask/metamask-extension/pull/22867))
- Adjusted menu positioning ensuring visibility of all options ([#22889](https://github.com/MetaMask/metamask-extension/pull/22889))
- Corrected asset list to display native currency symbols instead of fiat on the home page ([#22760](https://github.com/MetaMask/metamask-extension/pull/22760))
- Fixed tokens being added to incorrect networks after switching networks ([#22814](https://github.com/MetaMask/metamask-extension/pull/22814))
- Fixed an issue where NFTs disappeared or couldn't be re-imported after account switching ([#22856](https://github.com/MetaMask/metamask-extension/pull/22856))
- Fixed an issue with saving very low default gas fees ([#22790](https://github.com/MetaMask/metamask-extension/pull/22790))
- Removed the subtle background behind setting icons ([#22982](https://github.com/MetaMask/metamask-extension/pull/22982))
- Improved 'See Details' in alerts to stop auto-scrolling ([#22932](https://github.com/MetaMask/metamask-extension/pull/22932))
- Improved security checks for transactions ([#22978](https://github.com/MetaMask/metamask-extension/pull/22978))
- Ensured gas fee editing remains accessible even when currency rate checks are disabled ([#22890](https://github.com/MetaMask/metamask-extension/pull/22890))
- Updated modal overlay for better visibility and focus on content in both light and dark modes ([#23102](https://github.com/MetaMask/metamask-extension/pull/23102))
- Fixed behavior for manually added networks to show a modal with the option to switch, rather than auto-switching ([#22832](https://github.com/MetaMask/metamask-extension/pull/22832))
- Corrected link alignment in Snap UI ([#23045](https://github.com/MetaMask/metamask-extension/pull/23045))
- Resolved an issue that prevented cancelling permission requests without crashing the extension ([#22915](https://github.com/MetaMask/metamask-extension/pull/22915))
- Fixed badge color in app-header to accurately reflect connection status ([#23126](https://github.com/MetaMask/metamask-extension/pull/23126))
- Fixed a glitch in the Product Tour where step numbers were not displaying correctly ([#23100](https://github.com/MetaMask/metamask-extension/pull/23100))
- Enhanced handling of long account names ([#23096](https://github.com/MetaMask/metamask-extension/pull/23096))
- Resolved issue with tabs overlapping content in the send flow ([#23028](https://github.com/MetaMask/metamask-extension/pull/23028))
- Ensured consistent balance display in Eth Overview and account list ([#23059](https://github.com/MetaMask/metamask-extension/pull/23059))
- [MMI] Corrected custody type determination to support various types ([#22950](https://github.com/MetaMask/metamask-extension/pull/22950))

## [11.11.4]
### Changed
- Enable Snaps home pages ([#23383](https://github.com/MetaMask/metamask-extension/pull/23383))
Expand Down Expand Up @@ -4447,7 +4507,11 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
### Uncategorized
- Added the ability to restore accounts from seed words.

[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.11.4...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.12.3...HEAD
[11.12.3]: https://github.com/MetaMask/metamask-extension/compare/v11.12.2...v11.12.3
[11.12.2]: https://github.com/MetaMask/metamask-extension/compare/v11.12.1...v11.12.2
[11.12.1]: https://github.com/MetaMask/metamask-extension/compare/v11.12.0...v11.12.1
[11.12.0]: https://github.com/MetaMask/metamask-extension/compare/v11.11.4...v11.12.0
[11.11.4]: https://github.com/MetaMask/metamask-extension/compare/v11.11.3...v11.11.4
[11.11.3]: https://github.com/MetaMask/metamask-extension/compare/v11.11.2...v11.11.3
[11.11.2]: https://github.com/MetaMask/metamask-extension/compare/v11.11.1...v11.11.2
Expand Down
3 changes: 0 additions & 3 deletions app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 30 additions & 5 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/_locales/hi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/_locales/id/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d43fd7d

Please sign in to comment.