/// This function creates responses to the system calls that are redirected to
/// consensus.
This function creates responses to the system calls that are redirected to
consensus.
This function creates responses to the system calls that are redirected to consensus .
pub fn generate_responses_to_subnet_calls(
    state_manager: &dyn StateManager<State = ReplicatedState>,
    certified_height: Height,
    transcripts_for_new_subnets: &BTreeMap<NiDkgId, Result<NiDkgTranscript, String>>,
    batch_time: Time,
    log: &ReplicaLogger,
) -> Vec<Response> {
    let mut consensus_responses = Vec::<Response>::new();
    if let Ok(state) = state_manager.get_state_at(certified_height) {
        let setup_initial_dkg_contexts = &state
            .get_ref()
            .metadata
            .subnet_call_context_manager
            .setup_initial_dkg_contexts;
        consensus_responses.append(&mut generate_responses_to_setup_initial_dkg_calls(
            setup_initial_dkg_contexts,
            transcripts_for_new_subnets,
            log,
        ));
        let sign_with_mock_ecdsa_contexts = &state
            .get_ref()
            .metadata
            .subnet_call_context_manager
            .sign_with_mock_ecdsa_contexts;
        consensus_responses.append(&mut generate_responses_to_sign_with_mock_ecdsa_calls(
            sign_with_mock_ecdsa_contexts,
            batch_time,
        ));
    }
    consensus_responses
}
pub fn generate_responses_to_subnet_calls ( state_manager : & dyn StateManager < State = ReplicatedState > , certified_height : Height , transcripts_for_new_subnets : & BTreeMap < NiDkgId , Result < NiDkgTranscript , String > > , batch_time : Time , log : & ReplicaLogger , ) -> Vec < Response > { let mut consensus_responses = Vec :: < Response > :: new ( ) ; if let Ok ( state ) = state_manager . get_state_at ( certified_height ) { let setup_initial_dkg_contexts = & state . get_ref ( ) . metadata . subnet_call_context_manager . setup_initial_dkg_contexts ; consensus_responses . append ( & mut generate_responses_to_setup_initial_dkg_calls ( setup_initial_dkg_contexts , transcripts_for_new_subnets , log , ) ) ; let sign_with_mock_ecdsa_contexts = & state . get_ref ( ) . metadata . subnet_call_context_manager . sign_with_mock_ecdsa_contexts ; consensus_responses . append ( & mut generate_responses_to_sign_with_mock_ecdsa_calls ( sign_with_mock_ecdsa_contexts , batch_time , ) ) ; } consensus_responses }
This function creates responses to the system calls that are redirected to
consensus.
This function creates responses to the system calls that are redirected to consensus .
state_manager
&dyn StateManager<State = ReplicatedState>
certified_height
Height
transcripts_for_new_subnets
&BTreeMap<NiDkgId, Result<NiDkgTranscript, String>>
batch_time
Time
log
&ReplicaLogger