Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into ramps-buyable-networks
  • Loading branch information
georgeweiler committed Apr 16, 2024
2 parents 8bda667 + 6ed9d04 commit 7c4ba77
Show file tree
Hide file tree
Showing 52 changed files with 1,266 additions and 314 deletions.
12 changes: 4 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ jobs:
- test-artifacts

job-publish-prerelease:
executor: node-browsers-small
executor: node-browsers-medium
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -1384,13 +1384,9 @@ jobs:
path: test-artifacts
destination: test-artifacts
# important: generate lavamoat viz AFTER uploading builds as artifacts
# Temporarily disabled until we can update to a version of `sesify` with
# this fix included: https://github.com/LavaMoat/LavaMoat/pull/121
# Disabled 2024-03-25 due to flakiness.
# - see: https://github.com/MetaMask/metamask-extension/issues/23704
#- run:
# name: build:lavamoat-viz
# command: ./.circleci/scripts/create-lavamoat-viz.sh
- run:
name: build:lavamoat-viz
command: ./.circleci/scripts/create-lavamoat-viz.sh
- store_artifacts:
path: build-artifacts
destination: build-artifacts
Expand Down
29 changes: 27 additions & 2 deletions .circleci/scripts/create-lavamoat-viz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,33 @@ BUILD_DEST="./build-artifacts/build-viz/"
# prepare artifacts dir
mkdir -p "${BUILD_DEST}"

# generate lavamoat debug config
# generate lavamoat debug configs
yarn lavamoat:debug:build
yarn lavamoat:debug:webapp --parallel=false

# generate entries for all present policy dirs under lavamoat/browserify
# static entry for build-system
POLICY_DIR_NAMES=$(find lavamoat/browserify -maxdepth 1 -mindepth 1 -type d -printf '%f ')

POLICY_FILE_PATHS_JSON=$(echo -n "${POLICY_DIR_NAMES}" \
| jq --raw-input --slurp --indent 0 '
rtrimstr(" ")
| split(" ")
| map({
"key": .,
"value": {
"debug": ("lavamoat/browserify/"+.+"/policy-debug.json"),
"override":"lavamoat/browserify/policy-override.json",
"primary":("lavamoat/browserify/"+.+"/policy.json")
}
})
| from_entries
|."build-system"= {
"debug": "lavamoat/build-system/policy-debug.json",
"override":"lavamoat/build-system/policy-override.json",
"primary": "lavamoat/build-system/policy.json"
}'
)
# generate viz
npx lavamoat-viz --dest "${BUILD_DEST}"
# shellcheck disable=SC2086
yarn lavamoat-viz --dest "${BUILD_DEST}" --policyNames build-system ${POLICY_DIR_NAMES} --policyFilePathsJson "${POLICY_FILE_PATHS_JSON}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ test/e2e/mmi/playwright.config.ts
test/e2e/mmi/specs/**/*-darwin.png
test/e2e/mmi/dist/

lavamoat/**/policy-debug.json
5 changes: 5 additions & 0 deletions .metamaskrc.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ BLOCKAID_PUBLIC_KEY=
; SELENIUM_HEADLESS=
; Set this to 1 to make chrome e2e tests disable DoH/DoT and use system DNS
; SELENIUM_USE_SYSTEM_DNS=


ENABLE_CONFIRMATION_REDESIGN=

; Enables the Settings Page - Developer Options
; ENABLE_SETTINGS_PAGE_DEV_OPTIONS=true
23 changes: 22 additions & 1 deletion app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions app/images/filecoin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3513,6 +3513,9 @@ export default class MetamaskController extends EventEmitter {
rejectPendingApproval: this.rejectPendingApproval,

// Notifications
resetViewedNotifications: announcementController.resetViewed.bind(
announcementController,
),
updateViewedNotifications: announcementController.updateViewed.bind(
announcementController,
),
Expand Down
7 changes: 4 additions & 3 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ env:
# Variables that are modified with hardcoded code
###

# Used to enable confirmation redesigned pages
- ENABLE_CONFIRMATION_REDESIGN: ''
# Determines if feature flagged Settings Page - Developer Options should be used
- ENABLE_SETTINGS_PAGE_DEV_OPTIONS: false
# Used for debugging changes to the phishing warning page.
# Modified in <root>/development/build/scripts.js:@getPhishingWarningPageUrl
- PHISHING_WARNING_PAGE_URL: null
Expand Down Expand Up @@ -271,9 +275,6 @@ env:
# Determines if feature flagged Multichain Transactions should be used
- TRANSACTION_MULTICHAIN: ''

# Used to enable confirmation redesigned pages
- ENABLE_CONFIRMATION_REDESIGN: ''

# Enables the notifications feature within the build:
- NOTIFICATIONS: ''

Expand Down
5 changes: 5 additions & 0 deletions development/build/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,17 @@ function createFactoredBuild({
__dirname,
`../../lavamoat/browserify/${buildType}/policy.json`,
),
policyDebug: path.resolve(
__dirname,
`../../lavamoat/browserify/${buildType}/policy-debug.json`,
),
policyName: buildType,
policyOverride: path.resolve(
__dirname,
`../../lavamoat/browserify/policy-override.json`,
),
writeAutoPolicy: process.env.WRITE_AUTO_POLICY,
writeAutoPolicyDebug: process.env.WRITE_AUTO_POLICY_DEBUG,
};
Object.assign(bundlerOpts, lavamoatBrowserify.args);
bundlerOpts.plugin.push([lavamoatBrowserify, lavamoatOpts]);
Expand Down
22 changes: 5 additions & 17 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,13 @@
},
"@metamask/announcement-controller": {
"packages": {
"@metamask/base-controller": true
"@metamask/announcement-controller>@metamask/base-controller": true
}
},
"@metamask/announcement-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
Expand Down Expand Up @@ -2296,24 +2299,9 @@
},
"@metamask/snaps-utils>marked": {
"globals": {
"Hooks": true,
"Lexer": true,
"Parser": true,
"Renderer": true,
"TextRenderer": true,
"Tokenizer": true,
"console.error": true,
"console.warn": true,
"defaults": true,
"define": true,
"inlineQueue": true,
"passThroughHooks": true,
"renderer": true,
"rules": true,
"state": true,
"textRenderer": true,
"tokenizer": true,
"tokens": true
"define": true
}
},
"@metamask/snaps-utils>rfdc": {
Expand Down
22 changes: 5 additions & 17 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,13 @@
},
"@metamask/announcement-controller": {
"packages": {
"@metamask/base-controller": true
"@metamask/announcement-controller>@metamask/base-controller": true
}
},
"@metamask/announcement-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
Expand Down Expand Up @@ -2609,24 +2612,9 @@
},
"@metamask/snaps-utils>marked": {
"globals": {
"Hooks": true,
"Lexer": true,
"Parser": true,
"Renderer": true,
"TextRenderer": true,
"Tokenizer": true,
"console.error": true,
"console.warn": true,
"defaults": true,
"define": true,
"inlineQueue": true,
"passThroughHooks": true,
"renderer": true,
"rules": true,
"state": true,
"textRenderer": true,
"tokenizer": true,
"tokens": true
"define": true
}
},
"@metamask/snaps-utils>rfdc": {
Expand Down
22 changes: 5 additions & 17 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,13 @@
},
"@metamask/announcement-controller": {
"packages": {
"@metamask/base-controller": true
"@metamask/announcement-controller>@metamask/base-controller": true
}
},
"@metamask/announcement-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
Expand Down Expand Up @@ -2661,24 +2664,9 @@
},
"@metamask/snaps-utils>marked": {
"globals": {
"Hooks": true,
"Lexer": true,
"Parser": true,
"Renderer": true,
"TextRenderer": true,
"Tokenizer": true,
"console.error": true,
"console.warn": true,
"defaults": true,
"define": true,
"inlineQueue": true,
"passThroughHooks": true,
"renderer": true,
"rules": true,
"state": true,
"textRenderer": true,
"tokenizer": true,
"tokens": true
"define": true
}
},
"@metamask/snaps-utils>rfdc": {
Expand Down
22 changes: 5 additions & 17 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,13 @@
},
"@metamask/announcement-controller": {
"packages": {
"@metamask/base-controller": true
"@metamask/announcement-controller>@metamask/base-controller": true
}
},
"@metamask/announcement-controller>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
Expand Down Expand Up @@ -2576,24 +2579,9 @@
},
"@metamask/snaps-utils>marked": {
"globals": {
"Hooks": true,
"Lexer": true,
"Parser": true,
"Renderer": true,
"TextRenderer": true,
"Tokenizer": true,
"console.error": true,
"console.warn": true,
"defaults": true,
"define": true,
"inlineQueue": true,
"passThroughHooks": true,
"renderer": true,
"rules": true,
"state": true,
"textRenderer": true,
"tokenizer": true,
"tokens": true
"define": true
}
},
"@metamask/snaps-utils>rfdc": {
Expand Down
Loading

0 comments on commit 7c4ba77

Please sign in to comment.