referrerpolicy=no-referrer-when-downgrade

Trait SendToAssetHub

Source
pub trait SendToAssetHub {
    type AccountId;

    // Required methods
    fn relay_session_report(
        session_report: SessionReport<Self::AccountId>,
    ) -> Result<(), ()>;
    fn relay_new_offence_paged(
        offences: Vec<(SessionIndex, Offence<Self::AccountId>)>,
    ) -> Result<(), ()>;
}
Expand description

The interface to communicate to asset hub.

This trait should only encapsulate our outgoing communications. Any incoming message is handled with Calls.

In a real runtime, this is implemented via XCM calls, much like how the coretime pallet works. In a test runtime, it can be wired to direct function call.

Required Associated Types§

Source

type AccountId

The validator account ids.

Required Methods§

Source

fn relay_session_report( session_report: SessionReport<Self::AccountId>, ) -> Result<(), ()>

Report a session change to AssetHub.

Returning Err(()) means the DMP queue is full, and you should try again in the next block.

Source

fn relay_new_offence_paged( offences: Vec<(SessionIndex, Offence<Self::AccountId>)>, ) -> Result<(), ()>

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 SendToAssetHub for ()

A no-op implementation of SendToAssetHub.

Source§

type AccountId = u64

Source§

fn relay_session_report( _session_report: SessionReport<Self::AccountId>, ) -> Result<(), ()>

Source§

fn relay_new_offence_paged( _offences: Vec<(SessionIndex, Offence<Self::AccountId>)>, ) -> Result<(), ()>

Implementors§