From c8d3092208f73ee991a123052a71b7dbf7fffc27 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Mon, 3 Sep 2018 10:01:40 +0800 Subject: core: Add a new structure `Position` and move `ShardID`, `ChainID` and `Height` from `Block` (#89) --- core/types/vote.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'core/types/vote.go') diff --git a/core/types/vote.go b/core/types/vote.go index 1247f84..158c209 100644 --- a/core/types/vote.go +++ b/core/types/vote.go @@ -38,11 +38,12 @@ const ( // Vote is the vote structure defined in Crypto Shuffle Algorithm. type Vote struct { - ProposerID ValidatorID - Type VoteType - BlockHash common.Hash - Period uint64 - Signature crypto.Signature + ProposerID ValidatorID `json:"proposer_id"` + Type VoteType `json:"type"` + BlockHash common.Hash `json:"block_hash"` + Period uint64 `json:"period"` + Position Position `json:"position"` + Signature crypto.Signature `json:"signature"` } func (v *Vote) String() string { @@ -57,6 +58,11 @@ func (v *Vote) Clone() *Vote { Type: v.Type, BlockHash: v.BlockHash, Period: v.Period, - Signature: v.Signature.Clone(), + Position: Position{ + ShardID: v.Position.ShardID, + ChainID: v.Position.ChainID, + Height: v.Position.Height, + }, + Signature: v.Signature.Clone(), } } -- cgit v1.2.3