Skip to content

Commit

Permalink
Merge pull request #14 from Holo-Host/feat/suspend-happs
Browse files Browse the repository at this point in the history
feat: added missing fields to happ details
  • Loading branch information
zeeshan595 authored Mar 18, 2024
2 parents fe142fd + 00d1b84 commit 3b644b6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
27 changes: 26 additions & 1 deletion resources/test/config.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
{"core_happs":[{"app_id":"core-app","bundle_url":"https://holo-host.github.io/holo-hosting-app-rsm/releases/downloads/core-app/0_5_19/core-app.0_5_19.happ","dnas":[{"properties":"{skip_proof: false, holo_agent_override: \"uhCAkYhIZ8u7NvM7H-m75Z6L1zSWLkJsbsrE8nXx1Hi9Nc3FVbm2U\"}","role_name":"core-app"},{"properties":"{skip_proof: false, not_editable_profile: true, holo_agent_override: \"uhCAkYhIZ8u7NvM7H-m75Z6L1zSWLkJsbsrE8nXx1Hi9Nc3FVbm2U\", fee_collectors_pubkey: \"uhCAkAY_6T0jx4QSQso1R3MD6wA7vYgL4VbIA0GWT7rfMDDViZyQe\", holo_revenue_pubkey: \"uhCAkcgkEPrrgDDZYnj4MqIz5kNGOaaJO9y1h7ky7iN1PRiNmQYmr\", enable_reserves: true}","role_name":"holofuel"}]},{"app_id":"servicelogger","bundle_url":"https://holo-host.github.io/servicelogger-rsm/releases/downloads/0_4_19/servicelogger.0_4_19.happ","sl_dna_url":"https://holo-host.github.io/servicelogger-rsm/releases/downloads/0_4_19/servicelogger.0_4_19.dna"}],"self_hosted_happs":[]}
{
"core_happs":
[
{
"app_id": "core-app",
"bundle_url": "https://holo-host.github.io/holo-hosting-app-rsm/releases/downloads/core-app/0_5_27/core-app.0_5_27.happ",
"dnas":
[
{
"properties": '{skip_proof: false, holo_agent_override: "uhCAkYhIZ8u7NvM7H-m75Z6L1zSWLkJsbsrE8nXx1Hi9Nc3FVbm2U"}',
"role_name": "core-app",
},
{
"properties": '{skip_proof: false, not_editable_profile: true, holo_agent_override: "uhCAkYhIZ8u7NvM7H-m75Z6L1zSWLkJsbsrE8nXx1Hi9Nc3FVbm2U", fee_collectors_pubkey: "uhCAkAY_6T0jx4QSQso1R3MD6wA7vYgL4VbIA0GWT7rfMDDViZyQe", holo_revenue_pubkey: "uhCAkcgkEPrrgDDZYnj4MqIz5kNGOaaJO9y1h7ky7iN1PRiNmQYmr", enable_reserves: true}',
"role_name": "holofuel",
},
],
},
{
"app_id": "servicelogger",
"bundle_url": "https://holo-host.github.io/servicelogger-rsm/releases/downloads/0_4_21/servicelogger.0_4_21.happ",
"sl_dna_url": "https://holo-host.github.io/servicelogger-rsm/releases/downloads/0_4_21/servicelogger.0_4_21.dna",
},
],
"self_hosted_happs": [],
}
4 changes: 4 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct HappDetails {
pub description: String,
pub categories: Vec<String>,
pub enabled: bool,
pub is_auto_disabled: bool,
pub is_paused: bool,
pub source_chains: Option<u16>,
pub days_hosted: Option<u16>,
Expand All @@ -48,6 +49,7 @@ impl HappDetails {
description: happ.name.clone(),
categories: happ.categories.clone(),
enabled: happ.host_settings.is_enabled,
is_auto_disabled: happ.host_settings.is_auto_disabled,
is_paused: happ.is_paused,
source_chains: count_instances(happ.id.clone(), ws)
.await
Expand Down Expand Up @@ -199,6 +201,8 @@ pub struct DnaResource {
#[derive(Debug, Serialize, Deserialize, SerializedBytes)]
pub struct HostSettings {
pub is_enabled: bool,
pub is_host_disabled: bool, // signals that the host was the origin of the last disable request/action
pub is_auto_disabled: bool, // signals that an internal hpos service was the origin of the last disable request/action
}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down
6 changes: 3 additions & 3 deletions tests/utils/core_apps.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::fmt;

// https://github.com/Holo-Host/holo-nixpkgs/blob/develop/profiles/logical/happ-releases.nix#L9C5-L9C5
pub const HHA_URL: &str = "https://holo-host.github.io/holo-hosting-app-rsm/releases/downloads/core-app/0_5_19/core-app.0_5_19-skip-proof.happ";
pub const SL_URL: &str = "https://holo-host.github.io/servicelogger-rsm/releases/downloads/0_4_19/servicelogger.0_4_19.happ";
pub const HHA_URL: &str = "https://holo-host.github.io/holo-hosting-app-rsm/releases/downloads/core-app/0_5_27/core-app.0_5_27-skip-proof.happ";
pub const SL_URL: &str = "https://holo-host.github.io/servicelogger-rsm/releases/downloads/0_4_21/servicelogger.0_4_21.happ";

pub enum Happ {
HHA,
Expand All @@ -12,7 +12,7 @@ pub enum Happ {
impl fmt::Display for Happ {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Happ::HHA => write!(f, "core-app:0_5_19"),
Happ::HHA => write!(f, "core-app:0_5_27"),
Happ::SL => write!(f, "servicelogger"),
}
}
Expand Down

0 comments on commit 3b644b6

Please sign in to comment.