mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 22:23:11 +00:00
privval: add ctx to privval interface (#6240)
## Description - Add `context.Context` to Privval interface This pr does not introduce context into our custom privval connection protocol because this will be removed in the next release. When this pr is released.
This commit is contained in:
@@ -2,6 +2,7 @@ package state_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/big"
|
||||
@@ -363,7 +364,7 @@ func TestProposerFrequency(t *testing.T) {
|
||||
votePower := int64(tmrand.Int()%maxPower) + 1
|
||||
totalVotePower += votePower
|
||||
privVal := types.NewMockPV()
|
||||
pubKey, err := privVal.GetPubKey()
|
||||
pubKey, err := privVal.GetPubKey(context.Background())
|
||||
require.NoError(t, err)
|
||||
val := types.NewValidator(pubKey, votePower)
|
||||
val.ProposerPriority = tmrand.Int64()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package state_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -199,7 +200,7 @@ func TestValidateBlockCommit(t *testing.T) {
|
||||
)
|
||||
require.NoError(t, err, "height %d", height)
|
||||
|
||||
bpvPubKey, err := badPrivVal.GetPubKey()
|
||||
bpvPubKey, err := badPrivVal.GetPubKey(context.Background())
|
||||
require.NoError(t, err)
|
||||
|
||||
badVote := &types.Vote{
|
||||
@@ -215,9 +216,9 @@ func TestValidateBlockCommit(t *testing.T) {
|
||||
g := goodVote.ToProto()
|
||||
b := badVote.ToProto()
|
||||
|
||||
err = badPrivVal.SignVote(chainID, g)
|
||||
err = badPrivVal.SignVote(context.Background(), chainID, g)
|
||||
require.NoError(t, err, "height %d", height)
|
||||
err = badPrivVal.SignVote(chainID, b)
|
||||
err = badPrivVal.SignVote(context.Background(), chainID, b)
|
||||
require.NoError(t, err, "height %d", height)
|
||||
|
||||
goodVote.Signature, badVote.Signature = g.Signature, b.Signature
|
||||
|
||||
Reference in New Issue
Block a user