common_primitives::msa

Trait DelegationValidator

Source
pub trait DelegationValidator {
    type BlockNumber;
    type MaxSchemaGrantsPerDelegation: Get<u32>;
    type SchemaId;

    // Required method
    fn ensure_valid_delegation(
        provider: ProviderId,
        delegator: DelegatorId,
        block_number: Option<Self::BlockNumber>,
    ) -> Result<Delegation<Self::SchemaId, Self::BlockNumber, Self::MaxSchemaGrantsPerDelegation>, 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 MaxSchemaGrantsPerDelegation: Get<u32>

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

Source

type SchemaId

Schema Id is the unique identifier for a Schema

Required Methods§

Source

fn ensure_valid_delegation( provider: ProviderId, delegator: DelegatorId, block_number: Option<Self::BlockNumber>, ) -> Result<Delegation<Self::SchemaId, Self::BlockNumber, Self::MaxSchemaGrantsPerDelegation>, 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§