Skip to content

Commit

Permalink
Adjusted the event name for ethereum/mainnet chainId
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisei24 committed Oct 21, 2024
1 parent d42b8d4 commit 7ba5d3e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
15 changes: 9 additions & 6 deletions backend/pkg/api/data_access/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
15 changes: 9 additions & 6 deletions backend/pkg/api/data_access/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 4 additions & 4 deletions backend/pkg/api/data_access/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -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").
Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
}
}
Expand Down
5 changes: 3 additions & 2 deletions backend/pkg/api/types/data_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ type NotificationsDashboardsCursor struct {
}

type NetworkInfo struct {
ChainId uint64
Name string
ChainId uint64
Name string
NotificationsName string
}

type ClientInfo struct {
Expand Down

0 comments on commit 7ba5d3e

Please sign in to comment.