Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
fb8ea599
Unverified
Commit
fb8ea599
authored
Jul 29, 2021
by
Marius van der Wijden
Committed by
GitHub
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: update tests/testdata to v9.0.4 (london) (#23279)
parent
5c13012b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
18 deletions
+41
-18
block_test_util.go
tests/block_test_util.go
+9
-9
gen_btheader.go
tests/gen_btheader.go
+5
-5
state_test.go
tests/state_test.go
+8
-0
state_test_util.go
tests/state_test_util.go
+18
-3
testdata
tests/testdata
+1
-1
No files found.
tests/block_test_util.go
View file @
fb8ea599
...
...
@@ -85,17 +85,17 @@ type btHeader struct {
GasLimit
uint64
GasUsed
uint64
Timestamp
uint64
BaseFee
*
big
.
Int
BaseFee
PerGas
*
big
.
Int
}
type
btHeaderMarshaling
struct
{
ExtraData
hexutil
.
Bytes
Number
*
math
.
HexOrDecimal256
Difficulty
*
math
.
HexOrDecimal256
GasLimit
math
.
HexOrDecimal64
GasUsed
math
.
HexOrDecimal64
Timestamp
math
.
HexOrDecimal64
BaseFee
*
math
.
HexOrDecimal256
ExtraData
hexutil
.
Bytes
Number
*
math
.
HexOrDecimal256
Difficulty
*
math
.
HexOrDecimal256
GasLimit
math
.
HexOrDecimal64
GasUsed
math
.
HexOrDecimal64
Timestamp
math
.
HexOrDecimal64
BaseFee
PerGas
*
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
.
BaseFee
PerGas
,
}
}
...
...
tests/gen_btheader.go
View file @
fb8ea599
...
...
@@ -33,7 +33,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) {
GasLimit
math
.
HexOrDecimal64
GasUsed
math
.
HexOrDecimal64
Timestamp
math
.
HexOrDecimal64
BaseFee
*
math
.
HexOrDecimal256
BaseFee
PerGas
*
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
.
BaseFee
PerGas
=
(
*
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
BaseFee
PerGas
*
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
.
BaseFee
PerGas
!=
nil
{
b
.
BaseFee
PerGas
=
(
*
big
.
Int
)(
dec
.
BaseFeePerGas
)
}
return
nil
}
tests/state_test.go
View file @
fb8ea599
...
...
@@ -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
)
})
})
...
...
tests/state_test_util.go
View file @
fb8ea599
...
...
@@ -65,9 +65,11 @@ type stJSON struct {
}
type
stPostState
struct
{
Root
common
.
UnprefixedHash
`json:"hash"`
Logs
common
.
UnprefixedHash
`json:"logs"`
Indexes
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"`
Value
int
`json:"value"`
...
...
@@ -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
)
...
...
testdata
@
5d534e37
Subproject commit
fa0ab110f3f45d1f6786f978ea596a18ecbe8275
Subproject commit
5d534e37b80e9310e8c7751f805ca481a451123e
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment