Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor store_* and get_* methods to take *Path structs instead #419

Merged
merged 8 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactor get_* and store_* methods to take *Path structs instead
([#382](https://github.com/cosmos/ibc-rs/issues/382))
8 changes: 5 additions & 3 deletions crates/ibc/src/applications/transfer/relay/send_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::applications::transfer::packet::PacketData;
use crate::applications::transfer::{is_sender_chain_source, Coin, PrefixedCoin};
use crate::core::ics04_channel::handler::send_packet::send_packet;
use crate::core::ics04_channel::packet::Packet;
use crate::core::ics24_host::path::{ChannelEndPath, SeqSendPath};
use crate::events::ModuleEvent;
use crate::handler::{HandlerOutput, HandlerOutputBuilder};
use crate::prelude::*;
Expand All @@ -25,9 +26,9 @@ where
if !ctx.is_send_enabled() {
return Err(TokenTransferError::SendDisabled);
}

let chan_end_path_on_a = ChannelEndPath::new(&msg.port_on_a, &msg.chan_on_a);
let chan_end_on_a = ctx
.channel_end(&msg.port_on_a, &msg.chan_on_a)
.channel_end(&chan_end_path_on_a)
.map_err(TokenTransferError::PacketError)?;

let port_on_b = chan_end_on_a.counterparty().port_id().clone();
Expand All @@ -41,8 +42,9 @@ where
.clone();

// get the next sequence
let seq_send_path_on_a = SeqSendPath::new(&msg.port_on_a, &msg.chan_on_a);
let sequence = ctx
.get_next_sequence_send(&msg.port_on_a, &msg.chan_on_a)
.get_next_sequence_send(&seq_send_path_on_a)
.map_err(TokenTransferError::PacketError)?;

let token = msg
Expand Down
259 changes: 116 additions & 143 deletions crates/ibc/src/clients/ics07_tendermint/client_state.rs

Large diffs are not rendered by default.

Loading