Skip to content

Commit 6e8ff57

Browse files
committed
Block nonce as data
1 parent 93f832a commit 6e8ff57

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎rpc/responses.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type BlockRes struct {
1111
BlockNumber *hexnum `json:"number"`
1212
BlockHash *hexdata `json:"hash"`
1313
ParentHash *hexdata `json:"parentHash"`
14-
Nonce *hexnum `json:"nonce"`
14+
Nonce *hexdata `json:"nonce"`
1515
Sha3Uncles *hexdata `json:"sha3Uncles"`
1616
LogsBloom *hexdata `json:"logsBloom"`
1717
TransactionRoot *hexdata `json:"transactionRoot"`
@@ -41,7 +41,7 @@ func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
4141
res.BlockNumber = newHexNum(block.Number())
4242
res.BlockHash = newHexData(block.Hash())
4343
res.ParentHash = newHexData(block.ParentHash())
44-
res.Nonce = newHexNum(block.Header().Nonce)
44+
res.Nonce = newHexData(block.Header().Nonce)
4545
res.Sha3Uncles = newHexData(block.Header().UncleHash)
4646
res.LogsBloom = newHexData(block.Bloom())
4747
res.TransactionRoot = newHexData(block.Header().TxHash)

‎rpc/responses_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestNewBlockRes(t *testing.T) {
3434
"number": reNum,
3535
"hash": reHash,
3636
"parentHash": reHash,
37-
"nonce": reNum,
37+
"nonce": reData,
3838
"sha3Uncles": reHash,
3939
"logsBloom": reData,
4040
"transactionRoot": reHash,

0 commit comments

Comments
 (0)