Skip to content

Commit d6d1448

Browse files
authored
Merge branch 'main' into MMS-1830-slippage-improvements-xchain
2 parents 3b07d96 + b2c5314 commit d6d1448

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

.github/workflows/publish-prerelease.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,44 @@ jobs:
2525
BASE_REF: ${{ github.event.pull_request.base.ref }}
2626
run: |
2727
merge_base="$(git merge-base "origin/${BASE_REF}" HEAD)"
28-
echo "Merge base is '${merge_base}'"
2928
echo "MERGE_BASE=${merge_base}" >> "$GITHUB_OUTPUT"
29+
echo "Merge base is '${merge_base}'"
3030
3131
- name: Get CircleCI job details
3232
id: get-circleci-job-details
3333
env:
34-
REPOSITORY: ${{ github.repository }}
34+
OWNER: ${{ github.repository_owner }}
35+
REPOSITORY: ${{ github.event.repository.name }}
36+
# For a `pull_request` event, the branch is `github.head_ref``.
3537
BRANCH: ${{ github.head_ref }}
38+
# For a `pull_request` event, the head commit hash is `github.event.pull_request.head.sha`.
3639
HEAD_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
40+
JOB_NAME: job-publish-prerelease
3741
run: |
38-
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq -r ".items | map(select(.vcs.revision == \"${HEAD_COMMIT_HASH}\" )) | first | .id")
42+
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq --arg head_commit_hash "${HEAD_COMMIT_HASH}" -r '.items | map(select(.vcs.revision == $head_commit_hash)) | first | .id')
3943
workflow_id=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].id")
40-
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq -r '.items[] | select(.name == "job-publish-prerelease")')
41-
build_num=$(echo "$job_details" | jq -r '.job_number')
44+
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq --arg job_name "${JOB_NAME}" -r '.items[] | select(.name == $job_name)')
4245
46+
build_num=$(echo "$job_details" | jq -r '.job_number')
4347
echo 'CIRCLE_BUILD_NUM='"$build_num" >> "$GITHUB_OUTPUT"
48+
4449
job_id=$(echo "$job_details" | jq -r '.id')
4550
echo 'CIRCLE_WORKFLOW_JOB_ID='"$job_id" >> "$GITHUB_OUTPUT"
4651
47-
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job ID '${job_id}'"
52+
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job id '${job_id}'"
4853
4954
- name: Get CircleCI job artifacts
5055
env:
5156
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
5257
run: |
53-
mkdir -p "test-artifacts/chrome/benchmark"
58+
mkdir -p test-artifacts/chrome/benchmark
5459
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/benchmark/pageload.json" > "test-artifacts/chrome/benchmark/pageload.json"
5560
56-
bundle_size=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json")
57-
mkdir -p "test-artifacts/chrome"
58-
echo "${bundle_size}" > "test-artifacts/chrome/bundle_size.json"
61+
mkdir -p test-artifacts/chrome
62+
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json" > "test-artifacts/chrome/bundle_size.json"
5963
60-
stories=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json")
61-
mkdir "storybook-build"
62-
echo "${stories}" > "storybook-build/stories.json"
64+
mkdir storybook-build
65+
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json" > "storybook-build/stories.json"
6366
6467
- name: Publish prerelease
6568
env:

app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function addEthereumChainHandler(
5050
) {
5151
let validParams;
5252
try {
53-
validParams = validateAddEthereumChainParams(req.params[0], end);
53+
validParams = validateAddEthereumChainParams(req.params[0]);
5454
} catch (error) {
5555
return end(error);
5656
}

app/scripts/lib/rpc-method-middleware/handlers/ethereum-chain-utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function validateChainId(chainId) {
2525
return _chainId;
2626
}
2727

28-
export function validateSwitchEthereumChainParams(req, end) {
28+
export function validateSwitchEthereumChainParams(req) {
2929
if (!req.params?.[0] || typeof req.params[0] !== 'object') {
3030
throw rpcErrors.invalidParams({
3131
message: `Expected single, object parameter. Received:\n${JSON.stringify(
@@ -43,10 +43,10 @@ export function validateSwitchEthereumChainParams(req, end) {
4343
});
4444
}
4545

46-
return validateChainId(chainId, end);
46+
return validateChainId(chainId);
4747
}
4848

49-
export function validateAddEthereumChainParams(params, end) {
49+
export function validateAddEthereumChainParams(params) {
5050
if (!params || typeof params !== 'object') {
5151
throw rpcErrors.invalidParams({
5252
message: `Expected single, object parameter. Received:\n${JSON.stringify(
@@ -75,7 +75,7 @@ export function validateAddEthereumChainParams(params, end) {
7575
});
7676
}
7777

78-
const _chainId = validateChainId(chainId, end);
78+
const _chainId = validateChainId(chainId);
7979
if (!rpcUrls || !Array.isArray(rpcUrls) || rpcUrls.length === 0) {
8080
throw rpcErrors.invalidParams({
8181
message: `Expected an array with at least one valid string HTTPS url 'rpcUrls', Received:\n${rpcUrls}`,

app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum-chain.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function switchEthereumChainHandler(
3636
) {
3737
let chainId;
3838
try {
39-
chainId = validateSwitchEthereumChainParams(req, end);
39+
chainId = validateSwitchEthereumChainParams(req);
4040
} catch (error) {
4141
return end(error);
4242
}

app/scripts/metamask-controller.js

-2
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,6 @@ export default class MetamaskController extends EventEmitter {
761761
}),
762762
});
763763

764-
this.nftController.setApiKey(process.env.OPENSEA_KEY);
765-
766764
const nftDetectionControllerMessenger =
767765
this.controllerMessenger.getRestricted({
768766
name: 'NftDetectionController',

builds.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,9 @@ env:
214214
# API keys to 3rd party services
215215
###
216216

217-
- PUBNUB_PUB_KEY: null
218-
- PUBNUB_SUB_KEY: null
219217
- SEGMENT_HOST: null
220218
- SENTRY_DSN: null
221219
- SENTRY_DSN_DEV: null
222-
- OPENSEA_KEY: null
223-
- ETHERSCAN_KEY: null
224220
# also INFURA_PROJECT_ID below
225221

226222
###
@@ -318,3 +314,10 @@ env:
318314
# This should NEVER be enabled in production since it slows down react
319315
###
320316
- ENABLE_WHY_DID_YOU_RENDER: false
317+
318+
###
319+
# Unused environment variables referenced in dependencies
320+
# Unset environment variables cause a build error. These are set to `null` to tell our build
321+
# system that they are intentionally unset.
322+
###
323+
- ETHERSCAN_KEY: null # Used by `gridplus-sdk/dist/util.js`

0 commit comments

Comments
 (0)