@@ -2318,19 +2318,8 @@ mod tests {
2318
2318
2319
2319
#[ tokio:: test]
2320
2320
async fn test_check_approved_program_when_unsupported_system_program_instruction ( ) {
2321
- let ( service, opportunities) = get_service ( true ) ;
2322
- let opportunity = opportunities. user_token_specified . clone ( ) ;
2323
- let bid_amount = 1 ;
2321
+ let ( service, _) = get_service ( true ) ;
2324
2322
let searcher = Keypair :: new ( ) ;
2325
- let swap_instruction = svm:: Svm :: get_swap_instruction ( GetSwapInstructionParams {
2326
- searcher : searcher. pubkey ( ) ,
2327
- opportunity_params : get_opportunity_params ( opportunity. clone ( ) ) ,
2328
- bid_amount,
2329
- deadline : ( OffsetDateTime :: now_utc ( ) + Duration :: seconds ( 30 ) ) . unix_timestamp ( ) ,
2330
- fee_receiver_relayer : Pubkey :: new_unique ( ) ,
2331
- relayer_signer : service. config . chain_config . express_relay . relayer . pubkey ( ) ,
2332
- } )
2333
- . unwrap ( ) ;
2334
2323
let instructions = vec ! [
2335
2324
system_instruction:: advance_nonce_account( & Pubkey :: new_unique( ) , & Pubkey :: new_unique( ) ) ,
2336
2325
system_instruction:: create_account(
@@ -2354,10 +2343,8 @@ mod tests {
2354
2343
] ;
2355
2344
for instruction in instructions. into_iter ( ) {
2356
2345
let program_id = instruction. program_id ;
2357
- let transaction = Transaction :: new_with_payer (
2358
- & [ instruction. clone ( ) , swap_instruction. clone ( ) ] ,
2359
- Some ( & searcher. pubkey ( ) ) ,
2360
- ) ;
2346
+ let transaction =
2347
+ Transaction :: new_with_payer ( & [ instruction. clone ( ) ] , Some ( & searcher. pubkey ( ) ) ) ;
2361
2348
let instruction = transaction
2362
2349
. message ( )
2363
2350
. instructions
@@ -2374,19 +2361,8 @@ mod tests {
2374
2361
2375
2362
#[ tokio:: test]
2376
2363
async fn test_check_approved_program_when_unsupported_token_instruction ( ) {
2377
- let ( service, opportunities) = get_service ( true ) ;
2378
- let opportunity = opportunities. user_token_specified . clone ( ) ;
2379
- let bid_amount = 1 ;
2364
+ let ( service, _) = get_service ( true ) ;
2380
2365
let searcher = Keypair :: new ( ) ;
2381
- let swap_instruction = svm:: Svm :: get_swap_instruction ( GetSwapInstructionParams {
2382
- searcher : searcher. pubkey ( ) ,
2383
- opportunity_params : get_opportunity_params ( opportunity. clone ( ) ) ,
2384
- bid_amount,
2385
- deadline : ( OffsetDateTime :: now_utc ( ) + Duration :: seconds ( 30 ) ) . unix_timestamp ( ) ,
2386
- fee_receiver_relayer : Pubkey :: new_unique ( ) ,
2387
- relayer_signer : service. config . chain_config . express_relay . relayer . pubkey ( ) ,
2388
- } )
2389
- . unwrap ( ) ;
2390
2366
let instructions = vec ! [
2391
2367
spl_token:: instruction:: initialize_account(
2392
2368
& spl_token:: id( ) ,
@@ -2482,10 +2458,8 @@ mod tests {
2482
2458
let data = instruction. data . clone ( ) ;
2483
2459
let ix_parsed = TokenInstruction :: unpack ( & data) . unwrap ( ) ;
2484
2460
let program_id = instruction. program_id ;
2485
- let transaction = Transaction :: new_with_payer (
2486
- & [ instruction. clone ( ) , swap_instruction. clone ( ) ] ,
2487
- Some ( & searcher. pubkey ( ) ) ,
2488
- ) ;
2461
+ let transaction =
2462
+ Transaction :: new_with_payer ( & [ instruction. clone ( ) ] , Some ( & searcher. pubkey ( ) ) ) ;
2489
2463
let instruction = transaction
2490
2464
. message ( )
2491
2465
. instructions
@@ -2502,19 +2476,8 @@ mod tests {
2502
2476
2503
2477
#[ tokio:: test]
2504
2478
async fn test_check_approved_program_when_unsupported_token_2022_instruction ( ) {
2505
- let ( service, opportunities) = get_service ( true ) ;
2506
- let opportunity = opportunities. user_token_specified . clone ( ) ;
2507
- let bid_amount = 1 ;
2479
+ let ( service, _) = get_service ( true ) ;
2508
2480
let searcher = Keypair :: new ( ) ;
2509
- let swap_instruction = svm:: Svm :: get_swap_instruction ( GetSwapInstructionParams {
2510
- searcher : searcher. pubkey ( ) ,
2511
- opportunity_params : get_opportunity_params ( opportunity. clone ( ) ) ,
2512
- bid_amount,
2513
- deadline : ( OffsetDateTime :: now_utc ( ) + Duration :: seconds ( 30 ) ) . unix_timestamp ( ) ,
2514
- fee_receiver_relayer : Pubkey :: new_unique ( ) ,
2515
- relayer_signer : service. config . chain_config . express_relay . relayer . pubkey ( ) ,
2516
- } )
2517
- . unwrap ( ) ;
2518
2481
let instructions = vec ! [
2519
2482
spl_token_2022:: instruction:: initialize_account(
2520
2483
& spl_token_2022:: id( ) ,
@@ -2612,10 +2575,8 @@ mod tests {
2612
2575
let data = instruction. data . clone ( ) ;
2613
2576
let ix_parsed = TokenInstruction :: unpack ( & data) . unwrap ( ) ;
2614
2577
let program_id = instruction. program_id ;
2615
- let transaction = Transaction :: new_with_payer (
2616
- & [ instruction. clone ( ) , swap_instruction. clone ( ) ] ,
2617
- Some ( & searcher. pubkey ( ) ) ,
2618
- ) ;
2578
+ let transaction =
2579
+ Transaction :: new_with_payer ( & [ instruction. clone ( ) ] , Some ( & searcher. pubkey ( ) ) ) ;
2619
2580
let instruction = transaction
2620
2581
. message ( )
2621
2582
. instructions
@@ -2632,19 +2593,8 @@ mod tests {
2632
2593
2633
2594
#[ tokio:: test]
2634
2595
async fn test_check_approved_program_when_unsupported_associated_token_account_instruction ( ) {
2635
- let ( service, opportunities) = get_service ( true ) ;
2636
- let opportunity = opportunities. user_token_specified . clone ( ) ;
2637
- let bid_amount = 1 ;
2596
+ let ( service, _) = get_service ( true ) ;
2638
2597
let searcher = Keypair :: new ( ) ;
2639
- let swap_instruction = svm:: Svm :: get_swap_instruction ( GetSwapInstructionParams {
2640
- searcher : searcher. pubkey ( ) ,
2641
- opportunity_params : get_opportunity_params ( opportunity. clone ( ) ) ,
2642
- bid_amount,
2643
- deadline : ( OffsetDateTime :: now_utc ( ) + Duration :: seconds ( 30 ) ) . unix_timestamp ( ) ,
2644
- fee_receiver_relayer : Pubkey :: new_unique ( ) ,
2645
- relayer_signer : service. config . chain_config . express_relay . relayer . pubkey ( ) ,
2646
- } )
2647
- . unwrap ( ) ;
2648
2598
let instructions = vec ! [ recover_nested(
2649
2599
& Pubkey :: new_unique( ) ,
2650
2600
& Pubkey :: new_unique( ) ,
@@ -2660,10 +2610,8 @@ mod tests {
2660
2610
} )
2661
2611
. unwrap ( ) ;
2662
2612
let program_id = instruction. program_id ;
2663
- let transaction = Transaction :: new_with_payer (
2664
- & [ instruction. clone ( ) , swap_instruction. clone ( ) ] ,
2665
- Some ( & searcher. pubkey ( ) ) ,
2666
- ) ;
2613
+ let transaction =
2614
+ Transaction :: new_with_payer ( & [ instruction. clone ( ) ] , Some ( & searcher. pubkey ( ) ) ) ;
2667
2615
let instruction = transaction
2668
2616
. message ( )
2669
2617
. instructions
@@ -2680,26 +2628,13 @@ mod tests {
2680
2628
2681
2629
#[ tokio:: test]
2682
2630
async fn test_check_approved_program_when_unapproved_program_id ( ) {
2683
- let ( service, opportunities) = get_service ( true ) ;
2684
- let opportunity = opportunities. user_token_specified . clone ( ) ;
2685
- let bid_amount = 1 ;
2631
+ let ( service, _) = get_service ( true ) ;
2686
2632
let searcher = Keypair :: new ( ) ;
2687
- let swap_instruction = svm:: Svm :: get_swap_instruction ( GetSwapInstructionParams {
2688
- searcher : searcher. pubkey ( ) ,
2689
- opportunity_params : get_opportunity_params ( opportunity. clone ( ) ) ,
2690
- bid_amount,
2691
- deadline : ( OffsetDateTime :: now_utc ( ) + Duration :: seconds ( 30 ) ) . unix_timestamp ( ) ,
2692
- fee_receiver_relayer : Pubkey :: new_unique ( ) ,
2693
- relayer_signer : service. config . chain_config . express_relay . relayer . pubkey ( ) ,
2694
- } )
2695
- . unwrap ( ) ;
2696
2633
let program_id = Pubkey :: new_unique ( ) ;
2697
2634
let instruction = Instruction :: new_with_bincode ( program_id, & "" , vec ! [ ] ) ;
2698
2635
2699
- let transaction = Transaction :: new_with_payer (
2700
- & [ instruction. clone ( ) , swap_instruction. clone ( ) ] ,
2701
- Some ( & searcher. pubkey ( ) ) ,
2702
- ) ;
2636
+ let transaction =
2637
+ Transaction :: new_with_payer ( & [ instruction. clone ( ) ] , Some ( & searcher. pubkey ( ) ) ) ;
2703
2638
let instruction = transaction
2704
2639
. message ( )
2705
2640
. instructions
0 commit comments