@@ -109,7 +109,6 @@ use switchboard_on_demand_client::{
109109 } ,
110110 QueueAccountData ,
111111} ;
112- use switchboard_on_demand_client:: QueueAccountData ;
113112use tokio:: time:: sleep;
114113
115114use jito_priority_fee_distribution_sdk;
@@ -876,6 +875,8 @@ pub async fn crank_switchboard(handler: &CliHandler, switchboard_feed: &Pubkey)
876875 Ok ( ( ) )
877876 }
878877
878+ let switchboard_context = handler. switchboard_context ( ) ;
879+
879880 let client = handler. rpc_client ( ) ;
880881 let payer = handler. keypair ( ) ;
881882
@@ -892,7 +893,6 @@ pub async fn crank_switchboard(handler: &CliHandler, switchboard_feed: &Pubkey)
892893 . get_account_with_commitment ( & queue_key, handler. commitment )
893894 . await ?
894895 . value
895- . map ( |a| a)
896896 . expect ( "Queue account not found" ) ;
897897 let queue_account_info = AccountInfo {
898898 key : & queue_key,
@@ -902,14 +902,15 @@ pub async fn crank_switchboard(handler: &CliHandler, switchboard_feed: &Pubkey)
902902 lamports : Rc :: new ( RefCell :: new ( & mut queue_account. lamports ) ) ,
903903 data : Rc :: new ( RefCell :: new ( & mut queue_account. data ) ) ,
904904 executable : false ,
905+ #[ allow( deprecated) ]
905906 _unused : 0 ,
906907 } ;
907908
908909 let queue = * QueueAccountData :: new ( & queue_account_info) ?;
909910
910- // let gateways = &queue.fetch_gateways(client).await?;
911+ let gateways = & queue. fetch_gateways ( client) . await ?;
911912
912- /* if gateways.is_empty() {
913+ if gateways. is_empty ( ) {
913914 return Err ( anyhow ! ( "No gateways found" ) ) ;
914915 }
915916
@@ -938,7 +939,7 @@ pub async fn crank_switchboard(handler: &CliHandler, switchboard_feed: &Pubkey)
938939 "Crank Switchboard" ,
939940 & [ format ! ( "FEED: {:?}" , switchboard_feed) ] ,
940941 )
941- .await?;*/
942+ . await ?;
942943
943944 Ok ( ( ) )
944945}
0 commit comments