Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions shared/modules/shield/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export const ShieldConfigMap: Record<BuildType, ShieldEnvConfig> = {
},
};

export function isTestEnvironment() {
return process.env.METAMASK_ENVIRONMENT === ENVIRONMENT.TESTING;
}

/**
* Check if the environment is a Development or Test environment.
*
Expand All @@ -91,7 +95,7 @@ export const ShieldConfigMap: Record<BuildType, ShieldEnvConfig> = {
export function isDevOrTestEnvironment() {
return (
process.env.METAMASK_ENVIRONMENT === ENVIRONMENT.DEVELOPMENT ||
process.env.METAMASK_ENVIRONMENT === ENVIRONMENT.TESTING
isTestEnvironment()
);
}

Expand All @@ -116,7 +120,7 @@ export function loadShieldConfig(): ShieldEnvConfig {
const buildType = process.env.METAMASK_BUILD_TYPE;

let buildTypeEnv: BuildType = BUILD_TYPE.main;
if (isDevOrTestEnvironment()) {
if (isTestEnvironment()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local dev build with yarn start is pointing to prod env. Is it expected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's the purpose of this PR, so it match local dev default for profile sync controller (also prod env)

buildTypeEnv = BUILD_TYPE.dev;
} else if (buildType === 'experimental') {
buildTypeEnv = BUILD_TYPE.experimental;
Expand Down
Loading