Skip to content

Commit 2a26282

Browse files
authored
Make host_timestamp() abstract (#457)
* make host_timestamp abstract * changelog * changelog
1 parent d14fadd commit 2a26282

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Make ValidationContext::host_timestamp() abstract and remove
2+
ValidationContext::pending_host_consensus_state()
3+
([#418](https://github.com/cosmos/ibc-rs/issues/418))

crates/ibc/src/core/context.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,7 @@ pub trait ValidationContext: Router {
269269
fn host_height(&self) -> Result<Height, ContextError>;
270270

271271
/// Returns the current timestamp of the local chain.
272-
fn host_timestamp(&self) -> Result<Timestamp, ContextError> {
273-
let pending_consensus_state = self
274-
.pending_host_consensus_state()
275-
.expect("host must have pending consensus state");
276-
Ok(pending_consensus_state.timestamp())
277-
}
278-
279-
/// Returns the pending `ConsensusState` of the host (local) chain.
280-
fn pending_host_consensus_state(&self) -> Result<Box<dyn ConsensusState>, ContextError>;
272+
fn host_timestamp(&self) -> Result<Timestamp, ContextError>;
281273

282274
/// Returns the `ConsensusState` of the host (local) chain at a specific height.
283275
fn host_consensus_state(

crates/ibc/src/mock/context.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,6 @@ impl ValidationContext for MockContext {
824824
.unwrap())
825825
}
826826

827-
fn pending_host_consensus_state(&self) -> Result<Box<dyn ConsensusState>, ContextError> {
828-
Err(ClientError::ImplementationSpecific.into())
829-
}
830-
831827
fn host_consensus_state(
832828
&self,
833829
height: &Height,

0 commit comments

Comments
 (0)