mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
Proposer->Proposal; sign heartbeats
This commit is contained in:
@@ -31,6 +31,14 @@ type CanonicalJSONVote struct {
|
||||
Type byte `json:"type"`
|
||||
}
|
||||
|
||||
type CanonicalJSONHeartbeat struct {
|
||||
Height int `json:"height"`
|
||||
Round int `json:"round"`
|
||||
Sequence int `json:"sequence"`
|
||||
ValidatorAddress data.Bytes `json:"validator_address"`
|
||||
ValidatorIndex int `json:"validator_index"`
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
// Messages including a "chain id" can only be applied to one chain, hence "Once"
|
||||
|
||||
@@ -44,6 +52,11 @@ type CanonicalJSONOnceVote struct {
|
||||
Vote CanonicalJSONVote `json:"vote"`
|
||||
}
|
||||
|
||||
type CanonicalJSONOnceHeartbeat struct {
|
||||
ChainID string `json:"chain_id"`
|
||||
Heartbeat CanonicalJSONHeartbeat `json:"heartbeat"`
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Canonicalize the structs
|
||||
|
||||
@@ -79,3 +92,13 @@ func CanonicalVote(vote *Vote) CanonicalJSONVote {
|
||||
vote.Type,
|
||||
}
|
||||
}
|
||||
|
||||
func CanonicalHeartbeat(heartbeat *Heartbeat) CanonicalJSONHeartbeat {
|
||||
return CanonicalJSONHeartbeat{
|
||||
heartbeat.Height,
|
||||
heartbeat.Round,
|
||||
heartbeat.Sequence,
|
||||
heartbeat.ValidatorAddress,
|
||||
heartbeat.ValidatorIndex,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user