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

Revert "fix: off_chain_pool_data join on pmr_id instead of hash" #200

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Plutus V3 cost model mapping
- `/pools/{pool_id}/metadata`, `/txs/{hash}/pool_updates` returning multiple rows
slowbackspace marked this conversation as resolved.
Show resolved Hide resolved
- `/txs/{hash}/pool_updates` returning multiple rows

## [2.1.0] - 2024-07-31

Expand Down
2 changes: 1 addition & 1 deletion src/sql/pools/pools_pool_id_metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SELECT (
pod.ticker_name AS "ticker",
pod.json AS "metadata_text"
FROM pool_metadata_ref pmr
LEFT JOIN off_chain_pool_data pod ON (pod.pmr_id = pmr.id)
LEFT JOIN off_chain_pool_data pod ON (pmr.hash = pod.hash)
WHERE pmr.id = (
SELECT meta_id
FROM pool_update pu
Expand Down
4 changes: 2 additions & 2 deletions src/sql/txs/txs_hash_pool_updates.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT pu.id AS "pu_id",
SELECT DISTINCT pu.id AS "pu_id",
pu.cert_index AS "cert_index",
encode(pu.vrf_key_hash, 'hex') AS "vrf_key",
pu.pledge::TEXT AS "pledge", -- cast to TEXT to avoid number overflow
Expand Down Expand Up @@ -27,6 +27,6 @@ FROM tx
JOIN pool_hash ph ON (ph.id = pu.hash_id)
LEFT JOIN stake_address sa ON (sa.id = pu.reward_addr_id)
LEFT JOIN pool_metadata_ref pmr ON (pmr.id = pu.meta_id)
LEFT JOIN off_chain_pool_data pod ON (pod.pmr_id = pmr.id)
LEFT JOIN off_chain_pool_data pod ON (pmr.hash = pod.hash)
WHERE encode(tx.hash, 'hex') = $1
ORDER BY pu.cert_index ASC
Loading