chore: downgrade to tendermint v0.34.x (#12958)

This commit is contained in:
Julien Robert
2022-08-20 02:33:07 +02:00
committed by GitHub
parent f6b5822557
commit 1dee068932
94 changed files with 552 additions and 3092 deletions
+3 -5
View File
@@ -1,8 +1,6 @@
package mock
import (
"context"
"github.com/tendermint/tendermint/crypto"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
@@ -25,12 +23,12 @@ func NewPV() PV {
}
// GetPubKey implements PrivValidator interface
func (pv PV) GetPubKey(_ context.Context) (crypto.PubKey, error) {
func (pv PV) GetPubKey() (crypto.PubKey, error) {
return cryptocodec.ToTmPubKeyInterface(pv.PrivKey.PubKey())
}
// SignVote implements PrivValidator interface
func (pv PV) SignVote(_ context.Context, chainID string, vote *tmproto.Vote) error {
func (pv PV) SignVote(chainID string, vote *tmproto.Vote) error {
signBytes := tmtypes.VoteSignBytes(chainID, vote)
sig, err := pv.PrivKey.Sign(signBytes)
if err != nil {
@@ -41,7 +39,7 @@ func (pv PV) SignVote(_ context.Context, chainID string, vote *tmproto.Vote) err
}
// SignProposal implements PrivValidator interface
func (pv PV) SignProposal(_ context.Context, chainID string, proposal *tmproto.Proposal) error {
func (pv PV) SignProposal(chainID string, proposal *tmproto.Proposal) error {
signBytes := tmtypes.ProposalSignBytes(chainID, proposal)
sig, err := pv.PrivKey.Sign(signBytes)
if err != nil {
+3 -4
View File
@@ -1,7 +1,6 @@
package mock
import (
"context"
"testing"
"github.com/stretchr/testify/require"
@@ -10,7 +9,7 @@ import (
func TestGetPubKey(t *testing.T) {
pv := NewPV()
pb, err := pv.GetPubKey(context.Background())
pb, err := pv.GetPubKey()
require.NoError(t, err)
require.NotNil(t, pb)
}
@@ -18,7 +17,7 @@ func TestGetPubKey(t *testing.T) {
func TestSignVote(t *testing.T) {
pv := NewPV()
v := tmproto.Vote{}
err := pv.SignVote(context.Background(), "chain-id", &v)
err := pv.SignVote("chain-id", &v)
require.NoError(t, err)
require.NotNil(t, v.Signature)
}
@@ -26,7 +25,7 @@ func TestSignVote(t *testing.T) {
func TestSignProposal(t *testing.T) {
pv := NewPV()
p := tmproto.Proposal{}
err := pv.SignProposal(context.Background(), "chain-id", &p)
err := pv.SignProposal("chain-id", &p)
require.NoError(t, err)
require.NotNil(t, p.Signature)
}