mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
tests: fixes
This commit is contained in:
parent
de63562dda
commit
f465688357
3 changed files with 11 additions and 4 deletions
|
|
@ -24,6 +24,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) {
|
||||||
Timestamp math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"`
|
Timestamp math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"`
|
||||||
BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"`
|
BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"`
|
||||||
ExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas" gencodec:"optional"`
|
ExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas" gencodec:"optional"`
|
||||||
|
SlotNumber *math.HexOrDecimal64 `json:"slotNumber" gencodec:"optional"`
|
||||||
}
|
}
|
||||||
var enc stEnv
|
var enc stEnv
|
||||||
enc.Coinbase = common.UnprefixedAddress(s.Coinbase)
|
enc.Coinbase = common.UnprefixedAddress(s.Coinbase)
|
||||||
|
|
@ -34,6 +35,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) {
|
||||||
enc.Timestamp = math.HexOrDecimal64(s.Timestamp)
|
enc.Timestamp = math.HexOrDecimal64(s.Timestamp)
|
||||||
enc.BaseFee = (*math.HexOrDecimal256)(s.BaseFee)
|
enc.BaseFee = (*math.HexOrDecimal256)(s.BaseFee)
|
||||||
enc.ExcessBlobGas = (*math.HexOrDecimal64)(s.ExcessBlobGas)
|
enc.ExcessBlobGas = (*math.HexOrDecimal64)(s.ExcessBlobGas)
|
||||||
|
enc.SlotNumber = (*math.HexOrDecimal64)(s.SlotNumber)
|
||||||
return json.Marshal(&enc)
|
return json.Marshal(&enc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,6 +50,7 @@ func (s *stEnv) UnmarshalJSON(input []byte) error {
|
||||||
Timestamp *math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"`
|
Timestamp *math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"`
|
||||||
BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"`
|
BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"`
|
||||||
ExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas" gencodec:"optional"`
|
ExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas" gencodec:"optional"`
|
||||||
|
SlotNumber *math.HexOrDecimal64 `json:"slotNumber" gencodec:"optional"`
|
||||||
}
|
}
|
||||||
var dec stEnv
|
var dec stEnv
|
||||||
if err := json.Unmarshal(input, &dec); err != nil {
|
if err := json.Unmarshal(input, &dec); err != nil {
|
||||||
|
|
@ -81,5 +84,8 @@ func (s *stEnv) UnmarshalJSON(input []byte) error {
|
||||||
if dec.ExcessBlobGas != nil {
|
if dec.ExcessBlobGas != nil {
|
||||||
s.ExcessBlobGas = (*uint64)(dec.ExcessBlobGas)
|
s.ExcessBlobGas = (*uint64)(dec.ExcessBlobGas)
|
||||||
}
|
}
|
||||||
|
if dec.SlotNumber != nil {
|
||||||
|
s.SlotNumber = (*uint64)(dec.SlotNumber)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,8 @@ func TestExecutionSpecState(t *testing.T) {
|
||||||
st := new(testMatcher)
|
st := new(testMatcher)
|
||||||
|
|
||||||
// Broken tests
|
// Broken tests
|
||||||
st.skipLoad(`RevertInCreateInInit`)
|
st.skipLoad(`.*eip7610_create_collision/initcollision/.*`)
|
||||||
st.skipLoad(`InitCollisionParis`)
|
st.skipLoad(`.*eip7610_create_collision/revert_in_create/.*`)
|
||||||
st.skipLoad(`dynamicAccountOverwriteEmpty_Paris`)
|
|
||||||
st.skipLoad(`create2collisionStorageParis`)
|
|
||||||
|
|
||||||
st.walk(t, executionSpecStateTestDir, func(t *testing.T, name string, test *StateTest) {
|
st.walk(t, executionSpecStateTestDir, func(t *testing.T, name string, test *StateTest) {
|
||||||
execStateTest(t, st, test)
|
execStateTest(t, st, test)
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ type stEnv struct {
|
||||||
Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
|
Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
|
||||||
BaseFee *big.Int `json:"currentBaseFee" gencodec:"optional"`
|
BaseFee *big.Int `json:"currentBaseFee" gencodec:"optional"`
|
||||||
ExcessBlobGas *uint64 `json:"currentExcessBlobGas" gencodec:"optional"`
|
ExcessBlobGas *uint64 `json:"currentExcessBlobGas" gencodec:"optional"`
|
||||||
|
SlotNumber *uint64 `json:"slotNumber" gencodec:"optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type stEnvMarshaling struct {
|
type stEnvMarshaling struct {
|
||||||
|
|
@ -106,6 +107,7 @@ type stEnvMarshaling struct {
|
||||||
Timestamp math.HexOrDecimal64
|
Timestamp math.HexOrDecimal64
|
||||||
BaseFee *math.HexOrDecimal256
|
BaseFee *math.HexOrDecimal256
|
||||||
ExcessBlobGas *math.HexOrDecimal64
|
ExcessBlobGas *math.HexOrDecimal64
|
||||||
|
SlotNumber *math.HexOrDecimal64
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:generate go run github.com/fjl/gencodec -type stTransaction -field-override stTransactionMarshaling -out gen_sttransaction.go
|
//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,
|
GasLimit: t.json.Env.GasLimit,
|
||||||
Number: t.json.Env.Number,
|
Number: t.json.Env.Number,
|
||||||
Timestamp: t.json.Env.Timestamp,
|
Timestamp: t.json.Env.Timestamp,
|
||||||
|
SlotNumber: t.json.Env.SlotNumber,
|
||||||
Alloc: t.json.Pre,
|
Alloc: t.json.Pre,
|
||||||
}
|
}
|
||||||
if t.json.Env.Random != nil {
|
if t.json.Env.Random != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue