@@ -55,17 +55,17 @@ describe('Platform Routes HTTP request handler', () => {
55
55
describe ( 'GET /stations/daily' , ( ) => {
56
56
it ( 'returns daily station metrics for the given date range' , async ( ) => {
57
57
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-10' , [
58
- { station_id : 'station1' , accepted_measurement_count : 1 }
58
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
59
59
] )
60
60
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-11' , [
61
- { station_id : 'station2' , accepted_measurement_count : 1 }
61
+ { stationId : 'station2' , acceptedMeasurementCount : 1 }
62
62
] )
63
63
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-12' , [
64
- { station_id : 'station2' , accepted_measurement_count : 2 } ,
65
- { station_id : 'station3' , accepted_measurement_count : 1 }
64
+ { stationId : 'station2' , acceptedMeasurementCount : 2 } ,
65
+ { stationId : 'station3' , acceptedMeasurementCount : 1 }
66
66
] )
67
67
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-13' , [
68
- { station_id : 'station1' , accepted_measurement_count : 1 }
68
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
69
69
] )
70
70
71
71
const res = await fetch (
@@ -89,25 +89,25 @@ describe('Platform Routes HTTP request handler', () => {
89
89
it ( 'returns monthly station metrics for the given date range ignoring the day number' , async ( ) => {
90
90
// before the date range
91
91
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2023-12-31' , [
92
- { station_id : 'station1' , accepted_measurement_count : 1 }
92
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
93
93
] )
94
94
// in the date range
95
95
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-10' , [
96
- { station_id : 'station1' , accepted_measurement_count : 1 }
96
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
97
97
] )
98
98
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-11' , [
99
- { station_id : 'station2' , accepted_measurement_count : 1 }
99
+ { stationId : 'station2' , acceptedMeasurementCount : 1 }
100
100
] )
101
101
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-12' , [
102
- { station_id : 'station2' , accepted_measurement_count : 2 } ,
103
- { station_id : 'station3' , accepted_measurement_count : 1 }
102
+ { stationId : 'station2' , acceptedMeasurementCount : 2 } ,
103
+ { stationId : 'station3' , acceptedMeasurementCount : 1 }
104
104
] )
105
105
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-02-13' , [
106
- { station_id : 'station1' , accepted_measurement_count : 1 }
106
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
107
107
] )
108
108
// after the date range
109
109
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-03-01' , [
110
- { station_id : 'station1' , accepted_measurement_count : 1 }
110
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
111
111
] )
112
112
113
113
const res = await fetch (
@@ -130,17 +130,17 @@ describe('Platform Routes HTTP request handler', () => {
130
130
describe ( 'GET /measurements/daily' , ( ) => {
131
131
it ( 'returns daily total accepted measurement count for the given date range' , async ( ) => {
132
132
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-10' , [
133
- { station_id : 'station1' , accepted_measurement_count : 1 }
133
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
134
134
] )
135
135
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-11' , [
136
- { station_id : 'station2' , accepted_measurement_count : 1 }
136
+ { stationId : 'station2' , acceptedMeasurementCount : 1 }
137
137
] )
138
138
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-12' , [
139
- { station_id : 'station2' , accepted_measurement_count : 2 } ,
140
- { station_id : 'station3' , accepted_measurement_count : 1 }
139
+ { stationId : 'station2' , acceptedMeasurementCount : 2 } ,
140
+ { stationId : 'station3' , acceptedMeasurementCount : 1 }
141
141
] )
142
142
await givenDailyStationMetrics ( pgPoolEvaluateDb , '2024-01-13' , [
143
- { station_id : 'station1' , accepted_measurement_count : 1 }
143
+ { stationId : 'station1' , acceptedMeasurementCount : 1 }
144
144
] )
145
145
146
146
const res = await fetch (
@@ -163,17 +163,17 @@ describe('Platform Routes HTTP request handler', () => {
163
163
describe ( 'GET /transfers/daily' , ( ) => {
164
164
it ( 'returns daily total Rewards sent for the given date range' , async ( ) => {
165
165
await givenDailyRewardTransferMetrics ( pgPoolStatsDb , '2024-01-10' , [
166
- { to_address : 'to1' , amount : 100 , last_checked_block : 1 }
166
+ { toAddress : 'to1' , amount : 100 , lastCheckedBlock : 1 }
167
167
] )
168
168
await givenDailyRewardTransferMetrics ( pgPoolStatsDb , '2024-01-11' , [
169
- { to_address : 'to2' , amount : 150 , last_checked_block : 1 }
169
+ { toAddress : 'to2' , amount : 150 , lastCheckedBlock : 1 }
170
170
] )
171
171
await givenDailyRewardTransferMetrics ( pgPoolStatsDb , '2024-01-12' , [
172
- { to_address : 'to2' , amount : 300 , last_checked_block : 1 } ,
173
- { to_address : 'to3' , amount : 250 , last_checked_block : 1 }
172
+ { toAddress : 'to2' , amount : 300 , lastCheckedBlock : 1 } ,
173
+ { toAddress : 'to3' , amount : 250 , lastCheckedBlock : 1 }
174
174
] )
175
175
await givenDailyRewardTransferMetrics ( pgPoolStatsDb , '2024-01-13' , [
176
- { to_address : 'to1' , amount : 100 , last_checked_block : 1 }
176
+ { toAddress : 'to1' , amount : 100 , lastCheckedBlock : 1 }
177
177
] )
178
178
179
179
const res = await fetch (
@@ -201,8 +201,8 @@ const givenDailyStationMetrics = async (pgPoolEvaluateDb, day, stationStats) =>
201
201
ON CONFLICT DO NOTHING
202
202
` , [
203
203
day ,
204
- stationStats . map ( s => s . station_id ) ,
205
- stationStats . map ( s => s . accepted_measurement_count )
204
+ stationStats . map ( s => s . stationId ) ,
205
+ stationStats . map ( s => s . acceptedMeasurementCount )
206
206
] )
207
207
}
208
208
@@ -213,8 +213,8 @@ const givenDailyRewardTransferMetrics = async (pgPoolStatsDb, day, transferStats
213
213
ON CONFLICT DO NOTHING
214
214
` , [
215
215
day ,
216
- transferStats . map ( s => s . to_address ) ,
216
+ transferStats . map ( s => s . toAddress ) ,
217
217
transferStats . map ( s => s . amount ) ,
218
- transferStats . map ( s => s . last_checked_block )
218
+ transferStats . map ( s => s . lastCheckedBlock )
219
219
] )
220
220
}
0 commit comments