8000 refactor: encapsulate oracle config access via getter methods by zargarzadehm · Pull Request #334 · ergoplatform/oracle-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: encapsulate oracle config access via getter methods #334

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

zargarzadehm
Copy link
Contributor
@zargarzadehm zargarzadehm 8000 commented May 31, 2025

Closes: #333

  • Add getter methods for oracle_address, oracle_mnemonic, change_address, and network_prefix
  • Prefer reading oracle_mnemonic from env vars or oracle-config file
  • Replace direct field access with getter methods throughout the codebase
  • Remove unnecessary address cloning and unwrapping
  • Improve encapsulation and enable more secure config handling

Breaking Change:
Oracle operators must now add oracle_network: mainnet to their oracle_config.yaml file.
The oracle_address field is no longer required and can be removed.

Secret Loading Priority:
The application now loads the oracle's secret or mnemonic using the following priority:

  1. ORACLE_WALLET_SECRET (hex format) from environment variables
  2. oracle_secret from oracle_config.yaml
  3. ORACLE_WALLET_MNEMONIC from environment variables
  4. oracle_mnemonic from oracle_config.yaml

- Add getter methods for oracle_address, oracle_mnemonic, change_address, and network_prefix
- Prefer reading oracle_mnemonic from env vars or oracle-config file
- Replace direct field access with getter methods throughout the codebase
- Remove unnecessary address cloning and unwrapping
- Improve encapsulation and enable more secure config handling
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15366130552

Details

  • 6 of 102 (5.88%) changed or added relevant lines in 14 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 53.24%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/src/cli_commands/prepare_update.rs 2 3 66.67%
core/src/explorer_api.rs 0 1 0.0%
core/src/node_interface/node_api.rs 0 1 0.0%
core/src/pool_commands.rs 0 1 0.0%
core/src/actions.rs 0 2 0.0%
core/src/cli_commands/bootstrap.rs 0 2 0.0%
core/src/metrics.rs 0 2 0.0%
core/src/api.rs 0 3 0.0%
core/src/cli_commands/extract_reward_tokens.rs 0 3 0.0%
core/src/cli_commands/transfer_oracle_token.rs 0 3 0.0%
Totals Coverage Status
Change from base Build 14595237185: -0.6%
Covered Lines: 2005
Relevant Lines: 3766

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove oracle_address from config
3 participants
0