cowprotocol / dune-bridge

Other
4 stars 3 forks source link

[HotFix] App Content Parsing #16

Closed bh2smith closed 2 years ago

bh2smith commented 2 years ago

This PR addresses 2 problems with the current query:

  1. We were seeing that null valued environments were being parsed as the text "null". To see this, create a query
select count(*) from dune_user_generated.gnosis_protocol_v2_app_data
where environment = 'null'
  1. Also were seeing non-uniqueness (because we previously didn't include all the fields). For example:
    select * from dune_user_generated.gnosis_protocol_v2_app_data
    where app_hash in (
    '0x7aaf97865c2aa7f17a380f6bd566377d4336ddc785768acd431ab7ceddffc45a',
    '0x7e4b2a44ca9e43f582ac9dadb7c23a7e34f9423312066d85325e2aed4378167b'
    )

    The results here look like they should be the same... (i.e. have the same hash). However this query shows the difference in environment (the outer one):

select * from dune_user_generated.gp_appdata
where app_data in (
    '0x7aaf97865c2aa7f17a380f6bd566377d4336ddc785768acd431ab7ceddffc45a',
    '0x7e4b2a44ca9e43f582ac9dadb7c23a7e34f9423312066d85325e2aed4378167b'
)

Furthermore we add the DROP VIEW ... CASCADE so that we can alter the table columns

Test Plan:

POC Query here: https://dune.com/queries/1031950