6464 "ONCHAIN_SOLANA_PROGRAMS_DIR_PATH" : "/tmp" ,
6565 "ONCHAIN_APTOS_DEPLOYER_KEY" : "0x123" ,
6666 "ONCHAIN_TRON_DEPLOYER_KEY" : "0x123" ,
67+ "ONCHAIN_SUI_DEPLOYER_KEY" : "0x123" ,
6768 "OFFCHAIN_JD_AUTH_COGNITO_APP_CLIENT_ID" : "123" ,
6869 "OFFCHAIN_JD_AUTH_COGNITO_APP_CLIENT_SECRET" : "123" ,
6970 "OFFCHAIN_JD_AUTH_AWS_REGION" : "us-east-1" ,
7677 "CATALOG_GRPC" : "http://localhost:8080" ,
7778 }
7879
80+ legacyEnvVars = map [string ]string {
81+ "KMS_DEPLOYER_KEY_ID" : "123" ,
82+ "KMS_DEPLOYER_KEY_REGION" : "us-east-1" ,
83+ "TEST_WALLET_KEY" : "0x123" ,
84+ "SETH_CONFIG_FILE" : "config.json" ,
85+ "GETH_WRAPPERS_DIRS" : "./a,./b" ,
86+ "SOLANA_WALLET_KEY" : "0x123" ,
87+ "SOLANA_PROGRAM_PATH" : "/tmp" ,
88+ "APTOS_DEPLOYER_KEY" : "0x123" ,
89+ "TRON_DEPLOYER_KEY" : "0x123" ,
90+ "JD_AUTH_COGNITO_APP_CLIENT_ID" : "123" ,
91+ "JD_AUTH_COGNITO_APP_CLIENT_SECRET" : "123" ,
92+ "JD_AUTH_AWS_REGION" : "us-east-1" ,
93+ "JD_AUTH_USERNAME" : "123" ,
94+ "JD_AUTH_PASSWORD" : "123" ,
95+ "JD_WS_RPC" : "WSRPC2" ,
96+ "JD_GRPC" : "GRPC2" ,
97+ "OCR_X_SIGNERS" : "awkward bat" ,
98+ "OCR_X_PROPOSERS" : "caring deer" ,
99+ "CATALOG_SERVICE_GRPC" : "http://localhost:8080" ,
100+ // These values do not have a legacy equivalent
101+ "ONCHAIN_SUI_DEPLOYER_KEY" : "0x123" ,
102+ }
103+
79104 // envCfg is the config that is loaded from the environment variables.
80105 envCfg = & Config {
81106 Onchain : OnchainConfig {
@@ -100,6 +125,9 @@ var (
100125 Tron : TronConfig {
101126 DeployerKey : "0x123" ,
102127 },
128+ Sui : SuiConfig {
129+ DeployerKey : "0x123" ,
130+ },
103131 },
104132 Offchain : OffchainConfig {
105133 JobDistributor : JobDistributorConfig {
@@ -167,7 +195,7 @@ func Test_Load(t *testing.T) { //nolint:paralleltest // see comment in setupTest
167195 beforeFunc : func (t * testing.T ) {
168196 t .Helper ()
169197
170- setupTestEnvVars ( t )
198+ setupEnvVars ( t , envVars )
171199 },
172200 givePath : "./testdata/config.yml" ,
173201 want : envCfg ,
@@ -177,7 +205,7 @@ func Test_Load(t *testing.T) { //nolint:paralleltest // see comment in setupTest
177205 beforeFunc : func (t * testing.T ) {
178206 t .Helper ()
179207
180- setupTestEnvVars ( t )
208+ setupEnvVars ( t , envVars )
181209 },
182210 givePath : "./testdata/invalid.yml" ,
183211 want : envCfg ,
@@ -241,7 +269,16 @@ func Test_LoadFile(t *testing.T) {
241269}
242270
243271func Test_LoadEnv (t * testing.T ) { //nolint:paralleltest // see comment in setupTestEnvVars
244- setupTestEnvVars (t )
272+ setupEnvVars (t , envVars )
273+
274+ got , err := LoadEnv ()
275+ require .NoError (t , err )
276+
277+ assert .Equal (t , envCfg , got )
278+ }
279+
280+ func Test_LoadEnv_Legacy (t * testing.T ) { //nolint:paralleltest // see comment in setupTestEnvVars
281+ setupEnvVars (t , legacyEnvVars )
245282
246283 got , err := LoadEnv ()
247284 require .NoError (t , err )
@@ -253,7 +290,7 @@ func Test_LoadEnv(t *testing.T) { //nolint:paralleltest // see comment in setupT
253290//
254291// CAUTION: Because this function uses t.Setenv which affects the entire process, tests which call
255292// this function cannot be run in parallel.
256- func setupTestEnvVars (t * testing.T ) {
293+ func setupEnvVars (t * testing.T , envVars map [ string ] string ) {
257294 t .Helper ()
258295
259296 for key , value := range envVars {
0 commit comments