diff --git a/api/src/sdk.rs b/api/src/sdk.rs index 99b15b4..56e98de 100644 --- a/api/src/sdk.rs +++ b/api/src/sdk.rs @@ -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 { diff --git a/program/src/open.rs b/program/src/open.rs index c7b1808..396799b 100644 --- a/program/src/open.rs +++ b/program/src/open.rs @@ -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(()) }