Skip to content

Commit eb9e43b

Browse files
committed
Fix console.log spam
1 parent b4c367f commit eb9e43b

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

src/lib/transaction.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ export async function sendTransaction(
220220
const computeUnitBuffer = userComputeBuffer ?? { multiplier: 1.1 };
221221

222222
if (transaction.recentBlockhash === undefined) {
223-
console.log("No blockhash provided. Setting recent blockhash");
224223
const { blockhash } = await connection.getLatestBlockhash(commitment);
225224
transaction.recentBlockhash = blockhash;
226225
}
@@ -233,7 +232,6 @@ export async function sendTransaction(
233232

234233
// Skip compute preparation if transaction is already signed or has compute instructions
235234
if (transaction.signatures.length > 0) {
236-
console.log("Transaction already signed, skipping compute preparation");
237235
return sendRawTransactionWithRetry(connection, transaction.serialize() as Uint8Array, {
238236
commitment,
239237
...sendOptions,
@@ -383,8 +381,6 @@ export async function addComputeInstructions(
383381
throw new Error("Failed to simulate compute units");
384382
}
385383

386-
console.log("Simulated compute units", simulatedCompute);
387-
388384
// Apply buffer to compute units
389385
let finalComputeUnits = simulatedCompute;
390386
if (computeUnitBuffer.multiplier) {
@@ -394,8 +390,6 @@ export async function addComputeInstructions(
394390
finalComputeUnits += computeUnitBuffer.fixed;
395391
}
396392

397-
console.log("Final compute units (with buffer)", finalComputeUnits);
398-
399393
instructions.push(
400394
ComputeBudgetProgram.setComputeUnitLimit({
401395
units: finalComputeUnits,
@@ -448,7 +442,7 @@ async function sendRawTransactionWithRetry(
448442
initialDelayMs = DEFAULT_SEND_OPTIONS.initialDelayMs,
449443
commitment = DEFAULT_SEND_OPTIONS.commitment,
450444
skipPreflight = DEFAULT_SEND_OPTIONS.skipPreflight,
451-
onStatusUpdate = (status) => console.log("Transaction status:", status),
445+
onStatusUpdate,
452446
}: SendTransactionOptions = {},
453447
): Promise<string> {
454448
onStatusUpdate?.({ status: "created" });
@@ -553,8 +547,6 @@ export async function createLookupTable(
553547
// Need to wait until the lookup table is active
554548
await confirmTransaction(connection, lookupTableInstructionsSignature, "finalized");
555549

556-
console.log("Lookup table instructions signature", lookupTableInstructionsSignature);
557-
558550
const lookupTableAccount = (
559551
await connection.getAddressLookupTable(lookupTableAddress, {
560552
commitment: "confirmed",

tests/src/idl.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe("confirmTransaction", () => {
2727
"51f5WEqS7VSaeyg1o7qSY4oVqbuzxm4tCe7woSBKdSgxqkp9h1ebJLV5nKhaLHYohkSaV4Kaccs1ye8CexhBhgG6",
2828
provider,
2929
);
30-
console.log("Events", JSON.stringify(events, null, 2));
3130
assert.equal(events.length, 1, "Should have two events");
3231
assert.equal(events[0].name, "otterVerifyEvent", "Its a otterVerifyEvent");
3332
});
@@ -49,10 +48,6 @@ describe("confirmTransaction", () => {
4948
provider,
5049
programId,
5150
);
52-
console.log(
53-
"Counter increase transaction",
54-
JSON.stringify(counterTransaction, null, 2),
55-
);
5651

5752
// Assert transaction structure
5853
assert.equal(
@@ -104,10 +99,6 @@ describe("confirmTransaction", () => {
10499
provider,
105100
programId,
106101
);
107-
console.log(
108-
"VerifyTransaction",
109-
JSON.stringify(versionedTransactionDecoded, null, 2),
110-
);
111102

112103
// Assert transaction structure
113104
assert.equal(
@@ -150,7 +141,6 @@ describe("confirmTransaction", () => {
150141
new PublicKey("NRBNcTmfRkZWCLwnd6ygiz8CYerneu6m5Hcchx8RbFD"),
151142
provider,
152143
);
153-
console.log("Account data", JSON.stringify(accountData, null, 2));
154144

155145
// Type assertion for better IDE support
156146
const buildParams = accountData as {

tests/src/transaction.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ describe("Transaction utilities", () => {
128128
{
129129
onStatusUpdate: (status) => {
130130
statusUpdates.push(status);
131-
console.log("status", status);
132131
},
133132
},
134133
);
@@ -221,7 +220,6 @@ describe("Transaction utilities", () => {
221220
computeUnitBuffer: { multiplier: 1.1 },
222221
onStatusUpdate: (status) => {
223222
statusUpdates.push(status);
224-
console.log("status", status);
225223
},
226224
},
227225
);
@@ -232,7 +230,6 @@ describe("Transaction utilities", () => {
232230
["created", "signed", "sent", "confirmed"],
233231
);
234232

235-
console.log("Versioned transaction signature", signature);
236233
});
237234

238235
test("send versioned transaction with already setComputeLimit instructions", async () => {
@@ -268,7 +265,6 @@ describe("Transaction utilities", () => {
268265
computeUnitBuffer: { multiplier: 1.1 },
269266
onStatusUpdate: (status) => {
270267
statusUpdates.push(status);
271-
console.log("status", status);
272268
},
273269
},
274270
);
@@ -279,7 +275,6 @@ describe("Transaction utilities", () => {
279275
["created", "signed", "sent", "confirmed"],
280276
);
281277

282-
console.log("Versioned transaction signature", signature);
283278
});
284279

285280
test("send versioned transaction with lookup table", async () => {
@@ -335,10 +330,6 @@ describe("Transaction utilities", () => {
335330

336331
assert.ok(signature);
337332

338-
console.log(
339-
"Versioned transaction with lookup tables signature",
340-
signature,
341-
);
342333
});
343334

344335
test("sendTransaction should prepare and send a transaction and add priority fee instructions", async () => {
@@ -370,7 +361,6 @@ describe("Transaction utilities", () => {
370361
computeUnitBuffer: { multiplier: 1.1 },
371362
onStatusUpdate: (status) => {
372363
statusUpdates.push(status);
373-
console.log("status", status);
374364
},
375365
},
376366
);
@@ -421,7 +411,6 @@ describe("Transaction utilities", () => {
421411
computeUnitBuffer: { multiplier: 1.1 },
422412
onStatusUpdate: (status) => {
423413
statusUpdates.push(status);
424-
console.log("status", status);
425414
},
426415
},
427416
);
@@ -472,7 +461,6 @@ describe("Transaction utilities", () => {
472461
computeUnitBuffer: { multiplier: 1.1 },
473462
onStatusUpdate: (status) => {
474463
statusUpdates.push(status);
475-
console.log("status", status);
476464
},
477465
},
478466
);

0 commit comments

Comments
 (0)