Skip to content

Commit

Permalink
using borsh for channel end ser
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvja committed Oct 18, 2023
1 parent dcb602e commit 27adf86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ base64 = { version = "0.21", default-features = false, features = ["alloc"] }
bincode = "1.3.3"
borsh = { version = "0.10.3", default-features = false }
derive_more = "0.99.17"
ibc = { version = "0.45.0", default-features = false, features = ["serde", "mocks", "std"] }
ibc = { version = "0.45.0", default-features = false, features = ["serde", "mocks", "std", "borsh"] }
ibc-proto = { version = "0.35.0", default-features = false, features = ["serde"] }
pretty_assertions = "1.4.0"
rand = { version = "0.8.5" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ impl ClientExecutionContext for SolanaIbcStorage<'_, '_> {
&lib::hash::CryptoHash::digest(serialized_client_state.as_bytes()),
)
.unwrap();

self.clients.insert(client_state_key, serialized_client_state);
Ok(())
}
Expand Down Expand Up @@ -363,13 +362,13 @@ impl ExecutionContext for SolanaIbcStorage<'_, '_> {
channel_end_path.1.clone().to_string(),
));

let serialized_channel_end =
serde_json::to_string(&channel_end).unwrap();
let serialized_channel_end =
borsh::to_vec(&channel_end).unwrap();
let channel_end_trie_key = &TrieKey::from(channel_end_path).to_vec();
let trie = self.trie.as_mut().unwrap();
trie.set(
channel_end_trie_key,
&lib::hash::CryptoHash::digest(serialized_channel_end.as_bytes()),
&lib::hash::CryptoHash::digest(&serialized_channel_end),
)
.unwrap();

Expand Down

0 comments on commit 27adf86

Please sign in to comment.