diff --git a/lib/grandpa/grandpa.go b/lib/grandpa/grandpa.go index 91e380a0e0..778489ecbb 100644 --- a/lib/grandpa/grandpa.go +++ b/lib/grandpa/grandpa.go @@ -74,9 +74,8 @@ type Service struct { bestFinalCandidate map[uint64]*Vote // map of round number -> best final candidate // channels for communication with other services - in chan *networkVoteMessage // only used to receive *VoteMessage - finalisedCh chan *types.FinalisationInfo - neighbourMessage *NeighbourMessage // cached neighbour message + in chan *networkVoteMessage // only used to receive *VoteMessage + finalisedCh chan *types.FinalisationInfo telemetry telemetry.Client } diff --git a/lib/grandpa/network_test.go b/lib/grandpa/network_test.go index 94469b2ef6..18caa23197 100644 --- a/lib/grandpa/network_test.go +++ b/lib/grandpa/network_test.go @@ -142,7 +142,7 @@ func TestNotifyNeighbor(t *testing.T) { defer wg.Done() const roundAround = 1 * time.Second - calledWithin := time.Now().Sub(*timecheck) + calledWithin := time.Since(*timecheck) calledWithin = calledWithin.Round(roundAround) // avoid decimal points assert.Equal(t, tt.expectWithin, calledWithin) } diff --git a/lib/grandpa/round_test.go b/lib/grandpa/round_test.go index 41340e4bd7..e2bd819a60 100644 --- a/lib/grandpa/round_test.go +++ b/lib/grandpa/round_test.go @@ -613,6 +613,7 @@ func TestPlayGrandpaRound_MultipleRounds(t *testing.T) { func TestSendingVotesInRightStage(t *testing.T) { ed25519Keyring, err := keystore.NewEd25519Keyring() + require.NoError(t, err) currentAuthority := ed25519Keyring.Bob().(*ed25519.Keypair) votersPublicKeys := []*ed25519.PublicKey{ @@ -632,7 +633,7 @@ func TestSendingVotesInRightStage(t *testing.T) { ctrl := gomock.NewController(t) mockedGrandpaState := NewMockGrandpaState(ctrl) mockedGrandpaState.EXPECT(). - NextGrandpaAuthorityChange(testGenesisHeader.Hash(), uint(testGenesisHeader.Number)). + NextGrandpaAuthorityChange(testGenesisHeader.Hash(), testGenesisHeader.Number). Return(uint(0), state.ErrNoNextAuthorityChange). Times(2) mockedGrandpaState.EXPECT().