From 08674b8388c1cd12c2d0235a6f790c726d063961 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 4 Dec 2020 14:47:17 -0800 Subject: [PATCH] hotfix: manually coerce some inner instructions (#13963) --- explorer/src/pages/TransactionDetailsPage.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/explorer/src/pages/TransactionDetailsPage.tsx b/explorer/src/pages/TransactionDetailsPage.tsx index 78e7f7e90c..c3972b017a 100644 --- a/explorer/src/pages/TransactionDetailsPage.tsx +++ b/explorer/src/pages/TransactionDetailsPage.tsx @@ -572,6 +572,23 @@ function renderInstructionCard({ } } + // TODO: There is a bug in web3, where inner instructions + // aren't getting coerced. This is a temporary fix. + + if (typeof ix.programId === "string") { + ix.programId = new PublicKey(ix.programId); + } + + ix.accounts = ix.accounts.map((account) => { + if (typeof account === "string") { + return new PublicKey(account); + } + + return account; + }); + + // TODO: End hotfix + const transactionIx = intoTransactionInstruction(tx, ix); if (!transactionIx) {