From 7eaf1fed8bfc839bcd3502a26c9be328ea1b2bfe Mon Sep 17 00:00:00 2001 From: LukasDeco Date: Mon, 19 Aug 2024 10:13:39 -0600 Subject: [PATCH] fix: uncaught-tx-serializer-error --- packages/indexer/src/transaction/serializer.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/indexer/src/transaction/serializer.ts b/packages/indexer/src/transaction/serializer.ts index ea68ca3c..68bf9e75 100644 --- a/packages/indexer/src/transaction/serializer.ts +++ b/packages/indexer/src/transaction/serializer.ts @@ -18,6 +18,7 @@ import { InstructionDisplay, Instruction as AnchorInstruction, } from "@coral-xyz/anchor/dist/cjs/coder/borsh/instruction"; +import { logger } from "../logger"; /** * This version should be bumped every time we update this file. @@ -401,13 +402,17 @@ function getIxWithDisplay( }; } }); + try { + const ixDisplay = coder.format(decodedIx, accounts); - const ixDisplay = coder.format(decodedIx, accounts); - - return { - instruction: decodedIx, - instructionDisplay: ixDisplay, - }; + return { + instruction: decodedIx, + instructionDisplay: ixDisplay, + }; + } catch (e) { + logger.error("error with coder formatting of decodedIx:", e); + return null; + } } function flattenIdlAccounts(