instruction macro and simplification

This commit is contained in:
Hardhat Chad
2024-08-26 21:02:52 +00:00
parent 3a3550ced5
commit bff1868ccc
16 changed files with 217 additions and 170 deletions

View File

@@ -1,4 +1,4 @@
use ore_api::{consts::*, instruction::StakeArgs, loaders::*, state::Proof};
use ore_api::{consts::*, instruction::Stake, loaders::*, state::Proof};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, clock::Clock, entrypoint::ProgramResult,
@@ -8,7 +8,7 @@ use solana_program::{
/// Stake deposits ORE into a proof account to earn multiplier.
pub fn process_stake(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.
let args = StakeArgs::try_from_bytes(data)?;
let args = Stake::try_from_bytes(data)?;
let amount = u64::from_le_bytes(args.amount);
// Load accounts.