|
|
|
@ -353,6 +353,8 @@ func newRPCStakingTransaction(tx *types2.StakingTransaction, blockHash common.Ha |
|
|
|
|
// RPCBlock represents a block that will serialize to the RPC representation of a block
|
|
|
|
|
type RPCBlock struct { |
|
|
|
|
Number *hexutil.Big `json:"number"` |
|
|
|
|
ViewID *hexutil.Big `json:"viewID"` |
|
|
|
|
Epoch *hexutil.Big `json:"epoch"` |
|
|
|
|
Hash common.Hash `json:"hash"` |
|
|
|
|
ParentHash common.Hash `json:"parentHash"` |
|
|
|
|
Nonce types.BlockNonce `json:"nonce"` |
|
|
|
@ -382,6 +384,8 @@ func RPCMarshalBlock(b *types.Block, blockArgs BlockArgs) (map[string]interface{ |
|
|
|
|
head := b.Header() // copies the header once
|
|
|
|
|
fields := map[string]interface{}{ |
|
|
|
|
"number": (*hexutil.Big)(head.Number()), |
|
|
|
|
"viewID": (*hexutil.Big)(head.ViewID()), |
|
|
|
|
"epoch": (*hexutil.Big)(head.Epoch()), |
|
|
|
|
"hash": b.Hash(), |
|
|
|
|
"parentHash": head.ParentHash(), |
|
|
|
|
"nonce": 0, // Remove this because we don't have it in our header
|
|
|
|
|