Skip to content

Commit

Permalink
Skip version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tifrel committed Feb 27, 2024
1 parent 23917c7 commit 8c28df7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/sdk/src/config/config.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const TESTNET_MOCK = {
network: NEAR_NETWORKS.TESTNET,
connectProxyAddress: null,
ftAddresses: { usdc: USDC_ADDRESS.testnet, usdt: USDT_ADDRESS.testnet },
checkVersions: true,
};


Expand All @@ -31,4 +32,5 @@ export const MAINNET_MOCK = {
network: NEAR_NETWORKS.MAINNET,
connectProxyAddress: null,
ftAddresses: { usdc: USDC_ADDRESS.mainnet, usdt: USDT_ADDRESS.mainnet },
checkVersions: true,
};
2 changes: 2 additions & 0 deletions packages/sdk/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const startupConfig: MbJsKeysObject = {
debugMode: isDebugMode ? true : false,
ftAddresses: isProcessEnv ? FT_ADDRESSES[process.env.NEAR_NETWORK] : FT_ADDRESSES[NEAR_NETWORKS.MAINNET],
isSet: isProcessEnv ? true : false,
checkVersions: true,
};

// config is scoped globally as to avoid version mismatches from conflicting
Expand All @@ -64,6 +65,7 @@ export const setGlobalEnv = (configObj: ConfigOptions): MbJsKeysObject => {
connectProxyAddress: null,
ftAddresses: FT_ADDRESSES[configObj.network],
isSet: true,
checkVersions: true,
};

config.network = globalConfig.network;
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export interface ConfigOptionsObj extends ConfigOptions {
apiKey?: string;
connectProxyAddress?: string;
ftAddresses: FtAddresses | '';
checkVersions?: boolean;
}

export interface MbJsKeysObject extends ConfigOptionsObj {
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { ERROR_MESSAGES } from './errorMessages';
import { Splits } from './types';

export function isStoreV1(name: string): boolean {
return name.endsWith(`.${mbjs.keys.mbContract}`);
return !mbjs.keys.checkVersions || name.endsWith(`.${mbjs.keys.mbContract}`);
}

export function isStoreV2(name: string): boolean {
return name.endsWith(`.${mbjs.keys.mbContractV2}`);
return !mbjs.keys.checkVersions || name.endsWith(`.${mbjs.keys.mbContractV2}`);
}

export function standardizeString(name: string): string {
Expand Down

0 comments on commit 8c28df7

Please sign in to comment.