Skip to content

Commit

Permalink
Simplify trait bounds for CanBuildIbcTokenTransferMessage (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
soareschen authored Jan 27, 2025
1 parent 8e62668 commit 61b94d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cgp::prelude::HasAsyncErrorType;
use hermes_cosmos_chain_components::traits::message::{CosmosMessage, ToCosmosMessage};
use hermes_relayer_components::chain::traits::types::ibc::HasIbcChainTypes;
use hermes_relayer_components::chain::traits::types::height::HasHeightType;
use hermes_relayer_components::chain::traits::types::ibc::{HasChannelIdType, HasPortIdType};
use hermes_relayer_components::chain::traits::types::message::HasMessageType;
use hermes_relayer_components::chain::traits::types::timestamp::HasTimeoutType;
use hermes_test_components::chain::traits::messages::ibc_transfer::IbcTokenTransferMessageBuilder;
use hermes_test_components::chain::traits::types::address::HasAddressType;
use hermes_test_components::chain::traits::types::amount::HasAmountType;
Expand All @@ -19,15 +22,13 @@ impl<Chain, Counterparty> IbcTokenTransferMessageBuilder<Chain, Counterparty>
where
Chain: HasAsyncErrorType
+ HasAddressType
+ HasMessageType
+ HasHeightType<Height = Height>
+ HasTimeoutType<Timeout = Timestamp>
+ HasAmountType<Amount = Amount>
+ HasMemoType<Memo = Option<String>>
+ HasIbcChainTypes<
Counterparty,
ChannelId = ChannelId,
PortId = PortId,
Height = Height,
Timeout = Timestamp,
>,
+ HasChannelIdType<Counterparty, ChannelId = ChannelId>
+ HasPortIdType<Counterparty, PortId = PortId>,
Counterparty: HasAddressType,
Chain::Message: From<CosmosMessage>,
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cgp::prelude::*;
use hermes_relayer_components::chain::traits::types::height::HasHeightType;
use hermes_relayer_components::chain::traits::types::ibc::HasIbcChainTypes;
use hermes_relayer_components::chain::traits::types::ibc::{HasChannelIdType, HasPortIdType};
use hermes_relayer_components::chain::traits::types::message::HasMessageType;
use hermes_relayer_components::chain::traits::types::timestamp::HasTimeoutType;

Expand All @@ -20,7 +20,8 @@ pub trait CanBuildIbcTokenTransferMessage<Counterparty>:
+ HasMessageType
+ HasHeightType
+ HasTimeoutType
+ HasIbcChainTypes<Counterparty>
+ HasChannelIdType<Counterparty>
+ HasPortIdType<Counterparty>
where
Counterparty: HasAddressType,
{
Expand Down

0 comments on commit 61b94d9

Please sign in to comment.