aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/vote.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/types/vote.go')
-rw-r--r--core/types/vote.go18
1 files changed, 12 insertions, 6 deletions
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(),
}
}