pallet_domains

Type Alias FraudProofFor

Source
pub type FraudProofFor<T> = FraudProof<BlockNumberFor<T>, <T as Config>::Hash, <T as Config>::DomainHeader, <T as Config>::MmrHash>;

Aliased Type§

struct FraudProofFor<T> {
    pub domain_id: DomainId,
    pub bad_receipt_hash: <<T as Config>::DomainHeader as Header>::Hash,
    pub maybe_mmr_proof: Option<ConsensusChainMmrLeafProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::Hash, <T as Config>::MmrHash>>,
    pub maybe_domain_runtime_code_proof: Option<DomainRuntimeCodeAt<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::Hash, <T as Config>::MmrHash>>,
    pub proof: FraudProofVariant<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::Hash, <T as Config>::MmrHash, <T as Config>::DomainHeader>,
}

Fields§

§domain_id: DomainId§bad_receipt_hash: <<T as Config>::DomainHeader as Header>::Hash

Hash of the bad receipt this fraud proof targeted

§maybe_mmr_proof: Option<ConsensusChainMmrLeafProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::Hash, <T as Config>::MmrHash>>

The MMR proof for the consensus state root that is used to verify the storage proof

It is set None if the specific fraud proof variant doesn’t contain a storage proof

§maybe_domain_runtime_code_proof: Option<DomainRuntimeCodeAt<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::Hash, <T as Config>::MmrHash>>

The domain runtime code storage proof

It is set None if the specific fraud proof variant doesn’t require domain runtime code or the required domain runtime code is available from the current runtime state.

§proof: FraudProofVariant<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::Hash, <T as Config>::MmrHash, <T as Config>::DomainHeader>

The specific fraud proof variant

Implementations

§

impl<Number, Hash, MmrHash, DomainHeader> FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header,

pub fn domain_id(&self) -> DomainId

pub fn targeted_bad_receipt_hash(&self) -> <DomainHeader as Header>::Hash

pub fn is_unexpected_domain_runtime_code_proof(&self) -> bool

pub fn is_unexpected_mmr_proof(&self) -> bool

pub fn dummy_fraud_proof( domain_id: DomainId, bad_receipt_hash: <DomainHeader as Header>::Hash, ) -> FraudProof<Number, Hash, DomainHeader, MmrHash>

§

impl<Number, Hash, MmrHash, DomainHeader> FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header, Number: Encode, Hash: Encode, MmrHash: Encode,

pub fn hash(&self) -> <DomainHeader as Header>::Hash

Trait Implementations

§

impl<Number, Hash, DomainHeader, MmrHash> Clone for FraudProof<Number, Hash, DomainHeader, MmrHash>
where Number: Clone, Hash: Clone, DomainHeader: Clone + Header, MmrHash: Clone,

§

fn clone(&self) -> FraudProof<Number, Hash, DomainHeader, MmrHash>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<Number, Hash, MmrHash, DomainHeader> Debug for FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<Number, Hash, DomainHeader, MmrHash> Decode for FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header, <DomainHeader as Header>::Hash: Decode, Option<ConsensusChainMmrLeafProof<Number, Hash, MmrHash>>: Decode, Option<DomainRuntimeCodeAt<Number, Hash, MmrHash>>: Decode, FraudProofVariant<Number, Hash, MmrHash, DomainHeader>: Decode,

§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<FraudProof<Number, Hash, DomainHeader, MmrHash>, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl<Number, Hash, DomainHeader, MmrHash> Encode for FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header, <DomainHeader as Header>::Hash: Encode, Option<ConsensusChainMmrLeafProof<Number, Hash, MmrHash>>: Encode, Option<DomainRuntimeCodeAt<Number, Hash, MmrHash>>: Encode, FraudProofVariant<Number, Hash, MmrHash, DomainHeader>: Encode,

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl<Number, Hash, DomainHeader, MmrHash> PartialEq for FraudProof<Number, Hash, DomainHeader, MmrHash>
where Number: PartialEq, Hash: PartialEq, DomainHeader: PartialEq + Header, MmrHash: PartialEq,

§

fn eq(&self, other: &FraudProof<Number, Hash, DomainHeader, MmrHash>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<Number, Hash, DomainHeader, MmrHash> TypeInfo for FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header + TypeInfo + 'static, <DomainHeader as Header>::Hash: TypeInfo + 'static, Option<ConsensusChainMmrLeafProof<Number, Hash, MmrHash>>: TypeInfo + 'static, Option<DomainRuntimeCodeAt<Number, Hash, MmrHash>>: TypeInfo + 'static, FraudProofVariant<Number, Hash, MmrHash, DomainHeader>: TypeInfo + 'static, Number: TypeInfo + 'static, Hash: TypeInfo + 'static, MmrHash: TypeInfo + 'static,

§

type Identity = FraudProof<Number, Hash, DomainHeader, MmrHash>

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl<Number, Hash, DomainHeader, MmrHash> EncodeLike for FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header, <DomainHeader as Header>::Hash: Encode, Option<ConsensusChainMmrLeafProof<Number, Hash, MmrHash>>: Encode, Option<DomainRuntimeCodeAt<Number, Hash, MmrHash>>: Encode, FraudProofVariant<Number, Hash, MmrHash, DomainHeader>: Encode,

§

impl<Number, Hash, DomainHeader, MmrHash> Eq for FraudProof<Number, Hash, DomainHeader, MmrHash>
where Number: Eq, Hash: Eq, DomainHeader: Eq + Header, MmrHash: Eq,

§

impl<Number, Hash, DomainHeader, MmrHash> StructuralPartialEq for FraudProof<Number, Hash, DomainHeader, MmrHash>
where DomainHeader: Header,