Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchen1991 committed Oct 13, 2023
1 parent 42a2419 commit 2f79431
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
6 changes: 1 addition & 5 deletions crates/ibc/src/clients/ics07_tendermint/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,7 @@ where
ClientConsensusStatePath::new(client_id, &self.latest_height),
tm_consensus_state.into(),
)?;
ctx.store_update_time(
client_id.clone(),
self.latest_height(),
host_timestamp,
)?;
ctx.store_update_time(client_id.clone(), self.latest_height(), host_timestamp)?;
ctx.store_update_height(client_id.clone(), self.latest_height(), host_height)?;

Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use crate::clients::ics07_tendermint::consensus_state::ConsensusState as TmConse
use crate::clients::ics07_tendermint::error::{Error, IntoResult};
use crate::clients::ics07_tendermint::header::Header as TmHeader;
use crate::clients::ics07_tendermint::{CommonContext, ValidationContext as TmValidationContext};
use crate::core::ics02_client::ClientExecutionContext;
use crate::core::ics02_client::consensus_state::ConsensusState;
use crate::core::ics02_client::error::ClientError;
use crate::core::ics02_client::ClientExecutionContext;
use crate::core::ics24_host::identifier::ClientId;
use crate::core::ics24_host::path::ClientConsensusStatePath;
use crate::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/clients/ics07_tendermint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::core::ics24_host::identifier::ClientId;
use crate::core::ics24_host::path::ClientConsensusStatePath;
use crate::core::timestamp::Timestamp;
use crate::core::ContextError;
use crate::Height;
use crate::prelude::*;
use crate::Height;

/// Client's context required during both validation and execution
pub trait CommonContext {
Expand Down
15 changes: 5 additions & 10 deletions crates/ibc/src/mock/context/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ impl TmCommonContext for MockContext {
ValidationContext::consensus_state(self, client_cons_state_path)
}

fn consensus_state_heights(
&self,
client_id: &ClientId
) -> Result<Vec<Height>, ContextError> {
fn consensus_state_heights(&self, client_id: &ClientId) -> Result<Vec<Height>, ContextError> {
let ibc_store = self.ibc_store.lock();
let client_record =
ibc_store
Expand Down Expand Up @@ -234,7 +231,7 @@ impl ClientExecutionContext for MockContext {

fn delete_consensus_state(
&mut self,
consensus_state_path: ClientConsensusStatePath
consensus_state_path: ClientConsensusStatePath,
) -> Result<(), ContextError> {
let mut ibc_store = self.ibc_store.lock();

Expand All @@ -249,17 +246,15 @@ impl ClientExecutionContext for MockContext {
let height = Height::new(consensus_state_path.epoch, consensus_state_path.height)
.expect("Never fails");

client_record
.consensus_states
.remove(&height);
client_record.consensus_states.remove(&height);

Ok(())
}

fn delete_update_height(
&mut self,
client_id: ClientId,
height: Height
height: Height,
) -> Result<(), ContextError> {
let _ = self
.ibc_store
Expand All @@ -273,7 +268,7 @@ impl ClientExecutionContext for MockContext {
fn delete_update_time(
&mut self,
client_id: ClientId,
height: Height
height: Height,
) -> Result<(), ContextError> {
let _ = self
.ibc_store
Expand Down

0 comments on commit 2f79431

Please sign in to comment.