From 74c390ad953796808089fccff3ba974b733a77b7 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Mon, 18 Mar 2024 15:29:06 -0400 Subject: [PATCH] log errors --- sdk/src/contexts/solana/utils/computeBudget/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/src/contexts/solana/utils/computeBudget/index.ts b/sdk/src/contexts/solana/utils/computeBudget/index.ts index 9404f1437..6f52fbebd 100644 --- a/sdk/src/contexts/solana/utils/computeBudget/index.ts +++ b/sdk/src/contexts/solana/utils/computeBudget/index.ts @@ -34,6 +34,12 @@ export async function determineComputeBudget( try { const simulateResponse = await connection.simulateTransaction(transaction); + if (simulateResponse.value.err) { + console.error( + `Error simulating Solana transaction: ${simulateResponse.value.err}`, + ); + } + if (simulateResponse?.value?.unitsConsumed) { // Set compute budget to 120% of the units used in the simulated transaction computeBudget = Math.round(simulateResponse.value.unitsConsumed * 1.2);