Skip to content

Commit

Permalink
fix test and default trait for `PublisherPricingPref~
Browse files Browse the repository at this point in the history
  • Loading branch information
JettTech committed Oct 29, 2023
1 parent 7711232 commit 6c84314
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/core_app_cli/src/actions/list_all_my_happs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use holochain_types::prelude::{
holochain_serial, ActionHashB64, AgentPubKeyB64, ExternIO, FunctionName, SerializedBytes,
ZomeName,
};
use holofuel_types::fuel::Fuel;
use hpos_hc_connect::{CoreAppAgent, CoreAppRoleName};
use serde::{Deserialize, Serialize};

Expand Down
1 change: 1 addition & 0 deletions crates/holo_happ_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tracing-subscriber = "0.3.17"
tokio = "1.28.2"
url2 = "0.0.6"
hpos-config-core = { git = "https://github.com/Holo-Host/hpos-config", rev = "bfaced6044ae570bf20d4528fa9aaafcc43ddeec" }
holofuel_types = "0.5.0"

[dev-dependencies]
configure-holochain = { path = "../configure-holochain"}
Expand Down
29 changes: 20 additions & 9 deletions crates/holo_happ_manager/src/hha_type.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use holochain_types::prelude::{holochain_serial, SerializedBytes};
use holofuel_types::fuel::Fuel;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, SerializedBytes, Clone)]
Expand All @@ -18,11 +19,11 @@ pub struct HappInput {
#[serde(default)]
pub description: String,
#[serde(default)]
pub categories: Vec<String>, //
pub categories: Vec<String>,
#[serde(default)]
pub jurisdictions: Vec<String>, //
pub jurisdictions: Vec<String>,
#[serde(default)]
pub exclude_jurisdictions: bool, //
pub exclude_jurisdictions: bool,
#[serde(default)]
pub publisher_pricing_pref: PublisherPricingPref,
#[serde(default)]
Expand All @@ -31,22 +32,32 @@ pub struct HappInput {
pub uid: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, SerializedBytes, Clone)]
pub struct DnaResource {
pub hash: String, // hash of the dna, not a stored dht address
pub src_url: String,
pub nick: String,
}

#[derive(Debug, Serialize, Deserialize, SerializedBytes, Clone, Default)]
pub struct LoginConfig {
pub display_publisher_name: bool,
pub registration_info_url: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, SerializedBytes, Clone, Default)]
#[derive(Debug, Serialize, Deserialize, SerializedBytes, Clone)]
pub struct PublisherPricingPref {
pub cpu: Fuel,
pub storage: Fuel,
pub bandwidth: Fuel,
}

#[derive(Debug, Serialize, Deserialize, SerializedBytes, Clone)]
pub struct DnaResource {
pub hash: String, // hash of the dna, not a stored dht address
pub src_url: String,
pub nick: String,
impl Default for PublisherPricingPref {
fn default() -> Self {
Self {
cpu: Fuel::new(0),
storage: Fuel::new(0),
bandwidth: Fuel::new(0),
}
}
}

0 comments on commit 6c84314

Please sign in to comment.