version: 2
models:
  - name: silver__core_metrics_hourly
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - BLOCK_TIMESTAMP_HOUR
    columns:
      - name: BLOCK_TIMESTAMP_HOUR
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - TIMESTAMP_LTZ
                - TIMESTAMP_NTZ
      - name: BLOCK_NUMBER_MIN
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: BLOCK_NUMBER_MAX
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: BLOCK_COUNT
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: TRANSACTION_COUNT
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: TRANSACTION_COUNT_SUCCESS
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: TRANSACTION_COUNT_FAILED
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: TOTAL_FEES
        tests:
          - not_null:
              where:
                block_timestamp_hour::date > '2020-03-16' /* ignore first set of metrics */
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - DECIMAL
                - FLOAT
                - NUMBER
      - name: UNIQUE_SIGNERS_COUNT
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: _INSERTED_TIMESTAMP
        tests:
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 1