Skip to content

Commit

Permalink
Merge branch 'develop' into jl/added-generic-polling-hook-replace-use…
Browse files Browse the repository at this point in the history
…Safe
  • Loading branch information
adonesky1 committed Mar 6, 2024
2 parents c246019 + bf6a7a9 commit 928c60b
Show file tree
Hide file tree
Showing 42 changed files with 931 additions and 484 deletions.
4 changes: 3 additions & 1 deletion app/scripts/controllers/permissions/caveat-mutators.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CaveatMutatorOperation } from '@metamask/permission-controller';
import { toChecksumAddress } from 'ethereumjs-util';
import { CaveatTypes } from '../../../../shared/constants/permissions';

/**
Expand All @@ -23,8 +24,9 @@ export const CaveatMutatorFactories = {
* account permissions.
*/
function removeAccount(targetAccount, existingAccounts) {
const checkSumTargetAccount = toChecksumAddress(targetAccount);
const newAccounts = existingAccounts.filter(
(address) => address !== targetAccount,
(address) => toChecksumAddress(address) !== checkSumTargetAccount,
);

if (newAccounts.length === existingAccounts.length) {
Expand Down
10 changes: 10 additions & 0 deletions app/scripts/controllers/permissions/caveat-mutators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ describe('caveat mutators', () => {
operation: CaveatMutatorOperation.revokePermission,
});
});

it('returns the revoke permission operation even if the target account is a checksummed address', () => {
expect(
removeAccount('0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAee5', [
'0x95222290dd7278aa3ddd389cc1e1d165cc4baee5',
]),
).toStrictEqual({
operation: CaveatMutatorOperation.revokePermission,
});
});
});
});
});
10 changes: 5 additions & 5 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildTypes:
- SEGMENT_WRITE_KEY_REF: SEGMENT_PROD_WRITE_KEY
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.2/index.html
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
# Main build uses the default browser manifest
manifestOverrides: false
Expand Down Expand Up @@ -65,7 +65,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.2/index.html
- SUPPORT_LINK: https://metamask-flask.zendesk.com/hc
- SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
Expand All @@ -86,7 +86,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.2/index.html
- SUPPORT_LINK: https://metamask-flask.zendesk.com/hc
- SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
Expand All @@ -107,7 +107,7 @@ buildTypes:
- SEGMENT_WRITE_KEY_REF: SEGMENT_MMI_WRITE_KEY
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/5.0.2/index.html
- MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v2/configuration/default
- SUPPORT_LINK: https://mmi-support.zendesk.com/hc/en-us
- SUPPORT_REQUEST_LINK: https://mmi-support.zendesk.com/hc/en-us/requests/new
Expand Down Expand Up @@ -141,7 +141,7 @@ features:
- WEB_SOCKET_PORT: null
blockaid:
env:
- BLOCKAID_FILE_CDN: static.metafi.codefi.network/api/v1/confirmations/ppom
- BLOCKAID_FILE_CDN: static.cx.metamask.io/api/v1/confirmations/ppom
- BLOCKAID_PUBLIC_KEY: 066ad3e8af5583385e312c156d238055215d5f25247c1e91055afa756cb98a88
petnames:
conf-redesign:
Expand Down
30 changes: 15 additions & 15 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": {
"packages": {
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true
"@metamask/utils>@scure/base": true,
"@noble/hashes": true
}
},
"@ethersproject/abi": {
Expand Down Expand Up @@ -504,6 +504,7 @@
"@lavamoat/lavadome-react": {
"globals": {
"Document.prototype": true,
"DocumentFragment.prototype": true,
"Element.prototype": true,
"Node.prototype": true,
"console.warn": true,
Expand Down Expand Up @@ -743,7 +744,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1855,7 +1856,7 @@
"@metamask/snaps-sdk>@metamask/key-tree": true,
"@metamask/snaps-utils": true,
"@metamask/utils": true,
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"superstruct": true
}
},
Expand All @@ -1875,8 +1876,8 @@
"@metamask/scure-bip39": true,
"@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": true,
"@metamask/snaps-sdk>@metamask/key-tree>@noble/ed25519": true,
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"@noble/hashes": true,
"eth-lattice-keyring>@noble/secp256k1": true
}
},
Expand All @@ -1886,7 +1887,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1935,9 +1936,8 @@
"@metamask/snaps-utils>rfdc": true,
"@metamask/snaps-utils>validate-npm-package-name": true,
"@metamask/utils": true,
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@noble/hashes": true,
"chalk": true,
"semver": true,
"superstruct": true
Expand Down Expand Up @@ -2062,21 +2062,15 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/utils>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@metamask/utils>@scure/base": {
"globals": {
"TextDecoder": true,
Expand Down Expand Up @@ -2125,6 +2119,12 @@
"define": true
}
},
"@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@popperjs/core": {
"globals": {
"Element": true,
Expand Down
34 changes: 17 additions & 17 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": {
"packages": {
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true
"@metamask/utils>@scure/base": true,
"@noble/hashes": true
}
},
"@ethersproject/abi": {
Expand Down Expand Up @@ -504,6 +504,7 @@
"@lavamoat/lavadome-react": {
"globals": {
"Document.prototype": true,
"DocumentFragment.prototype": true,
"Element.prototype": true,
"Node.prototype": true,
"console.warn": true,
Expand Down Expand Up @@ -743,7 +744,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2119,7 +2120,7 @@
"@metamask/snaps-sdk>@metamask/key-tree": true,
"@metamask/snaps-utils": true,
"@metamask/utils": true,
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"superstruct": true
}
},
Expand All @@ -2139,8 +2140,8 @@
"@metamask/scure-bip39": true,
"@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": true,
"@metamask/snaps-sdk>@metamask/key-tree>@noble/ed25519": true,
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"@noble/hashes": true,
"eth-lattice-keyring>@noble/secp256k1": true
}
},
Expand All @@ -2150,7 +2151,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2199,9 +2200,8 @@
"@metamask/snaps-utils>rfdc": true,
"@metamask/snaps-utils>validate-npm-package-name": true,
"@metamask/utils": true,
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@noble/hashes": true,
"chalk": true,
"semver": true,
"superstruct": true
Expand All @@ -2211,7 +2211,7 @@
"packages": {
"@metamask/snaps-utils>@metamask/snaps-registry>@noble/curves": true,
"@metamask/utils": true,
"@metamask/utils>@noble/hashes": true,
"@noble/hashes": true,
"superstruct": true
}
},
Expand All @@ -2220,7 +2220,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true
"@noble/hashes": true
}
},
"@metamask/snaps-utils>cron-parser": {
Expand Down Expand Up @@ -2342,21 +2342,15 @@
"TextEncoder": true
},
"packages": {
"@metamask/utils>@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/utils>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@metamask/utils>@scure/base": {
"globals": {
"TextDecoder": true,
Expand Down Expand Up @@ -2405,6 +2399,12 @@
"define": true
}
},
"@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@popperjs/core": {
"globals": {
"Element": true,
Expand Down
Loading

0 comments on commit 928c60b

Please sign in to comment.