Skip to content

Commit

Permalink
Merge branch 'main' into feat/nft-grid-view-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
gambinish authored Jan 10, 2025
2 parents 08e7587 + b2c5314 commit 1f840e7
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 87 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,44 @@ jobs:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
merge_base="$(git merge-base "origin/${BASE_REF}" HEAD)"
echo "Merge base is '${merge_base}'"
echo "MERGE_BASE=${merge_base}" >> "$GITHUB_OUTPUT"
echo "Merge base is '${merge_base}'"
- name: Get CircleCI job details
id: get-circleci-job-details
env:
REPOSITORY: ${{ github.repository }}
OWNER: ${{ github.repository_owner }}
REPOSITORY: ${{ github.event.repository.name }}
# For a `pull_request` event, the branch is `github.head_ref``.
BRANCH: ${{ github.head_ref }}
# For a `pull_request` event, the head commit hash is `github.event.pull_request.head.sha`.
HEAD_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
JOB_NAME: job-publish-prerelease
run: |
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")
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')
workflow_id=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].id")
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq -r '.items[] | select(.name == "job-publish-prerelease")')
build_num=$(echo "$job_details" | jq -r '.job_number')
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)')
build_num=$(echo "$job_details" | jq -r '.job_number')
echo 'CIRCLE_BUILD_NUM='"$build_num" >> "$GITHUB_OUTPUT"
job_id=$(echo "$job_details" | jq -r '.id')
echo 'CIRCLE_WORKFLOW_JOB_ID='"$job_id" >> "$GITHUB_OUTPUT"
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job ID '${job_id}'"
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job id '${job_id}'"
- name: Get CircleCI job artifacts
env:
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
run: |
mkdir -p "test-artifacts/chrome/benchmark"
mkdir -p test-artifacts/chrome/benchmark
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"
bundle_size=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json")
mkdir -p "test-artifacts/chrome"
echo "${bundle_size}" > "test-artifacts/chrome/bundle_size.json"
mkdir -p test-artifacts/chrome
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"
stories=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json")
mkdir "storybook-build"
echo "${stories}" > "storybook-build/stories.json"
mkdir storybook-build
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json" > "storybook-build/stories.json"
- name: Publish prerelease
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function addEthereumChainHandler(
) {
let validParams;
try {
validParams = validateAddEthereumChainParams(req.params[0], end);
validParams = validateAddEthereumChainParams(req.params[0]);
} catch (error) {
return end(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function validateChainId(chainId) {
return _chainId;
}

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

return validateChainId(chainId, end);
return validateChainId(chainId);
}

export function validateAddEthereumChainParams(params, end) {
export function validateAddEthereumChainParams(params) {
if (!params || typeof params !== 'object') {
throw rpcErrors.invalidParams({
message: `Expected single, object parameter. Received:\n${JSON.stringify(
Expand Down Expand Up @@ -75,7 +75,7 @@ export function validateAddEthereumChainParams(params, end) {
});
}

const _chainId = validateChainId(chainId, end);
const _chainId = validateChainId(chainId);
if (!rpcUrls || !Array.isArray(rpcUrls) || rpcUrls.length === 0) {
throw rpcErrors.invalidParams({
message: `Expected an array with at least one valid string HTTPS url 'rpcUrls', Received:\n${rpcUrls}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function switchEthereumChainHandler(
) {
let chainId;
try {
chainId = validateSwitchEthereumChainParams(req, end);
chainId = validateSwitchEthereumChainParams(req);
} catch (error) {
return end(error);
}
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,6 @@ export default class MetamaskController extends EventEmitter {
}),
});

this.nftController.setApiKey(process.env.OPENSEA_KEY);

const nftDetectionControllerMessenger =
this.controllerMessenger.getRestricted({
name: 'NftDetectionController',
Expand Down
11 changes: 7 additions & 4 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,9 @@ env:
# API keys to 3rd party services
###

- PUBNUB_PUB_KEY: null
- PUBNUB_SUB_KEY: null
- SEGMENT_HOST: null
- SENTRY_DSN: null
- SENTRY_DSN_DEV: null
- OPENSEA_KEY: null
- ETHERSCAN_KEY: null
# also INFURA_PROJECT_ID below

###
Expand Down Expand Up @@ -318,3 +314,10 @@ env:
# This should NEVER be enabled in production since it slows down react
###
- ENABLE_WHY_DID_YOU_RENDER: false

###
# Unused environment variables referenced in dependencies
# Unset environment variables cause a build error. These are set to `null` to tell our build
# system that they are intentionally unset.
###
- ETHERSCAN_KEY: null # Used by `gridplus-sdk/dist/util.js`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
"@metamask/post-message-stream": "^8.0.0",
"@metamask/ppom-validator": "0.36.0",
"@metamask/preinstalled-example-snap": "^0.3.0",
"@metamask/profile-sync-controller": "^3.1.1",
"@metamask/profile-sync-controller": "^3.2.0",
"@metamask/providers": "^18.2.0",
"@metamask/queued-request-controller": "^7.0.1",
"@metamask/rate-limit-controller": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
"isProfileSyncingEnabled": null,
"isProfileSyncingUpdateLoading": "boolean",
"hasAccountSyncingSyncedAtLeastOnce": "boolean",
"isAccountSyncingReadyToBeDispatched": "boolean"
"isAccountSyncingReadyToBeDispatched": "boolean",
"isAccountSyncingInProgress": "boolean"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
"isProfileSyncingUpdateLoading": "boolean",
"hasAccountSyncingSyncedAtLeastOnce": "boolean",
"isAccountSyncingReadyToBeDispatched": "boolean",
"isAccountSyncingInProgress": "boolean",
"subscriptionAccountsSeen": "object",
"isMetamaskNotificationsFeatureSeen": "boolean",
"isNotificationServicesEnabled": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const getMockedNotificationsState = () => {
isProfileSyncingUpdateLoading: false,
hasAccountSyncingSyncedAtLeastOnce: false,
isAccountSyncingReadyToBeDispatched: false,
isAccountSyncingInProgress: false,
isMetamaskNotificationsFeatureSeen: true,
isNotificationServicesEnabled: true,
isFeatureAnnouncementsEnabled: true,
Expand Down
1 change: 1 addition & 0 deletions ui/components/app/name/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
gap: 5px;
font-size: 12px;
max-width: 100%;
cursor: pointer;

&__missing {
background-color: var(--color-background-alternative);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,17 @@ exports[`<ApproveInfo /> renders component for approve request 1`] = `
class="mm-box mm-box--display-flex mm-box--gap-2 mm-box--flex-wrap-wrap mm-box--align-items-center mm-box--min-width-0"
data-testid="advanced-details-displayed-nonce"
>
<button
aria-label="Edit"
class="mm-box mm-button-icon mm-button-icon--size-sm edit-nonce-btn mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="edit-nonce-icon"
style="margin-right: -4px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
style="mask-image: url('./images/icons/edit.svg');"
/>
</button>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
style="white-space: pre-wrap;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ exports[`<AdvancedDetails /> renders component when the prop override is passed
class="mm-box mm-box--display-flex mm-box--gap-2 mm-box--flex-wrap-wrap mm-box--align-items-center mm-box--min-width-0"
data-testid="advanced-details-displayed-nonce"
>
<button
aria-label="Edit"
class="mm-box mm-button-icon mm-button-icon--size-sm edit-nonce-btn mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="edit-nonce-icon"
style="margin-right: -4px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
style="mask-image: url('./images/icons/edit.svg');"
/>
</button>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
style="white-space: pre-wrap;"
Expand Down Expand Up @@ -164,6 +175,17 @@ exports[`<AdvancedDetails /> renders component when the state property is true 1
class="mm-box mm-box--display-flex mm-box--gap-2 mm-box--flex-wrap-wrap mm-box--align-items-center mm-box--min-width-0"
data-testid="advanced-details-displayed-nonce"
>
<button
aria-label="Edit"
class="mm-box mm-button-icon mm-button-icon--size-sm edit-nonce-btn mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="edit-nonce-icon"
style="margin-right: -4px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
style="mask-image: url('./images/icons/edit.svg');"
/>
</button>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
style="white-space: pre-wrap;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useI18nContext } from '../../../../../../../hooks/useI18nContext';
import {
getCustomNonceValue,
getNextSuggestedNonce,
getUseNonceField,
} from '../../../../../../../selectors';
import {
getNextNonce,
Expand All @@ -37,7 +36,6 @@ const NonceDetails = () => {
}
}, [currentConfirmation, dispatch]);

const enableCustomNonce = useSelector(getUseNonceField);
const nextNonce = useSelector(getNextSuggestedNonce);
const customNonceValue = useSelector(getCustomNonceValue);

Expand Down Expand Up @@ -65,9 +63,7 @@ const NonceDetails = () => {
<ConfirmInfoRowText
data-testid="advanced-details-displayed-nonce"
text={`${displayedNonce}`}
onEditClick={
enableCustomNonce ? () => openEditNonceModal() : undefined
}
onEditClick={() => openEditNonceModal()}
editIconClassName="edit-nonce-btn"
editIconDataTestId="edit-nonce-icon"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useI18nContext } from '../../../../hooks/useI18nContext';
import {
BannerAlert,
ButtonLink,
Box,
Text,
BannerAlertSeverity,
} from '../../../../components/component-library';
Expand Down Expand Up @@ -95,27 +96,29 @@ export const SmartTransactionsBannerAlert: React.FC<SmartTransactionsBannerAlert
};

return (
<BannerAlert
severity={BannerAlertSeverity.Info}
onClose={dismissAlert}
data-testid="smart-transactions-banner-alert"
style={getMarginStyle()}
>
<Text fontWeight={FontWeight.Bold}>
{t('smartTransactionsEnabledTitle')}
</Text>
<Text as="p">
<ButtonLink
href={SMART_TRANSACTIONS_LEARN_MORE_URL}
onClick={dismissAlert}
externalLink
style={{ height: 'unset', verticalAlign: 'unset' }}
>
{t('smartTransactionsEnabledLink')}
</ButtonLink>
{t('smartTransactionsEnabledDescription')}
</Text>
</BannerAlert>
<Box className="transaction-alerts">
<BannerAlert
severity={BannerAlertSeverity.Info}
onClose={dismissAlert}
data-testid="smart-transactions-banner-alert"
style={getMarginStyle()}
>
<Text fontWeight={FontWeight.Bold}>
{t('smartTransactionsEnabledTitle')}
</Text>
<Text as="p">
<ButtonLink
href={SMART_TRANSACTIONS_LEARN_MORE_URL}
onClick={dismissAlert}
externalLink
style={{ height: 'unset', verticalAlign: 'unset' }}
>
{t('smartTransactionsEnabledLink')}
</ButtonLink>
{t('smartTransactionsEnabledDescription')}
</Text>
</BannerAlert>
</Box>
);
});

Expand Down
Loading

0 comments on commit 1f840e7

Please sign in to comment.