@@ -190,14 +190,6 @@ impl IbcProvider for SolanaClient {
190
190
} ;
191
191
log:: info!( "This is client state {:?}" , client_state) ;
192
192
let latest_cp_client_height = u64:: from ( client_state. 0 . latest_height ) ;
193
- // let prev_block_header = events::get_header_from_height(
194
- // self.rpc_client(),
195
- // self.solana_ibc_program_id,
196
- // latest_cp_client_height,
197
- // )
198
- // .await
199
- // .expect(&format!("No block header found for height {:?}", latest_cp_client_height));
200
-
201
193
println ! ( "This is counterparty client height {:?}" , latest_cp_client_height) ;
202
194
let ( all_signatures, new_block_events) = events:: get_signatures_upto_height (
203
195
self . rpc_client ( ) ,
@@ -215,52 +207,8 @@ impl IbcProvider for SolanaClient {
215
207
convert_new_event_to_old ( event. clone ( ) , Height :: new ( 1 , u64:: from ( finality_height) ) )
216
208
} )
217
209
. collect ( ) ;
218
- // let sigs = rpc_client
219
- // .get_signatures_for_address(&self.solana_ibc_program_id)
220
- // .await
221
- // .map_err(|e| Error::RpcError(format!("{:?}", e)))?;
222
- // for sig in sigs {
223
- // if sig.slot < u64::from(prev_block_header.host_height) {
224
- // break;
225
- // }
226
- // let signature = Signature::from_str(&sig.signature).unwrap();
227
- // let tx = rpc_client
228
- // .get_transaction(&signature, UiTransactionEncoding::Json)
229
- // .await
230
- // .unwrap();
231
- // let logs = match tx.transaction.meta.unwrap().log_messages {
232
- // solana_transaction_status::option_serializer::OptionSerializer::Some(logs) => logs,
233
- // solana_transaction_status::option_serializer::OptionSerializer::None => {
234
- // return Err(Error::Custom(String::from("No logs found")).into())
235
- // },
236
- // solana_transaction_status::option_serializer::OptionSerializer::Skip => {
237
- // return Err(
238
- // Error::Custom(String::from("Logs were skipped, so not available")).into()
239
- // )
240
- // },
241
- // };
242
- // let (events, _proof_height) = events::get_ibc_events_from_logs(logs);
243
- // let converted_events: Vec<IbcEvent> = events
244
- // .iter()
245
- // .filter_map(|event| {
246
- // convert_new_event_to_old(
247
- // event.clone(),
248
- // Height::new(1, u64::from(finality_height)),
249
- // )
250
- // })
251
- // .collect();
252
- // log::info!("These are events fetched {:?}", converted_events);
253
- // block_events.extend(converted_events);
254
- // }
255
210
256
211
let chain_account = self . get_chain_storage ( ) . await ;
257
- // let (signatures, block_header) = events::get_signatures_for_blockhash(
258
- // rpc_client,
259
- // self.solana_ibc_program_id,
260
- // finality_blockhash,
261
- // )
262
- // .await
263
- // .unwrap();
264
212
let mut updates = Vec :: new ( ) ;
265
213
for ( signatures, block_header, epoch) in all_signatures {
266
214
if epoch. is_none ( ) && u64:: from ( block_header. block_height ) != finality_height {
@@ -371,6 +319,8 @@ impl IbcProvider for SolanaClient {
371
319
} ;
372
320
updates. push ( update) ;
373
321
}
322
+ // Reversing so that updates are sent in ascending order of their height.
323
+ updates. reverse ( ) ;
374
324
Ok ( updates)
375
325
}
376
326
0 commit comments