ic-query 0.26.5

Internet Computer query library for NNS, SNS, ICRC, system canisters, and public network metadata
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::relation_inventory::fetch_mainnet_registry_relation_snapshot;
use crate::ic_registry::{
    MainnetRegistryFetchRequest, MainnetSubnetTopology, RegistryFetchError,
    projection::subnet_topology_from_inventory, relations::RegistryRelationInventoryScope,
};

pub(in crate::ic_registry) async fn fetch_mainnet_subnet_topology_async(
    request: &MainnetRegistryFetchRequest,
) -> Result<MainnetSubnetTopology, RegistryFetchError> {
    let snapshot = fetch_mainnet_registry_relation_snapshot(
        request,
        RegistryRelationInventoryScope::BaseRelations,
    )
    .await?;
    subnet_topology_from_inventory(request, &snapshot.inventory, snapshot.registry_version)
}