An 933 sol no gaps (#39)

* blocks no gaps test

* added test for bronze transactions

* renamed tests and added votes to tx test

* adds tx count filter
This commit is contained in:
Jessica Huhnke 2022-04-15 12:52:01 -05:00 committed by GitHub
parent 5c2770374c
commit 2320bcd519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,22 @@
{{ config(error_if = '>500', warn_if = '>400') }}
WITH tmp AS (
SELECT block_id,
block_hash,
previous_block_hash
FROM {{ ref('silver__blocks') }}
),
hash AS (
SELECT
t.block_id AS missing_slot,
t.block_hash
FROM tmp t
LEFT JOIN tmp t2
ON t.previous_block_hash = t2.block_hash
WHERE t2.block_hash is null
)
SELECT
count(*) AS num_missing
FROM hash

View File

@ -0,0 +1,18 @@
{{ config(error_if = '>500', warn_if = '>500') }}
SELECT
block_id AS slot
FROM {{ ref('silver__blocks') }}
WHERE block_id NOT IN (
SELECT
block_id
FROM {{ ref('silver__transactions') }}
)
AND block_id NOT IN (
SELECT
block_id
FROM {{ ref('silver__votes') }}
)
AND tx_count > 0