eth/gasestimator: allow slight estimation error in favor of less iterations (#28618)
* eth/gasestimator: early exit for plain transfer and error allowance * core, eth/gasestimator: hard guess at a possible required gas * internal/ethapi: update estimation tests with the error ratio * eth/gasestimator: I hate you linter * graphql: fix gas estimation test --------- Co-authored-by: Oren <orenyomtov@users.noreply.github.com>
This commit is contained in:
@@ -735,7 +735,7 @@ func TestEstimateGas(t *testing.T) {
|
||||
t.Errorf("test %d: want no error, have %v", i, err)
|
||||
continue
|
||||
}
|
||||
if uint64(result) != tc.want {
|
||||
if float64(result) > float64(tc.want)*(1+estimateGasErrorRatio) {
|
||||
t.Errorf("test %d, result mismatch, have\n%v\n, want\n%v\n", i, uint64(result), tc.want)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user