mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-19 15:10:29 +00:00
log pda validations
This commit is contained in:
@@ -10,4 +10,4 @@ pub(crate) use ore_utils as utils;
|
||||
use solana_program::declare_id;
|
||||
|
||||
// declare_id!("mineRHF5r6S7HyD9SppBfVMXMavDkJsxwGesEvxZr2A");
|
||||
declare_id!("CWZk6C3fGbpr1UprdCGaLvnW2ogh7okEmeXaS161RxUg");
|
||||
declare_id!("EcZSwrCoS7bgstnUMdELZGno2riZ6mhW8hvRbq6vUCNm");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use solana_program::{
|
||||
account_info::AccountInfo, program_error::ProgramError, program_pack::Pack, pubkey::Pubkey,
|
||||
system_program, sysvar,
|
||||
account_info::AccountInfo, log::sol_log, program_error::ProgramError, program_pack::Pack,
|
||||
pubkey::Pubkey, system_program, sysvar,
|
||||
};
|
||||
use spl_token::state::Mint;
|
||||
|
||||
@@ -36,6 +36,11 @@ pub fn load_bus<'a, 'info>(
|
||||
return Err(ProgramError::InvalidAccountOwner);
|
||||
}
|
||||
|
||||
sol_log(&format!("key: {}", info.key.to_string()));
|
||||
sol_log(&format!(
|
||||
"bus address: {}",
|
||||
BUS_ADDRESSES[id as usize].to_string()
|
||||
));
|
||||
if info.key.ne(&BUS_ADDRESSES[id as usize]) {
|
||||
return Err(ProgramError::InvalidSeeds);
|
||||
}
|
||||
@@ -106,6 +111,8 @@ pub fn load_config<'a, 'info>(
|
||||
return Err(ProgramError::InvalidAccountOwner);
|
||||
}
|
||||
|
||||
sol_log(&format!("key: {}", info.key.to_string()));
|
||||
sol_log(&format!("config address: {}", CONFIG_ADDRESS.to_string()));
|
||||
if info.key.ne(&CONFIG_ADDRESS) {
|
||||
return Err(ProgramError::InvalidSeeds);
|
||||
}
|
||||
@@ -233,6 +240,11 @@ pub fn load_treasury<'a, 'info>(
|
||||
return Err(ProgramError::InvalidAccountOwner);
|
||||
}
|
||||
|
||||
sol_log(&format!("key: {}", info.key.to_string()));
|
||||
sol_log(&format!(
|
||||
"treasury address: {}",
|
||||
TREASURY_ADDRESS.to_string()
|
||||
));
|
||||
if info.key.ne(&TREASURY_ADDRESS) {
|
||||
return Err(ProgramError::InvalidSeeds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user