-
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.
- Loading branch information
Showing
6 changed files
with
51 additions
and
5 deletions.
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
37 changes: 37 additions & 0 deletions
37
crates/core_app_cli/src/actions/get_agents_jurisdiction.rs
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,37 @@ | ||
use anyhow::Result; | ||
use holochain_types::{ | ||
dna::{AgentPubKey, AgentPubKeyB64}, | ||
prelude::{FunctionName, ZomeName}, | ||
}; | ||
use hpos_hc_connect::{ | ||
app_connection::CoreAppRoleName, hha_agent::CoreAppAgent, hha_types::PresentedHappBundle, | ||
}; | ||
|
||
pub async fn get(agent_pubkey: String) -> Result<()> { | ||
let mut agent = CoreAppAgent::spawn(None).await?; | ||
let pubkey_bytes: AgentPubKey = AgentPubKeyB64::from_b64_str(&agent_pubkey.clone())?.into(); | ||
|
||
let agent_jurisdiction: Vec<(AgentPubKey, Option<String>)> = agent | ||
.app | ||
.zome_call_typed( | ||
CoreAppRoleName::HHA.into(), | ||
ZomeName::from("hha"), | ||
FunctionName::from("get_agents_jurisdiction"), | ||
vec![pubkey_bytes], | ||
) | ||
.await?[0]; | ||
|
||
if let Some(d) = agent_jurisdiction.1 { | ||
// Please do not change this print and if you do see that the nightly tests that depend on this print are updated as well | ||
println!("==================="); | ||
println!( | ||
"Hosting Preference for agent {:?}: {}", | ||
agent_pubkey, jurisdiction | ||
); | ||
println!("==================="); | ||
} else { | ||
println!("Error: No jurisdiction found for agent {:?}", agent_pubkey) | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
pub mod enable_happ_for_host; | ||
pub mod get_agents_jurisdiction; | ||
pub mod get_all_happs_by; | ||
pub mod get_happ_hosts; | ||
pub mod get_happ_pref_for_host; | ||
pub mod get_happ_pref_hash_for_host; | ||
pub mod get_specific_happ_prefs; | ||
pub mod ledger; | ||
pub mod list_all_my_happs; | ||
pub mod list_all_tx; | ||
pub mod pay_invoices; | ||
pub mod profile; | ||
pub mod set_happ_prefs; | ||
pub mod set_host_happ_prefs; |
File renamed without changes.
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