mirror of
https://github.com/FlipsideCrypto/ethereum-models.git
synced 2026-02-06 13:36:48 +00:00
add missing txs tests (#561)
This commit is contained in:
parent
3ff4e5a766
commit
05222105db
@ -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
|
||||
|
||||
2
tests/ethereum/test_silver__missing_txs.sql
Normal file
2
tests/ethereum/test_silver__missing_txs.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- depends_on: {{ ref('test_silver__blocks_full') }}
|
||||
{{ tx_gaps(ref("test_silver__transactions_full")) }}
|
||||
2
tests/ethereum/test_silver__recent_missing_txs.sql
Normal file
2
tests/ethereum/test_silver__recent_missing_txs.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- depends_on: {{ ref('test_silver__blocks_recent') }}
|
||||
{{ recent_tx_gaps(ref("test_silver__transactions_recent")) }}
|
||||
Loading…
Reference in New Issue
Block a user