12345678910111213141516171819202122232425262728293031moduleBaker=structletrun~(cctxt:#Protocol_client_context.full)~stop_on_event~chain_id~(context_index:Abstract_context_index.t)~delegates=letopenLwt_result_syntaxinletchain=`Hashchain_idinletbaking_configuration=letopenBaking_configurationin{default_configwithvalidation=ContextIndexcontext_index;state_recorder=Memory;}in(* By default errors are simply printed but the baker won't stop
because of them. This is not what we want for testing. Here we force
the baker to terminate unsuccessfully if an error occurs. *)letcanceler=Lwt_canceler.create()inleton_error(err:errortrace)=let*!(_:(unit,exntrace)result)=Lwt_canceler.cancelcancelerinFormat.printf"%a"Error_monad.pp_print_traceerr;Lwt_exit.exit_and_raise1inBaking_scheduling.runcctxt~canceler~stop_on_event~on_error~chainbaking_configurationdelegatesend