forked from cerc-io/plugeth
tests: update tests/testdata to v9.0.4 (london) (#23279)
This commit is contained in:
parent
5c13012b56
commit
fb8ea5993f
@ -85,7 +85,7 @@ type btHeader struct {
|
||||
GasLimit uint64
|
||||
GasUsed uint64
|
||||
Timestamp uint64
|
||||
BaseFee *big.Int
|
||||
BaseFeePerGas *big.Int
|
||||
}
|
||||
|
||||
type btHeaderMarshaling struct {
|
||||
@ -95,7 +95,7 @@ type btHeaderMarshaling struct {
|
||||
GasLimit math.HexOrDecimal64
|
||||
GasUsed math.HexOrDecimal64
|
||||
Timestamp math.HexOrDecimal64
|
||||
BaseFee *math.HexOrDecimal256
|
||||
BaseFeePerGas *math.HexOrDecimal256
|
||||
}
|
||||
|
||||
func (t *BlockTest) Run(snapshotter bool) error {
|
||||
@ -170,7 +170,7 @@ func (t *BlockTest) genesis(config *params.ChainConfig) *core.Genesis {
|
||||
Mixhash: t.json.Genesis.MixHash,
|
||||
Coinbase: t.json.Genesis.Coinbase,
|
||||
Alloc: t.json.Pre,
|
||||
BaseFee: t.json.Genesis.BaseFee,
|
||||
BaseFee: t.json.Genesis.BaseFeePerGas,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) {
|
||||
GasLimit math.HexOrDecimal64
|
||||
GasUsed math.HexOrDecimal64
|
||||
Timestamp math.HexOrDecimal64
|
||||
BaseFee *math.HexOrDecimal256
|
||||
BaseFeePerGas *math.HexOrDecimal256
|
||||
}
|
||||
var enc btHeader
|
||||
enc.Bloom = b.Bloom
|
||||
@ -52,7 +52,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) {
|
||||
enc.GasLimit = math.HexOrDecimal64(b.GasLimit)
|
||||
enc.GasUsed = math.HexOrDecimal64(b.GasUsed)
|
||||
enc.Timestamp = math.HexOrDecimal64(b.Timestamp)
|
||||
enc.BaseFee = (*math.HexOrDecimal256)(b.BaseFee)
|
||||
enc.BaseFeePerGas = (*math.HexOrDecimal256)(b.BaseFeePerGas)
|
||||
return json.Marshal(&enc)
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ func (b *btHeader) UnmarshalJSON(input []byte) error {
|
||||
GasLimit *math.HexOrDecimal64
|
||||
GasUsed *math.HexOrDecimal64
|
||||
Timestamp *math.HexOrDecimal64
|
||||
BaseFee *math.HexOrDecimal256
|
||||
BaseFeePerGas *math.HexOrDecimal256
|
||||
}
|
||||
var dec btHeader
|
||||
if err := json.Unmarshal(input, &dec); err != nil {
|
||||
@ -129,8 +129,8 @@ func (b *btHeader) UnmarshalJSON(input []byte) error {
|
||||
if dec.Timestamp != nil {
|
||||
b.Timestamp = uint64(*dec.Timestamp)
|
||||
}
|
||||
if dec.BaseFee != nil {
|
||||
b.BaseFee = (*big.Int)(dec.BaseFee)
|
||||
if dec.BaseFeePerGas != nil {
|
||||
b.BaseFeePerGas = (*big.Int)(dec.BaseFeePerGas)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -68,6 +68,10 @@ func TestState(t *testing.T) {
|
||||
t.Run(key+"/trie", func(t *testing.T) {
|
||||
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
|
||||
_, _, err := test.Run(subtest, vmconfig, false)
|
||||
if err != nil && len(test.json.Post[subtest.Fork][subtest.Index].ExpectException) > 0 {
|
||||
// Ignore expected errors (TODO MariusVanDerWijden check error string)
|
||||
return nil
|
||||
}
|
||||
return st.checkFailure(t, err)
|
||||
})
|
||||
})
|
||||
@ -79,6 +83,10 @@ func TestState(t *testing.T) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err != nil && len(test.json.Post[subtest.Fork][subtest.Index].ExpectException) > 0 {
|
||||
// Ignore expected errors (TODO MariusVanDerWijden check error string)
|
||||
return nil
|
||||
}
|
||||
return st.checkFailure(t, err)
|
||||
})
|
||||
})
|
||||
|
@ -67,6 +67,8 @@ type stJSON struct {
|
||||
type stPostState struct {
|
||||
Root common.UnprefixedHash `json:"hash"`
|
||||
Logs common.UnprefixedHash `json:"logs"`
|
||||
TxBytes hexutil.Bytes `json:"txbytes"`
|
||||
ExpectException string `json:"expectException"`
|
||||
Indexes struct {
|
||||
Data int `json:"data"`
|
||||
Gas int `json:"gas"`
|
||||
@ -198,6 +200,19 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
|
||||
return nil, nil, common.Hash{}, err
|
||||
}
|
||||
|
||||
// Try to recover tx with current signer
|
||||
if len(post.TxBytes) != 0 {
|
||||
var ttx types.Transaction
|
||||
err := ttx.UnmarshalBinary(post.TxBytes)
|
||||
if err != nil {
|
||||
return nil, nil, common.Hash{}, err
|
||||
}
|
||||
|
||||
if _, err := types.Sender(types.LatestSigner(config), &ttx); err != nil {
|
||||
return nil, nil, common.Hash{}, err
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare the EVM.
|
||||
txContext := core.NewEVMTxContext(msg)
|
||||
context := core.NewEVMBlockContext(block.Header(), nil, &t.json.Env.Coinbase)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit fa0ab110f3f45d1f6786f978ea596a18ecbe8275
|
||||
Subproject commit 5d534e37b80e9310e8c7751f805ca481a451123e
|
Loading…
Reference in New Issue
Block a user