(
account: &AccountInfo,
dest_account: &AccountInfo,
)
| 233 | } |
| 234 | |
| 235 | pub fn close_account( |
| 236 | account: &AccountInfo, |
| 237 | dest_account: &AccountInfo, |
| 238 | ) -> Result<(), ProgramError> { |
| 239 | //close account by draining lamports |
| 240 | let dest_starting_lamports = dest_account.lamports(); |
| 241 | msg!("dest_starting_lamports {}", dest_starting_lamports); |
| 242 | **dest_account.lamports.borrow_mut() = dest_starting_lamports |
| 243 | .checked_add(account.lamports()) |
| 244 | .ok_or(ProgramError::InvalidAccountData)?; |
| 245 | **account.lamports.borrow_mut() = 0; |
| 246 | msg!("dest_ending_lamports {}", dest_account.lamports()); |
| 247 | |
| 248 | Ok(()) |
| 249 | } |
| 250 | |
| 251 | pub fn sol_transfer( |
| 252 | from_account: &AccountInfo, |
no outgoing calls
no test coverage detected