From b61a98a2bbccae5d7fe36227e1b907ea1d9f1336 Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 11 Dec 2023 15:47:07 +0100 Subject: [PATCH] Fix: add namespace messages sort --- internal/storage/postgres/namespace.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/storage/postgres/namespace.go b/internal/storage/postgres/namespace.go index 2ce925a8..67011cdd 100644 --- a/internal/storage/postgres/namespace.go +++ b/internal/storage/postgres/namespace.go @@ -62,7 +62,8 @@ func (n *Namespace) Messages(ctx context.Context, id uint64, limit, offset int) ColumnExpr("tx.id as tx__id, tx.height as tx__height, tx.time as tx__time, tx.position as tx__position, tx.gas_wanted as tx__gas_wanted, tx.gas_used as tx__gas_used, tx.timeout_height as tx__timeout_height, tx.events_count as tx__events_count, tx.messages_count as tx__messages_count, tx.fee as tx__fee, tx.status as tx__status, tx.error as tx__error, tx.codespace as tx__codespace, tx.hash as tx__hash, tx.memo as tx__memo, tx.message_types as tx__message_types"). Join("LEFT JOIN namespace ON namespace.id = msgs.namespace_id"). Join("LEFT JOIN message ON message.id = msgs.msg_id"). - Join("LEFT JOIN tx ON tx.id = msgs.tx_id") + Join("LEFT JOIN tx ON tx.id = msgs.tx_id"). + Order("msgs.time desc") err = query.Scan(ctx, &msgs) return }