Skip to content

Commit 3615760

Browse files
committed
fix(sql): filter failed receipts for unstake and withdraw
1 parent 75297cf commit 3615760

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sql_files/views/user_activities.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ WITH receipt_actions_prep AS (
300300
LEFT JOIN LATERAL UNNEST(ra.logs) AS unnested_logs ON TRUE
301301
WHERE
302302
ra.method_name IN ('withdraw_from_staking_pool', 'withdraw_all_from_staking_pool')
303+
AND ra.event_status = 'succeeded'
303304
AND SUBSTRING(ra.receiver_id FROM POSITION('.' IN ra.receiver_id) + 1) IN (
304305
'{VENEAR_CONTRACT_PREFIX}.{HOS_CONTRACT}'
305306
, '{VOTING_CONTRACT_PREFIX}.{HOS_CONTRACT}'
@@ -338,6 +339,7 @@ WITH receipt_actions_prep AS (
338339
LEFT JOIN LATERAL UNNEST(ra.logs) AS unnested_logs ON TRUE
339340
WHERE
340341
ra.method_name IN ('unstake', 'unstake_all')
342+
AND ra.event_status = 'succeeded'
341343
AND SUBSTRING(ra.receiver_id FROM POSITION('.' IN ra.receiver_id) + 1) IN (
342344
'{VENEAR_CONTRACT_PREFIX}.{HOS_CONTRACT}'
343345
, '{VOTING_CONTRACT_PREFIX}.{HOS_CONTRACT}'

0 commit comments

Comments
 (0)