Skip to content

Commit

Permalink
Add coalesce for drep hash being null for pre-assigned roles
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlrt committed Aug 26, 2024
1 parent c0e03c8 commit c427873
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion files/grest/rpc/account/account_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BEGIN
LEFT JOIN (
SELECT
dv.addr_id,
grest.cip129_hex_to_drep_id(dh.raw, dh.has_script) AS delegated_drep
COALESCE(grest.cip129_hex_to_drep_id(dh.raw, dh.has_script), dh.view::text) AS delegated_drep
FROM delegation_vote AS dv
INNER JOIN drep_hash AS dh ON dh.id = dv.drep_hash_id
WHERE dv.addr_id = ANY(sa_id_list)
Expand Down
2 changes: 1 addition & 1 deletion files/grest/rpc/account/account_info_cached.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ BEGIN
LEFT JOIN (
SELECT
dv.addr_id,
grest.cip129_hex_to_drep_id(dh.raw, dh.has_script) AS delegated_drep
COALESCE(grest.cip129_hex_to_drep_id(dh.raw, dh.has_script), dh.view::text) AS delegated_drep
FROM delegation_vote AS dv
INNER JOIN drep_hash AS dh ON dh.id = dv.drep_hash_id
WHERE dv.addr_id = ANY(sa_id_list)
Expand Down

0 comments on commit c427873

Please sign in to comment.