mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 21:36:26 +00:00
PrepareProposal-VoteExtension integration (#6915)
This commit is contained in:
@@ -518,7 +518,8 @@ func (h *Header) StringIndented(indent string) string {
|
||||
indent, h.LastResultsHash,
|
||||
indent, h.EvidenceHash,
|
||||
indent, h.ProposerAddress,
|
||||
indent, h.Hash())
|
||||
indent, h.Hash(),
|
||||
)
|
||||
}
|
||||
|
||||
// ToProto converts Header to protobuf
|
||||
|
||||
@@ -326,6 +326,18 @@ func (vote *Vote) ToProto() *tmproto.Vote {
|
||||
}
|
||||
}
|
||||
|
||||
func VotesToProto(votes []*Vote) (res []*tmproto.Vote) {
|
||||
if votes == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
res = make([]*tmproto.Vote, len(votes))
|
||||
for i, vote := range votes {
|
||||
res[i] = vote.ToProto()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func VoteExtensionFromProto(pext *tmproto.VoteExtension) VoteExtension {
|
||||
ext := VoteExtension{}
|
||||
if pext != nil {
|
||||
|
||||
@@ -226,6 +226,10 @@ func (voteSet *VoteSet) getVote(valIndex int32, blockKey string) (vote *Vote, ok
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (voteSet *VoteSet) GetVotes() []*Vote {
|
||||
return voteSet.votes
|
||||
}
|
||||
|
||||
// Assumes signature is valid.
|
||||
// If conflicting vote exists, returns it.
|
||||
func (voteSet *VoteSet) addVerifiedVote(
|
||||
|
||||
Reference in New Issue
Block a user