@@ -839,9 +839,7 @@ impl Processor {
839
839
}
840
840
841
841
let mut source_account_data = source_account_info. data . borrow_mut ( ) ;
842
- if let Ok ( mut source_account) =
843
- StateWithExtensionsMut :: < Account > :: unpack ( & mut source_account_data)
844
- {
842
+ if let Ok ( source_account) = StateWithExtensions :: < Account > :: unpack ( & source_account_data) {
845
843
if !source_account. base . is_native ( ) && source_account. base . amount != 0 {
846
844
return Err ( TokenError :: NonNativeHasBalance . into ( ) ) ;
847
845
}
@@ -859,24 +857,17 @@ impl Processor {
859
857
account_info_iter. as_slice ( ) ,
860
858
) ?;
861
859
862
- // TODO use get_extension when
863
- // https://github.com/solana-labs/solana-program-library/pull/2822 lands
864
860
if let Ok ( confidential_transfer_state) =
865
- source_account. get_extension_mut :: < ConfidentialTransferAccount > ( )
861
+ source_account. get_extension :: < ConfidentialTransferAccount > ( )
866
862
{
867
863
confidential_transfer_state. closable ( ) ?
868
864
}
869
865
870
- // TODO use get_extension when
871
- // https://github.com/solana-labs/solana-program-library/pull/2822 lands
872
- if let Ok ( transfer_fee_state) = source_account. get_extension_mut :: < TransferFeeAmount > ( )
873
- {
866
+ if let Ok ( transfer_fee_state) = source_account. get_extension :: < TransferFeeAmount > ( ) {
874
867
transfer_fee_state. closable ( ) ?
875
868
}
876
- } else if let Ok ( mut mint) =
877
- StateWithExtensionsMut :: < Mint > :: unpack ( & mut source_account_data)
878
- {
879
- let extension = mint. get_extension_mut :: < MintCloseAuthority > ( ) ?;
869
+ } else if let Ok ( mint) = StateWithExtensions :: < Mint > :: unpack ( & source_account_data) {
870
+ let extension = mint. get_extension :: < MintCloseAuthority > ( ) ?;
880
871
let maybe_authority: Option < Pubkey > = extension. close_authority . into ( ) ;
881
872
let authority = maybe_authority. ok_or ( TokenError :: AuthorityTypeNotSupported ) ?;
882
873
Self :: validate_owner (
0 commit comments