mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-15 23:16:46 +00:00
continue migration
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use ore_api::{loaders::*, state::Proof};
|
||||
use ore_api::state::Proof;
|
||||
use solana_program::{
|
||||
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
|
||||
};
|
||||
@@ -7,16 +7,15 @@ use steel::*;
|
||||
/// Update changes the miner authority on a proof account.
|
||||
pub fn process_update(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
|
||||
// Load accounts.
|
||||
let [signer, miner_info, proof_info] = accounts else {
|
||||
let [signer_info, miner_info, proof_info] = accounts else {
|
||||
return Err(ProgramError::NotEnoughAccountKeys);
|
||||
};
|
||||
signer.is_signer()?;
|
||||
// load_any(miner_info, false)?;
|
||||
load_proof(proof_info, signer.key, true)?;
|
||||
signer_info.is_signer()?;
|
||||
let proof = proof_info
|
||||
.to_account_mut::<Proof>(&ore_api::ID)?
|
||||
.check_mut(|p| p.authority == *signer_info.key)?;
|
||||
|
||||
// Update the proof's miner authority.
|
||||
let mut proof_data = proof_info.data.borrow_mut();
|
||||
let proof = Proof::try_from_bytes_mut(&mut proof_data)?;
|
||||
proof.miner = *miner_info.key;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user