mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-05 15:11:28 +00:00
const noise
This commit is contained in:
@@ -7,7 +7,7 @@ use spl_token::state::Mint;
|
||||
use crate::{
|
||||
state::{Bus, Config, Proof, Treasury},
|
||||
utils::{AccountDeserialize, Discriminator},
|
||||
BUS_ADDRESSES, CONFIG_ADDRESS, NOISE_ADDRESS, TREASURY_ADDRESS,
|
||||
BUS_ADDRESSES, CONFIG_ADDRESS, TREASURY_ADDRESS,
|
||||
};
|
||||
|
||||
/// Errors if:
|
||||
@@ -125,30 +125,6 @@ pub fn load_config<'a, 'info>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// asdf
|
||||
pub fn load_noise<'a, 'info>(
|
||||
info: &'a AccountInfo<'info>,
|
||||
is_writable: bool,
|
||||
) -> Result<(), ProgramError> {
|
||||
if info.owner.ne(&crate::id()) {
|
||||
return Err(ProgramError::InvalidAccountOwner);
|
||||
}
|
||||
|
||||
if info.key.ne(&NOISE_ADDRESS) {
|
||||
return Err(ProgramError::InvalidSeeds);
|
||||
}
|
||||
|
||||
if info.data_is_empty() {
|
||||
return Err(ProgramError::UninitializedAccount);
|
||||
}
|
||||
|
||||
if is_writable && !info.is_writable {
|
||||
return Err(ProgramError::InvalidAccountData);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Errors if:
|
||||
/// - Owner is not Ore program.
|
||||
/// - Data is empty.
|
||||
|
||||
Reference in New Issue
Block a user