diff --git a/fixtures/call_external/programs/call_external/src/lib.rs b/fixtures/call_external/programs/call_external/src/lib.rs index c854fd4..128ca87 100644 --- a/fixtures/call_external/programs/call_external/src/lib.rs +++ b/fixtures/call_external/programs/call_external/src/lib.rs @@ -9,7 +9,7 @@ pub mod call_external { pub fn initialize(ctx: Context) -> Result<()> { let signer = &ctx.accounts.signer; let pubkey = signer.signer_key().unwrap(); - msg!("Signer's pubkey is: {}", pubkey); + msg!("Signer's pubkey: {}", pubkey); Ok(()) } } diff --git a/fixtures/call_external/tests/call_external.ts b/fixtures/call_external/tests/call_external.ts index 082ecc3..899b661 100644 --- a/fixtures/call_external/tests/call_external.ts +++ b/fixtures/call_external/tests/call_external.ts @@ -12,11 +12,20 @@ describe("call_external", () => { // Add your test here. const tx = await program.methods.initialize().rpc(); console.log("Your transaction signature", tx); - const txDetails = await program.provider.connection.getTransaction(tx, { - maxSupportedTransactionVersion: 0, - commitment: "confirmed", - }); + let txDetails = null; + let nAttempts = 0; + while (true) { + txDetails = await program.provider.connection.getTransaction(tx, { + maxSupportedTransactionVersion: 0, + commitment: "confirmed", + }); + if (txDetails == null && ++nAttempts < 2) { + console.log("Retrying transaction fetch...") + } else { + break; + } + } const logMessages = txDetails.meta.logMessages; - console.log(`${JSON.stringify(logMessages, null, 2)}`); + console.log(`Log messages: ${JSON.stringify(logMessages, null, 2)}`); }); });