types: comment on need for length prefixing (#5283)

Fixes #5276.
This commit is contained in:
Erik Grinaker
2020-08-25 11:23:16 +02:00
committed by GitHub
parent 6f54fee4db
commit d30e1d83b6
2 changed files with 8 additions and 4 deletions

View File

@@ -85,9 +85,11 @@ func (vote *Vote) CommitSig() CommitSig {
}
// VoteSignBytes returns the proto-encoding of the canonicalized Vote, for
// signing.
// signing. Panics is the marshaling fails.
//
// Panics if the marshaling fails.
// The encoded Protobuf message is varint length-prefixed (using MarshalDelimited)
// for backwards-compatibility with the Amino encoding, due to e.g. hardware
// devices that rely on this encoding.
//
// See CanonicalizeVote
func VoteSignBytes(chainID string, vote *tmproto.Vote) []byte {