@@ -152,7 +152,7 @@ pub async fn get_transactions(
152152 FROM transactions t
153153 LEFT JOIN blocks b ON t.block_hash = b.hash
154154 WHERE b.height <= $1 and b.height > $2 AND t.transaction_type = 'blob_transaction'
155- ORDER BY b.height DESC, t.index ASC
155+ ORDER BY b.height DESC, t.index DESC
156156 LIMIT $3
157157 "# ,
158158 )
@@ -165,7 +165,7 @@ pub async fn get_transactions(
165165 FROM transactions t
166166 LEFT JOIN blocks b ON t.block_hash = b.hash
167167 WHERE t.transaction_type = 'blob_transaction'
168- ORDER BY b.height DESC, t.index ASC
168+ ORDER BY b.height DESC, t.index DESC
169169 LIMIT $1
170170 "# ,
171171 )
@@ -203,7 +203,7 @@ pub async fn get_transactions_by_contract(
203203 JOIN blobs b ON t.tx_hash = b.tx_hash
204204 LEFT JOIN blocks bl ON t.block_hash = bl.hash
205205 WHERE b.contract_name = $1 AND bl.height <= $2 AND bl.height > $3 AND t.transaction_type = 'blob_transaction'
206- ORDER BY bl.height DESC, t.index ASC
206+ ORDER BY bl.height DESC, t.index DESC
207207 LIMIT $4
208208 "# ,
209209 )
@@ -217,7 +217,7 @@ pub async fn get_transactions_by_contract(
217217 FROM transactions t
218218 JOIN blobs b ON t.tx_hash = b.tx_hash AND t.parent_dp_hash = b.parent_dp_hash
219219 WHERE b.contract_name = $1 AND t.transaction_type = 'blob_transaction'
220- ORDER BY t.block_hash DESC, t.index ASC
220+ ORDER BY t.block_hash DESC, t.index DESC
221221 LIMIT $2
222222 "# ,
223223 )
@@ -255,7 +255,7 @@ pub async fn get_transactions_by_height(
255255 FROM transactions t
256256 JOIN blocks b ON t.block_hash = b.hash
257257 WHERE b.height = $1 AND t.transaction_type = 'blob_transaction'
258- ORDER BY t.index ASC
258+ ORDER BY t.index DESC
259259 "# ,
260260 )
261261 . bind ( height)
@@ -287,7 +287,7 @@ pub async fn get_transaction_with_hash(
287287 SELECT tx_hash, version, transaction_type, transaction_status, parent_dp_hash, block_hash, index
288288 FROM transactions
289289 WHERE tx_hash = $1 AND transaction_type = 'blob_transaction'
290- ORDER BY index ASC
290+ ORDER BY index DESC
291291 "# ,
292292 )
293293 . bind( tx_hash)
@@ -641,7 +641,7 @@ pub async fn get_proofs(
641641 FROM transactions t
642642 LEFT JOIN blocks b ON t.block_hash = b.hash
643643 WHERE b.height <= $1 and b.height > $2 AND t.transaction_type = 'proof_transaction'
644- ORDER BY b.height DESC, t.index ASC
644+ ORDER BY b.height DESC, t.index DESC
645645 LIMIT $3
646646 "# ,
647647 )
@@ -654,7 +654,7 @@ pub async fn get_proofs(
654654 FROM transactions t
655655 LEFT JOIN blocks b ON t.block_hash = b.hash
656656 WHERE t.transaction_type = 'proof_transaction'
657- ORDER BY b.height DESC, t.index ASC
657+ ORDER BY b.height DESC, t.index DESC
658658 LIMIT $1
659659 "# ,
660660 )
@@ -689,7 +689,7 @@ pub async fn get_proofs_by_height(
689689 FROM transactions t
690690 JOIN blocks b ON t.block_hash = b.hash
691691 WHERE b.height = $1 AND t.transaction_type = 'proof_transaction'
692- ORDER BY t.index ASC
692+ ORDER BY t.index DESC
693693 "# ,
694694 )
695695 . bind ( height)
@@ -721,7 +721,7 @@ pub async fn get_proof_with_hash(
721721 SELECT tx_hash, version, transaction_type, transaction_status, parent_dp_hash, block_hash, index
722722 FROM transactions
723723 WHERE tx_hash = $1 AND transaction_type = 'proof_transaction'
724- ORDER BY index ASC
724+ ORDER BY index DESC
725725 "# ,
726726 )
727727 . bind( tx_hash)
0 commit comments