From c5ad4d53b63362a66f678003877caf55eb464d0b Mon Sep 17 00:00:00 2001 From: Blockiosaurus Date: Thu, 31 Oct 2024 07:48:58 -0400 Subject: [PATCH] Removing unwrap. --- core/rust/utils/src/account.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rust/utils/src/account.rs b/core/rust/utils/src/account.rs index bef839cf0..496aa3a30 100644 --- a/core/rust/utils/src/account.rs +++ b/core/rust/utils/src/account.rs @@ -107,7 +107,7 @@ pub fn close_account_raw<'a>( let dest_starting_lamports = dest_account_info.lamports(); **dest_account_info.lamports.borrow_mut() = dest_starting_lamports .checked_add(src_account_info.lamports()) - .unwrap(); + .ok_or(ProgramError::InvalidRealloc)?; **src_account_info.lamports.borrow_mut() = 0; src_account_info.assign(&system_program::ID);