-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56708ab
commit 3bec77b
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ artifacts.json | |
|
||
# Dependency directories | ||
node_modules/ | ||
venv/ | ||
|
||
# Idea files | ||
.idea/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import json | ||
import os | ||
|
||
from predeployed_generator.openzeppelin.proxy_admin_generator import ProxyAdminGenerator | ||
from filestorage_predeployed import (UpgradeableFileStorageGenerator, FILESTORAGE_ADDRESS, | ||
FILESTORAGE_IMPLEMENTATION_ADDRESS, | ||
FILESTORAGE_ADMIN_ADDRESS) | ||
|
||
DIR_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'test') | ||
BASE_CONFIG_PATH = os.path.join(DIR_PATH, 'data', 'base_config.json') | ||
CONFIG_PATH = os.path.join(DIR_PATH, 'data', 'config.json') | ||
|
||
if __name__ == '__main__': | ||
with open(BASE_CONFIG_PATH, 'r') as f: | ||
raw_config = f.read() | ||
config = json.loads(raw_config) | ||
schain_owner = config['skaleConfig']['sChain']['schainOwner'] | ||
proxy_admin = ProxyAdminGenerator().generate_allocation( | ||
contract_address=FILESTORAGE_ADMIN_ADDRESS, | ||
owner_address=schain_owner | ||
) | ||
filestorage_upgradeable = UpgradeableFileStorageGenerator().generate_allocation( | ||
contract_address=FILESTORAGE_ADDRESS, | ||
proxy_admin_address=FILESTORAGE_ADMIN_ADDRESS, | ||
implementation_address=FILESTORAGE_IMPLEMENTATION_ADDRESS, | ||
allocated_storage=10000000, | ||
schain_owner=schain_owner | ||
) | ||
config['accounts'].update(proxy_admin) | ||
config['accounts'].update(filestorage_upgradeable) | ||
with open(CONFIG_PATH, 'w') as f: | ||
f.write(json.dumps(config, indent=4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
VERSION=$(node -p "require('@skalenetwork/filestorage/package.json').version") | ||
ARTIFACTS_PATH=$PWD/test/data/artifacts.json | ||
curl -LJO https://github.com/skalenetwork/filestorage/releases/download/$VERSION/artifacts.json | ||
mv artifacts.json $ARTIFACTS_PATH | ||
node -e 'require("./test/utils/helper.js").generateConfig()' | ||
pip install filestorage-predeployed==$VERSION | ||
python scripts/generate_config.py | ||
|