Trait gear_core_processor::common::JournalHandler
source · pub trait JournalHandler {
Show 19 methods
// Required methods
fn message_dispatched(
&mut self,
message_id: MessageId,
source: ProgramId,
outcome: DispatchOutcome,
);
fn gas_burned(&mut self, message_id: MessageId, amount: u64);
fn exit_dispatch(
&mut self,
id_exited: ProgramId,
value_destination: ProgramId,
);
fn message_consumed(&mut self, message_id: MessageId);
fn send_dispatch(
&mut self,
message_id: MessageId,
dispatch: Dispatch,
delay: u32,
reservation: Option<ReservationId>,
);
fn wait_dispatch(
&mut self,
dispatch: StoredDispatch,
duration: Option<u32>,
waited_type: MessageWaitedType,
);
fn wake_message(
&mut self,
message_id: MessageId,
program_id: ProgramId,
awakening_id: MessageId,
delay: u32,
);
fn update_pages_data(
&mut self,
program_id: ProgramId,
pages_data: BTreeMap<GearPage, PageBuf>,
);
fn update_allocations(
&mut self,
program_id: ProgramId,
allocations: IntervalsTree<WasmPage>,
);
fn send_value(
&mut self,
from: ProgramId,
to: Option<ProgramId>,
value: u128,
);
fn store_new_programs(
&mut self,
program_id: ProgramId,
code_id: CodeId,
candidates: Vec<(MessageId, ProgramId)>,
);
fn stop_processing(&mut self, dispatch: StoredDispatch, gas_burned: u64);
fn reserve_gas(
&mut self,
message_id: MessageId,
reservation_id: ReservationId,
program_id: ProgramId,
amount: u64,
bn: u32,
);
fn unreserve_gas(
&mut self,
reservation_id: ReservationId,
program_id: ProgramId,
expiration: u32,
);
fn update_gas_reservation(
&mut self,
program_id: ProgramId,
reserver: GasReserver,
);
fn system_reserve_gas(&mut self, message_id: MessageId, amount: u64);
fn system_unreserve_gas(&mut self, message_id: MessageId);
fn send_signal(
&mut self,
message_id: MessageId,
destination: ProgramId,
code: SignalCode,
);
fn reply_deposit(
&mut self,
message_id: MessageId,
future_reply_id: MessageId,
amount: u64,
);
}
Expand description
Journal handler.
Something that can update state.
Required Methods§
sourcefn message_dispatched(
&mut self,
message_id: MessageId,
source: ProgramId,
outcome: DispatchOutcome,
)
fn message_dispatched( &mut self, message_id: MessageId, source: ProgramId, outcome: DispatchOutcome, )
Process message dispatch.
sourcefn gas_burned(&mut self, message_id: MessageId, amount: u64)
fn gas_burned(&mut self, message_id: MessageId, amount: u64)
Process gas burned.
sourcefn exit_dispatch(&mut self, id_exited: ProgramId, value_destination: ProgramId)
fn exit_dispatch(&mut self, id_exited: ProgramId, value_destination: ProgramId)
Process exit dispatch.
sourcefn message_consumed(&mut self, message_id: MessageId)
fn message_consumed(&mut self, message_id: MessageId)
Process message consumed.
sourcefn send_dispatch(
&mut self,
message_id: MessageId,
dispatch: Dispatch,
delay: u32,
reservation: Option<ReservationId>,
)
fn send_dispatch( &mut self, message_id: MessageId, dispatch: Dispatch, delay: u32, reservation: Option<ReservationId>, )
Process send dispatch.
sourcefn wait_dispatch(
&mut self,
dispatch: StoredDispatch,
duration: Option<u32>,
waited_type: MessageWaitedType,
)
fn wait_dispatch( &mut self, dispatch: StoredDispatch, duration: Option<u32>, waited_type: MessageWaitedType, )
Process send message.
sourcefn wake_message(
&mut self,
message_id: MessageId,
program_id: ProgramId,
awakening_id: MessageId,
delay: u32,
)
fn wake_message( &mut self, message_id: MessageId, program_id: ProgramId, awakening_id: MessageId, delay: u32, )
Process send message.
sourcefn update_pages_data(
&mut self,
program_id: ProgramId,
pages_data: BTreeMap<GearPage, PageBuf>,
)
fn update_pages_data( &mut self, program_id: ProgramId, pages_data: BTreeMap<GearPage, PageBuf>, )
Process page update.
sourcefn update_allocations(
&mut self,
program_id: ProgramId,
allocations: IntervalsTree<WasmPage>,
)
fn update_allocations( &mut self, program_id: ProgramId, allocations: IntervalsTree<WasmPage>, )
Process JournalNote::UpdateAllocations.
sourcefn send_value(&mut self, from: ProgramId, to: Option<ProgramId>, value: u128)
fn send_value(&mut self, from: ProgramId, to: Option<ProgramId>, value: u128)
Send value.
sourcefn store_new_programs(
&mut self,
program_id: ProgramId,
code_id: CodeId,
candidates: Vec<(MessageId, ProgramId)>,
)
fn store_new_programs( &mut self, program_id: ProgramId, code_id: CodeId, candidates: Vec<(MessageId, ProgramId)>, )
Store new programs in storage.
Program ids are ids of potential (planned to be initialized) programs.
sourcefn stop_processing(&mut self, dispatch: StoredDispatch, gas_burned: u64)
fn stop_processing(&mut self, dispatch: StoredDispatch, gas_burned: u64)
Stop processing queue.
Pushes StoredDispatch back to the top of the queue and decreases gas allowance.
sourcefn reserve_gas(
&mut self,
message_id: MessageId,
reservation_id: ReservationId,
program_id: ProgramId,
amount: u64,
bn: u32,
)
fn reserve_gas( &mut self, message_id: MessageId, reservation_id: ReservationId, program_id: ProgramId, amount: u64, bn: u32, )
Reserve gas.
sourcefn unreserve_gas(
&mut self,
reservation_id: ReservationId,
program_id: ProgramId,
expiration: u32,
)
fn unreserve_gas( &mut self, reservation_id: ReservationId, program_id: ProgramId, expiration: u32, )
Unreserve gas.
sourcefn update_gas_reservation(
&mut self,
program_id: ProgramId,
reserver: GasReserver,
)
fn update_gas_reservation( &mut self, program_id: ProgramId, reserver: GasReserver, )
Update gas reservations.
sourcefn system_reserve_gas(&mut self, message_id: MessageId, amount: u64)
fn system_reserve_gas(&mut self, message_id: MessageId, amount: u64)
Do system reservation.
sourcefn system_unreserve_gas(&mut self, message_id: MessageId)
fn system_unreserve_gas(&mut self, message_id: MessageId)
Do system unreservation.
sourcefn send_signal(
&mut self,
message_id: MessageId,
destination: ProgramId,
code: SignalCode,
)
fn send_signal( &mut self, message_id: MessageId, destination: ProgramId, code: SignalCode, )
Send system signal.
sourcefn reply_deposit(
&mut self,
message_id: MessageId,
future_reply_id: MessageId,
amount: u64,
)
fn reply_deposit( &mut self, message_id: MessageId, future_reply_id: MessageId, amount: u64, )
Create deposit for future reply.