-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run background relayer in test (#231)
* Implement CanAssertEventualAmount * Update test to use auto relayer * Fix clone wrong relay * Scaffold BuildStarknetIbcTransferMessage * Scaffold IbcTokenTransferMessageBuilder types * Leave implementation of IBC transfer message to later * Use separate wallet for transferring token in test * ICS transfer test with background auto relayer is working * Use back main branch * typo --------- Co-authored-by: Farhad Shabani <Farhad.Shabani@gmail.com>
- Loading branch information
1 parent
34457fa
commit ff5f389
Showing
8 changed files
with
194 additions
and
118 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
relayer/crates/starknet-chain-components/src/impls/messages/ibc_transfer.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use cgp::prelude::HasAsyncErrorType; | ||
use hermes_chain_components::traits::types::height::HasHeightType; | ||
use hermes_chain_components::traits::types::ibc::{HasChannelIdType, HasPortIdType}; | ||
use hermes_chain_components::traits::types::message::HasMessageType; | ||
use hermes_chain_components::traits::types::timestamp::HasTimeoutType; | ||
use hermes_chain_type_components::traits::types::address::HasAddressType; | ||
use hermes_test_components::chain::traits::messages::ibc_transfer::IbcTokenTransferMessageBuilder; | ||
use hermes_test_components::chain::traits::types::amount::HasAmountType; | ||
use hermes_test_components::chain::traits::types::memo::HasMemoType; | ||
use ibc::core::host::types::identifiers::PortId; | ||
use ibc::primitives::Timestamp; | ||
|
||
use crate::impls::types::message::StarknetMessage; | ||
use crate::types::amount::StarknetAmount; | ||
use crate::types::channel_id::ChannelId; | ||
|
||
pub struct BuildStarknetIbcTransferMessage; | ||
|
||
impl<Chain, Counterparty> IbcTokenTransferMessageBuilder<Chain, Counterparty> | ||
for BuildStarknetIbcTransferMessage | ||
where | ||
Chain: HasAsyncErrorType | ||
+ HasAmountType<Amount = StarknetAmount> | ||
+ HasMemoType<Memo = Option<String>> | ||
+ HasMessageType<Message = StarknetMessage> | ||
+ HasHeightType<Height = u64> | ||
+ HasTimeoutType<Timeout = Timestamp> | ||
+ HasChannelIdType<Counterparty, ChannelId = ChannelId> | ||
+ HasPortIdType<Counterparty, PortId = PortId>, | ||
Counterparty: HasAddressType, | ||
{ | ||
async fn build_ibc_token_transfer_message( | ||
_chain: &Chain, | ||
_channel_id: &ChannelId, | ||
_port_id: &PortId, | ||
_recipient_address: &Counterparty::Address, | ||
_amount: &StarknetAmount, | ||
_memo: &Option<String>, | ||
_timeout_height: Option<&u64>, | ||
_timeout_time: Option<&Timestamp>, | ||
) -> Result<Chain::Message, Chain::Error> { | ||
// FIXME: Implement the logic to build the token transfer message | ||
todo!() | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
relayer/crates/starknet-chain-components/src/impls/messages/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub mod channel; | ||
pub mod connection; | ||
pub mod create_client; | ||
pub mod ibc_transfer; | ||
pub mod packet; | ||
pub mod update_client; |
Oops, something went wrong.