Skip to content

Commit 8268471

Browse files
authored
Merge branch 'main' into 2254-use-infura-endpoints-in-gas-fee-controller
2 parents 18f7461 + 1aaaab0 commit 8268471

File tree

75 files changed

+1264
-297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1264
-297
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/core-monorepo",
3-
"version": "126.0.0",
3+
"version": "132.0.0",
44
"private": true,
55
"description": "Monorepo for packages shared between MetaMask clients",
66
"repository": {
@@ -85,7 +85,7 @@
8585
"simple-git-hooks": "^2.8.0",
8686
"ts-node": "^10.9.1",
8787
"tsup": "^8.0.2",
88-
"typescript": "~4.8.4",
88+
"typescript": "~4.9.5",
8989
"yargs": "^17.7.2"
9090
},
9191
"packageManager": "[email protected]",

packages/accounts-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"ts-jest": "^27.1.4",
6464
"typedoc": "^0.24.8",
6565
"typedoc-plugin-missing-exports": "^2.0.0",
66-
"typescript": "~4.8.4"
66+
"typescript": "~4.9.5"
6767
},
6868
"peerDependencies": {
6969
"@metamask/keyring-controller": "^14.0.0",

packages/address-book-controller/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"dependencies": {
4444
"@metamask/base-controller": "^5.0.1",
45-
"@metamask/controller-utils": "^9.0.1",
45+
"@metamask/controller-utils": "^9.0.2",
4646
"@metamask/utils": "^8.3.0"
4747
},
4848
"devDependencies": {
@@ -53,7 +53,7 @@
5353
"ts-jest": "^27.1.4",
5454
"typedoc": "^0.24.8",
5555
"typedoc-plugin-missing-exports": "^2.0.0",
56-
"typescript": "~4.8.4"
56+
"typescript": "~4.9.5"
5757
},
5858
"engines": {
5959
"node": ">=16.0.0"

packages/address-book-controller/src/AddressBookController.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@ describe('AddressBookController', () => {
294294
).toBe(true);
295295
});
296296

297+
it('should return false to indicate an address book entry has NOT been deleted due to unsafe input', () => {
298+
const controller = new AddressBookController();
299+
// @ts-expect-error Suppressing error to test runtime behavior
300+
expect(controller.delete('__proto__', '0x01')).toBe(false);
301+
expect(controller.delete(toHex(1), 'constructor')).toBe(false);
302+
});
303+
297304
it('should return false to indicate an address book entry has NOT been deleted', () => {
298305
const controller = new AddressBookController();
299306
controller.set('0x32Be343B94f860124dC4fEe278FDCBD38C102D88', '0x00');

packages/address-book-controller/src/AddressBookController.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { BaseControllerV1 } from '@metamask/base-controller';
33
import {
44
normalizeEnsName,
55
isValidHexAddress,
6+
isSafeDynamicKey,
67
toChecksumHexAddress,
78
toHex,
89
} from '@metamask/controller-utils';
@@ -110,6 +111,7 @@ export class AddressBookController extends BaseControllerV1<
110111
delete(chainId: Hex, address: string) {
111112
address = toChecksumHexAddress(address);
112113
if (
114+
![chainId, address].every((key) => isSafeDynamicKey(key)) ||
113115
!isValidHexAddress(address) ||
114116
!this.state.addressBook[chainId] ||
115117
!this.state.addressBook[chainId][address]

packages/announcement-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"ts-jest": "^27.1.4",
5252
"typedoc": "^0.24.8",
5353
"typedoc-plugin-missing-exports": "^2.0.0",
54-
"typescript": "~4.8.4"
54+
"typescript": "~4.9.5"
5555
},
5656
"engines": {
5757
"node": ">=16.0.0"

packages/announcement-controller/src/AnnouncementController.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,25 @@ describe('announcement controller', () => {
120120
expect(controller.state.announcements[3].isShown).toBe(false);
121121
});
122122

123+
describe('resetViewed', () => {
124+
it('resets all announcement isShown states to false', () => {
125+
const controller = new AnnouncementController({
126+
messenger: getRestrictedMessenger(),
127+
state: state2,
128+
allAnnouncements: allAnnouncements2,
129+
});
130+
131+
controller.updateViewed({ 1: true, 3: true });
132+
expect(controller.state.announcements[1].isShown).toBe(true);
133+
expect(controller.state.announcements[3].isShown).toBe(true);
134+
135+
controller.resetViewed();
136+
Object.values(controller.state.announcements).forEach((announcement) => {
137+
expect(announcement.isShown).toBe(false);
138+
});
139+
});
140+
});
141+
123142
describe('update viewed announcements', () => {
124143
it('should update isShown status', () => {
125144
const controller = new AnnouncementController({

packages/announcement-controller/src/AnnouncementController.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ export class AnnouncementController extends BaseController<
122122
});
123123
}
124124

125+
/**
126+
* Resets the isShown status for all announcements
127+
*/
128+
resetViewed(): void {
129+
this.update(({ announcements }) => {
130+
for (const announcement of Object.values(announcements)) {
131+
announcement.isShown = false;
132+
}
133+
});
134+
}
135+
125136
/**
126137
* Updates the status of the status of the specified announcements
127138
* once it is read by the user.

packages/approval-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"ts-jest": "^27.1.4",
5656
"typedoc": "^0.24.8",
5757
"typedoc-plugin-missing-exports": "^2.0.0",
58-
"typescript": "~4.8.4"
58+
"typescript": "~4.9.5"
5959
},
6060
"engines": {
6161
"node": ">=16.0.0"

packages/assets-controllers/CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [27.2.0]
11+
12+
### Added
13+
14+
- `CodefiTokenPricesServiceV2` exports `SUPPORTED_CHAIN_IDS`, an array of chain IDs supported by Codefi Price API V2. ([#4079](https://github.com/MetaMask/core/pull/4079))
15+
16+
- Added `tokenURI` key to `compareNftMetadata` function to compare nft metadata entries with. ([#3856](https://github.com/MetaMask/core/pull/3856))
17+
18+
## [27.1.0]
19+
20+
### Added
21+
22+
- Add `updateNftMetadata` method to `NftController` to update metadata for the requested NFTs ([#4008](https://github.com/MetaMask/core/pull/4008))
23+
1024
## [27.0.1]
1125

1226
### Fixed
@@ -723,7 +737,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
723737
724738
- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
725739
726-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
740+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
741+
[27.2.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
742+
[27.1.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
727743
[27.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
728744
[27.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
729745
[26.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]

0 commit comments

Comments
 (0)