referrerpolicy=no-referrer-when-downgrade

SendValidatorSet

Trait SendValidatorSet 

Source
pub trait SendValidatorSet<AccountId> {
    type Destination: Parameter;

    // Required method
    fn send(
        destination: &Self::Destination,
        era: EraIndex,
        validators: &[AccountId],
    ) -> Result<(), ()>;

    // Provided methods
    fn message_size(
        _destination: &Self::Destination,
        era: EraIndex,
        validators: &[AccountId],
    ) -> usize
       where AccountId: Encode { ... }
    fn max_message_size(_destination: &Self::Destination) -> Option<usize> { ... }
    fn ensure_successful_send(_destination: &Self::Destination) { ... }
}
Expand description

Sends a validator set to one destination.

Required Associated Types§

Source

type Destination: Parameter

Identifies a destination.

Required Methods§

Source

fn send( destination: &Self::Destination, era: EraIndex, validators: &[AccountId], ) -> Result<(), ()>

Hand the validator set of era to the transport for destination.

Ok means the set was accepted for delivery, not that the destination applied it.

Provided Methods§

Source

fn message_size( _destination: &Self::Destination, era: EraIndex, validators: &[AccountId], ) -> usize
where AccountId: Encode,

The encoded size of what Self::send sends to destination.

By default the encoded era and validators, 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(_destination: &Self::Destination) -> Option<usize>

The largest message the transport accepts for destination, None without a limit.

Source

fn ensure_successful_send(_destination: &Self::Destination)

Prepare destination so that Self::send succeeds 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> SendValidatorSet<AccountId> for ()

Source§

type Destination = ()

Source§

fn send(_: &(), _: EraIndex, _: &[AccountId]) -> Result<(), ()>

Implementors§