refactor: bring cometbft back to v0.38.x family (#25285)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v2"
|
||||
"github.com/cometbft/cometbft/v2/crypto"
|
||||
cmttypes "github.com/cometbft/cometbft/v2/types"
|
||||
"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"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
@@ -28,21 +28,13 @@ func (pv PV) GetPubKey() (crypto.PubKey, error) {
|
||||
}
|
||||
|
||||
// SignVote implements PrivValidator interface
|
||||
func (pv PV) SignVote(chainID string, vote *cmtproto.Vote, signExtension bool) error {
|
||||
func (pv PV) SignVote(chainID string, vote *cmtproto.Vote) error {
|
||||
signBytes := cmttypes.VoteSignBytes(chainID, vote)
|
||||
sig, err := pv.PrivKey.Sign(signBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vote.Signature = sig
|
||||
if signExtension {
|
||||
extSignBytes, _ := cmttypes.VoteExtensionSignBytes(chainID, vote)
|
||||
extSig, err := pv.PrivKey.Sign(extSignBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vote.ExtensionSignature = extSig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package mock
|
||||
import (
|
||||
"testing"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v2"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"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, false)
|
||||
err := pv.SignVote("chain-id", &v)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, v.Signature)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
appmodule "cosmossdk.io/core/appmodule"
|
||||
types "github.com/cometbft/cometbft/v2/abci/types"
|
||||
types "github.com/cometbft/cometbft/abci/types"
|
||||
client "github.com/cosmos/cosmos-sdk/client"
|
||||
codec "github.com/cosmos/cosmos-sdk/codec"
|
||||
types0 "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
json "encoding/json"
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/cometbft/cometbft/v2/abci/types"
|
||||
types "github.com/cometbft/cometbft/abci/types"
|
||||
client "github.com/cosmos/cosmos-sdk/client"
|
||||
codec "github.com/cosmos/cosmos-sdk/codec"
|
||||
types0 "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
|
||||
Reference in New Issue
Block a user