/// Parses a JSON-encoded map from node type (string) to the number of
/// rewardable nodes of that type.
///
/// The supplied node types must be in the node type whitelist
Parses a JSON-encoded map from node type (string) to the number of
rewardable nodes of that type.

The supplied node types must be in the node type whitelist
Parses a JSON - encoded map from node type ( string ) to the number of rewardable nodes of that type . The supplied node types must be in the node type whitelist
fn parse_rewardable_nodes(json: &str) -> BTreeMap<String, u32> {
    let map: BTreeMap<String, u32> = serde_json::from_str(json)
        .unwrap_or_else(|e| panic!("Unable to parse rewardable_nodes: {}", e));
    for node_type in map.keys() {
        if !ic_nns_constants::NODE_TYPES.contains(&node_type.as_str()) {
            panic!(
                "Supplied node type \"{}\" is not a whitelisted node type",
                node_type
            )
        }
    }
    map
}
fn parse_rewardable_nodes ( json : & str ) -> BTreeMap < String , u32 > { let map : BTreeMap < String , u32 > = serde_json :: from_str ( json ) . unwrap_or_else ( | e | panic ! ( " " e ) ) ; for node_type in map . keys ( ) { if ! ic_nns_constants :: NODE_TYPES . contains ( & node_type . as_str ( ) ) { panic ! ( " \" \" " node_type ) } } map }
Parses a JSON-encoded map from node type (string) to the number of
rewardable nodes of that type.
Parses a JSON - encoded map from node type ( string ) to the number of rewardable nodes of that type .
json
&str