Merge branch 'master' into util_error_chain
This commit is contained in:
@@ -44,7 +44,7 @@ use self::epoch::PendingTransition;
|
||||
use account_provider::AccountProvider;
|
||||
use block::ExecutedBlock;
|
||||
use builtin::Builtin;
|
||||
use client::EngineClient;
|
||||
use client::Client;
|
||||
use vm::{EnvInfo, LastHashes, Schedule, CreateContractAddress};
|
||||
use error::Error;
|
||||
use header::{Header, BlockNumber};
|
||||
@@ -124,22 +124,12 @@ pub type Headers<'a> = Fn(H256) -> Option<Header> + 'a;
|
||||
/// Type alias for a function we can query pending transitions by block hash through.
|
||||
pub type PendingTransitionStore<'a> = Fn(H256) -> Option<PendingTransition> + 'a;
|
||||
|
||||
/// Proof dependent on state.
|
||||
pub trait StateDependentProof: Send + Sync {
|
||||
/// Generate a proof, given the state.
|
||||
fn generate_proof(&self, caller: &Call) -> Result<Vec<u8>, String>;
|
||||
/// Check a proof generated elsewhere (potentially by a peer).
|
||||
// `engine` needed to check state proofs, while really this should
|
||||
// just be state machine params.
|
||||
fn check_proof(&self, engine: &Engine, proof: &[u8]) -> Result<(), String>;
|
||||
}
|
||||
|
||||
/// Proof generated on epoch change.
|
||||
pub enum Proof {
|
||||
/// Known proof (extracted from signal)
|
||||
/// Known proof (exctracted from signal)
|
||||
Known(Vec<u8>),
|
||||
/// State dependent proof.
|
||||
WithState(Arc<StateDependentProof>),
|
||||
/// Extract proof from caller.
|
||||
WithState(Box<Fn(&Call) -> Result<Vec<u8>, String>>),
|
||||
}
|
||||
|
||||
/// Generated epoch verifier.
|
||||
@@ -371,7 +361,7 @@ pub trait Engine : Sync + Send {
|
||||
fn sign(&self, _hash: H256) -> Result<Signature, Error> { unimplemented!() }
|
||||
|
||||
/// Add Client which can be used for sealing, querying the state and sending messages.
|
||||
fn register_client(&self, _client: Weak<EngineClient>) {}
|
||||
fn register_client(&self, _client: Weak<Client>) {}
|
||||
|
||||
/// Trigger next step of the consensus engine.
|
||||
fn step(&self) {}
|
||||
|
||||
Reference in New Issue
Block a user