pub trait Config: Config {
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type SwapAction: SwapAction<Self::AccountId, Self> + Parameter + MaxEncodedLen;
    type ProofLimit: Get<u32>;
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait. Atomic swap’s pallet configuration trait.

Required Associated Types§

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

The overarching event type.

source

type SwapAction: SwapAction<Self::AccountId, Self> + Parameter + MaxEncodedLen

Swap action.

source

type ProofLimit: Get<u32>

Limit of proof size.

Atomic swap is only atomic if once the proof is revealed, both parties can submit the proofs on-chain. If A is the one that generates the proof, then it requires that either:

  • A’s blockchain has the same proof length limit as B’s blockchain.
  • Or A’s blockchain has shorter proof length limit as B’s blockchain.

If B sees A is on a blockchain with larger proof length limit, then it should kindly refuse to accept the atomic swap request if A generates the proof, and asks that B generates the proof instead.

Object Safety§

This trait is not object safe.

Implementors§