add missing txs tests (#561)

This commit is contained in:
Austin 2023-05-24 11:17:34 -04:00 committed by GitHub
parent 3ff4e5a766
commit 05222105db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 1 deletions

View File

@ -6,7 +6,41 @@
block_number,
tx_count
FROM
{{ ref('silver__blocks') }}
{{ ref('test_silver__blocks_full') }}
),
model_name AS (
SELECT
block_number,
COUNT(
DISTINCT tx_hash
) AS model_tx_count
FROM
{{ model }}
GROUP BY
block_number
)
SELECT
block_base.block_number,
tx_count,
model_name.block_number AS model_block_number,
model_tx_count
FROM
block_base
LEFT JOIN model_name
ON block_base.block_number = model_name.block_number
WHERE
tx_count <> model_tx_count
{% endmacro %}
{% macro recent_tx_gaps(
model
) %}
WITH block_base AS (
SELECT
block_number,
tx_count
FROM
{{ ref('test_silver__blocks_recent') }}
),
model_name AS (
SELECT

View File

@ -0,0 +1,2 @@
-- depends_on: {{ ref('test_silver__blocks_full') }}
{{ tx_gaps(ref("test_silver__transactions_full")) }}

View File

@ -0,0 +1,2 @@
-- depends_on: {{ ref('test_silver__blocks_recent') }}
{{ recent_tx_gaps(ref("test_silver__transactions_recent")) }}