Skale-contracts integration: Update Environment Variable Handling & Validation in node-cli; Deprecate ABI JSON Downloads; Integrate Ruff Linting #835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces a major overhaul of the environment configuration and validation in node-cli. The key changes include:
Simplified Environment Variable Handling:
MANAGER_CONTRACTS_ABI_URL
andIMA_CONTRACTS_ABI_URL
) with a new approach that uses the environment variablesMANAGER_CONTRACTS
andIMA_CONTRACTS
.Refactored Validation Logic:
env.py
file has been refactored to introduce helper functions to modularize the process of loading and validating environment variables.Enhanced Testing:
tests/configs/configs_env_validate_test.py
) has been created to extensively test the updated environment functions.requests_mock
to simulate network responses, ensuring that the tests remain isolated.Workflow and Documentation Improvements:
ruff
for linting and code formatting, improving our code quality checks.info.py
) to avoid development-time import errors.Detailed Changes
Environment Configuration Updates:
MANAGER_CONTRACTS_ABI_URL
andIMA_CONTRACTS_ABI_URL
withMANAGER_CONTRACTS
andIMA_CONTRACTS
.load_env_file()
), building a base parameters dictionary (build_params()
), and populating it with environment values (populate_params()
).validate_params()
now callsvalidate_env_type()
for environment type variable andvalidate_env_alias_or_address()
for both the IMA and Manager contracts using the new variables.Testing Enhancements:
requests_mock
to isolate tests from real network dependencies.Workflow & Linting:
ruff
into our CI/CD pipelines via GitHub Actions.ruff
.Build Process Improvement:
info.py
is now handled in a separate script (referenced in the README and CI), reducing development-time import errors.Impact
validate
command group has been removed.Testing
ruff
for code style and formatting checks.