@ -71,7 +71,7 @@ func TestStateProposerSelection0(t *testing.T) {
// Commit a block and ensure proposer for the next height is correct.
prop := cs1 . GetRoundState ( ) . Validators . GetProposer ( )
pv , err := cs1 . privValidator . GetPubKey ( )
pv , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
address := pv . Address ( )
if ! bytes . Equal ( prop . Address , address ) {
@ -88,7 +88,7 @@ func TestStateProposerSelection0(t *testing.T) {
ensureNewRound ( newRoundCh , height + 1 , 0 )
prop = cs1 . GetRoundState ( ) . Validators . GetProposer ( )
pv1 , err := vss [ 1 ] . GetPubKey ( )
pv1 , err := vss [ 1 ] . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
if ! bytes . Equal ( prop . Address , addr ) {
@ -116,7 +116,7 @@ func TestStateProposerSelection2(t *testing.T) {
// everyone just votes nil. we get a new proposer each round
for i := int32 ( 0 ) ; int ( i ) < len ( vss ) ; i ++ {
prop := cs1 . GetRoundState ( ) . Validators . GetProposer ( )
pvk , err := vss [ int ( i + round ) % len ( vss ) ] . GetPubKey ( )
pvk , err := vss [ int ( i + round ) % len ( vss ) ] . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pvk . Address ( )
correctProposer := addr
@ -218,7 +218,7 @@ func TestStateBadProposal(t *testing.T) {
blockID := types . BlockID { Hash : propBlock . Hash ( ) , PartSetHeader : propBlockParts . Header ( ) }
proposal := types . NewProposal ( vs2 . Height , round , - 1 , blockID )
p := proposal . ToProto ( )
if err := vs2 . SignProposal ( config . ChainID ( ) , p ) ; err != nil {
if err := vs2 . SignProposal ( context . Background ( ) , con fig . ChainID ( ) , p ) ; err != nil {
t . Fatal ( "failed to sign bad proposal" , err )
}
@ -274,7 +274,7 @@ func TestStateOversizedBlock(t *testing.T) {
blockID := types . BlockID { Hash : propBlock . Hash ( ) , PartSetHeader : propBlockParts . Header ( ) }
proposal := types . NewProposal ( height , round , - 1 , blockID )
p := proposal . ToProto ( )
if err := vs2 . SignProposal ( config . ChainID ( ) , p ) ; err != nil {
if err := vs2 . SignProposal ( context . Background ( ) , con fig . ChainID ( ) , p ) ; err != nil {
t . Fatal ( "failed to sign bad proposal" , err )
}
proposal . Signature = p . Signature
@ -616,7 +616,7 @@ func TestStateLockPOLRelock(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
proposalCh := subscribe ( cs1 . eventBus , types . EventQueryCompleteProposal )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -717,7 +717,7 @@ func TestStateLockPOLUnlock(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
unlockCh := subscribe ( cs1 . eventBus , types . EventQueryUnlock )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -809,7 +809,7 @@ func TestStateLockPOLUnlockOnUnknownBlock(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
proposalCh := subscribe ( cs1 . eventBus , types . EventQueryCompleteProposal )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -939,7 +939,7 @@ func TestStateLockPOLSafety1(t *testing.T) {
timeoutProposeCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutPropose )
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1060,7 +1060,7 @@ func TestStateLockPOLSafety2(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
unlockCh := subscribe ( cs1 . eventBus , types . EventQueryUnlock )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1115,7 +1115,7 @@ func TestStateLockPOLSafety2(t *testing.T) {
// in round 2 we see the polkad block from round 0
newProp := types . NewProposal ( height , round , 0 , propBlockID0 )
p := newProp . ToProto ( )
if err := vs3 . SignProposal ( config . ChainID ( ) , p ) ; err != nil {
if err := vs3 . SignProposal ( context . Background ( ) , con fig . ChainID ( ) , p ) ; err != nil {
t . Fatal ( err )
}
@ -1160,7 +1160,7 @@ func TestProposeValidBlock(t *testing.T) {
timeoutProposeCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutPropose )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
unlockCh := subscribe ( cs1 . eventBus , types . EventQueryUnlock )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1251,7 +1251,7 @@ func TestSetValidBlockOnDelayedPrevote(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
validBlockCh := subscribe ( cs1 . eventBus , types . EventQueryValidBlock )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1315,7 +1315,7 @@ func TestSetValidBlockOnDelayedProposal(t *testing.T) {
timeoutProposeCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutPropose )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
validBlockCh := subscribe ( cs1 . eventBus , types . EventQueryValidBlock )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1392,7 +1392,7 @@ func TestWaitingTimeoutProposeOnNewRound(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutPropose )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1430,7 +1430,7 @@ func TestRoundSkipOnNilPolkaFromHigherRound(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1468,7 +1468,7 @@ func TestWaitTimeoutProposeOnNilPolkaForTheCurrentRound(t *testing.T) {
timeoutProposeCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutPropose )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1595,7 +1595,7 @@ func TestStartNextHeightCorrectlyAfterTimeout(t *testing.T) {
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
newBlockHeader := subscribe ( cs1 . eventBus , types . EventQueryNewBlockHeader )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1657,7 +1657,7 @@ func TestResetTimeoutPrecommitUponNewHeight(t *testing.T) {
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
newBlockHeader := subscribe ( cs1 . eventBus , types . EventQueryNewBlockHeader )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )
@ -1798,7 +1798,7 @@ func TestStateHalt1(t *testing.T) {
timeoutWaitCh := subscribe ( cs1 . eventBus , types . EventQueryTimeoutWait )
newRoundCh := subscribe ( cs1 . eventBus , types . EventQueryNewRound )
newBlockCh := subscribe ( cs1 . eventBus , types . EventQueryNewBlock )
pv1 , err := cs1 . privValidator . GetPubKey ( )
pv1 , err := cs1 . privValidator . GetPubKey ( context . Background ( ) )
require . NoError ( t , err )
addr := pv1 . Address ( )
voteCh := subscribeToVoter ( cs1 , addr )