Skip to content

Commit

Permalink
Token transfer using ibc_token_transfer is now working
Browse files Browse the repository at this point in the history
  • Loading branch information
soareschen committed May 9, 2022
1 parent 6fe286d commit 655aca9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions tools/integration-test/src/tests/transfer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use ibc_test_framework::ibc::denom::derive_ibc_denom;
use ibc_test_framework::prelude::*;
use ibc_test_framework::relayer::transfer::ibc_token_transfer;
use ibc_test_framework::util::random::random_u64_range;

#[test]
Expand Down Expand Up @@ -70,13 +71,14 @@ impl BinaryChannelTest for IbcTransferTest {
denom_a
);

chains.node_a.chain_driver().transfer_token(
ibc_token_transfer(
&chains.node_a.chain_driver(),
&channel.port_a.as_ref(),
&channel.channel_id_a.as_ref(),
&wallet_a.as_ref(),
&wallet_b.address(),
a_to_b_amount,
&denom_a,
a_to_b_amount,
)?;

let denom_b = derive_ibc_denom(
Expand Down Expand Up @@ -123,13 +125,14 @@ impl BinaryChannelTest for IbcTransferTest {
denom_b
);

chains.node_b.chain_driver().transfer_token(
ibc_token_transfer(
&chains.node_b.chain_driver(),
&channel.port_b.as_ref(),
&channel.channel_id_b.as_ref(),
&wallet_b.as_ref(),
&wallet_c.address(),
b_to_a_amount,
&denom_b.as_ref(),
b_to_a_amount,
)?;

chains.node_b.chain_driver().assert_eventual_wallet_amount(
Expand Down
6 changes: 3 additions & 3 deletions tools/test-framework/src/relayer/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ pub fn tx_raw_ft_transfer<SrcChain: ChainHandle, DstChain: ChainHandle>(

pub fn ibc_token_transfer<SrcChain: ChainHandle, DstChain: ChainHandle>(
chain_driver: &MonoTagged<SrcChain, &ChainDriver>,
channel_id: &TaggedChannelIdRef<'_, SrcChain, DstChain>,
port_id: &TaggedPortIdRef<'_, SrcChain, DstChain>,
channel_id: &TaggedChannelIdRef<'_, SrcChain, DstChain>,
sender: &MonoTagged<SrcChain, &Wallet>,
recipient: &MonoTagged<DstChain, &WalletAddress>,
denom: &MonoTagged<SrcChain, &Denom>,
Expand All @@ -87,8 +87,8 @@ pub fn ibc_token_transfer<SrcChain: ChainHandle, DstChain: ChainHandle>(
.runtime
.block_on(async_ibc_token_transfer(
chain_driver,
channel_id,
port_id,
channel_id,
sender,
recipient,
denom,
Expand All @@ -98,8 +98,8 @@ pub fn ibc_token_transfer<SrcChain: ChainHandle, DstChain: ChainHandle>(

pub async fn async_ibc_token_transfer<SrcChain: ChainHandle, DstChain: ChainHandle>(
chain_driver: &MonoTagged<SrcChain, &ChainDriver>,
channel_id: &TaggedChannelIdRef<'_, SrcChain, DstChain>,
port_id: &TaggedPortIdRef<'_, SrcChain, DstChain>,
channel_id: &TaggedChannelIdRef<'_, SrcChain, DstChain>,
sender: &MonoTagged<SrcChain, &Wallet>,
recipient: &MonoTagged<DstChain, &WalletAddress>,
denom: &MonoTagged<SrcChain, &Denom>,
Expand Down

0 comments on commit 655aca9

Please sign in to comment.