version: 2
models:
  - name: silver__blocks
    description: Records of all blocks that have occurred on Osmosis, dating back to the genesis block. 
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - CHAIN_ID
            - BLOCK_ID
      - sequence_gaps:
          column_name: BLOCK_ID
          config:
            severity: error
            error_if: ">2"
    columns:
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 1
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - TIMESTAMP_NTZ
      - name: CHAIN_ID
        description: "{{ doc('chain_id') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: TX_COUNT
        description: "{{ doc('tx_count') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT 
      - name: PROPOSER_ADDRESS
        description: "{{ doc('proposer_address') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: VALIDATOR_HASH
        description: "{{ doc('validator_hash') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('inserted_timestamp') }}"
        tests:
          - not_null
