aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-26 10:28:42 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:17 +0800
commit18e57b078ef9214b3abc27bc0980b0e7eaddc8f4 (patch)
tree70788b265624666d19bb8b51d4e49180d9943670 /core
parentf5e29152b2b8113f3c205c197952d826ccc729ae (diff)
downloadgo-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.tar
go-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.tar.gz
go-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.tar.bz2
go-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.tar.lz
go-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.tar.xz
go-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.tar.zst
go-tangerine-18e57b078ef9214b3abc27bc0980b0e7eaddc8f4.zip
dex: return round in get block rpc output
Diffstat (limited to 'core')
-rw-r--r--core/types/block.go1
-rw-r--r--core/types/gen_header_json.go8
2 files changed, 5 insertions, 4 deletions
diff --git a/core/types/block.go b/core/types/block.go
index 24750ba97..9e42a776a 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -105,6 +105,7 @@ type headerMarshaling struct {
Time hexutil.Uint64
Extra hexutil.Bytes
Randomness hexutil.Bytes
+ Round hexutil.Uint64
DexconMeta hexutil.Bytes
Hash common.Hash `json:"hash"` // adds call to Hash() in MarshalJSON
}
diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go
index dd2ca136e..31796bf5b 100644
--- a/core/types/gen_header_json.go
+++ b/core/types/gen_header_json.go
@@ -34,7 +34,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
Nonce BlockNonce `json:"nonce"`
Randomness hexutil.Bytes `json:"randomness" gencodec:"required"`
Position types.Position `json:"position" gencodec:"required"`
- Round uint64 `json:"round" gencodec:"required"`
+ Round hexutil.Uint64 `json:"round" gencodec:"required"`
DexconMeta hexutil.Bytes `json:"dexconMeta" gencodec:"required"`
Hash common.Hash `json:"hash"`
}
@@ -56,7 +56,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
enc.Nonce = h.Nonce
enc.Randomness = h.Randomness
enc.Position = h.Position
- enc.Round = h.Round
+ enc.Round = hexutil.Uint64(h.Round)
enc.DexconMeta = h.DexconMeta
enc.Hash = h.Hash()
return json.Marshal(&enc)
@@ -82,7 +82,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
Nonce *BlockNonce `json:"nonce"`
Randomness *hexutil.Bytes `json:"randomness" gencodec:"required"`
Position *types.Position `json:"position" gencodec:"required"`
- Round *uint64 `json:"round" gencodec:"required"`
+ Round *hexutil.Uint64 `json:"round" gencodec:"required"`
DexconMeta *hexutil.Bytes `json:"dexconMeta" gencodec:"required"`
}
var dec Header
@@ -158,7 +158,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
if dec.Round == nil {
return errors.New("missing required field 'round' for Header")
}
- h.Round = *dec.Round
+ h.Round = uint64(*dec.Round)
if dec.DexconMeta == nil {
return errors.New("missing required field 'dexconMeta' for Header")
}