all: review nits

This commit is contained in:
lightclient 2025-02-04 11:23:32 -07:00
parent 4ed3eb8a7e
commit 0b3e4b9062
No known key found for this signature in database
GPG key ID: 657913021EF45A6A
2 changed files with 6 additions and 8 deletions

View file

@ -57,15 +57,12 @@ func TestCalcExcessBlobGas(t *testing.T) {
}
for i, tt := range tests {
blobGasUsed := uint64(tt.blobs) * params.BlobTxBlobGasPerBlob
head := &types.Header{
Time: *config.CancunTime,
}
parent := &types.Header{
Time: *config.CancunTime + 12,
header := &types.Header{
Time: *config.CancunTime,
ExcessBlobGas: &tt.excess,
BlobGasUsed: &blobGasUsed,
}
result := CalcExcessBlobGas(config, parent, head)
result := CalcExcessBlobGas(config, header, header)
if result != tt.want {
t.Errorf("test %d: excess blob gas mismatch: have %v, want %v", i, result, tt.want)
}

View file

@ -54,8 +54,9 @@ func (c *callContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
}
if genesis.ExcessBlobGas != nil && genesis.BlobGasUsed != nil {
excess := eip4844.CalcExcessBlobGas(genesis.Config, genesis.ToBlock().Header(), genesis.ToBlock().Header())
header := &types.Header{ExcessBlobGas: &excess, Number: genesis.Config.LondonBlock, Time: *genesis.Config.CancunTime}
header := &types.Header{Number: genesis.Config.LondonBlock, Time: *genesis.Config.CancunTime}
excess := eip4844.CalcExcessBlobGas(genesis.Config, header, genesis.ToBlock().Header())
header.ExcessBlobGas = &excess
context.BlobBaseFee = eip4844.CalcBlobFee(genesis.Config, header)
}
return context