-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skale-contracts integration: Update Environment Variable Handling & Validation in node-cli; Deprecate ABI JSON Downloads; Integrate Ruff Linting #835
Open
Masterix0
wants to merge
13
commits into
4.1.0
Choose a base branch
from
skale-contract-integration
base: 4.1.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Added sample info.py file to fix pylance error since file doesn't existe. File will be overwritten at build time.
…alidation • Introduced dynamic fetching of contract ABIs from skale-contracts by allowing either an alias (e.g., “test-manager”) or a direct contract address (e.g., “0xabc123…”) in the environment. • Renamed and replaced the old environment variables that directly pointed to local ABI files. • Created new validation logic (validate_env_alias_or_address) for both Manager and IMA contracts in the CLI. • Removed the obsolete tests that ensured local ABI files existed/were valid JSON and replaced them with new tests that check for valid aliases or addresses. • Updated existing tests and mocks to patch or skip the new external validation calls where necessary. • Added ruff configuration (ruff.toml) and reformatted code throughout the repository.
Added it to README dev preparation so there are no problems with missing info.py. Added info.py to .gitignore.
…ate contract address validation logic to use this utility function.
…_OR_ADDRESS' to 'MANAGER_CONTRACTS' and 'IMA_CONTRACTS', respectively.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.