Skip to content

Commit 8b6579e

Browse files
authored
Merge pull request #2674 from IntersectMBO/fix/missing-addr-id-in-stake-key-vp-sql
fix: add missing select on stake key addr id
2 parents b812a46 + 568d6e5 commit 8b6579e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
SELECT
2-
SUM(tx_out.value)
2+
COALESCE(SUM(tx_out.value), 0) AS voting_power,
3+
stake_address.id as addr_id
34
FROM
45
stake_address
56
JOIN
67
tx_out on tx_out.stake_address_id = stake_address.id
78
LEFT JOIN
89
tx_in ON tx_in.tx_out_id = tx_out.id AND tx_in.tx_out_index = tx_out.index
910
WHERE
10-
stake_address.hash_raw = decode(?, 'hex') AND tx_in.id IS NULL;
11+
stake_address.hash_raw = decode(?, 'hex') AND tx_in.id IS NULL
12+
GROUP BY
13+
stake_address.id;

0 commit comments

Comments
 (0)