diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-10-15 22:07:19 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2015-12-14 23:34:05 +0800 |
commit | eae81465c1c815c317cd30e4de6bdf4d59df2340 (patch) | |
tree | b6f4b7787967a58416171adb79fd12ac29d89577 /core/types | |
parent | 8db9d44ca9fb6baf406256cae491c475de2f4989 (diff) | |
download | dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.gz dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.bz2 dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.lz dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.xz dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.zst dexon-eae81465c1c815c317cd30e4de6bdf4d59df2340.zip |
rpc: new RPC implementation with pub/sub support
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/block.go | 4 | ||||
-rw-r--r-- | core/types/bloom9.go | 4 |
2 files changed, 8 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 diff --git a/core/types/bloom9.go b/core/types/bloom9.go index cd90fd971..372045ab2 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -69,6 +69,10 @@ func (b Bloom) TestBytes(test []byte) bool { return b.Test(common.BytesToBig(test)) } +func (b Bloom) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%#x"`, b.Bytes())), nil +} + func CreateBloom(receipts Receipts) Bloom { bin := new(big.Int) for _, receipt := range receipts { |