Skip to content

feat(oracle): add get_oracle_registration view function - #1892

Open
Shackole wants to merge 1 commit into
StellarCheckMate:mainfrom
Shackole:feat/1820-get-oracle-registration
Open

Shackole wants to merge 1 commit into
StellarCheckMate:mainfrom
Shackole:feat/1820-get-oracle-registration

Conversation

@Shackole

Copy link
Copy Markdown

Summary

Adds a public get_oracle_registration(oracle: Address) -> Option<OracleRegistration> view function to OracleContract so off-chain tooling and callers can query an oracle's registration details directly without reconstructing state from events. Returns None if the oracle is not registered.

Related Issue

Closes #1820

What Changed

  • Contracts: Added get_oracle_registration view function in contracts/oracle/src/lib.rs and derived Eq, PartialEq on OracleRegistration in contracts/oracle/src/types.rs.
  • Tests: Added unit tests test_get_oracle_registration_returns_none_when_unregistered and test_get_oracle_registration_returns_details_when_registered in contracts/oracle/src/tests.rs.
  • Docs: Documented get_oracle_registration in docs/oracle.md.

Checklist

  • cargo test passes locally
  • cargo clippy is clean
  • Tests added or updated for this change
  • Documentation updated (or no update needed)

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.

Enhancement: add get_oracle_registration view function to oracle contract

1 participant