@@ -42,14 +42,17 @@ impl ExecuteOrderFallbackAccounts {
42
42
current_state : & TestingEngineState ,
43
43
payer_signer : & Pubkey ,
44
44
fixture_accounts : & utils:: account_fixtures:: FixtureAccounts ,
45
+ override_fast_market_order_address : Option < Pubkey > ,
45
46
) -> Self {
46
47
let transfer_direction = current_state. base ( ) . transfer_direction ;
47
48
let auction_accounts = current_state. auction_accounts ( ) . unwrap ( ) ;
48
49
let active_auction_state = current_state. auction_state ( ) . get_active_auction ( ) . unwrap ( ) ;
49
- let fast_market_order_address = current_state
50
- . fast_market_order ( )
51
- . unwrap ( )
52
- . fast_market_order_address ;
50
+ let fast_market_order_address = override_fast_market_order_address. unwrap_or_else ( || {
51
+ current_state
52
+ . fast_market_order ( )
53
+ . unwrap ( )
54
+ . fast_market_order_address
55
+ } ) ;
53
56
let remote_token_messenger = match transfer_direction {
54
57
TransferDirection :: FromEthereumToArbitrum => {
55
58
fixture_accounts. arbitrum_remote_token_messenger
@@ -95,7 +98,7 @@ pub struct ExecuteOrderFallbackFixtureAccounts {
95
98
pub executor_token : Pubkey ,
96
99
}
97
100
98
- pub async fn execute_order_fallback (
101
+ pub async fn execute_order_shimful (
99
102
testing_context : & TestingContext ,
100
103
test_context : & mut ProgramTestContext ,
101
104
config : & ExecuteOrderInstructionConfig ,
@@ -131,7 +134,11 @@ pub async fn execute_order_fallback(
131
134
. get_new_latest_blockhash ( test_context)
132
135
. await
133
136
. unwrap ( ) ;
134
- crate :: testing_engine:: engine:: fast_forward_slots ( test_context, 3 ) . await ;
137
+ let slots_to_fast_forward = config. fast_forward_slots ;
138
+ if slots_to_fast_forward > 0 {
139
+ crate :: testing_engine:: engine:: fast_forward_slots ( test_context, slots_to_fast_forward)
140
+ . await ;
141
+ }
135
142
let transaction = Transaction :: new_signed_with_payer (
136
143
& [ execute_order_ix] ,
137
144
Some ( & payer_signer. pubkey ( ) ) ,
@@ -262,7 +269,7 @@ pub fn create_execute_order_shim_accounts<'ix>(
262
269
}
263
270
}
264
271
265
- pub async fn execute_order_fallback_test (
272
+ pub async fn execute_order_shimful_test (
266
273
testing_context : & TestingContext ,
267
274
test_context : & mut ProgramTestContext ,
268
275
current_state : & TestingEngineState ,
@@ -276,9 +283,13 @@ pub async fn execute_order_fallback_test(
276
283
. payer_signer
277
284
. clone ( )
278
285
. unwrap_or_else ( || testing_context. testing_actors . payer_signer . clone ( ) ) ;
279
- let execute_order_fallback_accounts =
280
- ExecuteOrderFallbackAccounts :: new ( current_state, & payer_signer. pubkey ( ) , & fixture_accounts) ;
281
- execute_order_fallback (
286
+ let execute_order_fallback_accounts = ExecuteOrderFallbackAccounts :: new (
287
+ current_state,
288
+ & payer_signer. pubkey ( ) ,
289
+ & fixture_accounts,
290
+ config. fast_market_order_address ,
291
+ ) ;
292
+ execute_order_shimful (
282
293
testing_context,
283
294
test_context,
284
295
config,
0 commit comments