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
ccf53dae
Unverified
Commit
ccf53dae
authored
Jun 14, 2021
by
Péter Szilágyi
Committed by
GitHub
Jun 14, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23013 from holiman/genesis_fix
core: make genesis parse baseFee correctly
parents
eff998ef
f763846e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
gen_genesis.go
core/gen_genesis.go
+4
-4
genesis.go
core/genesis.go
+1
-0
No files found.
core/gen_genesis.go
View file @
ccf53dae
...
...
@@ -30,7 +30,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) {
Number
math
.
HexOrDecimal64
`json:"number"`
GasUsed
math
.
HexOrDecimal64
`json:"gasUsed"`
ParentHash
common
.
Hash
`json:"parentHash"`
BaseFee
*
big
.
Int
`json:"baseFee"`
BaseFee
*
math
.
HexOrDecimal256
`json:"baseFee"`
}
var
enc
Genesis
enc
.
Config
=
g
.
Config
...
...
@@ -50,7 +50,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) {
enc
.
Number
=
math
.
HexOrDecimal64
(
g
.
Number
)
enc
.
GasUsed
=
math
.
HexOrDecimal64
(
g
.
GasUsed
)
enc
.
ParentHash
=
g
.
ParentHash
enc
.
BaseFee
=
g
.
BaseFee
enc
.
BaseFee
=
(
*
math
.
HexOrDecimal256
)(
g
.
BaseFee
)
return
json
.
Marshal
(
&
enc
)
}
...
...
@@ -69,7 +69,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
Number
*
math
.
HexOrDecimal64
`json:"number"`
GasUsed
*
math
.
HexOrDecimal64
`json:"gasUsed"`
ParentHash
*
common
.
Hash
`json:"parentHash"`
BaseFee
*
big
.
Int
`json:"baseFee"`
BaseFee
*
math
.
HexOrDecimal256
`json:"baseFee"`
}
var
dec
Genesis
if
err
:=
json
.
Unmarshal
(
input
,
&
dec
);
err
!=
nil
{
...
...
@@ -118,7 +118,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
g
.
ParentHash
=
*
dec
.
ParentHash
}
if
dec
.
BaseFee
!=
nil
{
g
.
BaseFee
=
dec
.
BaseFee
g
.
BaseFee
=
(
*
big
.
Int
)(
dec
.
BaseFee
)
}
return
nil
}
core/genesis.go
View file @
ccf53dae
...
...
@@ -98,6 +98,7 @@ type genesisSpecMarshaling struct {
GasUsed
math
.
HexOrDecimal64
Number
math
.
HexOrDecimal64
Difficulty
*
math
.
HexOrDecimal256
BaseFee
*
math
.
HexOrDecimal256
Alloc
map
[
common
.
UnprefixedAddress
]
GenesisAccount
}
...
...
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