pub trait KeyOwnerProofSystem<Key> {
    type Proof: Codec;
    type IdentificationTuple: Codec;

    // Required methods
    fn prove(key: Key) -> Option<Self::Proof>;
    fn check_proof(
        key: Key,
        proof: Self::Proof
    ) -> Option<Self::IdentificationTuple>;
}
Expand description

Something which can compute and check proofs of a historical key owner and return full identification data of that key owner.

Required Associated Types§

type Proof: Codec

The proof of membership itself.

type IdentificationTuple: Codec

The full identification of a key owner and the stash account.

Required Methods§

fn prove(key: Key) -> Option<Self::Proof>

Prove membership of a key owner in the current block-state.

This should typically only be called off-chain, since it may be computationally heavy.

Returns Some iff the key owner referred to by the given key is a member of the current set.

fn check_proof( key: Key, proof: Self::Proof ) -> Option<Self::IdentificationTuple>

Check a proof of membership on-chain. Return Some iff the proof is valid and recent enough to check.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<Key> KeyOwnerProofSystem<Key> for ()

§

type Proof = Void

§

type IdentificationTuple = Void

§

fn prove(_key: Key) -> Option<<() as KeyOwnerProofSystem<Key>>::Proof>

§

fn check_proof( _key: Key, _proof: <() as KeyOwnerProofSystem<Key>>::Proof ) -> Option<<() as KeyOwnerProofSystem<Key>>::IdentificationTuple>

§

impl<T, D> KeyOwnerProofSystem<(KeyTypeId, D)> for Pallet<T>
where T: Config, D: AsRef<[u8]>,

§

type Proof = MembershipProof

§

type IdentificationTuple = (<T as Config>::ValidatorId, <T as Config>::FullIdentification)

§

fn prove( key: (KeyTypeId, D) ) -> Option<<Pallet<T> as KeyOwnerProofSystem<(KeyTypeId, D)>>::Proof>

§

fn check_proof( key: (KeyTypeId, D), proof: <Pallet<T> as KeyOwnerProofSystem<(KeyTypeId, D)>>::Proof ) -> Option<(<T as Config>::ValidatorId, <T as Config>::FullIdentification)>

Implementors§