diff --git a/CHANGELOG.md b/CHANGELOG.md index 435aa401..ffd37a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `/addresses/{payment_cred}` and `/addresses/{payment_cred}/extended` to always show `stake_address: null` - ordering in `/scripts` ## [2.0.3] - 2024-05-23 diff --git a/src/sql/addresses/addresses_address.sql b/src/sql/addresses/addresses_address.sql index bb2cbf54..7cec1d01 100644 --- a/src/sql/addresses/addresses_address.sql +++ b/src/sql/addresses/addresses_address.sql @@ -1,11 +1,6 @@ WITH queried_address AS ( SELECT CASE - WHEN $2::BYTEA IS NOT NULL THEN ( - SELECT stake_address_id AS "stake_address_id" - FROM tx_out txo - WHERE txo.payment_cred = $2 - LIMIT 1 - ) + WHEN $2::BYTEA IS NOT NULL THEN (0) ELSE ( SELECT stake_address_id AS "stake_address_id" FROM tx_out txo diff --git a/src/sql/addresses/addresses_address_extended.sql b/src/sql/addresses/addresses_address_extended.sql index be3b2cbe..b9595e2a 100644 --- a/src/sql/addresses/addresses_address_extended.sql +++ b/src/sql/addresses/addresses_address_extended.sql @@ -1,11 +1,6 @@ WITH queried_address AS ( SELECT CASE - WHEN $2::BYTEA IS NOT NULL THEN ( - SELECT stake_address_id AS "stake_address_id" - FROM tx_out txo - WHERE txo.payment_cred = $2 - LIMIT 1 - ) + WHEN $2::BYTEA IS NOT NULL THEN (0) ELSE ( SELECT stake_address_id AS "stake_address_id" FROM tx_out txo