mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
consensus/misc/eip4844: update test
This commit is contained in:
parent
39f352a667
commit
9d40d522ab
1 changed files with 4 additions and 11 deletions
|
|
@ -137,17 +137,11 @@ func TestCalcExcessBlobGasEIP7918(t *testing.T) {
|
||||||
cfg.BlobScheduleConfig.Osaka = &pragueSchedule
|
cfg.BlobScheduleConfig.Osaka = &pragueSchedule
|
||||||
|
|
||||||
var (
|
var (
|
||||||
targetBlobs = targetBlobsPerBlock(cfg, *cfg.CancunTime)
|
targetBlobs = targetBlobsPerBlock(cfg, *cfg.CancunTime)
|
||||||
blobGasPerBlob = uint64(params.BlobTxBlobGasPerBlob)
|
blobGasTarget = uint64(targetBlobs) * params.BlobTxBlobGasPerBlob
|
||||||
blobGasTarget = uint64(targetBlobs) * blobGasPerBlob
|
|
||||||
)
|
)
|
||||||
|
makeHeader := func(parentExcess, parentBaseFee uint64, blobsUsed int) *types.Header {
|
||||||
makeHeader := func(
|
blobGasUsed := uint64(blobsUsed) * params.BlobTxBlobGasPerBlob
|
||||||
parentExcess uint64,
|
|
||||||
parentBaseFee uint64,
|
|
||||||
blobsUsed int,
|
|
||||||
) *types.Header {
|
|
||||||
blobGasUsed := uint64(blobsUsed) * blobGasPerBlob
|
|
||||||
return &types.Header{
|
return &types.Header{
|
||||||
BaseFee: big.NewInt(int64(parentBaseFee)),
|
BaseFee: big.NewInt(int64(parentBaseFee)),
|
||||||
ExcessBlobGas: &parentExcess,
|
ExcessBlobGas: &parentExcess,
|
||||||
|
|
@ -171,7 +165,6 @@ func TestCalcExcessBlobGasEIP7918(t *testing.T) {
|
||||||
wantExcessGas: 0,
|
wantExcessGas: 0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
got := CalcExcessBlobGas(cfg, tc.header, *cfg.CancunTime)
|
got := CalcExcessBlobGas(cfg, tc.header, *cfg.CancunTime)
|
||||||
if got != tc.wantExcessGas {
|
if got != tc.wantExcessGas {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue