Block order test (#96)

* bespoke test

* severity
This commit is contained in:
Jack Forgash 2022-12-12 14:32:49 -07:00 committed by GitHub
parent 404b413147
commit 8a5af8de93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,20 @@
{{ config(
severity = "error"
) }}
SELECT
DATEDIFF(
SECOND,
A.block_timestamp,
b.block_timestamp
) AS avg_time_diff,
b.block_height AS bheight,
b.block_timestamp AS btime,
A.*
FROM
{{ ref('silver__blocks') }} A,
{{ ref('silver__blocks') }}
b
WHERE
A.block_height = b.block_height -1
AND avg_time_diff < 0