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

Object Safety§

This trait is not object safe.

Implementors§