pub fn cmd_remove_subnet(
    agent: &Agent,
    player: &crate::Player,
    context_time: Time,
) -> Result<Option<SignedIngress>, String> {
    let mut subnet_record = player.get_subnet_record(context_time)?;
    let nodes = get_node_ids_from_subnet_record(&subnet_record);
    if nodes.is_empty() {
        println!("Subnet {} has empty membership", player.subnet_id);
        Ok(None)
    } else {
        println!("Removing subnet {} members: {:?}", player.subnet_id, nodes);
        subnet_record.membership = Vec::new();
        update_subnet_record(agent, player.subnet_id, subnet_record, context_time).map(Some)
    }
}
/// Creates an ingress for removing of all nodes from a subnet.
Creates an ingress for removing of all nodes from a subnet.
Creates an ingress for removing of all nodes from a subnet .
pub fn cmd_remove_subnet(
    agent: &Agent,
    player: &crate::Player,
    context_time: Time,
) -> Result<Option<SignedIngress>, String> {
    let mut subnet_record = player.get_subnet_record(context_time)?;
    let nodes = get_node_ids_from_subnet_record(&subnet_record);
    if nodes.is_empty() {
        println!("Subnet {} has empty membership", player.subnet_id);
        Ok(None)
    } else {
        println!("Removing subnet {} members: {:?}", player.subnet_id, nodes);
        subnet_record.membership = Vec::new();
        update_subnet_record(agent, player.subnet_id, subnet_record, context_time).map(Some)
    }
}
pub fn cmd_remove_subnet ( agent : & Agent , player : & crate :: Player , context_time : Time , ) -> Result < Option < SignedIngress > , String > { let mut subnet_record = player . get_subnet_record ( context_time ) ? ; let nodes = get_node_ids_from_subnet_record ( & subnet_record ) ; if nodes . is_empty ( ) { println ! ( " " player subnet_id ) ; Ok ( None ) } else { println ! ( " " player subnet_id nodes ) ; subnet_record . membership = Vec :: new ( ) ; update_subnet_record ( agent , player . subnet_id , subnet_record , context_time ) . map ( Some ) } }
Creates an ingress for removing of all nodes from a subnet.
Creates an ingress for removing of all nodes from a subnet .
agent
&Agent
player
&crate::Player
context_time
Time
agent
&Agent
player
&crate::Player
context_time
Time