Trait ethcore::verification::queue::kind::Kind
[−]
[src]
pub trait Kind: 'static + Sized + Send + Sync { type Input: Sized + Send + BlockLike + HeapSizeOf; type Unverified: Sized + Send + BlockLike + HeapSizeOf; type Verified: Sized + Send + BlockLike + HeapSizeOf; fn create(
input: Self::Input,
engine: &EthEngine
) -> Result<Self::Unverified, Error>; fn verify(
unverified: Self::Unverified,
engine: &EthEngine,
check_seal: bool
) -> Result<Self::Verified, Error>; }
Defines transitions between stages of verification.
It starts with a fallible transformation from an "input" into the unverified item. This consists of quick, simply done checks as well as extracting particular data.
Then, there is a verify
function which performs more expensive checks and
produces the verified output.
For correctness, the hashes produced by each stage of the pipeline should be consistent.
Associated Types
type Input: Sized + Send + BlockLike + HeapSizeOf
The first stage: completely unverified.
type Unverified: Sized + Send + BlockLike + HeapSizeOf
The second stage: partially verified.
type Verified: Sized + Send + BlockLike + HeapSizeOf
The third stage: completely verified.
Required Methods
fn create(
input: Self::Input,
engine: &EthEngine
) -> Result<Self::Unverified, Error>
input: Self::Input,
engine: &EthEngine
) -> Result<Self::Unverified, Error>
Attempt to create the Unverified
item from the input.
fn verify(
unverified: Self::Unverified,
engine: &EthEngine,
check_seal: bool
) -> Result<Self::Verified, Error>
unverified: Self::Unverified,
engine: &EthEngine,
check_seal: bool
) -> Result<Self::Verified, Error>
Attempt to verify the Unverified
item using the given engine.
Implementors
impl Kind for Blocks type Input = Unverified; type Unverified = Unverified; type Verified = PreverifiedBlock;
impl Kind for Headers type Input = Header; type Unverified = Header; type Verified = Header;