Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions gateway-contracts/tasks/utils/loadVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import path from "path";
import { ADDRESSES_DIR, GATEWAY_ADDRESSES_ENV_FILE_NAME } from "../../hardhat.config";
import { pascalCaseToAddressEnvVar } from "../utils";

// Get the required environment variable, throw an error if it's not set
// We only check if the variable is set, not if it's empty
// Get the required environment variable, throw an error if it's not set or empty
export function getRequiredEnvVar(name: string): string {
if (!(name in process.env)) {
throw new Error(`"${name}" env variable is not set`);
}
return process.env[name]!;
const value = process.env[name]!;
if (value.trim() === "") {
throw new Error(`"${name}" env variable is set but empty`);
}
return value;
}

// Get the required address from the environment variable, throw an error if it's not set
// We only check if the variable is set, not if it's empty
// Get the required address from the environment variable, throw an error if it's not set or empty
export function getRequiredAddressEnvVar(name: string): string {
const addressEnvVarName = pascalCaseToAddressEnvVar(name);
return getRequiredEnvVar(addressEnvVarName);
Expand Down
9 changes: 6 additions & 3 deletions host-contracts/tasks/utils/loadVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import path from 'path';

import { ADDRESSES_DIR, HOST_ADDRESSES_ENV_FILE_NAME } from '../../hardhat.config';

// Get the required environment variable, throw an error if it's not set
// We only check if the variable is set, not if it's empty
// Get the required environment variable, throw an error if it's not set or empty
export function getRequiredEnvVar(name: string): string {
if (!(name in process.env)) {
throw new Error(`"${name}" env variable is not set`);
}
return process.env[name]!;
const value = process.env[name]!;
if (value.trim() === '') {
throw new Error(`"${name}" env variable is set but empty`);
}
return value;
}

// Load the addresses as environment variables from the env file
Expand Down
9 changes: 6 additions & 3 deletions library-solidity/tasks/utils/loadVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import path from 'path';
const ADDRESSES_DIR = path.resolve(__dirname, '../../fhevmTemp/addresses');
const HOST_ADDRESSES_ENV_FILE_NAME = '.env.host';

// Get the required environment variable, throw an error if it's not set
// We only check if the variable is set, not if it's empty
// Get the required environment variable, throw an error if it's not set or empty
export function getRequiredEnvVar(name: string): string {
if (!(name in process.env)) {
throw new Error(`"${name}" env variable is not set`);
}
return process.env[name]!;
const value = process.env[name]!;
if (value.trim() === '') {
throw new Error(`"${name}" env variable is set but empty`);
}
return value;
}

// Load the addresses as environment variables from the env file
Expand Down
10 changes: 5 additions & 5 deletions test-suite/fhevm/env/staging/.env.gateway-sc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ DEPLOYER_PRIVATE_KEY=0xe746bc71f6bee141a954e6a49bc9384d334e393a7ea1e70b50241cb2e
# =============================================================================
# PROTOCOL CONFIGURATION
# =============================================================================
PROTOCOL_NAME=
PROTOCOL_WEBSITE=
PROTOCOL_NAME="Test Protocol"
PROTOCOL_WEBSITE="https://test-protocol.com"

# =============================================================================
# KMS CONFIGURATION
Expand All @@ -55,7 +55,7 @@ NUM_KMS_NODES=1
# KMS Node 1 (accounts[0] - Gateway)
KMS_TX_SENDER_ADDRESS_0=0x31de9c8ac5ecd5eaceddddee531e9bad8ac9c2a5
KMS_SIGNER_ADDRESS_0=0x0Ea5BA6Bdb66553ED882CDB7cc78630340e0F031
KMS_NODE_IP_ADDRESS_0=
KMS_NODE_IP_ADDRESS_0="127.0.0.1"
KMS_NODE_STORAGE_URL_0=http://minio:9000/kms-public

# =============================================================================
Expand Down Expand Up @@ -89,8 +89,8 @@ NUM_HOST_CHAINS=1
HOST_CHAIN_CHAIN_ID_0=12345
HOST_CHAIN_FHEVM_EXECUTOR_ADDRESS_0=0xcCAe95fF1d11656358E782570dF0418F59fA40e1
HOST_CHAIN_ACL_ADDRESS_0=0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c
HOST_CHAIN_NAME_0=
HOST_CHAIN_WEBSITE_0=
HOST_CHAIN_NAME_0="Host chain 0"
HOST_CHAIN_WEBSITE_0="https://host-chain-0.com"

# =============================================================================
# PAUSERS
Expand Down
Loading