Merge branch 'block_header_rpc' into on-demand-priority

This commit is contained in:
Robert Habermeier
2017-04-06 17:59:55 +02:00
47 changed files with 960 additions and 367 deletions

View File

@@ -119,7 +119,7 @@ impl Decodable for Entry {
}
fn cht_key(number: u64) -> String {
format!("canonical_{}", number)
format!("{:08x}_canonical", number)
}
fn era_key(number: u64) -> String {

View File

@@ -83,6 +83,13 @@ pub trait LightChainClient: Send + Sync {
/// Get the signing network ID.
fn signing_network_id(&self) -> Option<u64>;
/// Get environment info for execution at a given block.
/// Fails if that block's header is not stored.
fn env_info(&self, id: BlockId) -> Option<EnvInfo>;
/// Get a handle to the consensus engine.
fn engine(&self) -> &Arc<Engine>;
/// Query whether a block is known.
fn is_known(&self, hash: &H256) -> bool;
@@ -348,6 +355,14 @@ impl LightChainClient for Client {
Client::signing_network_id(self)
}
fn env_info(&self, id: BlockId) -> Option<EnvInfo> {
Client::env_info(self, id)
}
fn engine(&self) -> &Arc<Engine> {
Client::engine(self)
}
fn is_known(&self, hash: &H256) -> bool {
self.status(hash) == BlockStatus::InChain
}

View File

@@ -509,6 +509,9 @@ impl TransactionProof {
pub fn check_response(&self, _: &Mutex<::cache::Cache>, state_items: &[DBValue]) -> Result<super::ExecutionResult, Error> {
let root = self.header.state_root();
let mut env_info = self.env_info.clone();
env_info.gas_limit = self.tx.gas.clone();
let proved_execution = state::check_proof(
state_items,
root,