From 3690857da9bf27319d9ba2735e6567c4d3df0190 Mon Sep 17 00:00:00 2001 From: Juan De Luca Date: Mon, 23 Dec 2024 09:33:11 -0300 Subject: [PATCH] handles new block height field --- src/hooks/mining/useTransactions.ts | 8 +------- src/types/app-status.ts | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hooks/mining/useTransactions.ts b/src/hooks/mining/useTransactions.ts index ed81b00bd..f757f5233 100644 --- a/src/hooks/mining/useTransactions.ts +++ b/src/hooks/mining/useTransactions.ts @@ -33,13 +33,7 @@ export default function useFetchTx() { const txs = await invoke('get_transaction_history'); const sortedTransactions = txs.sort((a, b) => b.timestamp - a.timestamp); const mapped = sortedTransactions?.map((tx) => { - const blockHeight = tx.message.split(': ')[1]; - - if (blockHeight) { - return { ...tx, blockHeight }; - } - - return tx; + return { ...tx, blockHeight: tx.mined_in_block_height }; }) as Transaction[]; if (mapped?.length) { diff --git a/src/types/app-status.ts b/src/types/app-status.ts index 84737ed6d..79de36529 100644 --- a/src/types/app-status.ts +++ b/src/types/app-status.ts @@ -113,6 +113,7 @@ export interface TransactionInfo { timestamp: number; message: string; payment_id: string; + mined_in_block_height?: number; } export interface P2poolStatsResult {