pub trait SystemAPI {
type T: Config;
// Required methods
fn build_block(&mut self) -> BlockNumberFor<Self::T>;
fn build_blocks(&mut self, n: u32) -> BlockNumberFor<Self::T>;
fn block_number(&mut self) -> BlockNumberFor<Self::T>;
fn events(&mut self) -> Vec<EventRecordOf<Self::T>> ⓘ;
fn reset_events(&mut self);
fn runtime_call<Origin: Into<<RuntimeCall<Self::T> as Dispatchable>::RuntimeOrigin>>(
&mut self,
call: RuntimeCall<Self::T>,
origin: Origin,
) -> DispatchResultWithInfo<<RuntimeCall<Self::T> as Dispatchable>::PostInfo>;
}Expand description
System API for the sandbox.
Required Associated Types§
Required Methods§
Sourcefn build_block(&mut self) -> BlockNumberFor<Self::T>
fn build_block(&mut self) -> BlockNumberFor<Self::T>
Build a new empty block and return the new height.
Sourcefn build_blocks(&mut self, n: u32) -> BlockNumberFor<Self::T>
fn build_blocks(&mut self, n: u32) -> BlockNumberFor<Self::T>
Sourcefn block_number(&mut self) -> BlockNumberFor<Self::T>
fn block_number(&mut self) -> BlockNumberFor<Self::T>
Return the current height of the chain.
Sourcefn events(&mut self) -> Vec<EventRecordOf<Self::T>> ⓘ
fn events(&mut self) -> Vec<EventRecordOf<Self::T>> ⓘ
Return the events of the current block so far.
Sourcefn reset_events(&mut self)
fn reset_events(&mut self)
Reset the events of the current block.
Sourcefn runtime_call<Origin: Into<<RuntimeCall<Self::T> as Dispatchable>::RuntimeOrigin>>(
&mut self,
call: RuntimeCall<Self::T>,
origin: Origin,
) -> DispatchResultWithInfo<<RuntimeCall<Self::T> as Dispatchable>::PostInfo>
fn runtime_call<Origin: Into<<RuntimeCall<Self::T> as Dispatchable>::RuntimeOrigin>>( &mut self, call: RuntimeCall<Self::T>, origin: Origin, ) -> DispatchResultWithInfo<<RuntimeCall<Self::T> as Dispatchable>::PostInfo>
Execute a runtime call (dispatchable).
§Arguments
call- The runtime call to execute.origin- The origin of the call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".