@@ -815,88 +815,3 @@ where
815815 try_join_all ( cleanup_futs) . await . map ( |_| ( ) )
816816 }
817817}
818-
819- #[ cfg( test) ]
820- mod tests {
821- use std:: { collections:: HashMap , sync:: Arc } ;
822-
823- use magicblock_rpc_client:: MagicBlockRpcClientResult ;
824- use solana_account:: Account ;
825- use solana_pubkey:: Pubkey ;
826-
827- use crate :: {
828- intent_execution_manager:: intent_scheduler:: create_test_intent,
829- intent_executor:: {
830- task_info_fetcher:: {
831- ResetType , TaskInfoFetcher , TaskInfoFetcherResult ,
832- } ,
833- IntentExecutorImpl ,
834- } ,
835- persist:: IntentPersisterImpl ,
836- tasks:: task_builder:: { TaskBuilderImpl , TasksBuilder } ,
837- transaction_preparator:: TransactionPreparatorImpl ,
838- } ;
839-
840- struct MockInfoFetcher ;
841- #[ async_trait:: async_trait]
842- impl TaskInfoFetcher for MockInfoFetcher {
843- async fn fetch_next_commit_ids (
844- & self ,
845- pubkeys : & [ Pubkey ] ,
846- ) -> TaskInfoFetcherResult < HashMap < Pubkey , u64 > > {
847- Ok ( pubkeys. iter ( ) . map ( |pubkey| ( * pubkey, 0 ) ) . collect ( ) )
848- }
849-
850- async fn fetch_rent_reimbursements (
851- & self ,
852- pubkeys : & [ Pubkey ] ,
853- ) -> TaskInfoFetcherResult < Vec < Pubkey > > {
854- Ok ( pubkeys. iter ( ) . map ( |_| Pubkey :: new_unique ( ) ) . collect ( ) )
855- }
856-
857- fn peek_commit_id ( & self , _pubkey : & Pubkey ) -> Option < u64 > {
858- Some ( 0 )
859- }
860-
861- fn reset ( & self , _: ResetType ) { }
862-
863- async fn get_base_account (
864- & self ,
865- _pubkey : & Pubkey ,
866- ) -> MagicBlockRpcClientResult < Option < Account > > {
867- Ok ( None ) // AccountNotFound
868- }
869- }
870-
871- #[ tokio:: test]
872- async fn test_try_unite ( ) {
873- let pubkey = [ Pubkey :: new_unique ( ) ] ;
874- let intent = create_test_intent ( 0 , & pubkey) ;
875-
876- let info_fetcher = Arc :: new ( MockInfoFetcher ) ;
877- let commit_task = TaskBuilderImpl :: commit_tasks (
878- & info_fetcher,
879- & intent,
880- & None :: < IntentPersisterImpl > ,
881- )
882- . await
883- . unwrap ( ) ;
884- let finalize_task =
885- TaskBuilderImpl :: finalize_tasks ( & info_fetcher, & intent)
886- . await
887- . unwrap ( ) ;
888-
889- let result = IntentExecutorImpl :: <
890- TransactionPreparatorImpl ,
891- MockInfoFetcher ,
892- > :: try_unite_tasks (
893- & commit_task,
894- & finalize_task,
895- & Pubkey :: new_unique ( ) ,
896- & None :: < IntentPersisterImpl > ,
897- ) ;
898-
899- let strategy = result. unwrap ( ) . unwrap ( ) ;
900- assert ! ( strategy. lookup_tables_keys. is_empty( ) ) ;
901- }
902- }
0 commit comments