mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 07:53:47 +00:00
eth/gasprice: sanity check ratio values
This commit is contained in:
parent
2585776aab
commit
9c70995cf3
1 changed files with 10 additions and 0 deletions
|
|
@ -84,9 +84,19 @@ func TestFeeHistory(t *testing.T) {
|
||||||
if len(ratio) != c.expCount {
|
if len(ratio) != c.expCount {
|
||||||
t.Fatalf("Test case %d: gasUsedRatio array length mismatch, want %d, got %d", i, c.expCount, len(ratio))
|
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 len(blobRatio) != c.expCount {
|
if len(blobRatio) != c.expCount {
|
||||||
t.Fatalf("Test case %d: blobGasUsedRatio array length mismatch, want %d, got %d", i, c.expCount, len(blobRatio))
|
t.Fatalf("Test case %d: blobGasUsedRatio array length mismatch, want %d, got %d", i, c.expCount, len(blobRatio))
|
||||||
}
|
}
|
||||||
|
for _, ratio := range blobRatio {
|
||||||
|
if ratio > 1 {
|
||||||
|
t.Fatalf("Test case %d: blobGasUsedRatio greater than 1, got %f", i, ratio)
|
||||||
|
}
|
||||||
|
}
|
||||||
if len(blobBaseFee) != len(baseFee) {
|
if len(blobBaseFee) != len(baseFee) {
|
||||||
t.Fatalf("Test case %d: blobBaseFee array length mismatch, want %d, got %d", i, len(baseFee), len(blobBaseFee))
|
t.Fatalf("Test case %d: blobBaseFee array length mismatch, want %d, got %d", i, len(baseFee), len(blobBaseFee))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue