diff --git a/program/rust/src/tests/test_add_publisher.rs b/program/rust/src/tests/test_add_publisher.rs index 45d6172c..41dcfe67 100644 --- a/program/rust/src/tests/test_add_publisher.rs +++ b/program/rust/src/tests/test_add_publisher.rs @@ -58,21 +58,7 @@ fn test_add_publisher() { permissions_account_data.security_authority = *funding_account.key; } - // Expect the instruction to fail, because the price account isn't rent exempt - assert_eq!( - process_instruction( - &program_id, - &[ - funding_account.clone(), - price_account.clone(), - permissions_account.clone(), - ], - instruction_data - ), - Err(OracleError::InvalidWritableAccount.into()) - ); - - // Now give the price account enough lamports to be rent exempt + // Give the price account enough lamports to be rent exempt **price_account.try_borrow_mut_lamports().unwrap() = Rent::minimum_balance(&Rent::default(), PriceAccount::MINIMUM_SIZE); diff --git a/program/rust/src/utils.rs b/program/rust/src/utils.rs index 2f5d41e9..97ef9b53 100644 --- a/program/rust/src/utils.rs +++ b/program/rust/src/utils.rs @@ -115,9 +115,7 @@ fn valid_writable_account( program_id: &Pubkey, account: &AccountInfo, ) -> Result { - Ok(account.is_writable - && account.owner == program_id - && get_rent()?.is_exempt(account.lamports(), account.data_len())) + Ok(account.is_writable && account.owner == program_id) } pub fn check_valid_writable_account( @@ -134,10 +132,7 @@ fn valid_readable_account( program_id: &Pubkey, account: &AccountInfo, ) -> Result { - Ok( - account.owner == program_id - && get_rent()?.is_exempt(account.lamports(), account.data_len()), - ) + Ok(account.owner == program_id) } pub fn check_valid_readable_account( @@ -180,11 +175,7 @@ pub fn get_status_for_conf_price_ratio( confidence: u64, status: u32, ) -> Result { - let mut threshold_conf = price / MAX_CI_DIVISOR; - - if threshold_conf < 0 { - threshold_conf = -threshold_conf; - } + let threshold_conf = price.abs() / MAX_CI_DIVISOR; if confidence > try_convert::<_, u64>(threshold_conf)? { Ok(PC_STATUS_IGNORED)