Skip to content

Commit

Permalink
fix(sql): don't render asset in collateral utxo output
Browse files Browse the repository at this point in the history
Correct asset is part of normal output. The asset in output collateral
is completely wrong and it should only contain ADA value. This aligns
it with input UTXOs.

Closes #160
  • Loading branch information
sorki committed Mar 7, 2024
1 parent 43e01fe commit d5e6454
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/sql/txs/txs_hash_utxos_2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,7 @@ FROM (
UNION ALL
SELECT txo.address AS "address",
txo.value::TEXT AS "amount_lovelace",
-- cast to TEXT to avoid number overflow
(
SELECT json_agg(
json_build_object(
'unit',
CONCAT(encode(policy, 'hex'), encode(name, 'hex')),
'quantity',
mto.quantity::TEXT -- cast to TEXT to avoid number overflow
)
)
FROM ma_tx_out mto
JOIN multi_asset ma ON (mto.ident = ma.id)
WHERE mto.tx_out_id = txo.id
) AS "amount",
null AS "amount",
encode(txo.data_hash, 'hex') AS "data_hash",
encode(dat.bytes, 'hex') AS "inline_datum",
true AS "collateral",
Expand Down

0 comments on commit d5e6454

Please sign in to comment.