refactor! : bump comet to v1 (#19726)
Co-authored-by: yihuang <yi.codeplayer@gmail.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
"github.com/cometbft/cometbft/crypto"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmttypes "github.com/cometbft/cometbft/types"
|
||||
|
||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||
@@ -28,7 +28,7 @@ func (pv PV) GetPubKey() (crypto.PubKey, error) {
|
||||
}
|
||||
|
||||
// SignVote implements PrivValidator interface
|
||||
func (pv PV) SignVote(chainID string, vote *cmtproto.Vote) error {
|
||||
func (pv PV) SignVote(chainID string, vote *cmtproto.Vote, _ bool) error {
|
||||
signBytes := cmttypes.VoteSignBytes(chainID, vote)
|
||||
sig, err := pv.PrivKey.Sign(signBytes)
|
||||
if err != nil {
|
||||
@@ -48,3 +48,7 @@ func (pv PV) SignProposal(chainID string, proposal *cmtproto.Proposal) error {
|
||||
proposal.Signature = sig
|
||||
return nil
|
||||
}
|
||||
|
||||
func (pv PV) SignBytes(bytes []byte) ([]byte, error) {
|
||||
return pv.PrivKey.Sign(bytes)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package mock
|
||||
import (
|
||||
"testing"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestGetPubKey(t *testing.T) {
|
||||
func TestSignVote(t *testing.T) {
|
||||
pv := NewPV()
|
||||
v := cmtproto.Vote{}
|
||||
err := pv.SignVote("chain-id", &v)
|
||||
err := pv.SignVote("chain-id", &v, false)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, v.Signature)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user