tests: fixes

This commit is contained in:
Gary Rong 2026-07-06 11:28:28 +08:00
parent de63562dda
commit f465688357
3 changed files with 11 additions and 4 deletions

View file

@ -24,6 +24,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) {
Timestamp math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"`
BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"`
ExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas" gencodec:"optional"`
SlotNumber *math.HexOrDecimal64 `json:"slotNumber" gencodec:"optional"`
}
var enc stEnv
enc.Coinbase = common.UnprefixedAddress(s.Coinbase)
@ -34,6 +35,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) {
enc.Timestamp = math.HexOrDecimal64(s.Timestamp)
enc.BaseFee = (*math.HexOrDecimal256)(s.BaseFee)
enc.ExcessBlobGas = (*math.HexOrDecimal64)(s.ExcessBlobGas)
enc.SlotNumber = (*math.HexOrDecimal64)(s.SlotNumber)
return json.Marshal(&enc)
}
@ -48,6 +50,7 @@ func (s *stEnv) UnmarshalJSON(input []byte) error {
Timestamp *math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"`
BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"`
ExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas" gencodec:"optional"`
SlotNumber *math.HexOrDecimal64 `json:"slotNumber" gencodec:"optional"`
}
var dec stEnv
if err := json.Unmarshal(input, &dec); err != nil {
@ -81,5 +84,8 @@ func (s *stEnv) UnmarshalJSON(input []byte) error {
if dec.ExcessBlobGas != nil {
s.ExcessBlobGas = (*uint64)(dec.ExcessBlobGas)
}
if dec.SlotNumber != nil {
s.SlotNumber = (*uint64)(dec.SlotNumber)
}
return nil
}

View file

@ -97,10 +97,8 @@ func TestExecutionSpecState(t *testing.T) {
st := new(testMatcher)
// Broken tests
st.skipLoad(`RevertInCreateInInit`)
st.skipLoad(`InitCollisionParis`)
st.skipLoad(`dynamicAccountOverwriteEmpty_Paris`)
st.skipLoad(`create2collisionStorageParis`)
st.skipLoad(`.*eip7610_create_collision/initcollision/.*`)
st.skipLoad(`.*eip7610_create_collision/revert_in_create/.*`)
st.walk(t, executionSpecStateTestDir, func(t *testing.T, name string, test *StateTest) {
execStateTest(t, st, test)

View file

@ -95,6 +95,7 @@ type stEnv struct {
Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
BaseFee *big.Int `json:"currentBaseFee" gencodec:"optional"`
ExcessBlobGas *uint64 `json:"currentExcessBlobGas" gencodec:"optional"`
SlotNumber *uint64 `json:"slotNumber" gencodec:"optional"`
}
type stEnvMarshaling struct {
@ -106,6 +107,7 @@ type stEnvMarshaling struct {
Timestamp math.HexOrDecimal64
BaseFee *math.HexOrDecimal256
ExcessBlobGas *math.HexOrDecimal64
SlotNumber *math.HexOrDecimal64
}
//go:generate go run github.com/fjl/gencodec -type stTransaction -field-override stTransactionMarshaling -out gen_sttransaction.go
@ -378,6 +380,7 @@ func (t *StateTest) genesis(config *params.ChainConfig) *core.Genesis {
GasLimit: t.json.Env.GasLimit,
Number: t.json.Env.Number,
Timestamp: t.json.Env.Timestamp,
SlotNumber: t.json.Env.SlotNumber,
Alloc: t.json.Pre,
}
if t.json.Env.Random != nil {