Trait DelegationValidator

Source
pub trait DelegationValidator {
    type BlockNumber;
    type MaxGrantsPerDelegation: Get<u32>;
    type DelegationIdType;

    // Required method
    fn ensure_valid_delegation(
        provider: ProviderId,
        delegator: DelegatorId,
        block_number: Option<Self::BlockNumber>,
    ) -> Result<Delegation<Self::DelegationIdType, Self::BlockNumber, Self::MaxGrantsPerDelegation>, DispatchError>;
}
Expand description

A behavior that allows for validating a delegator-provider relationship

Required Associated Types§

Source

type BlockNumber

Type for block number.

Source

type MaxGrantsPerDelegation: Get<u32>

Type for maximum number of items that can be granted to a provider.

Source

type DelegationIdType

The unique identifier for a delegated item

Required Methods§

Source

fn ensure_valid_delegation( provider: ProviderId, delegator: DelegatorId, block_number: Option<Self::BlockNumber>, ) -> Result<Delegation<Self::DelegationIdType, Self::BlockNumber, Self::MaxGrantsPerDelegation>, DispatchError>

Validates that the delegator and provider have a relationship at this point

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.

Implementors§