Skip to content

Commit 4c7fbd0

Browse files
authored
feat: remove environments folder (#509)
* refactor: remove local dependency on @iexec/dataprotector-environments from subgraph package.json * fix: update upgrade scripts to use environment variables for contract addresses * fix: correct comment for DataProtectorSharing contract address in .env.template * fix: update variable assignment for dataprotectorSharingContractAddress in fillCollection.js
1 parent 1bd498e commit 4c7fbd0

File tree

18 files changed

+31
-3883
lines changed

18 files changed

+31
-3883
lines changed

.github/workflows/sharing-smart-contracts-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ jobs:
8888
8989
- name: Upgrade test
9090
working-directory: packages/sharing-smart-contract
91+
env:
92+
DATA_PROTECTOR_SHARING_ADDRESS: 0x1390c3c6a545198809F1C7c5Dd2600ef74D60925
93+
ADD_ONLY_APP_WHITELIST_REGISTRY_ADDRESS: 0x498D324F711b8998Be81818742e268dEE30347c6
9194
run: npm run upgrade-local-fork -- --network local-bellecour-fork
9295

9396
# TODO check why the CI does not fail when the following error occurs

environments/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

environments/common/utils.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

environments/environments.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

environments/esm/index.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

environments/package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

environments/scripts/updateEnvironments.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

environments/types/index.d.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/sharing-smart-contract/.env.template

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ DEPLOYER_PRIVATE_KEY=...
44
# wallet used for admin operations
55
ADMIN_PRIVATE_KEY=...
66

7-
# environment to use for configuration (prod/staging). The default is prod.
8-
ENV=...
9-
107
# IExec PoCo contract address override (deploy script only)
118
POCO_ADDRESS=...
129

1310
# DatasetRegistry contract address override (deploy script only)
1411
DATASET_REGISTRY_ADDRESS=...
1512

13+
# DataProtectorSharing contract address
14+
DATA_PROTECTOR_SHARING_ADDRESS=...
15+
16+
# AddOnlyAppWhitelistRegistry contract address
17+
ADD_ONLY_APP_WHITELIST_REGISTRY_ADDRESS=...
18+
1619
## RPC URL for the network
1720
RPC_URL=
1821

packages/sharing-smart-contract/config/env.cjs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ const envSchema = z.object({
2222
.optional()
2323
.or(z.literal('')),
2424

25-
// environment to use for configuration (prod/staging)
26-
ENV: z.enum(['prod', 'staging'], 'ENV must be either "prod" or "staging"').default('prod'),
27-
2825
// Address of the PoCo contract
2926
POCO_ADDRESS: z
3027
.string()
@@ -38,6 +35,20 @@ const envSchema = z.object({
3835
.regex(addressRegex, 'Invalid Ethereum address format')
3936
.optional()
4037
.or(z.literal('')),
38+
39+
// Address of the DataProtectorSharing contract
40+
DATA_PROTECTOR_SHARING_ADDRESS: z
41+
.string()
42+
.regex(addressRegex, 'Invalid Ethereum address format')
43+
.optional()
44+
.or(z.literal('')),
45+
46+
// Address of the AddOnlyAppWhitelistRegistry contract
47+
ADD_ONLY_APP_WHITELIST_REGISTRY_ADDRESS: z
48+
.string()
49+
.regex(addressRegex, 'Invalid Ethereum address format')
50+
.optional()
51+
.or(z.literal('')),
4152

4253
// URL of the RPC used for network connection
4354
RPC_URL: z.string().url('RPC_URL must be a valid URL').optional().or(z.literal('')),

0 commit comments

Comments
 (0)