set gas limit before proving transactions

This commit is contained in:
Robert Habermeier 2017-04-05 11:57:29 +02:00
parent c3769b8874
commit e2dfea8c12
2 changed files with 7 additions and 3 deletions

View File

@ -243,12 +243,14 @@ impl TransactionProof {
pub fn check_response(&self, state_items: &[DBValue]) -> ProvedExecution {
let root = self.header.state_root();
let mut env_info = self.env_info.clone();
env_info.gas_limit = self.tx.gas.clone();
state::check_proof(
state_items,
root,
&self.tx,
&*self.engine,
&self.env_info,
&env_info,
)
}
}

View File

@ -1627,10 +1627,12 @@ impl ::client::ProvingBlockChainClient for Client {
}
fn prove_transaction(&self, transaction: SignedTransaction, id: BlockId) -> Option<Vec<DBValue>> {
let (state, env_info) = match (self.state_at(id), self.env_info(id)) {
let (state, mut env_info) = match (self.state_at(id), self.env_info(id)) {
(Some(s), Some(e)) => (s, e),
_ => return None,
};
env_info.gas_limit = transaction.gas.clone();
let mut jdb = self.state_db.lock().journal_db().boxed_clone();
let backend = state::backend::Proving::new(jdb.as_hashdb_mut());