Skip to content

Commit

Permalink
chore: solve lint warns
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Jul 27, 2022
1 parent 3bad27e commit 5f65292
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/grandpa/grandpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion lib/grandpa/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion lib/grandpa/round_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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().
Expand Down

0 comments on commit 5f65292

Please sign in to comment.