Skip to content

Commit

Permalink
connectors-gateway: Rename LocalOrigin to LocalEVMOrigin
Browse files Browse the repository at this point in the history
  • Loading branch information
cdamian committed Jul 18, 2023
1 parent 4b5557a commit 2d6056c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pallets/connectors-gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub mod pallet {

/// The LocalOrigin ensures that some calls can only be performed from a
/// local context i.e. a different pallet.
type LocalOrigin: EnsureOrigin<
type LocalEVMOrigin: EnsureOrigin<
<Self as frame_system::Config>::RuntimeOrigin,
Success = DomainAddress,
>;
Expand Down Expand Up @@ -226,7 +226,7 @@ pub mod pallet {
origin: OriginFor<T>,
msg: BoundedVec<u8, T::MaxIncomingMessageSize>,
) -> DispatchResult {
let domain_address = T::LocalOrigin::ensure_origin(origin)?;
let domain_address = T::LocalEVMOrigin::ensure_origin(origin)?;

match domain_address {
DomainAddress::EVM(_, _) => {
Expand Down
2 changes: 1 addition & 1 deletion pallets/connectors-gateway/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl pallet_mock_routers::Config for Runtime {}
impl pallet_connectors_gateway::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId32>;
type InboundQueue = MockConnectors;
type LocalOrigin = EnsureLocal;
type LocalEVMOrigin = EnsureLocal;
type MaxIncomingMessageSize = MaxIncomingMessageSize;
type Message = MessageMock;
type Router = RouterMock<Runtime>;
Expand Down
3 changes: 1 addition & 2 deletions runtime/development/src/connectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ use crate::Connectors;
type ConnectorsMessage = pallet_connectors::Message<Domain, PoolId, TrancheId, Balance, Rate>;

parameter_types! {
// TODO(cdamian): Double-check these.
pub const MaxIncomingMessageSize: u32 = 1024;
}

impl pallet_connectors_gateway::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type InboundQueue = Connectors;
type LocalOrigin = pallet_connectors_gateway::EnsureLocal;
type LocalEVMOrigin = pallet_connectors_gateway::EnsureLocal;
type MaxIncomingMessageSize = MaxIncomingMessageSize;
type Message = ConnectorsMessage;
type Router = DummyRouter;
Expand Down

0 comments on commit 2d6056c

Please sign in to comment.