mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
block start at
This commit is contained in:
@@ -22,6 +22,9 @@ pub struct Block {
|
||||
/// The authority of the miner who submitted the best hash.
|
||||
pub best_hash_miner: Pubkey,
|
||||
|
||||
/// The timestamp at which the block starts mining.
|
||||
pub start_at: i64,
|
||||
|
||||
/// The slot at which the block starts trading.
|
||||
pub start_slot: u64,
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
||||
market.fee.cumulative = 0;
|
||||
|
||||
// Setup the next block start and end slots.
|
||||
block_next.start_at = clock.unix_timestamp;
|
||||
block_next.start_slot = clock.slot;
|
||||
block_next.end_slot = clock.slot + config.block_duration;
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ fn test_sniper_fees() {
|
||||
reward: 0,
|
||||
best_hash: [0; 32],
|
||||
best_hash_miner: Pubkey::default(),
|
||||
start_at: 0,
|
||||
start_slot: 0,
|
||||
end_slot: u64::MAX,
|
||||
slot_hash: [0; 32],
|
||||
|
||||
Reference in New Issue
Block a user