From a6549385859dbafcbfa15ec5c055577450e8a9c2 Mon Sep 17 00:00:00 2001 From: Tal Derei Date: Sun, 22 Dec 2024 00:45:14 -0800 Subject: [PATCH] linting --- .../services/src/view-service/transaction-info-by-hash.ts | 3 ++- packages/services/src/view-service/util/transaction-view.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/services/src/view-service/transaction-info-by-hash.ts b/packages/services/src/view-service/transaction-info-by-hash.ts index 81b724f30..d81866a20 100644 --- a/packages/services/src/view-service/transaction-info-by-hash.ts +++ b/packages/services/src/view-service/transaction-info-by-hash.ts @@ -24,13 +24,14 @@ export const transactionInfoByHash: Impl['transactionInfoByHash'] = async (req, throw new ConnectError('Transaction not available', Code.NotFound); } - let { txp: perspective, txv: view } = await generateTransactionInfo( + const { txp: perspective, txv } = await generateTransactionInfo( await fvk(), transaction, indexedDb.constants(), ); // Invoke a higher-level translator on the transaction view. + let view = txv; view = await txvTranslator(view); const txInfo = new TransactionInfo({ height, id: req.id, transaction, perspective, view }); diff --git a/packages/services/src/view-service/util/transaction-view.ts b/packages/services/src/view-service/util/transaction-view.ts index ac9f3ee76..412aa57e0 100644 --- a/packages/services/src/view-service/util/transaction-view.ts +++ b/packages/services/src/view-service/util/transaction-view.ts @@ -5,9 +5,11 @@ import { getTransmissionKeyByAddress } from '@penumbra-zone/wasm/keys'; // in the UI component library. For example, when handling IBC withdrawals with transparent // addresses, this component transforms ephemeral addresses into their bech32-encoded // transparent form to ensure the proper data is being displayed. -export const txvTranslator = async (view: TransactionView): Promise => { +export const txvTranslator = (view: TransactionView): TransactionView => { // 'Ics20Withdrawal' action view - const withdrawalAction = view?.bodyView?.actionViews?.find( + if (!view.bodyView) return view; + + const withdrawalAction = view.bodyView.actionViews.find( action => action.actionView.case === 'ics20Withdrawal', );