Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvja committed Oct 13, 2023
1 parent a2ab397 commit 6a38919
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 26 deletions.
1 change: 0 additions & 1 deletion common/lib/src/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ impl borsh::BorshDeserialize for VarInt<u32> {
}
}


/// Small on-stack buffer.
///
/// # Example
Expand Down
1 change: 0 additions & 1 deletion common/sealable-trie/src/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ impl<'a> ValueRef<'a, bool> {
pub fn sealed(self) -> Self { Self { is_sealed: true, hash: self.hash } }
}


// =============================================================================
// Conversions

Expand Down
1 change: 0 additions & 1 deletion common/sealable-trie/src/proof/serialisation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ fn invalid_data(msg: String) -> io::Error {
io::Error::new(io::ErrorKind::InvalidData, msg)
}


#[test]
fn test_item_borsh() {
#[track_caller]
Expand Down
1 change: 0 additions & 1 deletion common/sealable-trie/src/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ impl<A: memory::Allocator<Value = Value>> Trie<A> {
}
}


#[cfg(test)]
impl Trie<memory::test_utils::TestAllocator<Value>> {
/// Creates a test trie using a TestAllocator with given capacity.
Expand Down
14 changes: 6 additions & 8 deletions solana/solana-ibc/programs/solana-ibc/src/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ use ibc::core::ics24_host::identifier::ClientId;
use ibc::core::ics24_host::path::{ClientConsensusStatePath, Path};
use ibc::core::timestamp::Timestamp;
use ibc::core::{ContextError, ValidationContext};

#[cfg(any(test, feature = "mocks"))]
use ibc::mock::client_state::{
MockClientContext, MockClientState, MOCK_CLIENT_STATE_TYPE_URL,
};
use ibc::{Any, Height};
use ibc_proto::ibc::lightclients::tendermint::v1::ClientState as RawTmClientState;
#[cfg(any(test, feature = "mocks"))]
use ibc_proto::ibc::mock::ClientState as RawMockClientState;
use ibc_proto::protobuf::Protobuf;
use serde::{Deserialize, Serialize};

use super::consensus_state::AnyConsensusState;
use crate::SolanaIbcStorage;

#[cfg(any(test, feature = "mocks"))]
use ibc_proto::ibc::mock::ClientState as RawMockClientState;
#[cfg(any(test, feature = "mocks"))]
use ibc::mock::client_state::{
MockClientContext, MockClientState, MOCK_CLIENT_STATE_TYPE_URL,
};

const TENDERMINT_CLIENT_STATE_TYPE_URL: &str =
"/ibc.lightclients.tendermint.v1.ClientState";

Expand Down
11 changes: 4 additions & 7 deletions solana/solana-ibc/programs/solana-ibc/src/consensus_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ use ibc::core::ics02_client::consensus_state::ConsensusState;
use ibc::core::ics02_client::error::ClientError;
use ibc::core::ics23_commitment::commitment::CommitmentRoot;
use ibc::core::timestamp::Timestamp;

use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::lightclients::tendermint::v1::ConsensusState as RawTmConsensusState;
use ibc_proto::protobuf::Protobuf;
use serde::{Deserialize, Serialize};


#[cfg(any(test, feature = "mocks"))]
use ibc::mock::consensus_state::{
MockConsensusState, MOCK_CONSENSUS_STATE_TYPE_URL,
};
use ibc_proto::google::protobuf::Any;
use ibc_proto::ibc::lightclients::tendermint::v1::ConsensusState as RawTmConsensusState;
#[cfg(any(test, feature = "mocks"))]
use ibc_proto::ibc::mock::ConsensusState as RawMockConsensusState;
use ibc_proto::protobuf::Protobuf;
use serde::{Deserialize, Serialize};

const TENDERMINT_CONSENSUS_STATE_TYPE_URL: &str =
"/ibc.lightclients.tendermint.v1.ConsensusState";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ impl ClientExecutionContext for SolanaIbcStorage {
consensus_state_path: ClientConsensusStatePath,
consensus_state: Self::AnyConsensusState,
) -> Result {
msg!("store_consensus_state - path: {}, consensus_state: {:?}", consensus_state_path, consensus_state);
msg!(
"store_consensus_state - path: {}, consensus_state: {:?}",
consensus_state_path,
consensus_state
);
let consensus_state_key = (
consensus_state_path.client_id.to_string(),
(consensus_state_path.epoch, consensus_state_path.height),
Expand Down
2 changes: 1 addition & 1 deletion solana/solana-ibc/programs/solana-ibc/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn anchor_test_deliver() -> Result<()> {
.args(instruction::Deliver { messages: all_messages })
.payer(authority.clone())
.signer(&*authority)
.send_with_spinner_and_config(RpcSendTransactionConfig{
.send_with_spinner_and_config(RpcSendTransactionConfig {
skip_preflight: true,
..RpcSendTransactionConfig::default()
})?; // ? gives us the log messages on the why the tx did fail ( better than unwrap )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::str::FromStr;
use std::time::Duration;

use anchor_lang::prelude::{Pubkey, Clock, SolanaSysvar};
use anchor_lang::prelude::{Clock, Pubkey, SolanaSysvar};
use ibc::core::ics02_client::error::ClientError;
use ibc::core::ics03_connection::connection::ConnectionEnd;
use ibc::core::ics03_connection::error::ConnectionError;
Expand Down
1 change: 0 additions & 1 deletion solana/trie-example/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ impl<T> TrieResultExt for Result<T, sealable_trie::trie::Error> {
}
}


/// Instruction to execute.
pub(crate) enum Instruction<'a> {
// Encoding: <include-proof> <key>
Expand Down
3 changes: 0 additions & 3 deletions solana/trie-example/src/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ impl<'a, 'b> memory::Allocator for Allocator<'a, 'b> {
}
}



impl<'a, 'b> core::ops::Deref for AccountTrie<'a, 'b> {
type Target = sealable_trie::Trie<Allocator<'a, 'b>>;
fn deref(&self) -> &Self::Target { &self.0 }
Expand Down Expand Up @@ -249,7 +247,6 @@ fn write<const L: usize, const R: usize, const N: usize>(
right
}


#[test]
fn test_header_encoding() {
const ONE: CryptoHash = CryptoHash([1; 32]);
Expand Down

0 comments on commit 6a38919

Please sign in to comment.