Skip to content

Commit bb588af

Browse files
committed
Fix docs
1 parent a3f9c2b commit bb588af

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

sdk/pinocchio/src/instruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ macro_rules! signer {
304304
/// let pda_bump = 0xffu8;
305305
/// let pda_ref = &[pda_bump]; // prevent temporary value being freed
306306
/// let example_key = Address::default();
307-
/// let seeds = seeds!(b"seed", &example_key, pda_ref);
307+
/// let seeds = seeds!(b"seed", example_key.as_ref(), pda_ref);
308308
/// let signer = Signer::from(&seeds);
309309
/// ```
310310
#[macro_export]

sdk/pinocchio/src/log.rs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
//! [`RpcClient`]: https://docs.rs/solana-rpc-client/latest/solana_rpc_client/rpc_client/struct.RpcClient.html
2727
//! [`env_logger`]: https://docs.rs/env_logger
2828
//! [`RpcClient::get_transaction`]: https://docs.rs/solana-rpc-client/latest/solana_rpc_client/rpc_client/struct.RpcClient.html#method.get_transaction
29-
//!
30-
//! While most logging functions are defined in this module, [`Address`]es can
31-
//! also be efficiently logged with the [`solana_address::log`] function.
32-
//!
33-
//! [`Address`]: solana_address::Address
3429
3530
use crate::account_info::AccountInfo;
3631

@@ -137,22 +132,28 @@ pub fn sol_log_slice(slice: &[u8]) {
137132
/// - `accounts` - A slice of [`AccountInfo`].
138133
/// - `data` - The instruction data.
139134
pub fn sol_log_params(accounts: &[AccountInfo], data: &[u8]) {
140-
for (i, account) in accounts.iter().enumerate() {
141-
msg!("AccountInfo");
142-
sol_log_64(0, 0, 0, 0, i as u64);
143-
msg!("- Is signer");
144-
sol_log_64(0, 0, 0, 0, account.is_signer() as u64);
145-
msg!("- Key");
146-
account.key().log();
147-
msg!("- Lamports");
148-
sol_log_64(0, 0, 0, 0, account.lamports());
149-
msg!("- Account data length");
150-
sol_log_64(0, 0, 0, 0, account.data_len() as u64);
151-
msg!("- Owner");
152-
account.owner().log();
135+
#[cfg(target_os = "solana")]
136+
{
137+
for (i, account) in accounts.iter().enumerate() {
138+
msg!("AccountInfo");
139+
sol_log_64(0, 0, 0, 0, i as u64);
140+
msg!("- Is signer");
141+
sol_log_64(0, 0, 0, 0, account.is_signer() as u64);
142+
msg!("- Key");
143+
account.key().log();
144+
msg!("- Lamports");
145+
sol_log_64(0, 0, 0, 0, account.lamports());
146+
msg!("- Account data length");
147+
sol_log_64(0, 0, 0, 0, account.data_len() as u64);
148+
msg!("- Owner");
149+
account.owner().log();
150+
}
151+
msg!("Instruction data");
152+
sol_log_slice(data);
153153
}
154-
msg!("Instruction data");
155-
sol_log_slice(data);
154+
155+
#[cfg(not(target_os = "solana"))]
156+
core::hint::black_box((accounts, data));
156157
}
157158

158159
/// Print the remaining compute units available to the program.

0 commit comments

Comments
 (0)