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
8b12bcc0
Commit
8b12bcc0
authored
Aug 29, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpc: add receiptRoot to getBlock* responses
Fixes #1679
parent
6ec13e7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
parsing.go
rpc/api/parsing.go
+6
-0
No files found.
rpc/api/parsing.go
View file @
8b12bcc0
...
...
@@ -169,6 +169,7 @@ type BlockRes struct {
LogsBloom
*
hexdata
`json:"logsBloom"`
TransactionRoot
*
hexdata
`json:"transactionsRoot"`
StateRoot
*
hexdata
`json:"stateRoot"`
ReceiptRoot
*
hexdata
`json:"receiptRoot"`
Miner
*
hexdata
`json:"miner"`
Difficulty
*
hexnum
`json:"difficulty"`
TotalDifficulty
*
hexnum
`json:"totalDifficulty"`
...
...
@@ -192,6 +193,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
LogsBloom
*
hexdata
`json:"logsBloom"`
TransactionRoot
*
hexdata
`json:"transactionsRoot"`
StateRoot
*
hexdata
`json:"stateRoot"`
ReceiptRoot
*
hexdata
`json:"receiptRoot"`
Miner
*
hexdata
`json:"miner"`
Difficulty
*
hexnum
`json:"difficulty"`
TotalDifficulty
*
hexnum
`json:"totalDifficulty"`
...
...
@@ -212,6 +214,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext
.
LogsBloom
=
b
.
LogsBloom
ext
.
TransactionRoot
=
b
.
TransactionRoot
ext
.
StateRoot
=
b
.
StateRoot
ext
.
ReceiptRoot
=
b
.
ReceiptRoot
ext
.
Miner
=
b
.
Miner
ext
.
Difficulty
=
b
.
Difficulty
ext
.
TotalDifficulty
=
b
.
TotalDifficulty
...
...
@@ -236,6 +239,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
LogsBloom
*
hexdata
`json:"logsBloom"`
TransactionRoot
*
hexdata
`json:"transactionsRoot"`
StateRoot
*
hexdata
`json:"stateRoot"`
ReceiptRoot
*
hexdata
`json:"receiptRoot"`
Miner
*
hexdata
`json:"miner"`
Difficulty
*
hexnum
`json:"difficulty"`
TotalDifficulty
*
hexnum
`json:"totalDifficulty"`
...
...
@@ -256,6 +260,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext
.
LogsBloom
=
b
.
LogsBloom
ext
.
TransactionRoot
=
b
.
TransactionRoot
ext
.
StateRoot
=
b
.
StateRoot
ext
.
ReceiptRoot
=
b
.
ReceiptRoot
ext
.
Miner
=
b
.
Miner
ext
.
Difficulty
=
b
.
Difficulty
ext
.
TotalDifficulty
=
b
.
TotalDifficulty
...
...
@@ -291,6 +296,7 @@ func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
res
.
LogsBloom
=
newHexData
(
block
.
Bloom
())
res
.
TransactionRoot
=
newHexData
(
block
.
TxHash
())
res
.
StateRoot
=
newHexData
(
block
.
Root
())
res
.
ReceiptRoot
=
newHexData
(
block
.
ReceiptHash
())
res
.
Miner
=
newHexData
(
block
.
Coinbase
())
res
.
Difficulty
=
newHexNum
(
block
.
Difficulty
())
res
.
TotalDifficulty
=
newHexNum
(
block
.
Td
)
...
...
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