use crate::{
InternalError,
infra::ic::nns::registry::NnsRegistryInfra,
ops::{OpsError, prelude::*},
};
pub struct NnsRegistryOps;
impl NnsRegistryOps {
pub fn subnet_lookup_call_cost(pid: Principal) -> Result<u128, InternalError> {
NnsRegistryInfra::subnet_lookup_call_cost(pid).map_err(|error| OpsError::from(error).into())
}
pub async fn get_subnet_for_canister(
pid: Principal,
) -> Result<Option<Principal>, InternalError> {
let subnet = NnsRegistryInfra::get_subnet_for_canister(pid)
.await
.map_err(OpsError::from)?;
Ok(subnet)
}
}