Skip to content

Commit

Permalink
Merge branch 'main' into 240610-upgrade-AssetsContractController
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift authored Jul 16, 2024
2 parents b758d93 + 83957e2 commit 96db928
Show file tree
Hide file tree
Showing 18 changed files with 333 additions and 87 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "174.0.0",
"version": "176.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@metamask/base-controller": "^6.0.1",
"@metamask/eth-snap-keyring": "^4.3.1",
"@metamask/keyring-api": "^8.0.0",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/keyring-controller": "^17.1.1",
"@metamask/snaps-sdk": "^4.2.0",
"@metamask/snaps-utils": "^7.4.0",
"@metamask/utils": "^9.0.0",
Expand Down
23 changes: 22 additions & 1 deletion packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [36.0.0]

### Added

- Add optional `topBid` property to the `NftMetadata` type. This property must be of type `TopBid`. ([#4522](https://github.com/MetaMask/core/pull/4522))
- Add optional `floorAsk` property to the `TokenCollection` type. This property must be of type `FloorAskCollection`. ([#4522](https://github.com/MetaMask/core/pull/4522))
- Add linea mainnet support to nft detection supported networks ([#4515](https://github.com/MetaMask/core/pull/4515))
- The `Collection` type is expanded to include the following 'string'-type optional properties: `contractDeployedAt`, `creator`, `ownerCount`, and an optional property `topBid` of the type `TopBid & { sourceDomain?: string; }`. ([#4443](https://github.com/MetaMask/core/pull/4443))

### Changed

- Fetch NFT collections data from the NFT-API `Get Collections` endpoint when calling the `detectNfts` method of `NftDetectionController`, and the `updateNftMetadata` and `watchNft` methods of `NftController`. ([#4443](https://github.com/MetaMask/core/pull/4443))
- Bump `@metamask/utils` to `^9.0.0` ([#4516](https://github.com/MetaMask/core/pull/4516))
- Bump `@metamask/rpc-errors` to `^6.3.1` ([#4516](https://github.com/MetaMask/core/pull/4516))

### Fixed

- **BREAKING:** The `attributes` property of the `NftMetadata` type must be of type `Attributes[]` ([#4522](https://github.com/MetaMask/core/pull/4522))
- The `attributes` property was added and typed as `Attributes` on `v28.0.0`.

## [35.0.0]

### Changed
Expand Down Expand Up @@ -993,7 +1013,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@35.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@36.0.0...HEAD
[36.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@35.0.0...@metamask/assets-controllers@36.0.0
[35.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@34.0.0...@metamask/assets-controllers@35.0.0
[34.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@33.0.0...@metamask/assets-controllers@34.0.0
[33.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@32.0.0...@metamask/assets-controllers@33.0.0
Expand Down
4 changes: 2 additions & 2 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/assets-controllers",
"version": "35.0.0",
"version": "36.0.0",
"description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@metamask/contract-metadata": "^2.4.0",
"@metamask/controller-utils": "^11.0.1",
"@metamask/eth-query": "^4.0.0",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/keyring-controller": "^17.1.1",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/network-controller": "^20.0.0",
"@metamask/polling-controller": "^9.0.0",
Expand Down
13 changes: 12 additions & 1 deletion packages/keyring-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [17.1.1]

### Changed

- Bump `@metamask/utils` to `^9.0.0`, `@metamask/rpc-errors` to `^6.3.1` ([#4516](https://github.com/MetaMask/core/pull/4516))

### Fixed

- Clear encryption salt and key in `setLocked` and `#createNewVaultWithKeyring` to ensure that encryption key is always generated with the latest password ([#4514](https://github.com/MetaMask/core/pull/4514))

## [17.1.0]

### Added
Expand Down Expand Up @@ -497,7 +507,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

All changes listed after this point were applied to this package following the monorepo conversion.

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@17.1.0...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@17.1.1...HEAD
[17.1.1]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@17.1.0...@metamask/keyring-controller@17.1.1
[17.1.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@17.0.0...@metamask/keyring-controller@17.1.0
[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@16.1.0...@metamask/keyring-controller@17.0.0
[16.1.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@16.0.0...@metamask/keyring-controller@16.1.0
Expand Down
4 changes: 2 additions & 2 deletions packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/keyring-controller",
"version": "17.1.0",
"version": "17.1.1",
"description": "Stores identities seen in the wallet and manages interactions such as signing",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -49,7 +49,7 @@
"@metamask/eth-sig-util": "^7.0.1",
"@metamask/eth-simple-keyring": "^6.0.1",
"@metamask/keyring-api": "^8.0.0",
"@metamask/message-manager": "^10.0.0",
"@metamask/message-manager": "^10.0.1",
"@metamask/utils": "^9.0.0",
"async-mutex": "^0.5.0",
"ethereumjs-wallet": "^1.0.1",
Expand Down
14 changes: 13 additions & 1 deletion packages/message-manager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.0.1]

### Changed

- Bump `@metamask/utils` to `^9.0.0`, `@metamask/rpc-errors` to `^6.3.1` ([#4516](https://github.com/MetaMask/core/pull/4516))

### Fixed

- Add `EventEmitter` type annotation to the `hub` class field of `AbstractMessageManager` ([#4510](https://github.com/MetaMask/core/pull/4510))
- This ensures that `hub` is not inferred to be a generic type, which would break types for downstream consumers.

## [10.0.0]

### Changed
Expand Down Expand Up @@ -255,7 +266,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

All changes listed after this point were applied to this package following the monorepo conversion.

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@10.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@10.0.1...HEAD
[10.0.1]: https://github.com/MetaMask/core/compare/@metamask/message-manager@10.0.0...@metamask/message-manager@10.0.1
[10.0.0]: https://github.com/MetaMask/core/compare/@metamask/message-manager@9.0.0...@metamask/message-manager@10.0.0
[9.0.0]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.2...@metamask/message-manager@9.0.0
[8.0.2]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.1...@metamask/message-manager@8.0.2
Expand Down
2 changes: 1 addition & 1 deletion packages/message-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/message-manager",
"version": "10.0.0",
"version": "10.0.1",
"description": "Stores and manages interactions with signing requests",
"keywords": [
"MetaMask",
Expand Down
2 changes: 1 addition & 1 deletion packages/notification-services-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@contentful/rich-text-html-renderer": "^16.5.2",
"@metamask/base-controller": "^6.0.1",
"@metamask/controller-utils": "^11.0.1",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/keyring-controller": "^17.1.1",
"@metamask/profile-sync-controller": "^0.1.3",
"bignumber.js": "^4.1.0",
"contentful": "^10.3.6",
Expand Down
75 changes: 47 additions & 28 deletions packages/phishing-controller/src/PhishingController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type PhishingControllerActions,
type PhishingControllerOptions,
} from './PhishingController';
import { formatHostnameToUrl } from './tests/utils';

const controllerName = 'PhishingController';

Expand Down Expand Up @@ -218,14 +219,18 @@ describe('PhishingController', () => {
expect(controller.isStalelistOutOfDate()).toBe(false);
await controller.maybeUpdateState();
expect(
controller.test('this-should-not-be-in-default-blocklist.com'),
controller.test(
formatHostnameToUrl('this-should-not-be-in-default-blocklist.com'),
),
).toMatchObject({
result: false,
type: 'all',
});

expect(
controller.test('this-should-not-be-in-default-allowlist.com'),
controller.test(
formatHostnameToUrl('this-should-not-be-in-default-allowlist.com'),
),
).toMatchObject({
result: false,
type: 'all',
Expand All @@ -235,14 +240,18 @@ describe('PhishingController', () => {
await controller.maybeUpdateState();

expect(
controller.test('this-should-not-be-in-default-blocklist.com'),
controller.test(
formatHostnameToUrl('this-should-not-be-in-default-blocklist.com'),
),
).toMatchObject({
result: true,
type: 'blocklist',
});

expect(
controller.test('this-should-not-be-in-default-allowlist.com'),
controller.test(
formatHostnameToUrl('this-should-not-be-in-default-allowlist.com'),
),
).toMatchObject({
result: false,
type: 'allowlist',
Expand Down Expand Up @@ -479,7 +488,7 @@ describe('PhishingController', () => {
.reply(200, { data: [] });
const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('metamask.io')).toMatchObject({
expect(controller.test(formatHostnameToUrl('metamask.io'))).toMatchObject({
result: false,
type: 'allowlist',
name: ListNames.MetaMask,
Expand Down Expand Up @@ -513,7 +522,7 @@ describe('PhishingController', () => {

const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('i❤.ws')).toMatchObject({
expect(controller.test(formatHostnameToUrl('i❤.ws'))).toMatchObject({
result: false,
type: 'all',
});
Expand Down Expand Up @@ -546,7 +555,7 @@ describe('PhishingController', () => {

const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('xn--i-7iq.ws')).toMatchObject({
expect(controller.test(formatHostnameToUrl('xn--i-7iq.ws'))).toMatchObject({
result: false,
type: 'all',
});
Expand Down Expand Up @@ -579,7 +588,7 @@ describe('PhishingController', () => {

const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('etnerscan.io')).toMatchObject({
expect(controller.test(formatHostnameToUrl('etnerscan.io'))).toMatchObject({
result: true,
type: 'blocklist',
name: ListNames.MetaMask,
Expand Down Expand Up @@ -612,7 +621,9 @@ describe('PhishingController', () => {
.reply(200, { data: [] });
const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('myetherẉalletṭ.com')).toMatchObject({
expect(
controller.test(formatHostnameToUrl('myetherẉalletṭ.com')),
).toMatchObject({
result: true,
type: 'blocklist',
name: ListNames.MetaMask,
Expand Down Expand Up @@ -646,7 +657,9 @@ describe('PhishingController', () => {

const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('xn--myetherallet-4k5fwn.com')).toMatchObject({
expect(
controller.test(formatHostnameToUrl('xn--myetherallet-4k5fwn.com')),
).toMatchObject({
result: true,
type: 'blocklist',
name: ListNames.MetaMask,
Expand Down Expand Up @@ -689,7 +702,9 @@ describe('PhishingController', () => {
const controller = getPhishingController();
await controller.updateStalelist();
expect(
controller.test('e4d600ab9141b7a9859511c77e63b9b3.com'),
controller.test(
formatHostnameToUrl('e4d600ab9141b7a9859511c77e63b9b3.com'),
),
).toMatchObject({
result: true,
type: 'blocklist',
Expand Down Expand Up @@ -725,7 +740,9 @@ describe('PhishingController', () => {
const controller = getPhishingController();
await controller.updateStalelist();
expect(
controller.test('e4d600ab9141b7a9859511c77e63b9b3.com'),
controller.test(
formatHostnameToUrl('e4d600ab9141b7a9859511c77e63b9b3.com'),
),
).toMatchObject({
result: false,
type: 'all',
Expand Down Expand Up @@ -758,7 +775,7 @@ describe('PhishingController', () => {
.reply(200, { data: [] });
const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('opensea.io')).toMatchObject({
expect(controller.test(formatHostnameToUrl('opensea.io'))).toMatchObject({
result: false,
type: 'allowlist',
name: ListNames.MetaMask,
Expand Down Expand Up @@ -791,7 +808,7 @@ describe('PhishingController', () => {
.reply(200, { data: [] });
const controller = getPhishingController();
await controller.updateStalelist();
expect(controller.test('ohpensea.io')).toMatchObject({
expect(controller.test(formatHostnameToUrl('ohpensea.io'))).toMatchObject({
result: true,
type: 'fuzzy',
name: ListNames.MetaMask,
Expand Down Expand Up @@ -825,7 +842,9 @@ describe('PhishingController', () => {
const controller = getPhishingController();
await controller.updateStalelist();
expect(
controller.test('this-is-the-official-website-of-opensea.io'),
controller.test(
formatHostnameToUrl('this-is-the-official-website-of-opensea.io'),
),
).toMatchObject({
result: false,
type: 'all',
Expand Down Expand Up @@ -860,12 +879,12 @@ describe('PhishingController', () => {
await controller.updateStalelist();
const unsafeDomain = 'electrum.mx';
assert.equal(
controller.test(unsafeDomain).result,
controller.test(formatHostnameToUrl(unsafeDomain)).result,
true,
'Example unsafe domain seems to be safe',
);
controller.bypass(unsafeDomain);
expect(controller.test(unsafeDomain)).toMatchObject({
controller.bypass(formatHostnameToUrl(unsafeDomain));
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
result: false,
type: 'all',
});
Expand Down Expand Up @@ -899,13 +918,13 @@ describe('PhishingController', () => {
await controller.updateStalelist();
const unsafeDomain = 'electrum.mx';
assert.equal(
controller.test(unsafeDomain).result,
controller.test(formatHostnameToUrl(unsafeDomain)).result,
true,
'Example unsafe domain seems to be safe',
);
controller.bypass(unsafeDomain);
controller.bypass(unsafeDomain);
expect(controller.test(unsafeDomain)).toMatchObject({
controller.bypass(formatHostnameToUrl(unsafeDomain));
controller.bypass(formatHostnameToUrl(unsafeDomain));
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
result: false,
type: 'all',
});
Expand Down Expand Up @@ -939,12 +958,12 @@ describe('PhishingController', () => {
await controller.updateStalelist();
const unsafeDomain = 'myetherẉalletṭ.com';
assert.equal(
controller.test(unsafeDomain).result,
controller.test(formatHostnameToUrl(unsafeDomain)).result,
true,
'Example unsafe domain seems to be safe',
);
controller.bypass(unsafeDomain);
expect(controller.test(unsafeDomain)).toMatchObject({
controller.bypass(formatHostnameToUrl(unsafeDomain));
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
result: false,
type: 'all',
});
Expand Down Expand Up @@ -978,12 +997,12 @@ describe('PhishingController', () => {
await controller.updateStalelist();
const unsafeDomain = 'xn--myetherallet-4k5fwn.com';
assert.equal(
controller.test(unsafeDomain).result,
controller.test(formatHostnameToUrl(unsafeDomain)).result,
true,
'Example unsafe domain seems to be safe',
);
controller.bypass(unsafeDomain);
expect(controller.test(unsafeDomain)).toMatchObject({
controller.bypass(formatHostnameToUrl(unsafeDomain));
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
result: false,
type: 'all',
});
Expand Down
Loading

0 comments on commit 96db928

Please sign in to comment.