good morning!!!!

Skip to content
Snippets Groups Projects
Commit 9dc23ce2 authored by Felix Lange's avatar Felix Lange
Browse files

Merge pull request #1742 from fjl/rpc-receipt-root

rpc: add receiptRoot to getBlock* responses
parents 1801748c 8b12bcc0
No related branches found
No related tags found
No related merge requests found
...@@ -169,6 +169,7 @@ type BlockRes struct { ...@@ -169,6 +169,7 @@ type BlockRes struct {
LogsBloom *hexdata `json:"logsBloom"` LogsBloom *hexdata `json:"logsBloom"`
TransactionRoot *hexdata `json:"transactionsRoot"` TransactionRoot *hexdata `json:"transactionsRoot"`
StateRoot *hexdata `json:"stateRoot"` StateRoot *hexdata `json:"stateRoot"`
ReceiptRoot *hexdata `json:"receiptRoot"`
Miner *hexdata `json:"miner"` Miner *hexdata `json:"miner"`
Difficulty *hexnum `json:"difficulty"` Difficulty *hexnum `json:"difficulty"`
TotalDifficulty *hexnum `json:"totalDifficulty"` TotalDifficulty *hexnum `json:"totalDifficulty"`
...@@ -192,6 +193,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) { ...@@ -192,6 +193,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
LogsBloom *hexdata `json:"logsBloom"` LogsBloom *hexdata `json:"logsBloom"`
TransactionRoot *hexdata `json:"transactionsRoot"` TransactionRoot *hexdata `json:"transactionsRoot"`
StateRoot *hexdata `json:"stateRoot"` StateRoot *hexdata `json:"stateRoot"`
ReceiptRoot *hexdata `json:"receiptRoot"`
Miner *hexdata `json:"miner"` Miner *hexdata `json:"miner"`
Difficulty *hexnum `json:"difficulty"` Difficulty *hexnum `json:"difficulty"`
TotalDifficulty *hexnum `json:"totalDifficulty"` TotalDifficulty *hexnum `json:"totalDifficulty"`
...@@ -212,6 +214,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) { ...@@ -212,6 +214,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext.LogsBloom = b.LogsBloom ext.LogsBloom = b.LogsBloom
ext.TransactionRoot = b.TransactionRoot ext.TransactionRoot = b.TransactionRoot
ext.StateRoot = b.StateRoot ext.StateRoot = b.StateRoot
ext.ReceiptRoot = b.ReceiptRoot
ext.Miner = b.Miner ext.Miner = b.Miner
ext.Difficulty = b.Difficulty ext.Difficulty = b.Difficulty
ext.TotalDifficulty = b.TotalDifficulty ext.TotalDifficulty = b.TotalDifficulty
...@@ -236,6 +239,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) { ...@@ -236,6 +239,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
LogsBloom *hexdata `json:"logsBloom"` LogsBloom *hexdata `json:"logsBloom"`
TransactionRoot *hexdata `json:"transactionsRoot"` TransactionRoot *hexdata `json:"transactionsRoot"`
StateRoot *hexdata `json:"stateRoot"` StateRoot *hexdata `json:"stateRoot"`
ReceiptRoot *hexdata `json:"receiptRoot"`
Miner *hexdata `json:"miner"` Miner *hexdata `json:"miner"`
Difficulty *hexnum `json:"difficulty"` Difficulty *hexnum `json:"difficulty"`
TotalDifficulty *hexnum `json:"totalDifficulty"` TotalDifficulty *hexnum `json:"totalDifficulty"`
...@@ -256,6 +260,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) { ...@@ -256,6 +260,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext.LogsBloom = b.LogsBloom ext.LogsBloom = b.LogsBloom
ext.TransactionRoot = b.TransactionRoot ext.TransactionRoot = b.TransactionRoot
ext.StateRoot = b.StateRoot ext.StateRoot = b.StateRoot
ext.ReceiptRoot = b.ReceiptRoot
ext.Miner = b.Miner ext.Miner = b.Miner
ext.Difficulty = b.Difficulty ext.Difficulty = b.Difficulty
ext.TotalDifficulty = b.TotalDifficulty ext.TotalDifficulty = b.TotalDifficulty
...@@ -291,6 +296,7 @@ func NewBlockRes(block *types.Block, fullTx bool) *BlockRes { ...@@ -291,6 +296,7 @@ func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
res.LogsBloom = newHexData(block.Bloom()) res.LogsBloom = newHexData(block.Bloom())
res.TransactionRoot = newHexData(block.TxHash()) res.TransactionRoot = newHexData(block.TxHash())
res.StateRoot = newHexData(block.Root()) res.StateRoot = newHexData(block.Root())
res.ReceiptRoot = newHexData(block.ReceiptHash())
res.Miner = newHexData(block.Coinbase()) res.Miner = newHexData(block.Coinbase())
res.Difficulty = newHexNum(block.Difficulty()) res.Difficulty = newHexNum(block.Difficulty())
res.TotalDifficulty = newHexNum(block.Td) res.TotalDifficulty = newHexNum(block.Td)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment