diff --git a/backend/pkg/api/data_access/dummy.go b/backend/pkg/api/data_access/dummy.go index 7482328c0..24472343a 100644 --- a/backend/pkg/api/data_access/dummy.go +++ b/backend/pkg/api/data_access/dummy.go @@ -395,16 +395,19 @@ func (d *DummyService) GetValidatorDashboardRocketPoolMinipools(ctx context.Cont func (d *DummyService) GetAllNetworks() ([]t.NetworkInfo, error) { return []types.NetworkInfo{ { - ChainId: 1, - Name: "ethereum", + ChainId: 1, + Name: "ethereum", + NotificationsName: "mainnet", }, { - ChainId: 100, - Name: "gnosis", + ChainId: 100, + Name: "gnosis", + NotificationsName: "gnosis", }, { - ChainId: 17000, - Name: "holesky", + ChainId: 17000, + Name: "holesky", + NotificationsName: "holesky", }, }, nil } diff --git a/backend/pkg/api/data_access/networks.go b/backend/pkg/api/data_access/networks.go index df95fb008..30c0669ec 100644 --- a/backend/pkg/api/data_access/networks.go +++ b/backend/pkg/api/data_access/networks.go @@ -12,16 +12,19 @@ func (d *DataAccessService) GetAllNetworks() ([]types.NetworkInfo, error) { return []types.NetworkInfo{ { - ChainId: 1, - Name: "ethereum", + ChainId: 1, + Name: "ethereum", + NotificationsName: "mainnet", }, { - ChainId: 100, - Name: "gnosis", + ChainId: 100, + Name: "gnosis", + NotificationsName: "gnosis", }, { - ChainId: 17000, - Name: "holesky", + ChainId: 17000, + Name: "holesky", + NotificationsName: "holesky", }, }, nil } diff --git a/backend/pkg/api/data_access/notifications.go b/backend/pkg/api/data_access/notifications.go index b0819ac73..a99a289be 100644 --- a/backend/pkg/api/data_access/notifications.go +++ b/backend/pkg/api/data_access/notifications.go @@ -223,7 +223,7 @@ func (d *DataAccessService) GetNotificationOverview(ctx context.Context, userId if len(whereNetwork) > 0 { whereNetwork += " OR " } - whereNetwork += "event_name like '" + network.Name + ":rocketpool_%' OR event_name like '" + network.Name + ":network_%'" + whereNetwork += "event_name like '" + network.NotificationsName + ":rocketpool_%' OR event_name like '" + network.NotificationsName + ":network_%'" } query := goqu.Dialect("postgres"). @@ -1231,7 +1231,7 @@ func (d *DataAccessService) GetNotificationSettings(ctx context.Context, userId } networksSettings := make(map[string]*t.NotificationNetwork, len(networks)) for _, network := range networks { - networksSettings[network.Name] = &t.NotificationNetwork{ + networksSettings[network.NotificationsName] = &t.NotificationNetwork{ ChainId: network.ChainId, Settings: t.NotificationSettingsNetwork{ GasAboveThreshold: decimal.NewFromFloat(GasAboveThresholdDefault).Mul(decimal.NewFromInt(params.GWei)), @@ -1566,7 +1566,7 @@ func (d *DataAccessService) UpdateNotificationSettingsNetworks(ctx context.Conte networkName := "" for _, network := range networks { if network.ChainId == chainId { - networkName = network.Name + networkName = network.NotificationsName break } } @@ -2083,7 +2083,7 @@ func (d *DataAccessService) UpdateNotificationSettingsValidatorDashboard(ctx con networkName := "" for _, network := range networks { if network.ChainId == chainId { - networkName = network.Name + networkName = network.NotificationsName break } } diff --git a/backend/pkg/api/types/data_access.go b/backend/pkg/api/types/data_access.go index 229677a9b..66e4b5fb8 100644 --- a/backend/pkg/api/types/data_access.go +++ b/backend/pkg/api/types/data_access.go @@ -186,8 +186,9 @@ type NotificationsDashboardsCursor struct { } type NetworkInfo struct { - ChainId uint64 - Name string + ChainId uint64 + Name string + NotificationsName string } type ClientInfo struct {