referrerpolicy=no-referrer-when-downgrade

Trait StatementOracle

Source
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§

Source

type Ticket: Member + FullCodec + TypeInfo + MaxEncodedLen + Default

A small piece of data which may be used to identify different ongoing judgements.

Required Methods§

Source

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 of context 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.

Implementations on Foreign Types§

Source§

impl<C> StatementOracle<C> for ()

Implementors§