mirror of
https://github.com/FlipsideCrypto/solana-models.git
synced 2026-02-06 15:26:47 +00:00
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:
parent
5c2770374c
commit
2320bcd519
22
tests/silver__blocks__block_hash-assert-no-gaps.sql
Normal file
22
tests/silver__blocks__block_hash-assert-no-gaps.sql
Normal 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
|
||||
18
tests/silver__transactions__block_id-assert-no-gaps.sql
Normal file
18
tests/silver__transactions__block_id-assert-no-gaps.sql
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user