mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
accounts
This commit is contained in:
3563
Cargo.lock
generated
3563
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["api", "program", "cli"]
|
||||
members = ["api", "program"]
|
||||
|
||||
[workspace.package]
|
||||
version = "3.7.0-alpha"
|
||||
|
||||
@@ -6,25 +6,35 @@ use super::OreAccount;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Board {
|
||||
pub struct Game {
|
||||
/// The current round number.
|
||||
pub round_id: u64,
|
||||
|
||||
/// The timestamp at which the current round starts mining.
|
||||
pub start_at: i64,
|
||||
|
||||
/// The slot at which the current round starts mining.
|
||||
pub start_slot: u64,
|
||||
|
||||
/// The slot at which the current round ends mining.
|
||||
pub end_slot: u64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Round {
|
||||
/// The round number.
|
||||
pub id: u64,
|
||||
|
||||
/// The deployed SOL for the round.
|
||||
/// The amount of SOL deployed in each square.
|
||||
pub deployed: [u64; 25],
|
||||
|
||||
/// The timestamp at which the block starts mining.
|
||||
pub start_at: i64,
|
||||
|
||||
/// The slot at which the block starts trading.
|
||||
pub start_slot: u64,
|
||||
|
||||
/// The slot at which the block ends trading.
|
||||
pub end_slot: u64,
|
||||
|
||||
/// The hash of the end slot, provided by solana, used for random number generation.
|
||||
pub slot_hash: [u8; 32],
|
||||
|
||||
/// The slot at which claims for this round account end.
|
||||
pub expires_at: i64,
|
||||
|
||||
/// The top miner of the round.
|
||||
pub top_miner: Pubkey,
|
||||
|
||||
@@ -38,10 +48,23 @@ pub struct Board {
|
||||
pub total_winnings: u64,
|
||||
}
|
||||
|
||||
impl Board {
|
||||
pub fn pda(&self) -> (Pubkey, u8) {
|
||||
board_pda()
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Move {
|
||||
/// The authority of the move.
|
||||
pub authority: Pubkey,
|
||||
|
||||
/// The amount of SOL deployed in each square.
|
||||
pub deployed: [u64; 25],
|
||||
|
||||
/// The round number.
|
||||
pub round_id: u64,
|
||||
}
|
||||
|
||||
account!(OreAccount, Board);
|
||||
// impl Board {
|
||||
// pub fn pda(&self) -> (Pubkey, u8) {
|
||||
// board_pda()
|
||||
// }
|
||||
// }
|
||||
|
||||
// account!(OreAccount, Board);
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
mod automate;
|
||||
mod boost;
|
||||
mod bury;
|
||||
mod claim_ore;
|
||||
mod claim_seeker;
|
||||
mod claim_sol;
|
||||
mod claim_yield;
|
||||
mod deploy;
|
||||
mod deposit;
|
||||
mod initialize;
|
||||
mod log;
|
||||
mod reset;
|
||||
mod set_admin;
|
||||
mod set_fee_collector;
|
||||
mod whitelist;
|
||||
mod withdraw;
|
||||
mod wrap;
|
||||
// mod automate;
|
||||
// mod boost;
|
||||
// mod bury;
|
||||
// mod claim_ore;
|
||||
// mod claim_seeker;
|
||||
// mod claim_sol;
|
||||
// mod claim_yield;
|
||||
// mod deploy;
|
||||
// mod deposit;
|
||||
// mod initialize;
|
||||
// mod log;
|
||||
// mod reset;
|
||||
// mod set_admin;
|
||||
// mod set_fee_collector;
|
||||
// mod whitelist;
|
||||
// mod withdraw;
|
||||
// mod wrap;
|
||||
|
||||
use automate::*;
|
||||
use boost::*;
|
||||
use bury::*;
|
||||
use claim_ore::*;
|
||||
use claim_seeker::*;
|
||||
use claim_sol::*;
|
||||
use claim_yield::*;
|
||||
use deploy::*;
|
||||
use deposit::*;
|
||||
use initialize::*;
|
||||
use log::*;
|
||||
use reset::*;
|
||||
use set_admin::*;
|
||||
use set_fee_collector::*;
|
||||
use whitelist::*;
|
||||
use withdraw::*;
|
||||
use wrap::*;
|
||||
// use automate::*;
|
||||
// use boost::*;
|
||||
// use bury::*;
|
||||
// use claim_ore::*;
|
||||
// use claim_seeker::*;
|
||||
// use claim_sol::*;
|
||||
// use claim_yield::*;
|
||||
// use deploy::*;
|
||||
// use deposit::*;
|
||||
// use initialize::*;
|
||||
// use log::*;
|
||||
// use reset::*;
|
||||
// use set_admin::*;
|
||||
// use set_fee_collector::*;
|
||||
// use whitelist::*;
|
||||
// use withdraw::*;
|
||||
// use wrap::*;
|
||||
|
||||
use ore_api::instruction::*;
|
||||
use steel::*;
|
||||
@@ -42,33 +42,33 @@ pub fn process_instruction(
|
||||
accounts: &[AccountInfo],
|
||||
data: &[u8],
|
||||
) -> ProgramResult {
|
||||
let (ix, data) = parse_instruction(&ore_api::ID, program_id, data)?;
|
||||
// let (ix, data) = parse_instruction(&ore_api::ID, program_id, data)?;
|
||||
|
||||
match ix {
|
||||
// Miner
|
||||
OreInstruction::Automate => process_automate(accounts, data)?,
|
||||
OreInstruction::Boost => process_boost(accounts, data)?,
|
||||
OreInstruction::ClaimSOL => process_claim_sol(accounts, data)?,
|
||||
OreInstruction::ClaimORE => process_claim_ore(accounts, data)?,
|
||||
OreInstruction::Deploy => process_deploy(accounts, data)?,
|
||||
OreInstruction::Log => process_log(accounts, data)?,
|
||||
OreInstruction::Initialize => process_initialize(accounts, data)?,
|
||||
OreInstruction::Reset => process_reset(accounts, data)?,
|
||||
// match ix {
|
||||
// // Miner
|
||||
// OreInstruction::Automate => process_automate(accounts, data)?,
|
||||
// OreInstruction::Boost => process_boost(accounts, data)?,
|
||||
// OreInstruction::ClaimSOL => process_claim_sol(accounts, data)?,
|
||||
// OreInstruction::ClaimORE => process_claim_ore(accounts, data)?,
|
||||
// OreInstruction::Deploy => process_deploy(accounts, data)?,
|
||||
// OreInstruction::Log => process_log(accounts, data)?,
|
||||
// OreInstruction::Initialize => process_initialize(accounts, data)?,
|
||||
// OreInstruction::Reset => process_reset(accounts, data)?,
|
||||
|
||||
// Staker
|
||||
OreInstruction::Deposit => process_deposit(accounts, data)?,
|
||||
OreInstruction::Withdraw => process_withdraw(accounts, data)?,
|
||||
OreInstruction::ClaimYield => process_claim_yield(accounts, data)?,
|
||||
// // Staker
|
||||
// OreInstruction::Deposit => process_deposit(accounts, data)?,
|
||||
// OreInstruction::Withdraw => process_withdraw(accounts, data)?,
|
||||
// OreInstruction::ClaimYield => process_claim_yield(accounts, data)?,
|
||||
|
||||
// Admin
|
||||
OreInstruction::Bury => process_bury(accounts, data)?,
|
||||
OreInstruction::Wrap => process_wrap(accounts, data)?,
|
||||
OreInstruction::SetAdmin => process_set_admin(accounts, data)?,
|
||||
OreInstruction::SetFeeCollector => process_set_fee_collector(accounts, data)?,
|
||||
// // Admin
|
||||
// OreInstruction::Bury => process_bury(accounts, data)?,
|
||||
// OreInstruction::Wrap => process_wrap(accounts, data)?,
|
||||
// OreInstruction::SetAdmin => process_set_admin(accounts, data)?,
|
||||
// OreInstruction::SetFeeCollector => process_set_fee_collector(accounts, data)?,
|
||||
|
||||
// Seeker
|
||||
OreInstruction::ClaimSeeker => process_claim_seeker(accounts, data)?,
|
||||
}
|
||||
// // Seeker
|
||||
// OreInstruction::ClaimSeeker => process_claim_seeker(accounts, data)?,
|
||||
// }
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user