mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-17 23:16:48 +00:00
mine event
This commit is contained in:
@@ -3,13 +3,14 @@ use steel::*;
|
||||
use crate::state::{RewardConfig, SwapDirection};
|
||||
|
||||
pub enum OreEvent {
|
||||
Swap = 0,
|
||||
Reward = 1,
|
||||
Open = 2,
|
||||
Commit = 3,
|
||||
Deposit = 4,
|
||||
Withdraw = 5,
|
||||
Commit = 0,
|
||||
Deposit = 1,
|
||||
Mine = 2,
|
||||
Open = 3,
|
||||
Reward = 4,
|
||||
Swap = 5,
|
||||
Uncommit = 6,
|
||||
Withdraw = 7,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@@ -80,6 +81,28 @@ pub struct RewardEvent {
|
||||
pub ts: i64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
|
||||
pub struct MineEvent {
|
||||
/// The event discriminator.
|
||||
pub disc: u64,
|
||||
|
||||
/// The authority who mined.
|
||||
pub authority: Pubkey,
|
||||
|
||||
/// The block id.
|
||||
pub block_id: u64,
|
||||
|
||||
/// The amount of hashes deployed.
|
||||
pub deployed: u64,
|
||||
|
||||
/// The total amount of hashes deployed in the block.
|
||||
pub total_deployed: u64,
|
||||
|
||||
/// The timestamp of the event.
|
||||
pub ts: i64,
|
||||
}
|
||||
|
||||
#[repr(u8)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
|
||||
pub enum RewardsType {
|
||||
@@ -236,4 +259,5 @@ event!(CommitEvent);
|
||||
event!(DepositEvent);
|
||||
event!(WithdrawEvent);
|
||||
event!(UncommitEvent);
|
||||
event!(MineEvent);
|
||||
event!(CloseEvent);
|
||||
|
||||
@@ -93,8 +93,6 @@ pub fn mine(signer: Pubkey, id: u64, amount: u64) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
// let [signer_info, block_info, commitment_info, market_info, miner_info, mint_info, permit_info, sender_info, system_program, token_program, slot_hashes_sysvar] =
|
||||
|
||||
pub fn commit(
|
||||
signer: Pubkey,
|
||||
amount: u64,
|
||||
@@ -187,10 +185,6 @@ pub fn deposit(signer: Pubkey, id: u64, amount: u64) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
// let [signer_info, block_info, collateral_info, mint_ore_info, sender_info, stake_info, system_program, token_program] =
|
||||
|
||||
// let [signer_info, block_info, collateral_info, market_info, mint_base_info, mint_quote_info, stake_info, tokens_base_info, tokens_quote_info, vault_base_info, vault_quote_info, system_program, token_program, associated_token_program] =
|
||||
|
||||
pub fn swap(
|
||||
signer: Pubkey,
|
||||
id: u64,
|
||||
|
||||
Reference in New Issue
Block a user