Trait polkadot_primitives::v0::SwapAux[][src]

pub trait SwapAux {
    fn ensure_can_swap(one: Id, other: Id) -> Result<(), &'static str>;
fn on_swap(one: Id, other: Id) -> Result<(), &'static str>; }
Expand description

Auxiliary for when there’s an attempt to swap two parachains/parathreads.

Required methods

Result describing whether it is possible to swap two parachains. Doesn’t mutate state.

Updates any needed state/references to enact a logical swap of two parachains. Identity, code and head_data remain equivalent for all parachains/threads, however other properties such as leases, deposits held and thread/chain nature are swapped.

May only be called on a state that ensure_can_swap has previously returned Ok for: if this is not the case, the result is undefined. May only return an error if ensure_can_swap also returns an error.

Implementations on Foreign Types

Implementors