mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-17 15:10:21 +00:00
remove staking
This commit is contained in:
@@ -3,18 +3,10 @@ use steel::*;
|
||||
#[repr(u8)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
|
||||
pub enum OreInstruction {
|
||||
// Mine
|
||||
Open = 0,
|
||||
Close = 1,
|
||||
Mine = 2,
|
||||
|
||||
// Stake
|
||||
Deposit = 3,
|
||||
Withdraw = 4,
|
||||
|
||||
// Trade
|
||||
Free = 5,
|
||||
Swap = 6,
|
||||
Swap = 3,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@@ -33,22 +25,6 @@ pub struct Mine {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Deposit {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Withdraw {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Free {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Swap {
|
||||
@@ -60,7 +36,4 @@ pub struct Swap {
|
||||
instruction!(OreInstruction, Open);
|
||||
instruction!(OreInstruction, Close);
|
||||
instruction!(OreInstruction, Mine);
|
||||
instruction!(OreInstruction, Deposit);
|
||||
instruction!(OreInstruction, Withdraw);
|
||||
instruction!(OreInstruction, Free);
|
||||
instruction!(OreInstruction, Swap);
|
||||
|
||||
@@ -2,14 +2,12 @@ mod block;
|
||||
mod config;
|
||||
mod market;
|
||||
mod miner;
|
||||
mod receipt;
|
||||
mod treasury;
|
||||
|
||||
pub use block::*;
|
||||
pub use config::*;
|
||||
pub use market::*;
|
||||
pub use miner::*;
|
||||
pub use receipt::*;
|
||||
pub use treasury::*;
|
||||
|
||||
use crate::consts::*;
|
||||
@@ -23,8 +21,7 @@ pub enum OreAccount {
|
||||
Config = 101,
|
||||
Market = 102,
|
||||
Miner = 103,
|
||||
Receipt = 104,
|
||||
Treasury = 105,
|
||||
Treasury = 104,
|
||||
}
|
||||
|
||||
pub fn block_pda(id: u64) -> (Pubkey, u8) {
|
||||
@@ -43,13 +40,6 @@ pub fn miner_pda(authority: Pubkey) -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(&[MINER, &authority.to_bytes()], &crate::ID)
|
||||
}
|
||||
|
||||
pub fn receipt_pda(authority: Pubkey, id: u64) -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(
|
||||
&[RECEIPT, &authority.to_bytes(), &id.to_le_bytes()],
|
||||
&crate::ID,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn treasury_pda() -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(&[TREASURY], &crate::ID)
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
use steel::*;
|
||||
|
||||
use super::OreAccount;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Receipt {
|
||||
/// The authority of this receipt account.
|
||||
pub authority: Pubkey,
|
||||
|
||||
/// The amount of ORE this miner has deployed in the hashpower market corresponding to the block id.
|
||||
pub amount: u64,
|
||||
|
||||
/// The id of the block this receipt is associated with.
|
||||
pub block_id: u64,
|
||||
}
|
||||
|
||||
account!(OreAccount, Receipt);
|
||||
Reference in New Issue
Block a user