Skip to content

Commit

Permalink
Merge branch 'develop' into blockaid_metrics_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuri authored Sep 21, 2023
2 parents 48694a2 + 91a0064 commit 91f3f6c
Show file tree
Hide file tree
Showing 30 changed files with 770 additions and 394 deletions.
2 changes: 1 addition & 1 deletion app/scripts/controllers/mmi-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export default class MMIController extends EventEmitter {

// FIXME: status maps are not a thing anymore
this.custodyController.storeCustodyStatusMap(
custodian.name,
custodian.envName,
keyring.getStatusMap(),
);

Expand Down
3 changes: 3 additions & 0 deletions app/scripts/lib/setupSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export const SENTRY_BACKGROUND_STATE = {
keyrings: false,
keyringTypes: false,
},
LoggingController: {
logs: false,
},
MetaMetricsController: {
eventsBeforeMetricsOptIn: false,
fragments: false,
Expand Down
13 changes: 12 additions & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ import {
SelectedNetworkController,
createSelectedNetworkMiddleware,
} from '@metamask/selected-network-controller';
import { LoggingController } from '@metamask/logging-controller';

///: BEGIN:ONLY_INCLUDE_IN(snaps)
import { encrypt, decrypt } from '@metamask/browser-passworder';
import { RateLimitController } from '@metamask/rate-limit-controller';
import { NotificationController } from '@metamask/notification-controller';

import {
CronjobController,
JsonSnapsRegistry,
Expand Down Expand Up @@ -347,6 +347,13 @@ export default class MetamaskController extends EventEmitter {
],
});

this.loggingController = new LoggingController({
messenger: this.controllerMessenger.getRestricted({
name: 'LoggingController',
}),
state: initState.LoggingController,
});

///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
this.mmiConfigurationController = new MmiConfigurationController({
initState: initState.MmiConfigurationController,
Expand Down Expand Up @@ -1111,6 +1118,8 @@ export default class MetamaskController extends EventEmitter {
'SnapController:snapInstalled',
'SnapController:snapUpdated',
'SnapController:snapRemoved',
'SnapController:snapEnabled',
'SnapController:snapDisabled',
],
allowedActions: [
`${this.permissionController.name}:getPermissions`,
Expand Down Expand Up @@ -1728,6 +1737,7 @@ export default class MetamaskController extends EventEmitter {
NftController: this.nftController,
PhishingController: this.phishingController,
SelectedNetworkController: this.selectedNetworkController,
LoggingController: this.loggingController,
///: BEGIN:ONLY_INCLUDE_IN(snaps)
SnapController: this.snapController,
CronjobController: this.cronjobController,
Expand Down Expand Up @@ -1776,6 +1786,7 @@ export default class MetamaskController extends EventEmitter {
SmartTransactionsController: this.smartTransactionsController,
NftController: this.nftController,
SelectedNetworkController: this.selectedNetworkController,
LoggingController: this.loggingController,
///: BEGIN:ONLY_INCLUDE_IN(snaps)
SnapController: this.snapController,
CronjobController: this.cronjobController,
Expand Down
4 changes: 2 additions & 2 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.38.3-flask.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.39.0-flask.1/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 @@ -77,7 +77,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.38.3-flask.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.consensys.io/0.39.0-flask.1/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 Down
6 changes: 6 additions & 0 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,12 @@
"ethereumjs-util>rlp": true
}
},
"@metamask/logging-controller": {
"packages": {
"@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/logo": {
"globals": {
"addEventListener": true,
Expand Down
59 changes: 13 additions & 46 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,12 @@
"ethereumjs-util>rlp": true
}
},
"@metamask/logging-controller": {
"packages": {
"@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/logo": {
"globals": {
"addEventListener": true,
Expand Down Expand Up @@ -2053,20 +2059,7 @@
},
"@metamask/rpc-methods-flask>@metamask/snaps-ui": {
"packages": {
"@metamask/rpc-methods-flask>@metamask/snaps-ui>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/rpc-methods-flask>@metamask/snaps-ui>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"@metamask/rpc-methods-flask>@metamask/utils": true,
"superstruct": true
}
},
Expand Down Expand Up @@ -2211,6 +2204,7 @@
"@metamask/providers>@metamask/object-multiplex": true,
"@metamask/snaps-controllers-flask>@metamask/post-message-stream": true,
"@metamask/snaps-controllers-flask>@metamask/rpc-methods": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-registry": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"@metamask/snaps-controllers-flask>concat-stream": true,
Expand All @@ -2219,11 +2213,10 @@
"@metamask/snaps-controllers>gunzip-maybe": true,
"@metamask/snaps-controllers>readable-web-to-node-stream": true,
"@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-utils>@metamask/snaps-registry": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"json-rpc-middleware-stream": true,
"pump": true
"stream-browserify": true
}
},
"@metamask/snaps-controllers-flask>@metamask/post-message-stream": {
Expand Down Expand Up @@ -2268,20 +2261,14 @@
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui": {
"packages": {
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui>@metamask/utils": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"@metamask/snaps-controllers-flask>@metamask/snaps-registry": {
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"@metamask/key-tree>@noble/secp256k1": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"superstruct": true
}
},
Expand Down Expand Up @@ -2553,26 +2540,6 @@
"@metamask/snaps-utils-flask>is-svg>fast-xml-parser>strnum": true
}
},
"@metamask/snaps-utils>@metamask/snaps-registry": {
"packages": {
"@metamask/key-tree>@noble/secp256k1": true,
"@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/snaps-utils>cron-parser": {
"packages": {
"browserify>browser-resolve": true,
Expand Down
59 changes: 13 additions & 46 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,12 @@
"ethereumjs-util>rlp": true
}
},
"@metamask/logging-controller": {
"packages": {
"@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/logo": {
"globals": {
"addEventListener": true,
Expand Down Expand Up @@ -2069,20 +2075,7 @@
},
"@metamask/rpc-methods-flask>@metamask/snaps-ui": {
"packages": {
"@metamask/rpc-methods-flask>@metamask/snaps-ui>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/rpc-methods-flask>@metamask/snaps-ui>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"@metamask/rpc-methods-flask>@metamask/utils": true,
"superstruct": true
}
},
Expand Down Expand Up @@ -2227,6 +2220,7 @@
"@metamask/providers>@metamask/object-multiplex": true,
"@metamask/snaps-controllers-flask>@metamask/post-message-stream": true,
"@metamask/snaps-controllers-flask>@metamask/rpc-methods": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-registry": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"@metamask/snaps-controllers-flask>concat-stream": true,
Expand All @@ -2235,11 +2229,10 @@
"@metamask/snaps-controllers>gunzip-maybe": true,
"@metamask/snaps-controllers>readable-web-to-node-stream": true,
"@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-utils>@metamask/snaps-registry": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"json-rpc-middleware-stream": true,
"pump": true
"stream-browserify": true
}
},
"@metamask/snaps-controllers-flask>@metamask/post-message-stream": {
Expand Down Expand Up @@ -2284,20 +2277,14 @@
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui": {
"packages": {
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui>@metamask/utils": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/snaps-controllers-flask>@metamask/rpc-methods>@metamask/snaps-ui>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"@metamask/snaps-controllers-flask>@metamask/snaps-registry": {
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"@metamask/key-tree>@noble/secp256k1": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"superstruct": true
}
},
Expand Down Expand Up @@ -2569,26 +2556,6 @@
"@metamask/snaps-utils-flask>is-svg>fast-xml-parser>strnum": true
}
},
"@metamask/snaps-utils>@metamask/snaps-registry": {
"packages": {
"@metamask/key-tree>@noble/secp256k1": true,
"@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true,
"superstruct": true
}
},
"@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/snaps-utils>cron-parser": {
"packages": {
"browserify>browser-resolve": true,
Expand Down
6 changes: 6 additions & 0 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,12 @@
"ethereumjs-util>rlp": true
}
},
"@metamask/logging-controller": {
"packages": {
"@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/logo": {
"globals": {
"addEventListener": true,
Expand Down
6 changes: 6 additions & 0 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,12 @@
"ethereumjs-util>rlp": true
}
},
"@metamask/logging-controller": {
"packages": {
"@metamask/base-controller": true,
"uuid": true
}
},
"@metamask/logo": {
"globals": {
"addEventListener": true,
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"@lavamoat/snow": "^1.5.0",
"@material-ui/core": "^4.11.0",
"@metamask-institutional/custody-controller": "^0.2.12",
"@metamask-institutional/custody-keyring": "^1.0.1",
"@metamask-institutional/custody-keyring": "^1.0.2",
"@metamask-institutional/extension": "^0.3.5",
"@metamask-institutional/institutional-features": "^1.2.4",
"@metamask-institutional/portfolio-dashboard": "^1.4.0",
Expand Down Expand Up @@ -253,6 +253,7 @@
"@metamask/jazzicon": "^2.0.0",
"@metamask/key-tree": "^9.0.0",
"@metamask/keyring-controller": "^7.4.0",
"@metamask/logging-controller": "^1.0.1",
"@metamask/logo": "^3.1.1",
"@metamask/message-manager": "^7.3.0",
"@metamask/metamask-eth-abis": "^3.0.0",
Expand All @@ -267,19 +268,19 @@
"@metamask/providers": "^11.1.0",
"@metamask/rate-limit-controller": "^3.0.0",
"@metamask/rpc-methods": "^1.0.2",
"@metamask/rpc-methods-flask": "npm:@metamask/[email protected].2-flask.1",
"@metamask/rpc-methods-flask": "npm:@metamask/[email protected].3-flask.1",
"@metamask/safe-event-emitter": "^2.0.0",
"@metamask/scure-bip39": "^2.0.3",
"@metamask/selected-network-controller": "^1.0.0",
"@metamask/signature-controller": "^5.3.0",
"@metamask/slip44": "^3.0.0",
"@metamask/smart-transactions-controller": "^4.0.0",
"@metamask/snaps-controllers": "^1.0.2",
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.38.3-flask.1",
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.39.0-flask.1",
"@metamask/snaps-ui": "^1.0.2",
"@metamask/snaps-ui-flask": "npm:@metamask/[email protected].4-flask.1",
"@metamask/snaps-ui-flask": "npm:@metamask/[email protected].5-flask.1",
"@metamask/snaps-utils": "^1.0.2",
"@metamask/snaps-utils-flask": "npm:@metamask/[email protected].3-flask.1",
"@metamask/snaps-utils-flask": "npm:@metamask/[email protected].4-flask.1",
"@metamask/subject-metadata-controller": "^2.0.0",
"@metamask/utils": "^5.0.0",
"@ngraveio/bc-ur": "^1.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
"keyringTypes": "object",
"keyrings": "object"
},
"LoggingController": {
"logs": "object"
},
"MetaMetricsController": {
"participateInMetaMetrics": true,
"metaMetricsId": "fake-metrics-id",
Expand Down
Loading

0 comments on commit 91f3f6c

Please sign in to comment.