@solana/instruction-plans 6.3.0 → 6.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +13 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +13 -2
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +13 -2
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +13 -2
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +13 -2
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/transaction-plan-errors.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.node.cjs
CHANGED
|
@@ -656,7 +656,7 @@ function createFailedToSendTransactionError(result, abortReason) {
|
|
|
656
656
|
preflightData = unwrapped.preflightData;
|
|
657
657
|
cause = unwrapped.unwrappedError;
|
|
658
658
|
const indicator = getFailedIndicator(!!preflightData, result.context.signature);
|
|
659
|
-
causeMessage = `${indicator}: ${cause.message}`;
|
|
659
|
+
causeMessage = `${indicator}: ${cause.message}${formatLogSnippet(logs)}`;
|
|
660
660
|
} else {
|
|
661
661
|
cause = abortReason;
|
|
662
662
|
causeMessage = abortReason != null ? `. Canceled with abort reason: ${String(abortReason)}` : ": Canceled";
|
|
@@ -698,7 +698,8 @@ function createFailedToSendTransactionsError(result, abortReason) {
|
|
|
698
698
|
return `
|
|
699
699
|
[Tx #${index + 1}${indicator}] ${error.message}`;
|
|
700
700
|
});
|
|
701
|
-
|
|
701
|
+
const logSnippet = failedTransactions.length === 1 ? formatLogSnippet(failedTransactions[0].logs) : "";
|
|
702
|
+
causeMessages = `.${failureLines.join("")}${logSnippet}`;
|
|
702
703
|
} else {
|
|
703
704
|
cause = abortReason;
|
|
704
705
|
causeMessages = abortReason != null ? `. Canceled with abort reason: ${String(abortReason)}` : ": Canceled";
|
|
@@ -756,6 +757,16 @@ function findErrorFromTransactionPlanResult(result) {
|
|
|
756
757
|
}
|
|
757
758
|
}
|
|
758
759
|
}
|
|
760
|
+
function formatLogSnippet(logs) {
|
|
761
|
+
if (!logs || logs.length === 0) return "";
|
|
762
|
+
const maxLines = 8;
|
|
763
|
+
const lastLines = logs.slice(-maxLines);
|
|
764
|
+
const header = logs.length > maxLines ? `
|
|
765
|
+
|
|
766
|
+
Logs (last ${maxLines} of ${logs.length}):` : "\n\nLogs:";
|
|
767
|
+
return `${header}
|
|
768
|
+
${lastLines.map((line) => ` > ${line}`).join("\n")}`;
|
|
769
|
+
}
|
|
759
770
|
function getFailedIndicator(isPreflight, signature) {
|
|
760
771
|
if (isPreflight) return " (preflight)";
|
|
761
772
|
if (signature) return ` (${signature})`;
|