From b0eebf3a60a55095ed98b59153a5e7cb55cc37e4 Mon Sep 17 00:00:00 2001 From: Hemanth Sai Date: Mon, 4 Mar 2024 11:04:51 +0530 Subject: [PATCH] fix: display transactions (#1184) fix: display transaction --- .../overview-components/TransactionItem.tsx | 2 +- frontend/src/utils/transaction.ts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/(routes)/(overview)/overview-components/TransactionItem.tsx b/frontend/src/app/(routes)/(overview)/overview-components/TransactionItem.tsx index 210f2799d..a3cd1c0fc 100644 --- a/frontend/src/app/(routes)/(overview)/overview-components/TransactionItem.tsx +++ b/frontend/src/app/(routes)/(overview)/overview-components/TransactionItem.tsx @@ -58,7 +58,7 @@ const TransactionItem = ({ export const Chip = ({ msg }: { msg: string }) => { return ( -
+
{msg}
); diff --git a/frontend/src/utils/transaction.ts b/frontend/src/utils/transaction.ts index 4794c2936..97f873898 100644 --- a/frontend/src/utils/transaction.ts +++ b/frontend/src/utils/transaction.ts @@ -88,7 +88,7 @@ export const MsgType = (msg: string): string => { case msgDepositTypeUrl: return 'Deposit'; default: - return 'Todo: add type'; + return msg; } }; @@ -96,7 +96,8 @@ export const MsgType = (msg: string): string => { export const serializeMsg = ( msg: any, decimals: number, - originDenom: string + originDenom: string, + txHash: string ): string => { if (!msg) return 'No Message'; switch (msg['@type']) { @@ -123,7 +124,7 @@ export const serializeMsg = ( case msgDepositTypeUrl: return serializeMsgDeposit(msg, decimals, originDenom); default: - return `Todo: serialize message ${msg.typeUrl}`; + return txHash; } }; @@ -157,7 +158,12 @@ export const formatTransaction = ( const msgCount = msgs.length; const isTxSuccess = tx.code === 0; const time = getTimeDifference(tx.timestamp); - const firstMessage = serializeMsg(tx.messages[0], decimals, originDenom); + const firstMessage = serializeMsg( + tx.messages[0], + decimals, + originDenom, + tx.txhash + ); return { showMsgs, isTxSuccess,