migration

This commit is contained in:
Hardhat Chad
2025-09-18 09:00:49 -07:00
parent 7c94459df0
commit ffaa93d947
9 changed files with 410 additions and 244 deletions

View File

@@ -1,6 +1,8 @@
use ore_api::prelude::*;
use steel::*;
use crate::whitelist::AUTHORIZED_ACCOUNTS;
/// Claims a block reward.
pub fn process_prospect(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse data.
@@ -32,6 +34,11 @@ pub fn process_prospect(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRes
.assert_mut(|s| s.id == square_id)?;
system_program.is_program(&system_program::ID)?;
// Chekc whitelist
if !AUTHORIZED_ACCOUNTS.contains(&signer_info.key) {
return Err(ProgramError::InvalidAccountData);
}
// Create miner.
let miner = if miner_info.data_is_empty() {
create_program_account::<Miner>(