mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
all: review nits
This commit is contained in:
parent
4ed3eb8a7e
commit
0b3e4b9062
2 changed files with 6 additions and 8 deletions
|
|
@ -57,15 +57,12 @@ func TestCalcExcessBlobGas(t *testing.T) {
|
||||||
}
|
}
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
blobGasUsed := uint64(tt.blobs) * params.BlobTxBlobGasPerBlob
|
blobGasUsed := uint64(tt.blobs) * params.BlobTxBlobGasPerBlob
|
||||||
head := &types.Header{
|
header := &types.Header{
|
||||||
Time: *config.CancunTime,
|
Time: *config.CancunTime,
|
||||||
}
|
|
||||||
parent := &types.Header{
|
|
||||||
Time: *config.CancunTime + 12,
|
|
||||||
ExcessBlobGas: &tt.excess,
|
ExcessBlobGas: &tt.excess,
|
||||||
BlobGasUsed: &blobGasUsed,
|
BlobGasUsed: &blobGasUsed,
|
||||||
}
|
}
|
||||||
result := CalcExcessBlobGas(config, parent, head)
|
result := CalcExcessBlobGas(config, header, header)
|
||||||
if result != tt.want {
|
if result != tt.want {
|
||||||
t.Errorf("test %d: excess blob gas mismatch: have %v, want %v", i, result, tt.want)
|
t.Errorf("test %d: excess blob gas mismatch: have %v, want %v", i, result, tt.want)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,9 @@ func (c *callContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
if genesis.ExcessBlobGas != nil && genesis.BlobGasUsed != nil {
|
if genesis.ExcessBlobGas != nil && genesis.BlobGasUsed != nil {
|
||||||
excess := eip4844.CalcExcessBlobGas(genesis.Config, genesis.ToBlock().Header(), genesis.ToBlock().Header())
|
header := &types.Header{Number: genesis.Config.LondonBlock, Time: *genesis.Config.CancunTime}
|
||||||
header := &types.Header{ExcessBlobGas: &excess, 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)
|
context.BlobBaseFee = eip4844.CalcBlobFee(genesis.Config, header)
|
||||||
}
|
}
|
||||||
return context
|
return context
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue