@@ -317,6 +317,25 @@ pub async fn test_settle_auction_none_balance_changes_comparable() {
317
317
helpers:: compare_balance_changes ( & balance_changes_shimful, & balance_changes_shimless) ;
318
318
}
319
319
320
+ /// Test that settle auction none closes the prepared order account and the custody token account
321
+ #[ tokio:: test]
322
+ pub async fn test_settle_auction_none_closes_prepared_order_account_and_custody_token_account ( ) {
323
+ let ( mut test_context, prepared_order_state, testing_engine, _initial_balances) =
324
+ Box :: pin ( helpers:: prepare_settle_auction_none_shimful ( ) ) . await ;
325
+ let instruction_triggers = vec ! [ InstructionTrigger :: SettleAuctionNoneShim (
326
+ SettleAuctionNoneInstructionConfig :: default ( ) ,
327
+ ) ] ;
328
+ let settle_auction_none_state = testing_engine
329
+ . execute (
330
+ & mut test_context,
331
+ instruction_triggers,
332
+ Some ( prepared_order_state) ,
333
+ )
334
+ . await ;
335
+ helpers:: verify_prepared_order_accounts_closed ( & settle_auction_none_state, & mut test_context)
336
+ . await ;
337
+ }
338
+
320
339
/*
321
340
Sad path tests section
322
341
@@ -435,6 +454,25 @@ mod helpers {
435
454
436
455
use super :: * ;
437
456
457
+ pub async fn verify_prepared_order_accounts_closed (
458
+ testing_state : & TestingEngineState ,
459
+ test_context : & mut ProgramTestContext ,
460
+ ) {
461
+ let prepared_order_accounts = testing_state. order_prepared ( ) . unwrap ( ) ;
462
+ let prepared_order_account = test_context
463
+ . banks_client
464
+ . get_account ( prepared_order_accounts. prepared_custody_token )
465
+ . await
466
+ . unwrap ( ) ;
467
+ assert ! ( prepared_order_account. is_none( ) ) ;
468
+ let prepared_custody_token_account = test_context
469
+ . banks_client
470
+ . get_account ( prepared_order_accounts. prepared_custody_token )
471
+ . await
472
+ . unwrap ( ) ;
473
+ assert ! ( prepared_custody_token_account. is_none( ) ) ;
474
+ }
475
+
438
476
pub async fn balance_changes_shim ( ) -> BalanceChanges {
439
477
let transfer_direction = TransferDirection :: FromEthereumToArbitrum ;
440
478
let vaa_args = vec ! [ VaaArgs {
0 commit comments