From b51f16015073ba07ad6f5ac411b38e5d8442aa41 Mon Sep 17 00:00:00 2001 From: john Date: Mon, 24 Jun 2024 18:55:23 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加测试环境 --- .env.test | 12 ++++++++++++ package.json | 1 + src/components/WalletProvider.tsx | 9 +++++---- tsconfig.json | 5 +---- 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 .env.test diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..14c4a7f --- /dev/null +++ b/.env.test @@ -0,0 +1,12 @@ +### + # @LastEditors: John + # @Date: 2024-06-24 18:38:45 + # @LastEditTime: 2024-06-24 18:41:05 + # @Author: John +### +VITE_BASE_URL=http://wwwtest.exgo.pro +VITE_BASE_API_URL=http://wwwtest.exgo.pro +VITE_PARTICIPATE_CHAIN_ID=97 +VITE_PURCHASED_CONTRACT_ADDRESS=0xD70762bf8682b68bd0cbbBC0cdeC81db4f00AEc6 +VITE_NETWORK_USDT_ADDRESS=0xf9A18B7FC8Eb118f8Ad59fBD6eb1A181eaCb4E63 +VITE_CHECK_TRANSACTION_DETAILS_URL=https://testnet.bscscan.com/ \ No newline at end of file diff --git a/package.json b/package.json index 08949f0..807793b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", + "build:test": "tsc && vite build --mode test", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "iconfont": "npx iconfont-h5" diff --git a/src/components/WalletProvider.tsx b/src/components/WalletProvider.tsx index e70bf2a..81ce682 100644 --- a/src/components/WalletProvider.tsx +++ b/src/components/WalletProvider.tsx @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-17 18:01:43 - * @LastEditTime: 2024-06-17 18:16:57 + * @LastEditTime: 2024-06-24 18:51:52 * @Author: John */ /* @@ -39,9 +39,10 @@ const metadata = { icons: [`${import.meta.env.BASE_URL}/favicon.svg`], }; -let chains = import.meta.env.PROD - ? ([bsc] as const) - : ([bnbTestNetwork] as const); +let chains = + import.meta.env.DEV || import.meta.env.MODE == "test" + ? ([bnbTestNetwork] as const) + : ([bsc] as const); export const config = defaultWagmiConfig({ chains, // required diff --git a/tsconfig.json b/tsconfig.json index fe5ecd4..1afc14f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-17 17:20:03 - * @LastEditTime: 2024-06-17 17:41:09 + * @LastEditTime: 2024-06-24 18:48:07 * @Author: John */ { @@ -23,9 +23,6 @@ /* Linting */ "allowSyntheticDefaultImports": true, "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, "paths": { "@/*": ["./src/*"]