mirror of
https://github.com/FlipsideCrypto/ethereum-models.git
synced 2026-02-06 13:17:06 +00:00
34 lines
633 B
SQL
34 lines
633 B
SQL
{% test state_hash_gaps(
|
|
model
|
|
) %}
|
|
WITH batch_check AS (
|
|
SELECT
|
|
state_batch_index,
|
|
state_max_block,
|
|
LAG(
|
|
state_max_block,
|
|
1
|
|
) over (
|
|
ORDER BY
|
|
state_batch_index
|
|
) AS previous_state_max_block,
|
|
state_max_block - LAG(
|
|
state_max_block,
|
|
1
|
|
) over (
|
|
ORDER BY
|
|
state_batch_index
|
|
) AS difference
|
|
FROM
|
|
{{ model }}
|
|
)
|
|
SELECT
|
|
*
|
|
FROM
|
|
batch_check
|
|
WHERE
|
|
difference <> 1800
|
|
AND
|
|
difference <> 0 --allows for dupes batches
|
|
{% endtest %}
|