From 3cf272c3e40322dc53321933f13d873528e02cc0 Mon Sep 17 00:00:00 2001 From: Dhruv D Jain Date: Tue, 31 Oct 2023 01:00:18 +0530 Subject: [PATCH] change client to connection from connection to client (#63) We are having a mapping between connectionId to clientId ( connectionId is the key ) but it should be the other way round since we would query the connection using client. * change client to conn from conn to client * fmt --- .../solana-ibc/programs/solana-ibc/src/execution_context.rs | 4 ++-- solana/solana-ibc/programs/solana-ibc/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solana/solana-ibc/programs/solana-ibc/src/execution_context.rs b/solana/solana-ibc/programs/solana-ibc/src/execution_context.rs index 0e1121df..89698f3f 100644 --- a/solana/solana-ibc/programs/solana-ibc/src/execution_context.rs +++ b/solana/solana-ibc/programs/solana-ibc/src/execution_context.rs @@ -253,8 +253,8 @@ impl ExecutionContext for IbcStorage<'_, '_> { let mut store = self.0.borrow_mut(); store .private - .connection_to_client - .insert(conn_id.to_string(), client_connection_path.0.to_string()); + .client_to_connection + .insert(client_connection_path.0.to_string(), conn_id.to_string()); Ok(()) } diff --git a/solana/solana-ibc/programs/solana-ibc/src/lib.rs b/solana/solana-ibc/programs/solana-ibc/src/lib.rs index eaa11917..227d7540 100644 --- a/solana/solana-ibc/programs/solana-ibc/src/lib.rs +++ b/solana/solana-ibc/programs/solana-ibc/src/lib.rs @@ -201,7 +201,7 @@ pub struct PrivateStorage { pub connections: BTreeMap, pub channel_ends: BTreeMap<(InnerPortId, InnerChannelId), InnerChannelEnd>, // Contains the client id corresponding to the connectionId - pub connection_to_client: BTreeMap, + pub client_to_connection: BTreeMap, /// The port and channel id tuples of the channels. pub port_channel_id_set: Vec<(InnerPortId, InnerChannelId)>, pub channel_counter: u64,