/// A helper to merge the maturity of a neuron
A helper to merge the maturity of a neuron
A helper to merge the maturity of a neuron
fn merge_maturity(
    gov: &mut Governance,
    id: NeuronId,
    controller: &PrincipalId,
    percentage_to_merge: u32,
) -> Result<MergeMaturityResponse, GovernanceError> {
    let result = gov
        .manage_neuron(
            controller,
            &ManageNeuron {
                id: None,
                neuron_id_or_subaccount: Some(NeuronIdOrSubaccount::NeuronId(id)),
                command: Some(Command::MergeMaturity(MergeMaturity {
                    percentage_to_merge,
                })),
            },
        )
        .now_or_never()
        .unwrap()
        .command
        .unwrap();
    match result {
        manage_neuron_response::Command::Error(e) => Err(e),
        manage_neuron_response::Command::MergeMaturity(response) => Ok(response),
        _ => panic!("Merge maturity command returned unexpected response"),
    }
}
fn merge_maturity ( gov : & mut Governance , id : NeuronId , controller : & PrincipalId , percentage_to_merge : u32 , ) -> Result < MergeMaturityResponse , GovernanceError > { let result = gov . manage_neuron ( controller , & ManageNeuron { id : None , neuron_id_or_subaccount : Some ( NeuronIdOrSubaccount :: NeuronId ( id ) ) , command : Some ( Command :: MergeMaturity ( MergeMaturity { percentage_to_merge , } ) ) , } , ) . now_or_never ( ) . unwrap ( ) . command . unwrap ( ) ; match result { manage_neuron_response :: Command :: Error ( e ) => Err ( e ) , manage_neuron_response :: Command :: MergeMaturity ( response ) => Ok ( response ) , _ => panic ! ( " " ) , } }
A helper to merge the maturity of a neuron
A helper to merge the maturity of a neuron
gov
&mut Governance
id
NeuronId
controller
&PrincipalId
percentage_to_merge
u32