Skip to content

Commit

Permalink
Merge pull request #3283 from autonomys/fix-fraud-comment
Browse files Browse the repository at this point in the history
Give FraudProofVariant explicit codec indexes
  • Loading branch information
teor2345 authored Dec 5, 2024
2 parents 5a1cd71 + 3b42131 commit 6650fd0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crates/sp-domains-fraud-proof/src/fraud_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,23 @@ pub struct FraudProof<Number, Hash, DomainHeader: HeaderT, MmrHash> {
#[allow(clippy::large_enum_variant)]
#[derive(Debug, Decode, Encode, TypeInfo, PartialEq, Eq, Clone)]
pub enum FraudProofVariant<Number, Hash, MmrHash, DomainHeader: HeaderT> {
#[codec(index = 0)]
InvalidStateTransition(InvalidStateTransitionProof),
#[codec(index = 1)]
ValidBundle(ValidBundleProof<Number, Hash, DomainHeader>),
#[codec(index = 2)]
InvalidExtrinsicsRoot(InvalidExtrinsicsRootProof),
#[codec(index = 3)]
InvalidBundles(InvalidBundlesProof<Number, Hash, MmrHash, DomainHeader>),
#[codec(index = 4)]
InvalidDomainBlockHash(InvalidDomainBlockHashProof),
#[codec(index = 5)]
InvalidBlockFees(InvalidBlockFeesProof),
#[codec(index = 6)]
InvalidTransfers(InvalidTransfersProof),
// Dummy fraud proof only used in test and benchmark
//
// NOTE: the `Dummy` must be the last variant, because the `#[cfg(..)]` will apply to
// all the variants after it.
/// Dummy fraud proof only used in tests and benchmarks
#[cfg(any(feature = "std", feature = "runtime-benchmarks"))]
#[codec(index = 100)]
Dummy,
}

Expand Down

0 comments on commit 6650fd0

Please sign in to comment.