mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 19:53:58 +00:00
non breaking signbytes (#5008)
* test-vectors for backwards compatibility: - copy & paste test-vectors from v0.33.5 to ensure backwards compatibility for vote's SignBytes * WIP: everything besides time seems to match :-/ * almost * Found the culprit: field nums weren't consecutive ints ... * fix order of partset header too * this last votes-related test can easily be fixed * some minor changes and fix last failing test * move proto types back to stdtime, fix various linting * use libs/protoio * remvoe commented code * add comments * fix tests * uncomment testscases * dont ignore error panic * fix signable test * fix happy path testing * fix comment Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
This commit is contained in:
@@ -6,10 +6,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
"github.com/tendermint/tendermint/libs/protoio"
|
||||
tmproto "github.com/tendermint/tendermint/proto/types"
|
||||
)
|
||||
|
||||
@@ -87,10 +86,11 @@ func (vote *Vote) CommitSig() CommitSig {
|
||||
// If any error arises this will panic
|
||||
func VoteSignBytes(chainID string, vote *tmproto.Vote) []byte {
|
||||
pb := CanonicalizeVote(chainID, vote)
|
||||
bz, err := proto.Marshal(&pb)
|
||||
bz, err := protoio.MarshalDelimited(&pb)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return bz
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user