pub mod confidential_transfer;
pub mod confidential_transfer_fee;
pub mod cpi_guard;
pub mod default_account_state;
pub mod group_member_pointer;
pub mod group_pointer;
pub mod immutable_owner;
pub mod interest_bearing_mint;
pub mod memo_transfer;
pub mod metadata_pointer;
pub mod mint_close_authority;
pub mod non_transferable;
pub mod pausable;
pub mod permanent_delegate;
pub mod permissioned_burn;
pub mod reallocate;
pub mod scaled_ui_amount;
pub mod token_group;
pub mod token_metadata;
pub mod transfer_fee;
pub mod transfer_hook;
pub mod confidential_mint_burn;
use pinocchio::AccountView;
use solana_program_error::ProgramError;
#[deprecated(
since = "9.1.0",
note = "Use spl_token_2022_interface instead and remove spl_token_2022 as a dependency"
)]
pub use spl_token_2022_interface::extension::{
alloc_and_serialize, alloc_and_serialize_variable_len_extension, set_account_type, AccountType,
BaseState, BaseStateWithExtensions, BaseStateWithExtensionsMut, Extension, ExtensionType,
Length, PodStateWithExtensions, PodStateWithExtensionsMut, StateWithExtensions,
StateWithExtensionsMut, StateWithExtensionsOwned,
};
use spl_token_2022_interface::{extension::transfer_hook::TransferHookAccount, pod::PodAccount};
pub(crate) fn unset_transferring(account_info: &mut AccountView) -> Result<(), ProgramError> {
let mut account_data = account_info.try_borrow_mut()?;
let mut account = PodStateWithExtensionsMut::<PodAccount>::unpack(&mut account_data)?;
let account_extension = account.get_extension_mut::<TransferHookAccount>()?;
account_extension.transferring = false.into();
Ok(())
}