pub trait RelaychainStateProvider {
// Required method
fn current_relay_chain_state() -> RelayChainState;
// Provided method
fn set_current_relay_chain_state(_state: RelayChainState) { ... }
}
Expand description
This exposes the RelayChainState
to other runtime modules.
Enables parachains to read relay chain state via state proofs.
Required Methods§
Sourcefn current_relay_chain_state() -> RelayChainState
fn current_relay_chain_state() -> RelayChainState
May be called by any runtime module to obtain the current state of the relay chain.
NOTE: This is not guaranteed to return monotonically increasing relay parents.
Provided Methods§
Sourcefn set_current_relay_chain_state(_state: RelayChainState)
fn set_current_relay_chain_state(_state: RelayChainState)
Utility function only to be used in benchmarking scenarios, to be implemented optionally, else a noop.
It allows for setting a custom RelayChainState.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.