Skip to content

Commit

Permalink
V3config support (#202)
Browse files Browse the repository at this point in the history
Added support for v3 config

---------

Co-authored-by: Matthew Geddes <[email protected]>
Co-authored-by: Stefan Junker <[email protected]>
Co-authored-by: Lisa Jetton <[email protected]>
Co-authored-by: zo-el <[email protected]>
  • Loading branch information
5 people authored Aug 21, 2024
1 parent 5b169bd commit 2de51a8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ members = [
]

[workspace.dependencies]
hpos-config-core = { git = "https://github.com/Holo-Host/hpos-config", rev = "a36f862869cc162c843ac27ed617910d68f480cc" }
hpos-config-seed-bundle-explorer ={ git = "https://github.com/Holo-Host/hpos-config", rev = "a36f862869cc162c843ac27ed617910d68f480cc" }
hpos-config-core = { git = "https://github.com/Holo-Host/hpos-config", rev = "86411bdaabe7061a4b150d36c062fddc2c6c74cc" }
hpos-config-seed-bundle-explorer ={ git = "https://github.com/Holo-Host/hpos-config", rev = "86411bdaabe7061a4b150d36c062fddc2c6c74cc" }
ed25519-dalek = "2.1.1"
holochain_keystore = "0.4.0-dev.16"
holochain_types = { version = "0.4.0-dev.18", features = ["chc"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/configure-holochain/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async fn run_configure_holochain(f_r_a_k: &str, r_o_m_p: &str) {
set_var("HOLOCHAIN_DEFAULT_PASSWORD", "pass");

let device_bundle = match get_hpos_config().unwrap() {
Config::V2 { device_bundle, .. } => device_bundle,
Config::V3 { device_bundle, .. } | Config::V2 { device_bundle, .. } => device_bundle,
_ => panic!("Unsupported Config version"),
};

Expand Down
2 changes: 1 addition & 1 deletion crates/holo_happ_manager/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn run_happ_manager() {
set_var("IS_INTEGRATION_TEST", "TRUE");

let device_bundle = match get_hpos_config().unwrap() {
Config::V2 { device_bundle, .. } => device_bundle,
Config::V3 { device_bundle, .. } | Config::V2 { device_bundle, .. } => device_bundle,
_ => panic!("Unsupported Config version"),
};

Expand Down
9 changes: 9 additions & 0 deletions crates/hpos_connect_hc/src/holo_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ impl Happ {
.await?;
let key = AgentPubKey::from_raw_32(pub_key.to_bytes().to_vec());
match config {
hpos_config_core::Config::V3 {
registration_code,
settings,
..
} => Ok(Some(Admin {
key,
registration_code,
email: settings.admin.email,
})),
hpos_config_core::Config::V2 {
registration_code,
settings,
Expand Down
9 changes: 9 additions & 0 deletions crates/hpos_connect_hc/src/hpos_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ async fn populate_admin(admin_websocket: AdminWebsocket) -> Result<Admin> {
let key = get_agent_key(admin_websocket, &config).await?;

match config {
Config::V3 {
registration_code,
settings,
..
} => Ok(Admin {
key,
registration_code,
email: settings.admin.email,
}),
Config::V2 {
registration_code,
settings,
Expand Down

0 comments on commit 2de51a8

Please sign in to comment.