Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchen1991 committed Sep 17, 2024
2 parents a5cad7f + 8d36c68 commit cacf482
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [ibc-testkit] Remove redundant path constructions in the implementation of
`ValidationContext` for `MockIbcStore`
([#1338](https://github.com/cosmos/ibc-rs/pull/1338)).
34 changes: 6 additions & 28 deletions ibc-testkit/src/testapp/ibc/core/core_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ where

fn channel_end(&self, channel_end_path: &ChannelEndPath) -> Result<ChannelEnd, HostError> {
self.channel_end_store
.get(
StoreHeight::Pending,
&ChannelEndPath::new(&channel_end_path.0, &channel_end_path.1),
)
.get(StoreHeight::Pending, channel_end_path)
.ok_or(HostError::missing_state(format!(
"missing channel {} in port {}",
channel_end_path.1.clone(),
Expand All @@ -143,32 +140,23 @@ where

fn get_next_sequence_send(&self, seq_send_path: &SeqSendPath) -> Result<Sequence, HostError> {
self.send_sequence_store
.get(
StoreHeight::Pending,
&SeqSendPath::new(&seq_send_path.0, &seq_send_path.1),
)
.get(StoreHeight::Pending, seq_send_path)
.ok_or(HostError::failed_to_retrieve(
"failed to retrieve send packet sequence",
))
}

fn get_next_sequence_recv(&self, seq_recv_path: &SeqRecvPath) -> Result<Sequence, HostError> {
self.recv_sequence_store
.get(
StoreHeight::Pending,
&SeqRecvPath::new(&seq_recv_path.0, &seq_recv_path.1),
)
.get(StoreHeight::Pending, seq_recv_path)
.ok_or(HostError::failed_to_retrieve(
"failed to retrieve recv packet sequence",
))
}

fn get_next_sequence_ack(&self, seq_ack_path: &SeqAckPath) -> Result<Sequence, HostError> {
self.ack_sequence_store
.get(
StoreHeight::Pending,
&SeqAckPath::new(&seq_ack_path.0, &seq_ack_path.1),
)
.get(StoreHeight::Pending, seq_ack_path)
.ok_or(HostError::failed_to_retrieve(
"failed to retrieve ack packet sequence",
))
Expand All @@ -179,14 +167,7 @@ where
commitment_path: &CommitmentPath,
) -> Result<PacketCommitment, HostError> {
self.packet_commitment_store
.get(
StoreHeight::Pending,
&CommitmentPath::new(
&commitment_path.port_id,
&commitment_path.channel_id,
commitment_path.sequence,
),
)
.get(StoreHeight::Pending, commitment_path)
.ok_or(HostError::failed_to_retrieve(
"failed to retrieve packet commitment",
))
Expand All @@ -208,10 +189,7 @@ where
ack_path: &AckPath,
) -> Result<AcknowledgementCommitment, HostError> {
self.packet_ack_store
.get(
StoreHeight::Pending,
&AckPath::new(&ack_path.port_id, &ack_path.channel_id, ack_path.sequence),
)
.get(StoreHeight::Pending, ack_path)
.ok_or(HostError::failed_to_retrieve(format!(
"failed to retrieve packet acknowledgment {}",
ack_path.sequence
Expand Down

0 comments on commit cacf482

Please sign in to comment.