From e890e9c3124c21e93433022a156eca59564a02d2 Mon Sep 17 00:00:00 2001 From: Kriptikz Date: Wed, 24 Jul 2024 23:08:07 -0500 Subject: [PATCH] remove old mine fn introspect_transaction --- program/src/mine.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/program/src/mine.rs b/program/src/mine.rs index 6f70ea8..001b18b 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -186,41 +186,3 @@ pub fn process_mine<'a, 'info>( Ok(()) } -fn introspect_transaction(msg: &[u8]) -> Result { - #[allow(deprecated)] - let idx = load_current_index(msg); - let mut c = 0; - let num_instructions = read_u16(&mut c, msg)?; - let pc = c; - for i in 0..num_instructions as usize { - c = pc + i * 2; - c = read_u16(&mut c, msg)? as usize; - let num_accounts = read_u16(&mut c, msg)? as usize; - c += num_accounts * 33; - let program_id = read_pubkey(&mut c, msg)?; - if i.eq(&(idx as usize)) { - // Require top-level instruction at current index is a `mine` - if program_id.ne(&ore_api::ID) { - return Ok(false); - } - c += 2; - if let Ok(ix) = OreInstruction::try_from(read_u8(&mut c, msg)?) { - if ix.ne(&OreInstruction::Mine) { - return Ok(false); - } - } - } else { - // Require no other instructions in the transaction are a `mine` - if program_id.eq(&ore_api::ID) { - c += 2; - if let Ok(ix) = OreInstruction::try_from(read_u8(&mut c, msg)?) { - if ix.eq(&OreInstruction::Mine) { - return Ok(false); - } - } - } - } - } - - Ok(true) -}