Add msg! macro for program logging, deprecate info! macro
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
|
||||
extern crate solana_program;
|
||||
use solana_program::{
|
||||
account_info::AccountInfo, bpf_loader, entrypoint, entrypoint::ProgramResult, info, log::*,
|
||||
account_info::AccountInfo, bpf_loader, entrypoint, entrypoint::ProgramResult, log::*, msg,
|
||||
pubkey::Pubkey,
|
||||
};
|
||||
|
||||
@ -26,7 +26,7 @@ fn process_instruction(
|
||||
accounts: &[AccountInfo],
|
||||
instruction_data: &[u8],
|
||||
) -> ProgramResult {
|
||||
info!("Program identifier:");
|
||||
msg!("Program identifier:");
|
||||
program_id.log();
|
||||
|
||||
assert!(!bpf_loader::check_id(program_id));
|
||||
@ -34,7 +34,7 @@ fn process_instruction(
|
||||
// Log the provided account keys and instruction input data. In the case of
|
||||
// the no-op program, no account keys or input data are expected but real
|
||||
// programs will have specific requirements so they can do their work.
|
||||
info!("Account keys and instruction input data:");
|
||||
msg!("Account keys and instruction input data:");
|
||||
sol_log_params(accounts, instruction_data);
|
||||
|
||||
{
|
||||
@ -45,7 +45,7 @@ fn process_instruction(
|
||||
let result_str = std::str::from_utf8(&sparkle_heart).unwrap();
|
||||
assert_eq!(4, result_str.len());
|
||||
assert_eq!("💖", result_str);
|
||||
info!(result_str);
|
||||
msg!(result_str);
|
||||
}
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user