pub trait StatementOracle<RuntimeCall> {
type Ticket: Member + FullCodec + TypeInfo + MaxEncodedLen + Default;
// Required method
fn judge_statement(
statement: Statement,
context: JudgementContext,
callback: Callback<(Self::Ticket, JudgementContext, Judgement), RuntimeCall>,
) -> Result<Self::Ticket, DispatchError>;
}
Expand description
A provider of wondrous magic: give it a Statement
and it will tell you if it’s true, with
some degree of resilience.
It’s asynchronous, so you give it a callback in the form of a RuntimeCall
stub.
Required Associated Types§
Required Methods§
Sourcefn judge_statement(
statement: Statement,
context: JudgementContext,
callback: Callback<(Self::Ticket, JudgementContext, Judgement), RuntimeCall>,
) -> Result<Self::Ticket, DispatchError>
fn judge_statement( statement: Statement, context: JudgementContext, callback: Callback<(Self::Ticket, JudgementContext, Judgement), RuntimeCall>, ) -> Result<Self::Ticket, DispatchError>
Judge a statement
and get a Judgement.
We only care about the pallet/call index of callback
; it must take exactly three
arguments:
Self::Ticket
: The ticket which was returned here to identify the judgement.JudgementContext
: The value ofcontext
which was passed in to this call.Judgement
: The judgement given by the oracle.
It is assumed that all costs associated with this oraclisation have already been paid for or are absorbed by the system acting in its own interests.
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.