Skip to content

Commit

Permalink
fix: extern doc getter
Browse files Browse the repository at this point in the history
  • Loading branch information
8e8b2c committed Jun 14, 2024
1 parent 07f3c1c commit a582035
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/username_registry_coordinator/src/oracle_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn create_oracle_document(oracle_document: OracleDocument) -> ExternResult<R
Ok(record)
}

#[hdk_extern]
pub fn get_latest_oracle_document_ah_for_name(name: String) -> ExternResult<Option<ActionHash>> {
let base_address = hash_identifier(name)?;
let mut links = get_links(base_address, LinkTypes::NameToOracleDocument, None)?;
Expand All @@ -37,6 +38,7 @@ pub fn get_latest_oracle_document_ah_for_name(name: String) -> ExternResult<Opti
Ok(Some(action_hash))
}

#[hdk_extern]
pub fn get_latest_oracle_document_for_name(name: String) -> ExternResult<Option<Record>> {
let Some(action_hash) = get_latest_oracle_document_ah_for_name(name)? else {
return Ok(None);
Expand Down

0 comments on commit a582035

Please sign in to comment.