Skip to content

Commit

Permalink
Merge pull request #1040 from gobitfly/BEDS-886/Clean_up_event_names
Browse files Browse the repository at this point in the history
Cleaned up event names
  • Loading branch information
Eisei24 authored Oct 29, 2024
2 parents 6c646e6 + c03c764 commit 725d9e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/pkg/api/data_access/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ func (d *DataAccessService) GetNotificationSettingsDashboards(ctx context.Contex
settings.IsBlockProposalSubscribed = true
case types.ValidatorUpcomingProposalEventName:
settings.IsUpcomingBlockProposalSubscribed = true
case types.SyncCommitteeSoon:
case types.SyncCommitteeSoonEventName:
settings.IsSyncSubscribed = true
case types.ValidatorReceivedWithdrawalEventName:
settings.IsWithdrawalProcessedSubscribed = true
Expand Down Expand Up @@ -2127,7 +2127,7 @@ func (d *DataAccessService) UpdateNotificationSettingsValidatorDashboard(ctx con
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsGroupEfficiencyBelowSubscribed, userId, types.ValidatorGroupEfficiencyEventName, networkName, eventFilter, epoch, settings.GroupEfficiencyBelowThreshold)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsAttestationsMissedSubscribed, userId, types.ValidatorMissedAttestationEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsUpcomingBlockProposalSubscribed, userId, types.ValidatorUpcomingProposalEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsSyncSubscribed, userId, types.SyncCommitteeSoon, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsSyncSubscribed, userId, types.SyncCommitteeSoonEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsWithdrawalProcessedSubscribed, userId, types.ValidatorReceivedWithdrawalEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsSlashedSubscribed, userId, types.ValidatorGotSlashedEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsMaxCollateralSubscribed, userId, types.RocketpoolCollateralMaxReachedEventName, networkName, eventFilter, epoch, settings.MaxCollateralThreshold)
Expand Down
13 changes: 5 additions & 8 deletions backend/pkg/commons/types/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ func (npui NotificationsPerUserId) AddNotification(n Notification) {
}

const (
ValidatorMissedProposalEventName EventName = "validator_proposal_missed"
ValidatorExecutedProposalEventName EventName = "validator_proposal_submitted"

ValidatorDidSlashEventName EventName = "validator_did_slash"

ValidatorReceivedDepositEventName EventName = "validator_received_deposit"
Expand All @@ -78,20 +75,20 @@ const (
NetworkValidatorExitQueueNotFullEventName EventName = "network_validator_exit_queue_not_full"
NetworkLivenessIncreasedEventName EventName = "network_liveness_increased"
TaxReportEventName EventName = "user_tax_report"
SyncCommitteeSoonEventName EventName = "validator_synccommittee_soon"
//nolint:misspell
RocketpoolCommissionThresholdEventName EventName = "rocketpool_commision_threshold"

// Validator dashboard events
ValidatorIsOfflineEventName EventName = "validator_is_offline"
ValidatorIsOnlineEventName EventName = "validator_is_online"
ValidatorGroupEfficiencyEventName EventName = "validator_group_efficiency"
ValidatorMissedAttestationEventName EventName = "validator_attestation_missed"
ValidatorProposalEventName EventName = "validator_proposal"
ValidatorMissedProposalEventName EventName = "validator_proposal_missed"
ValidatorExecutedProposalEventName EventName = "validator_proposal_submitted"
ValidatorUpcomingProposalEventName EventName = "validator_proposal_upcoming"
SyncCommitteeSoon EventName = "validator_synccommittee_soon"
SyncCommitteeSoonEventName EventName = "validator_synccommittee_soon"
ValidatorReceivedWithdrawalEventName EventName = "validator_withdrawal"
ValidatorGotSlashedEventName EventName = "validator_got_slashed"
ValidatorGroupEfficiencyEventName EventName = "validator_group_efficiency"
RocketpoolCollateralMinReachedEventName EventName = "rocketpool_colleteral_min" //nolint:misspell
RocketpoolCollateralMaxReachedEventName EventName = "rocketpool_colleteral_max" //nolint:misspell

Expand All @@ -113,8 +110,8 @@ const (

// Network events
RocketpoolNewClaimRoundStartedEventName EventName = "rocketpool_new_claimround"
NetworkGasAboveThresholdEventName EventName = "network_gas_above_threshold"
NetworkGasBelowThresholdEventName EventName = "network_gas_below_threshold"
NetworkGasAboveThresholdEventName EventName = "network_gas_above_threshold"
NetworkParticipationRateThresholdEventName EventName = "network_participation_rate_threshold"
)

Expand Down

0 comments on commit 725d9e6

Please sign in to comment.