refactor TrustedBridgedNetworks

This commit is contained in:
Branislav Kontur
2023-01-04 13:59:52 +01:00
parent 18ad58b87b
commit fe7817e7cd
@@ -153,12 +153,6 @@ match_types! {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(Plurality { .. }) }
};
// TODO:check-parameter - add new pallet and persist/manage this via governance?
// Means, that we accept some `GlobalConsensus` from some `MultiLocation` (which is supposed to be our bridge-hub)
pub type TrustedBridgedNetworks: impl Contains<(MultiLocation, Junction)> = {
(MultiLocation { parents: 1, interior: X1(Parachain(1014)) }, GlobalConsensus(NetworkId::Rococo))
};
}
pub type Barrier = DenyThenTry<
@@ -312,6 +306,20 @@ impl EnsureOriginWithArg<RuntimeOrigin, MultiLocation> for ForeignCreators {
}
}
parameter_types! {
// TODO:check-parameter - add new pallet and persist/manage this via governance?
// Means, that we accept some `GlobalConsensus` from some `MultiLocation` (which is supposed to be our bridge-hub)
pub TrustedBridgedNetworks: sp_std::vec::Vec<(MultiLocation, Junction)> = sp_std::vec![
(MultiLocation { parents: 1, interior: X1(Parachain(1014)) }, GlobalConsensus(NetworkId::Rococo))
];
}
impl Contains<(MultiLocation, Junction)> for TrustedBridgedNetworks {
fn contains(t: &(MultiLocation, Junction)) -> bool {
Self::get().contains(t)
}
}
pub type BridgedCallsBarrier = (
// TODO:check-parameter - verify, if we need for production (usefull at least for testing connection in production)
AllowExecutionForTrapFrom<Everything>,