mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-23 23:16:47 +00:00
account validation checks
This commit is contained in:
@@ -6,6 +6,7 @@ use ore_api::{
|
||||
error::OreError,
|
||||
event::MineEvent,
|
||||
instruction::Mine,
|
||||
loaders::OreAccountInfoValidation,
|
||||
state::{Bus, Config, Proof},
|
||||
};
|
||||
use solana_program::program::set_return_data;
|
||||
@@ -32,7 +33,9 @@ pub fn process_mine(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult {
|
||||
};
|
||||
signer_info.is_signer()?;
|
||||
let bus = bus_info.to_account_mut::<Bus>(&ore_api::ID)?;
|
||||
let config = config_info.to_account::<Config>(&ore_api::ID)?;
|
||||
let config = config_info
|
||||
.is_config()?
|
||||
.to_account::<Config>(&ore_api::ID)?;
|
||||
let proof = proof_info
|
||||
.to_account_mut::<Proof>(&ore_api::ID)?
|
||||
.check_mut(|p| p.miner == *signer_info.key)?;
|
||||
|
||||
Reference in New Issue
Block a user