Trait pallet_distance::pallet::Config

source ·
pub trait Config: Config + Config + Config<IdtyIndex = u32> {
    type Currency: Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason> + Balanced<Self::AccountId>;
    type RuntimeHoldReason: From<HoldReason>;
    type EvaluationPrice: Get<BalanceOf<Self>>;
    type EvaluationPeriod: Get<u32>;
    type MaxRefereeDistance: Get<u32>;
    type MinAccessibleReferees: Get<Perbill>;
    type OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>;
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type WeightInfo: WeightInfo;
    type OnValidDistanceStatus: OnValidDistanceStatus<Self>;
    type CheckRequestDistanceEvaluation: CheckRequestDistanceEvaluation<Self>;
}
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.

Required Associated Types§

source

type Currency: Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason> + Balanced<Self::AccountId>

Currency type used in this pallet for reserve and slash operations.

source

type RuntimeHoldReason: From<HoldReason>

The overarching hold reason type.

source

type EvaluationPrice: Get<BalanceOf<Self>>

The amount reserved during evaluation.

source

type EvaluationPeriod: Get<u32>

The evaluation period in blocks. Since the evaluation uses 3 pools, the total evaluation time will be 3 * EvaluationPeriod.

source

type MaxRefereeDistance: Get<u32>

The maximum distance used to define a referee’s accessibility. This value is not used by the runtime but is needed by the client distance oracle.

source

type MinAccessibleReferees: Get<Perbill>

The minimum ratio of accessible referees required.

source

type OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>

Handler for unbalanced reduction when invalid distance causes a slash.

source

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

The overarching event type.

source

type WeightInfo: WeightInfo

Type representing the weight of this pallet

source

type OnValidDistanceStatus: OnValidDistanceStatus<Self>

A handler that is called when a distance evaluation is successfully validated.

source

type CheckRequestDistanceEvaluation: CheckRequestDistanceEvaluation<Self>

A trait that provides a method to check if a distance evaluation request is allowed.

Object Safety§

This trait is not object safe.

Implementors§