File tree Expand file tree Collapse file tree 4 files changed +24
-16
lines changed
gateway-contracts/tasks/utils
host-contracts/tasks/utils
library-solidity/tasks/utils
test-suite/fhevm/env/staging Expand file tree Collapse file tree 4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,19 @@ import path from "path";
55import { ADDRESSES_DIR , GATEWAY_ADDRESSES_ENV_FILE_NAME } from "../../hardhat.config" ;
66import { pascalCaseToAddressEnvVar } from "../utils" ;
77
8- // Get the required environment variable, throw an error if it's not set
9- // We only check if the variable is set, not if it's empty
8+ // Get the required environment variable, throw an error if it's not set or empty
109export function getRequiredEnvVar ( name : string ) : string {
1110 if ( ! ( name in process . env ) ) {
1211 throw new Error ( `"${ name } " env variable is not set` ) ;
1312 }
14- return process . env [ name ] ! ;
13+ const value = process . env [ name ] ! ;
14+ if ( value . trim ( ) === "" ) {
15+ throw new Error ( `"${ name } " env variable is set but empty` ) ;
16+ }
17+ return value ;
1518}
1619
17- // Get the required address from the environment variable, throw an error if it's not set
18- // We only check if the variable is set, not if it's empty
20+ // Get the required address from the environment variable, throw an error if it's not set or empty
1921export function getRequiredAddressEnvVar ( name : string ) : string {
2022 const addressEnvVarName = pascalCaseToAddressEnvVar ( name ) ;
2123 return getRequiredEnvVar ( addressEnvVarName ) ;
Original file line number Diff line number Diff line change @@ -4,13 +4,16 @@ import path from 'path';
44
55import { ADDRESSES_DIR , HOST_ADDRESSES_ENV_FILE_NAME } from '../../hardhat.config' ;
66
7- // Get the required environment variable, throw an error if it's not set
8- // We only check if the variable is set, not if it's empty
7+ // Get the required environment variable, throw an error if it's not set or empty
98export function getRequiredEnvVar ( name : string ) : string {
109 if ( ! ( name in process . env ) ) {
1110 throw new Error ( `"${ name } " env variable is not set` ) ;
1211 }
13- return process . env [ name ] ! ;
12+ const value = process . env [ name ] ! ;
13+ if ( value . trim ( ) === '' ) {
14+ throw new Error ( `"${ name } " env variable is set but empty` ) ;
15+ }
16+ return value ;
1417}
1518
1619// Load the addresses as environment variables from the env file
Original file line number Diff line number Diff line change @@ -5,13 +5,16 @@ import path from 'path';
55const ADDRESSES_DIR = path . resolve ( __dirname , '../../fhevmTemp/addresses' ) ;
66const HOST_ADDRESSES_ENV_FILE_NAME = '.env.host' ;
77
8- // Get the required environment variable, throw an error if it's not set
9- // We only check if the variable is set, not if it's empty
8+ // Get the required environment variable, throw an error if it's not set or empty
109export function getRequiredEnvVar ( name : string ) : string {
1110 if ( ! ( name in process . env ) ) {
1211 throw new Error ( `"${ name } " env variable is not set` ) ;
1312 }
14- return process . env [ name ] ! ;
13+ const value = process . env [ name ] ! ;
14+ if ( value . trim ( ) === '' ) {
15+ throw new Error ( `"${ name } " env variable is set but empty` ) ;
16+ }
17+ return value ;
1518}
1619
1720// Load the addresses as environment variables from the env file
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ DEPLOYER_PRIVATE_KEY=0xe746bc71f6bee141a954e6a49bc9384d334e393a7ea1e70b50241cb2e
3232# =============================================================================
3333# PROTOCOL CONFIGURATION
3434# =============================================================================
35- PROTOCOL_NAME=
36- PROTOCOL_WEBSITE=
35+ PROTOCOL_NAME="Test Protocol"
36+ PROTOCOL_WEBSITE="https://test-protocol.com"
3737
3838# =============================================================================
3939# KMS CONFIGURATION
@@ -55,7 +55,7 @@ NUM_KMS_NODES=1
5555# KMS Node 1 (accounts[0] - Gateway)
5656KMS_TX_SENDER_ADDRESS_0=0x31de9c8ac5ecd5eaceddddee531e9bad8ac9c2a5
5757KMS_SIGNER_ADDRESS_0=0x0Ea5BA6Bdb66553ED882CDB7cc78630340e0F031
58- KMS_NODE_IP_ADDRESS_0=
58+ KMS_NODE_IP_ADDRESS_0="127.0.0.1"
5959KMS_NODE_STORAGE_URL_0=http://minio:9000/kms-public
6060
6161# =============================================================================
@@ -89,8 +89,8 @@ NUM_HOST_CHAINS=1
8989HOST_CHAIN_CHAIN_ID_0=12345
9090HOST_CHAIN_FHEVM_EXECUTOR_ADDRESS_0=0xcCAe95fF1d11656358E782570dF0418F59fA40e1
9191HOST_CHAIN_ACL_ADDRESS_0=0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c
92- HOST_CHAIN_NAME_0=
93- HOST_CHAIN_WEBSITE_0=
92+ HOST_CHAIN_NAME_0="Host chain 0"
93+ HOST_CHAIN_WEBSITE_0="https://host-chain-0.com"
9494
9595# =============================================================================
9696# PAUSERS
You can’t perform that action at this time.
0 commit comments