mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:06:45 +00:00
parent
404b413147
commit
8a5af8de93
20
tests/tests__block_timestamp_order.sql
Normal file
20
tests/tests__block_timestamp_order.sql
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user