Skip to content

Commit 085745b

Browse files
committed
reversing updates to be sent on cosmos
1 parent 202e2ad commit 085745b

File tree

1 file changed

+2
-52
lines changed

1 file changed

+2
-52
lines changed

hyperspace/solana/src/lib.rs

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,6 @@ impl IbcProvider for SolanaClient {
190190
};
191191
log::info!("This is client state {:?}", client_state);
192192
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-
201193
println!("This is counterparty client height {:?}", latest_cp_client_height);
202194
let (all_signatures, new_block_events) = events::get_signatures_upto_height(
203195
self.rpc_client(),
@@ -215,52 +207,8 @@ impl IbcProvider for SolanaClient {
215207
convert_new_event_to_old(event.clone(), Height::new(1, u64::from(finality_height)))
216208
})
217209
.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-
// }
255210

256211
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();
264212
let mut updates = Vec::new();
265213
for (signatures, block_header, epoch) in all_signatures {
266214
if epoch.is_none() && u64::from(block_header.block_height) != finality_height {
@@ -371,6 +319,8 @@ impl IbcProvider for SolanaClient {
371319
};
372320
updates.push(update);
373321
}
322+
// Reversing so that updates are sent in ascending order of their height.
323+
updates.reverse();
374324
Ok(updates)
375325
}
376326

0 commit comments

Comments
 (0)