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§
sourcetype Currency: Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason> + Balanced<Self::AccountId>
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.
sourcetype RuntimeHoldReason: From<HoldReason>
type RuntimeHoldReason: From<HoldReason>
The overarching hold reason type.
sourcetype EvaluationPrice: Get<BalanceOf<Self>>
type EvaluationPrice: Get<BalanceOf<Self>>
The amount reserved during evaluation.
sourcetype EvaluationPeriod: Get<u32>
type EvaluationPeriod: Get<u32>
The evaluation period in blocks. Since the evaluation uses 3 pools, the total evaluation time will be 3 * EvaluationPeriod.
sourcetype MaxRefereeDistance: Get<u32>
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.
sourcetype MinAccessibleReferees: Get<Perbill>
type MinAccessibleReferees: Get<Perbill>
The minimum ratio of accessible referees required.
sourcetype OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>
type OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>
Handler for unbalanced reduction when invalid distance causes a slash.
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Type representing the weight of this pallet
sourcetype OnValidDistanceStatus: OnValidDistanceStatus<Self>
type OnValidDistanceStatus: OnValidDistanceStatus<Self>
A handler that is called when a distance evaluation is successfully validated.
sourcetype CheckRequestDistanceEvaluation: CheckRequestDistanceEvaluation<Self>
type CheckRequestDistanceEvaluation: CheckRequestDistanceEvaluation<Self>
A trait that provides a method to check if a distance evaluation request is allowed.