Browse Source

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

Fixes #5276.
pull/5286/head
Erik Grinaker 4 years ago
committed by GitHub
parent
commit
d30e1d83b6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions
  1. +4
    -2
      types/proposal.go
  2. +4
    -2
      types/vote.go

+ 4
- 2
types/proposal.go View File

@ -100,9 +100,11 @@ func (p *Proposal) String() string {
}
// ProposalSignBytes returns the proto-encoding of the canonicalized Proposal,
// for signing.
// for signing. Panics if 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 CanonicalizeProposal
func ProposalSignBytes(chainID string, p *tmproto.Proposal) []byte {


+ 4
- 2
types/vote.go 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 {


Loading…
Cancel
Save