mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
Implement proper checking of inherents
This commit is contained in:
@@ -8,9 +8,11 @@ authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
thiserror = "1"
|
||||
|
||||
parity-scale-codec = { version = "3.2", features = ["derive"] }
|
||||
|
||||
async-trait = "0.1"
|
||||
tokio = { version = "1", features = ["macros", "sync", "time", "rt"] }
|
||||
|
||||
sp-runtime = { git = "https://github.com/serai-dex/substrate", optional = true }
|
||||
|
||||
@@ -2,6 +2,7 @@ use core::{hash::Hash, fmt::Debug};
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use thiserror::Error;
|
||||
|
||||
use parity_scale_codec::{Encode, Decode};
|
||||
|
||||
@@ -97,12 +98,14 @@ pub trait Weights: Send + Sync {
|
||||
}
|
||||
|
||||
/// Simplified error enum representing a block's validity.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Error, Encode, Decode)]
|
||||
pub enum BlockError {
|
||||
/// Malformed block which is wholly invalid.
|
||||
#[error("invalid block")]
|
||||
Fatal,
|
||||
/// Valid block by syntax, with semantics which may or may not be valid yet are locally
|
||||
/// considered invalid. If a block fails to validate with this, a slash will not be triggered.
|
||||
#[error("invalid block under local view")]
|
||||
Temporal,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user