Trait oasis_runtime_sdk::runtime::Runtime
source · pub trait Runtime {
type Core: API;
type Accounts: API;
type Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler;
type FeeProxy: FeeProxyHandler = ();
const VERSION: Version;
const STATE_VERSION: u32 = 0u32;
const PREFETCH_LIMIT: u16 = 0u16;
const SCHEDULE_CONTROL: ScheduleControl = _;
// Required method
fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis;
// Provided methods
fn trusted_signers() -> Option<TrustedSigners> { ... }
fn consensus_trust_root() -> Option<TrustRoot> { ... }
fn migrate_state<C: Context>(_ctx: &C) { ... }
fn is_allowed_query(_method: &str) -> bool { ... }
fn is_allowed_private_km_query(_method: &str) -> bool { ... }
fn is_allowed_interactive_call(_method: &str) -> bool { ... }
fn migrate<C: Context>(ctx: &C) { ... }
fn start()
where Self: Sized + Send + Sync + 'static { ... }
}
Expand description
A runtime.
Required Associated Types§
sourcetype Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler
type Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler
Supported modules.
Provided Associated Types§
sourcetype FeeProxy: FeeProxyHandler = ()
type FeeProxy: FeeProxyHandler = ()
Handler for proxy fee payments.
Required Associated Constants§
Provided Associated Constants§
sourceconst STATE_VERSION: u32 = 0u32
const STATE_VERSION: u32 = 0u32
State version.
sourceconst PREFETCH_LIMIT: u16 = 0u16
const PREFETCH_LIMIT: u16 = 0u16
Prefetch limit. To enable prefetch set it to a non-zero value.
sourceconst SCHEDULE_CONTROL: ScheduleControl = _
const SCHEDULE_CONTROL: ScheduleControl = _
Runtime schedule control configuration.
Required Methods§
sourcefn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis
fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis
Genesis state for the runtime.
Provided Methods§
sourcefn trusted_signers() -> Option<TrustedSigners>
fn trusted_signers() -> Option<TrustedSigners>
Return the trusted signers for this runtime; if None
, a key manager connection will not be
established on startup.
sourcefn consensus_trust_root() -> Option<TrustRoot>
fn consensus_trust_root() -> Option<TrustRoot>
Return the consensus layer trust root for this runtime; if None
, consensus layer integrity
verification will not be performed.
sourcefn migrate_state<C: Context>(_ctx: &C)
fn migrate_state<C: Context>(_ctx: &C)
Perform runtime-specific state migration. This method is only called when the recorded
state version does not match STATE_VERSION
.
sourcefn is_allowed_query(_method: &str) -> bool
fn is_allowed_query(_method: &str) -> bool
Whether a given query method is allowed to be invoked.
sourcefn is_allowed_private_km_query(_method: &str) -> bool
fn is_allowed_private_km_query(_method: &str) -> bool
Whether a given query method is allowed to access private key manager state.
Note that even if this returns true
for a method, the method also needs to be tagged as
being allowed to access private key manager state (e.g. with allow_private_km
).
sourcefn is_allowed_interactive_call(_method: &str) -> bool
fn is_allowed_interactive_call(_method: &str) -> bool
Whether a given call is allowed to be invoked interactively.
Note that even if this returns true
for a method, the method also needs to be tagged as
being allowed to be executed interactively (e.g. with allow_interactive
)