Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MetaMask/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.0.0
Choose a base ref
...
head repository: MetaMask/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v9.1.0
Choose a head ref
  • 4 commits
  • 11 files changed
  • 3 contributors

Commits on May 20, 2021

  1. Copy the full SHA
    0bdd87c View commit details
  2. Add support for unicode domans to PhishingController (#471)

    The PhishingController now supports unicode domains. Previously it
    supported plain ASCII domains (including punycode domains), but any
    domains with non-ASCII unicode characters would always be considered
    as safe.
    
    Tests have been added to ensure the `test` and `bypass` methods both
    normalize input to punycode.
    
    Note that any whitelisted unicode domains will now be ignored. We could
    fix this with a migration, but it's exceedingly unlikely that any
    unicode domains could have been whitelisted in the first place, because
    we only offer that ability for blocked domains. And unicode domains
    were never blocked.
    
    The `eth-phishing-detect` package was updated to make a pre-existing
    test work correctly. Previously the "should bypass a given domain" test
    was broken because the example unsafe domain was not blocked in the
    version of `eth-phishing-detect` used. It is blocked in the current
    version, and an assertion has been added to ensure these tests are
    working correctly.
    Gudahtt authored May 20, 2021
    Copy the full SHA
    abc960e View commit details
  3. Collectibles updates (#454)

    * openseainterface
    
    * openseainterface
    
    * types
    
    * fixes MetaMask/metamask-mobile#2264
    
    * collectiblesmetadata
    
    * collectiblecontract
    
    * compareCollectiblesMetadata
    
    * compareCollectiblesMetadatatest
    
    * ignoreassigns
    
    * lintfix
    
    * Revert "Add BaseControllerV2 support to ComposableController (#447)"
    
    This reverts commit 5777094.
    
    * ApiCollectibleLastSale
    
    * address
    
    * addmetadata
    
    * fixtests
    
    * Revert "Revert "Add BaseControllerV2 support to ComposableController (#447)""
    
    This reverts commit c3ebf47.
    
    * ignore
    estebanmino authored May 20, 2021
    Copy the full SHA
    b8ba44c View commit details
  4. v9.1.0 (#474)

    * changelogandbump
    
    * typo
    
    * Update CHANGELOG.md
    
    Co-authored-by: Mark Stacey <markjstacey@gmail.com>
    
    Co-authored-by: Mark Stacey <markjstacey@gmail.com>
    estebanmino and Gudahtt authored May 20, 2021
    Copy the full SHA
    a554900 View commit details
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [9.1.0] - 2021-05-20
### Added
- Add support for unicode domains to PhishingController ([#471](https://github.com/MetaMask/controllers/pull/471))

### Changed
- AssetsController collectibles metadata improvements ([#454](https://github.com/MetaMask/controllers/pull/454))

## [9.0.0]
### Added
- Add `getState` action to BaseControllerV2 ([#457](https://github.com/MetaMask/controllers/pull/457))
@@ -236,7 +243,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Removed
- Remove shapeshift controller (#209)

[Unreleased]: https://github.com/MetaMask/controllers/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/controllers/compare/v9.1.0...HEAD
[9.1.0]: https://github.com/MetaMask/controllers/compare/v9.0.0...v9.1.0
[9.0.0]: https://github.com/MetaMask/controllers/compare/v8.0.0...v9.0.0
[8.0.0]: https://github.com/MetaMask/controllers/compare/v7.0.0...v8.0.0
[7.0.0]: https://github.com/MetaMask/controllers/compare/v6.2.1...v7.0.0
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/controllers",
"version": "9.0.0",
"version": "9.1.0",
"description": "Collection of platform-agnostic modules for creating secure data models for cryptocurrency wallets",
"license": "MIT",
"files": [
@@ -48,7 +48,7 @@
"eth-json-rpc-infura": "^5.1.0",
"eth-keyring-controller": "^6.2.1",
"eth-method-registry": "1.1.0",
"eth-phishing-detect": "^1.1.13",
"eth-phishing-detect": "^1.1.14",
"eth-query": "^2.1.2",
"eth-rpc-errors": "^4.0.0",
"eth-sig-util": "^3.0.0",
@@ -62,19 +62,21 @@
"isomorphic-fetch": "^3.0.0",
"jsonschema": "^1.2.4",
"nanoid": "^3.1.12",
"punycode": "^2.1.1",
"single-call-balance-checker-abi": "^1.0.0",
"uuid": "^8.3.2",
"web3": "^0.20.7",
"web3-provider-engine": "^16.0.1"
},
"devDependencies": {
"@metamask/auto-changelog": "^1.0.0",
"@metamask/auto-changelog": "^2.0.1",
"@metamask/eslint-config": "^6.0.0",
"@metamask/eslint-config-jest": "^6.0.0",
"@metamask/eslint-config-nodejs": "^6.0.0",
"@metamask/eslint-config-typescript": "^6.0.0",
"@types/jest": "^26.0.22",
"@types/node": "^14.14.31",
"@types/punycode": "^2.1.0",
"@types/sinon": "^9.0.10",
"@types/web3": "^1.0.6",
"@typescript-eslint/eslint-plugin": "^4.22.0",
35 changes: 29 additions & 6 deletions src/assets/AssetsController.test.ts
Original file line number Diff line number Diff line change
@@ -294,6 +294,33 @@ describe('AssetsController', () => {
});
});

it('should update collectible if image is different', async () => {
await assetsController.addCollectible('foo', 1, {
name: 'name',
image: 'image',
description: 'description',
});
expect(assetsController.state.collectibles[0]).toStrictEqual({
address: '0xfoO',
description: 'description',
image: 'image',
name: 'name',
tokenId: 1,
});
await assetsController.addCollectible('foo', 1, {
name: 'name',
image: 'image-updated',
description: 'description',
});
expect(assetsController.state.collectibles[0]).toStrictEqual({
address: '0xfoO',
description: 'description',
image: 'image-updated',
name: 'name',
tokenId: 1,
});
});

it('should not duplicate collectible nor collectible contract if already added', async () => {
await assetsController.addCollectible('foo', 1, {
name: 'name',
@@ -329,7 +356,7 @@ describe('AssetsController', () => {
expect(assetsController.state.collectibles[0]).toStrictEqual({
address: '0xfoO',
description: 'Description',
image: 'url',
imageOriginal: 'url',
name: 'Name',
tokenId: 1,
});
@@ -346,18 +373,14 @@ describe('AssetsController', () => {
await assetsController.addCollectible(KUDOSADDRESS, 1203);
expect(assetsController.state.collectibles[0]).toStrictEqual({
address: '0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163',
description: undefined,
image: 'Kudos Image',
name: 'Kudos Name',
tokenId: 1203,
});
expect(assetsController.state.collectibleContracts[0]).toStrictEqual({
address: '0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163',
description: undefined,
logo: undefined,
name: 'KudosToken',
symbol: 'KDO',
totalSupply: undefined,
});
});

@@ -435,7 +458,7 @@ describe('AssetsController', () => {
{
address: '0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163',
description: 'Kudos Description',
image: 'Kudos url',
imageOriginal: 'Kudos url',
name: 'Kudos Name',
tokenId: 1203,
},
Loading