You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no support for logging msgs in Solana Programs from Poseidon.
When transpiling Poseidon code to Anchor, the logging functionality provided by console.log! calls is not preserved and not converted to msg! in Anchor.
Example Poseidon code -
import { Account, Pubkey, Result, u32 } from "@solanaturbine/poseidon";
export default class ProcessingInstructionsProgram {
static PROGRAM_ID = new Pubkey(
"DgoL5J44aspizyUs9fcnpGEUJjWTLJRCfx8eYtUMYczf"
);
go_to_park(height: u32, name: String): Result {
// Display a welcome message
console.log("Welcome to the park,", name);
// Check if the height is above the threshold
if (Number(height) > 5) {
console.log("You are tall enough to ride this ride. Congratulations.");
} else {
console.log("You are NOT tall enough to ride this ride. Sorry mate.");
}
}
}
Adding this msg! logging feature can be particularly useful for displaying informational messages, such as whether a user meets certain conditions.
The text was updated successfully, but these errors were encountered:
ritikbhatt20
changed the title
Lack of Support for Logging Messages Using msg! in Poseidon
Lack of Support for Logging Messages from console.log to msg! in Poseidon
Oct 28, 2024
Currently, there is no support for logging msgs in Solana Programs from Poseidon.
When transpiling Poseidon code to Anchor, the logging functionality provided by console.log! calls is not preserved and not converted to msg! in Anchor.
Example Poseidon code -
and the transpiled Anchor code:
Adding this msg! logging feature can be particularly useful for displaying informational messages, such as whether a user meets certain conditions.
The text was updated successfully, but these errors were encountered: