Skip to content

Commit

Permalink
fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvja committed Oct 19, 2023
1 parent d72d1d0 commit a204f0e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,15 @@ impl SolanaIbcStorage<'_, '_> {
index: super::SequenceTripleIdx,
seq: Sequence,
) -> Result {
let mut store = self.0.borrow_mut();
let trie = store.trie.as_mut().unwrap();
let map_key = (path.port_id.to_string(), path.channel_id.to_string());
let triple = self.next_sequence.entry(map_key).or_default();
let binding = self.clone();
let mut store_clone = binding.0.borrow_mut();
let triple = store_clone.next_sequence.entry(map_key).or_default();
triple.set(index, seq);

let trie_key = TrieKey::from(path);
let trie = self.trie.as_mut().unwrap();
trie.set(&trie_key, &triple.to_hash()).unwrap();

Ok(())
Expand Down
47 changes: 3 additions & 44 deletions solana/solana-ibc/programs/solana-ibc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,52 +104,11 @@ pub mod solana_ibc {
trie: Some(trie),
};

<<<<<<< HEAD
let mut store =
SolanaIbcStorage(Rc::<RefCell<SolanaIbcStorageTest>>::new(
solana_real_storage.into(),
));
let mut router = store.clone();
=======
let mut solana_real_storage_another = SolanaIbcStorage {
height: solana_ibc_store.height,
module_holder: solana_ibc_store.module_holder.clone(),
clients: solana_ibc_store.clients.clone(),
client_id_set: solana_ibc_store.client_id_set.clone(),
client_counter: solana_ibc_store.client_counter,
client_processed_times: solana_ibc_store
.client_processed_times
.clone(),
client_processed_heights: solana_ibc_store
.client_processed_heights
.clone(),
consensus_states: solana_ibc_store.consensus_states.clone(),
client_consensus_state_height_sets: solana_ibc_store
.client_consensus_state_height_sets
.clone(),
connection_id_set: solana_ibc_store.connection_id_set.clone(),
connection_counter: solana_ibc_store.connection_counter,
connections: solana_ibc_store.connections.clone(),
channel_ends: solana_ibc_store.channel_ends.clone(),
connection_to_client: solana_ibc_store.connection_to_client.clone(),
port_channel_id_set: solana_ibc_store.port_channel_id_set.clone(),
channel_counter: solana_ibc_store.channel_counter,
next_sequence: solana_ibc_store.next_sequence.clone(),
packet_commitment_sequence_sets: solana_ibc_store
.packet_commitment_sequence_sets
.clone(),
packet_receipt_sequence_sets: solana_ibc_store
.packet_receipt_sequence_sets
.clone(),
packet_acknowledgement_sequence_sets: solana_ibc_store
.packet_acknowledgement_sequence_sets
.clone(),
ibc_events_history: solana_ibc_store.ibc_events_history.clone(),
trie: None,
};

let router = &mut solana_real_storage_another;
>>>>>>> 9688148cb79db1623e63ff5f4eaec2a83516c5b0

let errors =
all_messages.into_iter().fold(vec![], |mut errors, msg| {
Expand Down Expand Up @@ -190,10 +149,10 @@ pub mod solana_ibc {
solana_ibc_store.connection_to_client =
sol_store.connection_to_client.clone();
solana_ibc_store.port_channel_id_set =
solana_real_storage.port_channel_id_set.clone();
solana_ibc_store.channel_counter = solana_real_storage.channel_counter;
sol_store.port_channel_id_set.clone();
solana_ibc_store.channel_counter = sol_store.channel_counter;
solana_ibc_store.next_sequence =
solana_real_storage.next_sequence.clone();
sol_store.next_sequence.clone();
solana_ibc_store.packet_commitment_sequence_sets =
sol_store.packet_commitment_sequence_sets.clone();
solana_ibc_store.packet_receipt_sequence_sets =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ impl SolanaIbcStorage<'_, '_> {
ibc::core::ics24_host::identifier::ChannelId,
),
> {
self.next_sequence
let store = self.0.borrow();
store.next_sequence
.get(&(path.port_id.to_string(), path.channel_id.to_string()))
.and_then(|triple| triple.get(index))
.ok_or_else(|| (path.port_id.clone(), path.channel_id.clone()))
Expand Down

0 comments on commit a204f0e

Please sign in to comment.