Skip to content
Open
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
.envrc

*.txt
.env
*.txt
.idea
2 changes: 1 addition & 1 deletion internal/data/db.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 29 additions & 24 deletions internal/data/metrics.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions internal/data/models.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions internal/data/sql/queries/metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ SELECT * FROM block
WHERE slot = $1 FOR UPDATE;

-- name: CreateDecryptedTX :exec
INSERT into decrypted_tx(
slot,
tx_index,
tx_hash,
tx_status,
decryption_key_id,
transaction_submitted_event_id
)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT DO NOTHING;
INSERT INTO decrypted_tx (
slot,
tx_index,
tx_hash,
tx_status,
inclusion_position,
decryption_key_id,
transaction_submitted_event_id
) VALUES ($1, $2, $3, $4, $5, $6, $7);

-- name: CreateValidatorRegistryMessage :exec
INSERT into validator_registration_message(
Expand Down Expand Up @@ -161,20 +160,22 @@ ON CONFLICT DO NOTHING;

-- name: UpsertTX :exec
INSERT INTO decrypted_tx (
slot,
tx_index,
tx_hash,
tx_status,
decryption_key_id,
transaction_submitted_event_id,
block_number
slot,
tx_index,
tx_hash,
tx_status,
inclusion_position,
decryption_key_id,
transaction_submitted_event_id,
block_number
)
VALUES ($1, $2, $3, $4, $5, $6, $7)
ON CONFLICT (slot, tx_index)
DO UPDATE
SET tx_status = $4,
block_number = $7,
updated_at = NOW();
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
ON CONFLICT (slot, tx_index)
DO UPDATE
SET tx_status = $4,
inclusion_position = $5,
block_number = $8,
updated_at = NOW();

-- name: CreateTransactionSubmittedEventsSyncedUntil :exec
INSERT INTO transaction_submitted_events_synced_until (block_hash, block_number) VALUES ($1, $2)
Expand Down Expand Up @@ -206,5 +207,4 @@ WITH upserted AS (
updated_at = NOW()
RETURNING 1
)
SELECT EXISTS (SELECT 1 FROM upserted) AS did_upsert;

SELECT EXISTS (SELECT 1 FROM upserted) AS did_upsert;
Loading