Skip to content

Commit

Permalink
[skip audit] refine estimateQuota's error info (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyr338 authored and jerry-yu committed Nov 14, 2019
1 parent 0851226 commit 05f7aaf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cita-executor/core/src/libexecutor/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,12 @@ impl Commander for Executor {
// Try block_quota_limit first
let (run_ok, quota_used) = check_quota(max_quota);
let lower = if !run_ok {
trace!("estimate_gas failed with {}.", max_quota);
return Err(
format!("Requires quota higher than upper limit: {}", max_quota).to_owned(),
);
trace!("estimate_quota failed with {}.", max_quota);
return Err(format!(
"Requires quota higher than upper limit({}) or some internal errors",
max_quota
)
.to_owned());
} else {
quota_used
};
Expand All @@ -347,7 +349,7 @@ impl Commander for Executor {
while upper - lower > precision {
let mid = (lower + upper) / 2;
trace!(
"estimate_gas : lower {} .. mid {} .. upper {}",
"estimate_quota : lower {} .. mid {} .. upper {}",
lower,
mid,
upper
Expand Down

0 comments on commit 05f7aaf

Please sign in to comment.