mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-17 23:16:48 +00:00
instruction macro and simplification
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user