Skip to content

Commit 1a67ed3

Browse files
committed
gofmt
1 parent 19f36fa commit 1a67ed3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

internal/storage/postgres.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ func (p *PostgresConnector) StoreBlockFailures(failures []common.BlockFailure) e
153153
// Build multi-row INSERT without transaction for better performance
154154
valueStrings := make([]string, 0, len(failures))
155155
valueArgs := make([]interface{}, 0, len(failures)*5)
156-
156+
157157
for i, failure := range failures {
158-
valueStrings = append(valueStrings, fmt.Sprintf("($%d, $%d, $%d, $%d, $%d)",
158+
valueStrings = append(valueStrings, fmt.Sprintf("($%d, $%d, $%d, $%d, $%d)",
159159
i*5+1, i*5+2, i*5+3, i*5+4, i*5+5))
160-
valueArgs = append(valueArgs,
160+
valueArgs = append(valueArgs,
161161
failure.ChainId.String(),
162162
failure.BlockNumber.String(),
163163
failure.FailureTime.Unix(),
@@ -187,15 +187,15 @@ func (p *PostgresConnector) DeleteBlockFailures(failures []common.BlockFailure)
187187
// Build single DELETE query with all tuples
188188
tuples := make([]string, 0, len(failures))
189189
args := make([]interface{}, 0, len(failures)*2)
190-
190+
191191
for i, failure := range failures {
192192
tuples = append(tuples, fmt.Sprintf("($%d, $%d)", i*2+1, i*2+2))
193193
args = append(args, failure.ChainId.String(), failure.BlockNumber.String())
194194
}
195-
195+
196196
query := fmt.Sprintf(`DELETE FROM block_failures
197197
WHERE (chain_id, block_number) IN (%s)`, strings.Join(tuples, ","))
198-
198+
199199
_, err := p.db.Exec(query, args...)
200200
return err
201201
}
@@ -238,14 +238,14 @@ func (p *PostgresConnector) InsertStagingData(data []common.BlockData) error {
238238
// Build multi-row INSERT without transaction for better performance
239239
valueStrings := make([]string, 0, len(data))
240240
valueArgs := make([]interface{}, 0, len(data)*3)
241-
241+
242242
for i, blockData := range data {
243243
blockDataJSON, err := json.Marshal(blockData)
244244
if err != nil {
245245
return err
246246
}
247-
248-
valueStrings = append(valueStrings, fmt.Sprintf("($%d, $%d, $%d)",
247+
248+
valueStrings = append(valueStrings, fmt.Sprintf("($%d, $%d, $%d)",
249249
i*3+1, i*3+2, i*3+3))
250250
valueArgs = append(valueArgs,
251251
blockData.Block.ChainId.String(),
@@ -331,15 +331,15 @@ func (p *PostgresConnector) DeleteStagingData(data []common.BlockData) error {
331331
// Build single DELETE query with all tuples
332332
tuples := make([]string, 0, len(data))
333333
args := make([]interface{}, 0, len(data)*2)
334-
334+
335335
for i, blockData := range data {
336336
tuples = append(tuples, fmt.Sprintf("($%d, $%d)", i*2+1, i*2+2))
337337
args = append(args, blockData.Block.ChainId.String(), blockData.Block.Number.String())
338338
}
339-
339+
340340
query := fmt.Sprintf(`DELETE FROM block_data
341341
WHERE (chain_id, block_number) IN (%s)`, strings.Join(tuples, ","))
342-
342+
343343
_, err := p.db.Exec(query, args...)
344344
return err
345345
}

0 commit comments

Comments
 (0)