diff --git a/src/lib.rs b/src/lib.rs index 9190a7e..0d0bd7f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,7 @@ use anyhow::Result; use holochain_types::dna::{hash_type::Agent, HoloHash}; use hpos_hc_connect::{hha_agent::CoreAppAgent, holo_config::Config}; use std::collections::HashMap; -use tracing::{debug, error, info}; +use tracing::{debug, error, info, trace}; use types::hbs::{HbsClient, KycLevel}; use types::PublishedHappDetails; use utils::{ @@ -38,12 +38,17 @@ pub async fn run(config: &Config) -> Result<()> { debug!("Got host credentials from hbs {:?}", host_credentials); let mut core_app = CoreAppAgent::spawn(Some(config)).await?; + trace!("Connected to core app interface."); // Suspend happs that have overdue payments let pending_transactions = core_app.get_pending_transactions().await?; + trace!("Got pending_transactions : {:?}", pending_transactions); + let suspended_happs = get_suspended_happs(pending_transactions); + trace!("Got suspended_happs : {:#?}", suspended_happs); let published_happs = get_all_published_hosted_happs(&mut core_app).await?; + trace!("Got published_happs : {:#?}", published_happs); // Get happ jurisdictions AND publisher jurisdiction for each happ let mut published_happ_details: HashMap = HashMap::new(); @@ -72,6 +77,11 @@ pub async fn run(config: &Config) -> Result<()> { let jurisdiction = core_app .get_publisher_jurisdiction(publisher_pubkey.clone()) .await?; + trace!( + "Got jurisdiction for publisher {:?} : {:?}", + publisher_pubkey, + jurisdiction + ); publisher_jurisdictions.insert(publisher_pubkey, jurisdiction.clone()); published_happ_details.insert( happ.happ_id.clone().to_string(), diff --git a/src/types/hbs.rs b/src/types/hbs.rs index 566abdd..6d4a9f8 100644 --- a/src/types/hbs.rs +++ b/src/types/hbs.rs @@ -175,8 +175,6 @@ impl HbsClient { ) .await?; - tracing::trace!("Signature: {:?}", signature); - let connection = Self::connect()?; let mut headers = reqwest::header::HeaderMap::new(); diff --git a/src/types/mod.rs b/src/types/mod.rs index 48967cc..7043876 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -5,6 +5,7 @@ use holochain_types::dna::ActionHashB64; use holochain_types::prelude::{holochain_serial, SerializedBytes}; use serde::{Deserialize, Serialize}; +#[derive(Debug, Deserialize, Clone)] pub struct HappBundle { pub happ_id: ActionHashB64, pub bundle_url: String, diff --git a/src/utils.rs b/src/utils.rs index e1b5fcf..aa8a28e 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -264,9 +264,7 @@ pub async fn install_holo_hosted_happs( .await .context("failed to get enabled hApps")?, ); - trace!("enabled_happ_ids {:?}", enabled_happ_ids); - - let client = reqwest::Client::new(); + trace!("enabled_happ_ids {:#?}", enabled_happ_ids); // Iterate through the vec and // Call http://localhost/api/v2/apps/hosted/install @@ -379,6 +377,7 @@ pub async fn install_holo_hosted_happs( preferences: preferences.clone(), membrane_proofs: mem_proof.clone(), }; + let client = reqwest::Client::new(); let response = client .post("http://localhost/api/v2/apps/hosted/install") .json(&body)