diff options
Diffstat (limited to 'core/types/block.go')
-rw-r--r-- | core/types/block.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/types/block.go b/core/types/block.go index 1d1cfa515..5536e0ea8 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -48,6 +48,10 @@ func (n BlockNonce) Uint64() uint64 { return binary.BigEndian.Uint64(n[:]) } +func (n BlockNonce) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"0x%x"`, n)), nil +} + type Header struct { ParentHash common.Hash // Hash to the previous block UncleHash common.Hash // Uncles of this block |