mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
fix
This commit is contained in:
@@ -35,7 +35,7 @@ pub fn open(signer: Pubkey, id: u64) -> Instruction {
|
||||
AccountMeta::new_readonly(system_program::ID, false),
|
||||
AccountMeta::new_readonly(spl_token::ID, false),
|
||||
AccountMeta::new_readonly(spl_associated_token_account::ID, false),
|
||||
AccountMeta::new_readonly(ore_api::ID, false),
|
||||
AccountMeta::new_readonly(crate::ID, false),
|
||||
AccountMeta::new_readonly(sysvar::rent::ID, false),
|
||||
],
|
||||
data: Open {
|
||||
|
||||
@@ -313,27 +313,40 @@ pub fn process_open(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
|
||||
&[BLOCK, &id.to_le_bytes()],
|
||||
)?;
|
||||
|
||||
let msg = OpenEvent {
|
||||
disc: OreEvent::Open as u64,
|
||||
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,
|
||||
}
|
||||
.to_bytes();
|
||||
// let msg = OpenEvent {
|
||||
// disc: OreEvent::Open as u64,
|
||||
// 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,
|
||||
// }
|
||||
// .to_bytes();
|
||||
|
||||
invoke_signed(
|
||||
&ore_api::sdk::log(*block_info.key, &msg),
|
||||
&[block_info, ore_program],
|
||||
&crate::ID,
|
||||
&[BLOCK, &block_id.to_le_bytes()],
|
||||
&ore_api::sdk::log(
|
||||
*block_info.key,
|
||||
&OpenEvent {
|
||||
disc: OreEvent::Open as u64,
|
||||
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,
|
||||
}
|
||||
.to_bytes(),
|
||||
),
|
||||
&[block_info.clone(), ore_program.clone()],
|
||||
&ore_api::ID,
|
||||
&[BLOCK, &id.to_le_bytes()],
|
||||
)?;
|
||||
|
||||
// Emit event.
|
||||
program_log(id, block_info.clone(), &msg)?;
|
||||
// program_log(id, block_info.clone(), &msg)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user