Parts -> PartsHeader; *_parts -> *_parts_header in sign_bytes

This commit is contained in:
Jae Kwon
2015-08-12 22:36:43 -07:00
parent afc3e3b6c7
commit 5bf0040f14
6 changed files with 46 additions and 46 deletions

View File

@@ -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)
}
//--------------------------------------------------------------------------------