Skip to content

Commit

Permalink
chore: compile runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Aug 16, 2024
1 parent e5dedb2 commit de41c47
Show file tree
Hide file tree
Showing 10 changed files with 932 additions and 880 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pallets/liquidity-pools-forwarder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ pub mod pallet {
+ FullCodec;

/// The entity of the messages coming from this chain.
type Sender: MessageSender<
type MessageSender: MessageSender<
Middleware = Self::RouterId,
Origin = DomainAddress,
Message = Vec<u8>,
>;

/// The entity which acts on unwrapped messages.
type Receiver: MessageReceiver<Middleware = Self::RouterId, Origin = Domain>;
type MessageReceiver: MessageReceiver<Middleware = Self::RouterId, Origin = DomainAddress>;

/// An identification of a router.
type RouterId: Parameter + MaxEncodedLen;
Expand Down Expand Up @@ -149,7 +149,7 @@ pub mod pallet {
RouterForwarding::<T>::insert(
&router_id,
ForwardInfo {
source_domain: source_domain.clone(),
source_domain,
contract: forwarding_contract,
},
);
Expand Down Expand Up @@ -203,7 +203,7 @@ pub mod pallet {
message.serialize()
};

T::Sender::send(router_id, origin, payload)
T::MessageSender::send(router_id, origin, payload)
}
}

Expand All @@ -225,17 +225,17 @@ pub mod pallet {
// NOTE: We can rely on EVM side to ensure forwarded messages are valid such
// that it suffices to filter for the existence of forwarding info
if RouterForwarding::<T>::get(&router_id).is_some() {
return T::Receiver::receive(
return T::MessageReceiver::receive(
router_id,
domain_address.domain(),
domain_address,
lp_message.serialize(),
);
}
}

Err(Error::<T>::ForwardInfoNotFound.into())
} else {
T::Receiver::receive(router_id, domain_address.domain(), payload)
T::MessageReceiver::receive(router_id, domain_address, payload)
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions pallets/liquidity-pools-gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ pub mod pallet {
+ FullCodec;

/// The target of the messages coming from this chain
type MessageSender: MessageSender<Middleware = Self::RouterId, Origin = DomainAddress>;
type MessageSender: MessageSender<
Middleware = Self::RouterId,
Origin = DomainAddress,
Message = Self::Message,
>;

/// An identification of a router
type RouterId: Parameter + MaxEncodedLen;
Expand Down Expand Up @@ -525,7 +529,7 @@ pub mod pallet {
} => {
let weight = LP_DEFENSIVE_WEIGHT;

match T::MessageSender::send(router_id, sender, message.serialize()) {
match T::MessageSender::send(router_id, sender, message) {
Ok(_) => (Ok(()), weight),
Err(e) => (Err(e), weight),
}
Expand Down
6 changes: 3 additions & 3 deletions pallets/liquidity-pools/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ impl TryFrom<Message> for NonForwardMessage {
}
}

impl Into<Message> for NonForwardMessage {
fn into(self) -> Message {
*self.0
impl From<NonForwardMessage> for Message {
fn from(value: NonForwardMessage) -> Self {
*value.0
}
}

Expand Down
Loading

0 comments on commit de41c47

Please sign in to comment.