/// Creates a map of subnets to wallet canisters, ensuring that every provided
/// canister maps to unique subnet.
Creates a map of subnets to wallet canisters, ensuring that every provided
canister maps to unique subnet.
Creates a map of subnets to wallet canisters ensuring that every provided canister maps to unique subnet .
fn subnets_to_wallet_canisters(
    wallet_canisters: Vec<String>,
    ic: &dyn Ic,
) -> BTreeMap<SubnetId, CanisterId> {
    let wallet_canister_count = wallet_canisters.len();
    let subnet_wallet_canisters = wallet_canisters
        .into_iter()
        .map(|s| CanisterId::new(PrincipalId::from_str(&s).unwrap()).unwrap())
        .map(|c| (ic.route(c.get()).unwrap(), c))
        .collect::<BTreeMap<_, _>>();
    assert_eq!(wallet_canister_count, subnet_wallet_canisters.len());
    subnet_wallet_canisters
}
fn subnets_to_wallet_canisters ( wallet_canisters : Vec < String > , ic : & dyn Ic , ) -> BTreeMap < SubnetId , CanisterId > { let wallet_canister_count = wallet_canisters . len ( ) ; let subnet_wallet_canisters = wallet_canisters . into_iter ( ) . map ( | s | CanisterId :: new ( PrincipalId :: from_str ( & s ) . unwrap ( ) ) . unwrap ( ) ) . map ( | c | ( ic . route ( c . get ( ) ) . unwrap ( ) , c ) ) . collect :: < BTreeMap < _ , _ > > ( ) ; assert_eq ! ( wallet_canister_count subnet_wallet_canisters len ( ) ) ; subnet_wallet_canisters }
Creates a map of subnets to wallet canisters, ensuring that every provided
canister maps to unique subnet.
Creates a map of subnets to wallet canisters ensuring that every provided canister maps to unique subnet .
wallet_canisters
Vec<String>
ic
&dyn Ic