mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 15:10:13 +00:00
events
This commit is contained in:
@@ -76,6 +76,7 @@ pub fn process_close(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
||||
authority: block.reward.lode_authority,
|
||||
block_id: block.id,
|
||||
rewards_type: RewardsType::Lode as u64,
|
||||
ts: clock.unix_timestamp,
|
||||
}
|
||||
.log();
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
|
||||
authority: miner.authority,
|
||||
block_id: block.id,
|
||||
rewards_type: RewardsType::Motherlode as u64,
|
||||
ts: clock.unix_timestamp,
|
||||
}
|
||||
.log();
|
||||
}
|
||||
@@ -164,6 +165,7 @@ pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
|
||||
authority: miner.authority,
|
||||
block_id: block.id,
|
||||
rewards_type: RewardsType::Nugget as u64,
|
||||
ts: clock.unix_timestamp,
|
||||
}
|
||||
.log();
|
||||
}
|
||||
|
||||
@@ -223,6 +223,18 @@ pub fn process_open(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
|
||||
&[BLOCK, &id.to_le_bytes()],
|
||||
)?;
|
||||
|
||||
// Emit event.
|
||||
OpenEvent {
|
||||
id,
|
||||
start_slot,
|
||||
signer: *signer_info.key,
|
||||
reward_config: block.reward,
|
||||
liquidity_base: market.base.liquidity() as u64,
|
||||
liquidity_quote: market.quote.liquidity() as u64,
|
||||
ts: clock.unix_timestamp,
|
||||
}
|
||||
.log_return();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user