Skip to content

Commit

Permalink
Remove hardcoded JSONs (#54)
Browse files Browse the repository at this point in the history
* Remove hardcoded JSONs

* Update CI configuration

* Drop end2end.yml as it is not relevant for custom branches
  • Loading branch information
storojs72 committed Feb 20, 2024
1 parent 017f91d commit 26e4310
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 87 deletions.
83 changes: 0 additions & 83 deletions .github/workflows/end2end.yml

This file was deleted.

10 changes: 9 additions & 1 deletion generate_contract_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,40 @@ def parse_variables_from_file(file_path):
# Define regex patterns for matching variables
nova_url_pattern = r'\$NOVA_URL\s*=\s*\"(.+?)\"'
nova_commit_pattern = r'\$NOVA_COMMIT\s*=\s*\"(.+?)\"'
nova_test_name_pattern = r'\$NOVA_TEST_NAME\s*=\s*\"(.+?)\"'

# Match variables using regular expressions
nova_url_match = re.search(nova_url_pattern, content)
nova_commit_match = re.search(nova_commit_pattern, content)
nova_test_name_match = re.search(nova_test_name_pattern, content)

# Extract matched variables
if nova_url_match:
variables['NOVA_URL'] = nova_url_match.group(1)
if nova_commit_match:
variables['NOVA_COMMIT'] = nova_commit_match.group(1)
if nova_commit_match:
variables['NOVA_TEST_NAME'] = nova_test_name_match.group(1)

return variables

# python generate_contract_input.py https://github.com/artem-bakuta/Nova.git 3838031868ca3f2783c01299546849860bfd36d2
if __name__ == "__main__":
nova_repo_arg = ""
nova_commit_arg = ""
nova_test_name_arg = ""

if len(sys.argv) > 1:
nova_repo_arg = sys.argv[1]
nova_commit_arg = sys.argv[2]
nova_test_name_arg = sys.argv[3]

# Configurations
parsed_variables = parse_variables_from_file(file_path)
nova_repo_url = nova_repo_arg if nova_repo_arg else parsed_variables['NOVA_URL']
nova_commit_hash = nova_commit_arg if nova_commit_arg else parsed_variables['NOVA_COMMIT']
nova_test_name = nova_test_name_arg if nova_test_name_arg else parsed_variables['NOVA_TEST_NAME']

print("Pulling project from: " + nova_repo_url + " " + nova_commit_hash)
target_directory = "verify_cache"
nova_directory = "nova"
Expand All @@ -52,6 +60,6 @@ def parse_variables_from_file(file_path):
os.system(f"git checkout {nova_commit_hash}")

# Build the Nova project
os.system(f"cargo test solidity_compatibility_e2e_pasta --release -- --ignored")
os.system(f"cargo test {nova_test_name} --release -- --ignored")
print("Copy generated keys from Nova...")
os.system(f"cp vk.json compressed-snark.json ../../.")
1 change: 0 additions & 1 deletion pp-compressed-snark.json

This file was deleted.

1 change: 0 additions & 1 deletion pp-verifier-key.json

This file was deleted.

5 changes: 4 additions & 1 deletion rust-reference-info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
$NOVA_URL = "https://github.com/lurk-lab/Nova.git"

# NOVA_COMMIT variable
$NOVA_COMMIT = "d5f5fb5e557b99cb111f2d5693aa34fe30722750"
$NOVA_COMMIT = "ea4f75c225cb29f523780858ec84f1ff51c229bc"

# NOVA_TEST_NAME variable
$NOVA_TEST_NAME = "solidity_compatibility_e2e_pasta"

0 comments on commit 26e4310

Please sign in to comment.