Skip to content

Commit

Permalink
test deepsource
Browse files Browse the repository at this point in the history
  • Loading branch information
kanishkatn committed Sep 18, 2023
1 parent 0e9bdbb commit 7c80681
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 6 additions & 10 deletions dot/parachain/dispute/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,33 @@ type DBBackend interface {
}

type syncedEarliestSession struct {
*sync.RWMutex
sync.RWMutex
*parachainTypes.SessionIndex
}

func newSyncedEarliestSession() syncedEarliestSession {
return syncedEarliestSession{
RWMutex: new(sync.RWMutex),
}
return syncedEarliestSession{}
}

type syncedRecentDisputes struct {
*sync.RWMutex
sync.RWMutex
*btree.BTree
}

func newSyncedRecentDisputes() syncedRecentDisputes {
return syncedRecentDisputes{
RWMutex: new(sync.RWMutex),
BTree: btree.New(types.DisputeComparator),
BTree: btree.New(types.DisputeComparator),
}
}

type syncedCandidateVotes struct {
*sync.RWMutex
sync.RWMutex
votes map[types.Comparator]*types.CandidateVotes
}

func newSyncedCandidateVotes() syncedCandidateVotes {
return syncedCandidateVotes{
RWMutex: new(sync.RWMutex),
votes: make(map[types.Comparator]*types.CandidateVotes),
votes: make(map[types.Comparator]*types.CandidateVotes),
}
}

Expand Down
3 changes: 3 additions & 0 deletions dot/parachain/dispute/participation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ func TestParticipationHandler_Queue(t *testing.T) {
})

t.Run("cannot_participate_if_cannot_recover_validation_code", func(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down Expand Up @@ -378,6 +379,7 @@ func TestParticipationHandler_Queue(t *testing.T) {
})

t.Run("cast_invalid_vote_if_available_data_is_invalid", func(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down Expand Up @@ -425,6 +427,7 @@ func TestParticipationHandler_Queue(t *testing.T) {
})

t.Run("cast_invalid_vote_if_validation_fails_or_is_invalid", func(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down

0 comments on commit 7c80681

Please sign in to comment.