referrerpolicy=no-referrer-when-downgrade

ReportAuthoredBlocks

Trait ReportAuthoredBlocks 

Source
pub trait ReportAuthoredBlocks<AccountId> {
    // Required method
    fn report(blocks: &[(AccountId, u32)]) -> Result<(), ()>;

    // Provided methods
    fn message_size(blocks: &[(AccountId, u32)]) -> usize
       where AccountId: Encode { ... }
    fn max_message_size() -> Option<usize> { ... }
    fn ensure_successful_report(_blocks: &[(AccountId, u32)]) { ... }
}
Expand description

Delivers the block counts of one report.

Required Methods§

Source

fn report(blocks: &[(AccountId, u32)]) -> Result<(), ()>

Hand over the number of blocks each account authored.

Ok means the counts were accepted for delivery or credited, not that a remote chain applied them.

Provided Methods§

Source

fn message_size(blocks: &[(AccountId, u32)]) -> usize
where AccountId: Encode,

The encoded size of what Self::report sends for blocks.

By default the encoded blocks, as if the transport added nothing: an XCM envelope adds a few bytes. Checked against Self::max_message_size in the pallet’s integrity_test.

Source

fn max_message_size() -> Option<usize>

The largest message the transport accepts, None without a limit, as for a local credit.

Source

fn ensure_successful_report(_blocks: &[(AccountId, u32)])

Prepare the runtime so that Self::report succeeds for blocks in benchmarks.

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<AccountId> ReportAuthoredBlocks<AccountId> for ()

Discards the counts.

Source§

fn report(_: &[(AccountId, u32)]) -> Result<(), ()>

Implementors§