Skip to content

Commit

Permalink
Fix price tokens and set up tests (#6262)
Browse files Browse the repository at this point in the history
* fix price tokens and set up tests

* diff test setup

* diff test setup

* diff test setup
  • Loading branch information
0xRobin authored Jun 26, 2024
1 parent 0bad3bd commit 625919b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/prices/prices_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ models:
- &contract_address
name: contract_address
description: "Contract address of the token, if any"
tests:
- not_zero_address
- &symbol
name: symbol
description: "Token symbol"
Expand Down
1 change: 1 addition & 0 deletions models/prices/prices_tokens.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ FROM
, contract_address
, decimals
FROM {{ model }}
WHERE contract_address != 0x0000000000000000000000000000000000000000 -- safeguard as native tokens currently have null address
{% if not loop.last %}
UNION ALL
{% endif %}
Expand Down
6 changes: 6 additions & 0 deletions tests/generic/not_zero_address.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% test not_zero_address(model, column_name) %}
select
*
from {{ model }}
where {{column_name }} = 0x0000000000000000000000000000000000000000
{% endtest %}

0 comments on commit 625919b

Please sign in to comment.