@@ -9,7 +9,7 @@ use solana_program::{instruction::Instruction, program::invoke_signed_unchecked}
9
9
10
10
use crate :: {
11
11
error:: MatchingEngineError ,
12
- processor:: { get_user_amount_and_new_status_and_penalized , ActiveAuctionAccountInfos } ,
12
+ processor:: ExecuteOrderInternalAccounting ,
13
13
state:: { Auction , AuctionStatus , Custodian , MessageProtocol } ,
14
14
ID ,
15
15
} ;
@@ -347,24 +347,21 @@ pub(super) fn process(accounts: &[AccountInfo]) -> Result<()> {
347
347
// in?
348
348
349
349
// Prepare the execute order (get the user amount, fill, and order executed event)
350
- let active_auction_accounts = ActiveAuctionAccountInfos {
351
- auction_best_offer_token : auction_best_offer_token_info. to_account_info ( ) ,
352
- auction_executor_token : executor_token_info. to_account_info ( ) ,
353
- auction_initial_offer_token : auction_initial_offer_token_info. to_account_info ( ) ,
354
- auction_custody_token : auction_custody_info. to_account_info ( ) ,
355
- active_auction : active_auction_info. to_account_info ( ) ,
356
- auction_custodian : custodian_info. to_account_info ( ) ,
357
- } ;
358
- let custody_token =
350
+ let auction_custody =
359
351
TokenAccount :: try_deserialize ( & mut & auction_custody_info. data . borrow ( ) [ ..] ) ?;
360
- let ( user_amount, new_status, _penalized) = get_user_amount_and_new_status_and_penalized (
361
- & active_auction,
362
- & custody_token,
363
- & auction_config,
364
- fast_market_order. init_auction_fee ,
365
- active_auction_accounts,
366
- accounts,
367
- ) ?;
352
+
353
+ let ( user_amount, new_status, _penalized) = ExecuteOrderInternalAccounting {
354
+ active_auction_key : active_auction_info. key ,
355
+ active_auction : & active_auction,
356
+ auction_custody_key : auction_custody_info. key ,
357
+ auction_custody : & auction_custody,
358
+ best_offer_token_info : auction_best_offer_token_info,
359
+ executor_token_key : executor_token_info. key ,
360
+ initial_offer_token_info : auction_initial_offer_token_info,
361
+ custodian_key : custodian_info. key ,
362
+ auction_config : & auction_config,
363
+ }
364
+ . into_calculate_and_transfer ( fast_market_order. init_auction_fee , accounts) ?;
368
365
369
366
// Set the active auction status
370
367
active_auction. status = new_status;
0 commit comments