MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / VoteSignBytes

Function VoteSignBytes

types/vote.go:93–101  ·  view source on GitHub ↗

VoteSignBytes returns the proto-encoding of the canonicalized Vote, for signing. Panics is 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 encodi

(chainID string, vote *tmproto.Vote)

Source from the content-addressed store, hash-verified

91//
92// See CanonicalizeVote
93func VoteSignBytes(chainID string, vote *tmproto.Vote) []byte {
94 pb := CanonicalizeVote(chainID, vote)
95 bz, err := protoio.MarshalDelimited(&pb)
96 if err != nil {
97 panic(err)
98 }
99
100 return bz
101}
102
103func (vote *Vote) Copy() *Vote {
104 voteCopy := *vote

Callers 14

TestSignVoteMethod · 0.92
TestDifferByTimestampFunction · 0.92
signVoteMethod · 0.92
signVoteMethod · 0.92
makeVoteFunction · 0.92
newEvidenceFunction · 0.92
VerifyDuplicateVoteFunction · 0.92
SignVoteMethod · 0.85
VerifyMethod · 0.85
VoteSignBytesMethod · 0.85
TestVoteSignableFunction · 0.85

Calls 2

MarshalDelimitedFunction · 0.92
CanonicalizeVoteFunction · 0.85

Tested by 7

TestDifferByTimestampFunction · 0.74
makeVoteFunction · 0.74
newEvidenceFunction · 0.74
TestVoteSignableFunction · 0.68
TestVoteVerifySignatureFunction · 0.68