diff --git a/types/vote.go b/types/vote.go index 3d840f294..8d8331613 100644 --- a/types/vote.go +++ b/types/vote.go @@ -118,7 +118,8 @@ func (vote *Vote) Copy() *Vote { // 6. type string // 7. first 6 bytes of block hash // 8. first 6 bytes of signature -// 9. timestamp +// 9. first 6 bytes of vote extension +// 10. timestamp func (vote *Vote) String() string { if vote == nil { return nilVoteStr @@ -134,7 +135,7 @@ func (vote *Vote) String() string { panic("Unknown vote type") } - return fmt.Sprintf("Vote{%v:%X %v/%02d/%v(%v) %X %X @ %s}", + return fmt.Sprintf("Vote{%v:%X %v/%02d/%v(%v) %X %X %X @ %s}", vote.ValidatorIndex, tmbytes.Fingerprint(vote.ValidatorAddress), vote.Height, @@ -143,6 +144,7 @@ func (vote *Vote) String() string { typeString, tmbytes.Fingerprint(vote.BlockID.Hash), tmbytes.Fingerprint(vote.Signature), + tmbytes.Fingerprint(vote.Extension), CanonicalTime(vote.Timestamp), ) } diff --git a/types/vote_test.go b/types/vote_test.go index 9263cb2a8..9f77617e5 100644 --- a/types/vote_test.go +++ b/types/vote_test.go @@ -143,7 +143,7 @@ func TestVoteSignBytesTestVectors(t *testing.T) { ExtensionSignature: []byte{}, }, []byte{ - 0x38, // length + 0x2e, // length 0x11, // (field_number << 3) | wire_type 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // height 0x19, // (field_number << 3) | wire_type @@ -155,12 +155,6 @@ func TestVoteSignBytesTestVectors(t *testing.T) { 0x32, 0xd, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, // chainID // (field_number << 3) | wire_type - 0x3a, - 0x8, // length - 0xa, // (field_number << 3) | wire_type - 0x6, // length - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, // AppDataSigned - // SelfAuthenticating data is excluded on signing }, // chainID }, }