Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CIP-48 query (id 4017925) #13

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ initial_vouches as (
evt_block_number,
evt_index,
solver,
cow_reward_target,
bonding_pool,
cowrewardtarget,
bondingpool,
sender,
true as active,
rank() over (
partition by
solver,
bonding_pool,
bondingpool,
sender
order by
evt_block_number asc,
Expand All @@ -46,7 +46,7 @@ initial_vouches as (
from
first_event_after_timestamp
)
and bonding_pool in (
and bondingpool in (
select pool
from
bonding_pools
Expand All @@ -61,8 +61,8 @@ initial_vouches as (
joined_on_data as (
select
iv.solver,
iv.cow_reward_target as reward_target,
iv.bonding_pool as pool,
iv.cowrewardtarget as reward_target,
iv.bondingpool as pool,
iv.evt_block_number,
iv.evt_index,
iv.rk,
Expand All @@ -78,13 +78,13 @@ latest_vouches as (
evt_block_number,
evt_index,
solver,
cow_reward_target,
bonding_pool,
cowrewardtarget,
bondingpool,
sender,
rank() over (
partition by
solver,
bonding_pool,
bondingpool,
sender
order by
evt_block_number desc,
Expand All @@ -97,8 +97,8 @@ latest_vouches as (
evt_block_number,
evt_index,
solver,
cow_reward_target,
bonding_pool,
cowrewardtarget,
bondingpool,
sender,
'Vouch' as event_type
from
Expand All @@ -109,7 +109,7 @@ latest_vouches as (
from
first_event_after_timestamp
)
and bonding_pool in (
and bondingpool in (
select pool
from
bonding_pools
Expand All @@ -124,8 +124,8 @@ latest_vouches as (
evt_block_number,
evt_index,
solver,
null as cow_reward_target, -- Invalidation does not have a reward target
bonding_pool,
null as cowrewardtarget, -- Invalidation does not have a reward target
bondingpool,
sender,
'InvalidateVouch' as event_type
from
Expand All @@ -136,7 +136,7 @@ latest_vouches as (
from
first_event_after_timestamp
)
and bonding_pool in (
and bondingpool in (
select pool
from
bonding_pools
Expand All @@ -152,8 +152,8 @@ latest_vouches as (
valid_vouches as (
select
lv.solver,
lv.cow_reward_target as reward_target,
lv.bonding_pool as pool
lv.cowrewardtarget as reward_target,
lv.bondingpool as pool
from
latest_vouches as lv
where
Expand Down
Loading