From 37e1357ccc85f661fbf5f2014ecaddf647ec1522 Mon Sep 17 00:00:00 2001 From: andrewprog97 Date: Mon, 9 Sep 2024 21:12:56 +0300 Subject: [PATCH] add transactions pool tx_id display --- server/utils/methods.ts | 3 ++- .../Blockchain/components/TransactionPool/TransactionPool.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/utils/methods.ts b/server/utils/methods.ts index 67e3487..57fdeab 100644 --- a/server/utils/methods.ts +++ b/server/utils/methods.ts @@ -160,7 +160,7 @@ export async function getTxPoolDetails(count: number) { // When count is 0, retrieve all records ordered by timestamp DESC if (count === 0) { const result = await Pool.findAll({ - attributes: ['blob_size', 'fee', 'id', 'timestamp'], + attributes: ['blob_size', 'fee', 'id', 'timestamp', 'tx_id'], order: [['timestamp', 'DESC']] }); return result.length > 0 ? result : []; @@ -173,6 +173,7 @@ export async function getTxPoolDetails(count: number) { 'fee', 'id', 'timestamp', + 'tx_id', [literal('false'), 'isNew'] // Adding a literal false as "isNew" ], order: [['timestamp', 'DESC']], diff --git a/src/pages/Blockchain/components/TransactionPool/TransactionPool.tsx b/src/pages/Blockchain/components/TransactionPool/TransactionPool.tsx index 5997d83..7e7e936 100644 --- a/src/pages/Blockchain/components/TransactionPool/TransactionPool.tsx +++ b/src/pages/Blockchain/components/TransactionPool/TransactionPool.tsx @@ -12,6 +12,7 @@ function TransactionPool() { fee: string, id: string, timestamp: string, + tx_id: string, } const [turnedOn, setTurnedOn] = useState(true); @@ -77,7 +78,7 @@ function TransactionPool() { timeAgo(parseInt(element.timestamp, 10)*1000), element.blob_size + " bytes", parseInt(element.fee, 10)/10**12, - {element.id} + {element.tx_id} ])); return (