Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixtures/call_external/programs/call_external/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub mod call_external {
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
let signer = &ctx.accounts.signer;
let pubkey = signer.signer_key().unwrap();
msg!("Signer's pubkey is: {}", pubkey);
msg!("Signer's pubkey: {}", pubkey);
Ok(())
}
}
Expand Down
19 changes: 14 additions & 5 deletions fixtures/call_external/tests/call_external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`);
});
});