Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

2 changes: 1 addition & 1 deletion rs/nns/governance/src/pb/conversions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2707,7 +2707,7 @@ impl From<api::BlessAlternativeGuestOsVersion> for pb::BlessAlternativeGuestOsVe
}
}

fn convert_guest_launch_measurements_from_pb_to_api(
pub fn convert_guest_launch_measurements_from_pb_to_api(
item: PbGuestLaunchMeasurements,
) -> api::GuestLaunchMeasurements {
api::GuestLaunchMeasurements {
Expand Down
2 changes: 2 additions & 0 deletions rs/nns/governance/src/pb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ mod conversions;
mod convert_struct_to_enum;
pub mod proposal_conversions;

pub use conversions::convert_guest_launch_measurements_from_pb_to_api;

impl Storable for ArchivedMonthlyNodeProviderRewards {
fn to_bytes(&self) -> Cow<'_, [u8]> {
Cow::from(self.encode_to_vec())
Expand Down
1 change: 1 addition & 0 deletions rs/registry/admin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ rust_binary(
"//rs/nns/cmc",
"//rs/nns/common",
"//rs/nns/constants",
"//rs/nns/governance",
"//rs/nns/governance/api",
"//rs/nns/handlers/root/impl:root",
"//rs/nns/init",
Expand Down
1 change: 1 addition & 0 deletions rs/registry/admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ic-nervous-system-proto = { path = "../../nervous_system/proto" }
ic-nervous-system-root = { path = "../../nervous_system/root" }
ic-nns-common = { path = "../../nns/common" }
ic-nns-constants = { path = "../../nns/constants" }
ic-nns-governance = { path = "../../nns/governance" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to avoid this, because it could have a (very) detrimental impact on build performance.

ic-nns-governance-api = { path = "../../nns/governance/api" }
ic-nns-handler-root = { path = "../../nns/handlers/root/impl" }
ic-nns-init = { path = "../../nns/init" }
Expand Down
14 changes: 14 additions & 0 deletions rs/registry/admin/bin/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use ic_registry_transport::Error;
use ic_types::{NodeId, PrincipalId, SubnetId};
use indexmap::IndexMap;
use prost::Message;
use std::fs::File;
use std::path::Path;
use std::{convert::TryFrom, fs::read_to_string, path::PathBuf};
use url::Url;

Expand Down Expand Up @@ -184,3 +186,15 @@ pub(crate) fn shortened_pids_string(pids: &[PrincipalId]) -> String {
pids_string.push(']');
pids_string
}

pub(crate) fn read_from_json_file<T: serde::de::DeserializeOwned>(path: &Path) -> T {
let file = File::open(path)
.unwrap_or_else(|err| panic!("Failed to open file '{}': {}", path.display(), err));
serde_json::from_reader(file).unwrap_or_else(|err| {
panic!(
"Failed to parse JSON from file '{}': {}",
path.display(),
err
)
})
}
Loading
Loading