Skip to content

Commit

Permalink
chore: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jul 15, 2023
1 parent c1aa23c commit 4ba0ae0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions pkg/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ func (d *Database) GetAllNotifiers(chain string) (*types.Notifiers, error) {
var (
operatorAddress string
reporter constants.ReporterName
userId string
userID string
userName string
)

err = rows.Scan(&operatorAddress, &reporter, &userId, &userName)
err = rows.Scan(&operatorAddress, &reporter, &userID, &userName)
if err != nil {
d.logger.Error().Err(err).Msg("Error fetching notifier data")
return &notifiers, err
Expand All @@ -212,7 +212,7 @@ func (d *Database) GetAllNotifiers(chain string) (*types.Notifiers, error) {
newNotifier := &types.Notifier{
OperatorAddress: operatorAddress,
Reporter: reporter,
UserID: userId,
UserID: userID,
UserName: userName,
}

Expand All @@ -226,7 +226,7 @@ func (d *Database) InsertNotifier(
chain string,
operatorAddress string,
reporter constants.ReporterName,
userId string,
userID string,
userName string,
) error {
d.mutex.Lock()
Expand All @@ -237,7 +237,7 @@ func (d *Database) InsertNotifier(
chain,
operatorAddress,
reporter,
userId,
userID,
userName,
)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/state/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ func (m *Manager) GetSnapshot() snapshotPkg.Snapshot {
func (m *Manager) AddNotifier(
operatorAddress string,
reporter constants.ReporterName,
userId string,
userID string,
userName string,
) bool {
if added := m.state.AddNotifier(operatorAddress, reporter, userId, userName); !added {
if added := m.state.AddNotifier(operatorAddress, reporter, userID, userName); !added {
return false
}

err := m.database.InsertNotifier(m.config.Name, operatorAddress, reporter, userId, userName)
err := m.database.InsertNotifier(m.config.Name, operatorAddress, reporter, userID, userName)
return err == nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ func (s *State) SetActiveSet(activeSet types.HistoricalValidatorsMap) {
func (s *State) AddNotifier(
operatorAddress string,
reporter constants.ReporterName,
userId string,
userID string,
userName string,
) bool {
s.mutex.Lock()
defer s.mutex.Unlock()

notifiers, added := s.notifiers.AddNotifier(operatorAddress, reporter, userId, userName)
notifiers, added := s.notifiers.AddNotifier(operatorAddress, reporter, userID, userName)
if added {
s.notifiers = notifiers
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/types/notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func (n Notifiers) Length() int {
func (n Notifiers) AddNotifier(
operatorAddress string,
reporter constants.ReporterName,
userId string,
userID string,
userName string,
) (*Notifiers, bool) {
newNotifier := &Notifier{
OperatorAddress: operatorAddress,
Reporter: reporter,
UserID: userId,
UserID: userID,
UserName: userName,
}

Expand All @@ -60,10 +60,10 @@ func (n Notifiers) GetNotifiersForReporter(

func (n Notifiers) GetValidatorsForNotifier(
reporter constants.ReporterName,
userId string,
userID string,
) []string {
notifiers := utils.Filter(n, func(notifierInternal *Notifier) bool {
return notifierInternal.UserID == userId && notifierInternal.Reporter == reporter
return notifierInternal.UserID == userID && notifierInternal.Reporter == reporter
})

return utils.Map(notifiers, func(notifier *Notifier) string {
Expand Down

0 comments on commit 4ba0ae0

Please sign in to comment.