Skip to content

Commit

Permalink
Implement WithProvider for HasConnectionIdType
Browse files Browse the repository at this point in the history
  • Loading branch information
soareschen committed Dec 12, 2024
1 parent e3ab014 commit 4d0a70e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use core::fmt::{Debug, Display};

use cgp::core::component::WithProvider;
use cgp::core::types::traits::ProvideType;
use cgp::prelude::*;

#[cgp_component {
Expand All @@ -14,3 +16,13 @@ pub trait HasConnectionIdType<Counterparty>: Async {
*/
type ConnectionId: Debug + Display + Async;
}

impl<Chain, Counterparty, Provider, ConnectionId> ProvideConnectionIdType<Chain, Counterparty>
for WithProvider<Provider>
where
Chain: Async,
Provider: ProvideType<Chain, ConnectionIdTypeComponent, Type = ConnectionId>,
ConnectionId: Debug + Display + Async,
{
type ConnectionId = ConnectionId;
}

0 comments on commit 4d0a70e

Please sign in to comment.