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
47359301
Commit
47359301
authored
7 years ago
by
Martin Holst Swende
Committed by
Felix Lange
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: blocknumber in genesis as hex (#14812)
parent
0ff35e17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
gen_genesis.go
core/gen_genesis.go
+4
-6
genesis.go
core/genesis.go
+1
-0
No files found.
core/gen_genesis.go
View file @
47359301
...
...
@@ -13,8 +13,6 @@ import (
"github.com/ethereum/go-ethereum/params"
)
var
_
=
(
*
genesisSpecMarshaling
)(
nil
)
func
(
g
Genesis
)
MarshalJSON
()
([]
byte
,
error
)
{
type
Genesis
struct
{
Config
*
params
.
ChainConfig
`json:"config"`
...
...
@@ -26,7 +24,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) {
Mixhash
common
.
Hash
`json:"mixHash"`
Coinbase
common
.
Address
`json:"coinbase"`
Alloc
map
[
common
.
UnprefixedAddress
]
GenesisAccount
`json:"alloc" gencodec:"required"`
Number
uint64
`json:"number"`
Number
math
.
HexOrDecimal64
`json:"number"`
GasUsed
math
.
HexOrDecimal64
`json:"gasUsed"`
ParentHash
common
.
Hash
`json:"parentHash"`
}
...
...
@@ -45,7 +43,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) {
enc
.
Alloc
[
common
.
UnprefixedAddress
(
k
)]
=
v
}
}
enc
.
Number
=
g
.
Number
enc
.
Number
=
math
.
HexOrDecimal64
(
g
.
Number
)
enc
.
GasUsed
=
math
.
HexOrDecimal64
(
g
.
GasUsed
)
enc
.
ParentHash
=
g
.
ParentHash
return
json
.
Marshal
(
&
enc
)
...
...
@@ -62,7 +60,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
Mixhash
*
common
.
Hash
`json:"mixHash"`
Coinbase
*
common
.
Address
`json:"coinbase"`
Alloc
map
[
common
.
UnprefixedAddress
]
GenesisAccount
`json:"alloc" gencodec:"required"`
Number
*
uint64
`json:"number"`
Number
*
math
.
HexOrDecimal64
`json:"number"`
GasUsed
*
math
.
HexOrDecimal64
`json:"gasUsed"`
ParentHash
*
common
.
Hash
`json:"parentHash"`
}
...
...
@@ -104,7 +102,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
g
.
Alloc
[
common
.
Address
(
k
)]
=
v
}
if
dec
.
Number
!=
nil
{
g
.
Number
=
*
dec
.
Number
g
.
Number
=
uint64
(
*
dec
.
Number
)
}
if
dec
.
GasUsed
!=
nil
{
g
.
GasUsed
=
uint64
(
*
dec
.
GasUsed
)
...
...
This diff is collapsed.
Click to expand it.
core/genesis.go
View file @
47359301
...
...
@@ -92,6 +92,7 @@ type genesisSpecMarshaling struct {
ExtraData
hexutil
.
Bytes
GasLimit
math
.
HexOrDecimal64
GasUsed
math
.
HexOrDecimal64
Number
math
.
HexOrDecimal64
Difficulty
*
math
.
HexOrDecimal256
Alloc
map
[
common
.
UnprefixedAddress
]
GenesisAccount
}
...
...
This diff is collapsed.
Click to expand it.
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