mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 13:00:08 +00:00
Fix types tests
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -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),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user