fix call bug
This commit is contained in:
parent
4cf62e816e
commit
7c541117b3
@ -880,7 +880,8 @@ impl snapshot::DatabaseRestore for Client {
|
|||||||
|
|
||||||
impl BlockChainClient for Client {
|
impl BlockChainClient for Client {
|
||||||
fn call(&self, t: &SignedTransaction, block: BlockId, analytics: CallAnalytics) -> Result<Executed, CallError> {
|
fn call(&self, t: &SignedTransaction, block: BlockId, analytics: CallAnalytics) -> Result<Executed, CallError> {
|
||||||
let env_info = self.env_info(block).ok_or(CallError::StatePruned)?;
|
let mut env_info = self.env_info(block).ok_or(CallError::StatePruned)?;
|
||||||
|
env_info.gas_limit = U256::max_value();
|
||||||
|
|
||||||
// that's just a copy of the state.
|
// that's just a copy of the state.
|
||||||
let mut state = self.state_at(block).ok_or(CallError::StatePruned)?;
|
let mut state = self.state_at(block).ok_or(CallError::StatePruned)?;
|
||||||
@ -963,13 +964,13 @@ impl BlockChainClient for Client {
|
|||||||
{
|
{
|
||||||
while upper - lower > 1.into() {
|
while upper - lower > 1.into() {
|
||||||
let mid = (lower + upper) / 2.into();
|
let mid = (lower + upper) / 2.into();
|
||||||
trace!(target: "estimate_gas", "{} .. {} .. {}", lower, mid, upper);
|
trace!(target: "binary_chop", "{} .. {} .. {}", lower, mid, upper);
|
||||||
let c = cond(mid)?;
|
let c = cond(mid)?;
|
||||||
match c {
|
match c {
|
||||||
true => upper = mid,
|
true => upper = mid,
|
||||||
false => lower = mid,
|
false => lower = mid,
|
||||||
};
|
};
|
||||||
trace!(target: "estimate_gas", "{} => {} .. {}", c, lower, upper);
|
trace!(target: "binary_chop", "{} => {} .. {}", c, lower, upper);
|
||||||
}
|
}
|
||||||
Ok(upper)
|
Ok(upper)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user