mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
eth/gasprice: sanity check ratio values (#31270)
This commit is contained in:
parent
8f68af5da0
commit
5ef815a6c9
1 changed files with 5 additions and 0 deletions
|
|
@ -83,6 +83,11 @@ func TestFeeHistory(t *testing.T) {
|
|||
if len(ratio) != c.expCount {
|
||||
t.Fatalf("Test case %d: gasUsedRatio array length mismatch, want %d, got %d", i, c.expCount, len(ratio))
|
||||
}
|
||||
for _, ratio := range ratio {
|
||||
if ratio > 1 {
|
||||
t.Fatalf("Test case %d: gasUsedRatio greater than 1, got %f", i, ratio)
|
||||
}
|
||||
}
|
||||
if err != c.expErr && !errors.Is(err, c.expErr) {
|
||||
t.Fatalf("Test case %d: error mismatch, want %v, got %v", i, c.expErr, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue