-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Lisa Jetton <[email protected]>
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// NB: This endpoint is used by the nightly tests. Any change to it's input or output should also be updated there. | ||
|
||
use anyhow::Result; | ||
use holochain_types::prelude::{ExternIO, FunctionName, ZomeName}; | ||
use hpos_hc_connect::{hha_types::HoloportDetails, CoreAppAgent, CoreAppRoleName}; | ||
|
||
pub async fn get(happ_id: String, host_id: String) -> Result<()> { | ||
let mut agent = CoreAppAgent::connect().await?; | ||
|
||
let result = agent | ||
.zome_call( | ||
CoreAppRoleName::HHA, | ||
ZomeName::from("hha"), | ||
FunctionName::from("get_hosts"), | ||
ExternIO::encode(happ_id.clone())?, | ||
) | ||
.await?; | ||
|
||
let hosts: Vec<HoloportDetails> = rmp_serde::from_slice(result.as_bytes())?; | ||
|
||
let found = hosts.into_iter().find(|h| h.holoport_id.0 == host_id); | ||
|
||
if let Some(d) = found { | ||
if let Some(p) = d.preferences_hash { | ||
println!("{:#?}", p) | ||
} | ||
} | ||
|
||
Ok(()) | ||
} |
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
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
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