mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 06:15:33 +00:00
Parts -> PartsHeader; *_parts -> *_parts_header in sign_bytes
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"io"
|
||||
|
||||
acm "github.com/tendermint/tendermint/account"
|
||||
"github.com/tendermint/tendermint/wire"
|
||||
. "github.com/tendermint/tendermint/common"
|
||||
"github.com/tendermint/tendermint/wire"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -28,12 +28,12 @@ func (err *ErrVoteConflictingSignature) Error() string {
|
||||
|
||||
// Represents a prevote, precommit, or commit vote from validators for consensus.
|
||||
type Vote struct {
|
||||
Height int `json:"height"`
|
||||
Round int `json:"round"`
|
||||
Type byte `json:"type"`
|
||||
BlockHash []byte `json:"block_hash"` // empty if vote is nil.
|
||||
BlockParts PartSetHeader `json:"block_parts"` // zero if vote is nil.
|
||||
Signature acm.SignatureEd25519 `json:"signature"`
|
||||
Height int `json:"height"`
|
||||
Round int `json:"round"`
|
||||
Type byte `json:"type"`
|
||||
BlockHash []byte `json:"block_hash"` // empty if vote is nil.
|
||||
BlockPartsHeader PartSetHeader `json:"block_parts_header"` // zero if vote is nil.
|
||||
Signature acm.SignatureEd25519 `json:"signature"`
|
||||
}
|
||||
|
||||
// Types of votes
|
||||
@@ -44,7 +44,7 @@ const (
|
||||
|
||||
func (vote *Vote) WriteSignBytes(chainID string, w io.Writer, n *int64, err *error) {
|
||||
wire.WriteTo([]byte(Fmt(`{"chain_id":"%s"`, chainID)), w, n, err)
|
||||
wire.WriteTo([]byte(Fmt(`,"vote":{"block_hash":"%X","block_parts":%v`, vote.BlockHash, vote.BlockParts)), w, n, err)
|
||||
wire.WriteTo([]byte(Fmt(`,"vote":{"block_hash":"%X","block_parts_header":%v`, vote.BlockHash, vote.BlockPartsHeader)), w, n, err)
|
||||
wire.WriteTo([]byte(Fmt(`,"height":%v,"round":%v,"type":%v}}`, vote.Height, vote.Round, vote.Type)), w, n, err)
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func (vote *Vote) String() string {
|
||||
PanicSanity("Unknown vote type")
|
||||
}
|
||||
|
||||
return fmt.Sprintf("Vote{%v/%02d/%v(%v) %X#%v %v}", vote.Height, vote.Round, vote.Type, typeString, Fingerprint(vote.BlockHash), vote.BlockParts, vote.Signature)
|
||||
return fmt.Sprintf("Vote{%v/%02d/%v(%v) %X#%v %v}", vote.Height, vote.Round, vote.Type, typeString, Fingerprint(vote.BlockHash), vote.BlockPartsHeader, vote.Signature)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user