referrerpolicy=no-referrer-when-downgrade

Trait SendToAssetHub

pub trait SendToAssetHub {
    type AccountId;

    // Required methods
    fn relay_session_report(
        session_report: SessionReport<Self::AccountId>,
    ) -> Result<(), ()>;
    fn relay_new_offence_paged(
        offences: Vec<(u32, 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§

type AccountId

The validator account ids.

Required Methods§

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.

fn relay_new_offence_paged( offences: Vec<(u32, 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§

§

impl SendToAssetHub for ()

A no-op implementation of SendToAssetHub.

§

type AccountId = u64

§

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

§

fn relay_new_offence_paged( _offences: Vec<(u32, Offence<<() as SendToAssetHub>::AccountId>)>, ) -> Result<(), ()>

Implementors§