mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 11:01:08 +00:00
Allow Queries and Subscriptions (#700)
* Allow Queries and Subscriptions * Fixes * Formatting
This commit is contained in:
@@ -49,11 +49,11 @@ use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpd
|
|||||||
// XCM Imports
|
// XCM Imports
|
||||||
use xcm::latest::prelude::*;
|
use xcm::latest::prelude::*;
|
||||||
use xcm_builder::{
|
use xcm_builder::{
|
||||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,
|
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||||
EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset,
|
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
|
||||||
ParentAsSuperuser, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative,
|
FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
||||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SovereignSignedViaLocation,
|
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||||
TakeWeightCredit, UsingComponents,
|
SignedAccountId32AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||||
};
|
};
|
||||||
use xcm_executor::{Config, XcmExecutor};
|
use xcm_executor::{Config, XcmExecutor};
|
||||||
|
|
||||||
@@ -465,12 +465,22 @@ match_type! {
|
|||||||
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
|
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
match_type! {
|
||||||
|
pub type ParentOrSiblings: impl Contains<MultiLocation> = {
|
||||||
|
MultiLocation { parents: 1, interior: Here } |
|
||||||
|
MultiLocation { parents: 1, interior: X1(_) }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
pub type Barrier = (
|
pub type Barrier = (
|
||||||
TakeWeightCredit,
|
TakeWeightCredit,
|
||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||||
// ^^^ Parent and its exec plurality get free execution
|
// ^^^ Parent and its exec plurality get free execution
|
||||||
|
// Expected responses are OK.
|
||||||
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
|
// Subscriptions for version tracking are OK.
|
||||||
|
AllowSubscriptionsFrom<ParentOrSiblings>,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub struct XcmConfig;
|
pub struct XcmConfig;
|
||||||
|
|||||||
@@ -60,7 +60,10 @@ use parachains_common::{
|
|||||||
impls::{AssetsFrom, NonZeroIssuance},
|
impls::{AssetsFrom, NonZeroIssuance},
|
||||||
AssetId,
|
AssetId,
|
||||||
};
|
};
|
||||||
use xcm_builder::{AsPrefixedGeneralIndex, ConvertedConcreteAssetId, FungiblesAdapter};
|
use xcm_builder::{
|
||||||
|
AllowKnownQueryResponses, AllowSubscriptionsFrom, AsPrefixedGeneralIndex,
|
||||||
|
ConvertedConcreteAssetId, FungiblesAdapter,
|
||||||
|
};
|
||||||
use xcm_executor::traits::JustTry;
|
use xcm_executor::traits::JustTry;
|
||||||
|
|
||||||
// XCM imports
|
// XCM imports
|
||||||
@@ -376,6 +379,10 @@ pub type Barrier = (
|
|||||||
AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
|
||||||
// ^^^ Parent & its unit plurality gets free execution
|
// ^^^ Parent & its unit plurality gets free execution
|
||||||
AllowUnpaidExecutionFrom<Statemint>,
|
AllowUnpaidExecutionFrom<Statemint>,
|
||||||
|
// Expected responses are OK.
|
||||||
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
|
// Subscriptions for version tracking are OK.
|
||||||
|
AllowSubscriptionsFrom<Everything>,
|
||||||
);
|
);
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ use polkadot_parachain::primitives::Sibling;
|
|||||||
use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpdate};
|
use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpdate};
|
||||||
use xcm::latest::prelude::*;
|
use xcm::latest::prelude::*;
|
||||||
use xcm_builder::{
|
use xcm_builder::{
|
||||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
|
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||||
AsPrefixedGeneralIndex, ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin,
|
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
|
||||||
FixedWeightBounds, FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset,
|
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||||
ParentAsSuperuser, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative,
|
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
||||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SovereignSignedViaLocation,
|
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||||
TakeWeightCredit, UsingComponents,
|
SignedAccountId32AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||||
};
|
};
|
||||||
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
||||||
|
|
||||||
@@ -557,12 +557,22 @@ match_type! {
|
|||||||
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
|
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
match_type! {
|
||||||
|
pub type ParentOrSiblings: impl Contains<MultiLocation> = {
|
||||||
|
MultiLocation { parents: 1, interior: Here } |
|
||||||
|
MultiLocation { parents: 1, interior: X1(_) }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
pub type Barrier = (
|
pub type Barrier = (
|
||||||
TakeWeightCredit,
|
TakeWeightCredit,
|
||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||||
// ^^^ Parent and its exec plurality get free execution
|
// ^^^ Parent and its exec plurality get free execution
|
||||||
|
// Expected responses are OK.
|
||||||
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
|
// Subscriptions for version tracking are OK.
|
||||||
|
AllowSubscriptionsFrom<ParentOrSiblings>,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub struct XcmConfig;
|
pub struct XcmConfig;
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ use polkadot_parachain::primitives::Sibling;
|
|||||||
use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpdate};
|
use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpdate};
|
||||||
use xcm::latest::prelude::*;
|
use xcm::latest::prelude::*;
|
||||||
use xcm_builder::{
|
use xcm_builder::{
|
||||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
|
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||||
AsPrefixedGeneralIndex, ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin,
|
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
|
||||||
FixedWeightBounds, FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset,
|
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||||
ParentAsSuperuser, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative,
|
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
||||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SovereignSignedViaLocation,
|
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||||
TakeWeightCredit, UsingComponents,
|
SignedAccountId32AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||||
};
|
};
|
||||||
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
||||||
|
|
||||||
@@ -534,12 +534,22 @@ match_type! {
|
|||||||
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
|
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
match_type! {
|
||||||
|
pub type ParentOrSiblings: impl Contains<MultiLocation> = {
|
||||||
|
MultiLocation { parents: 1, interior: Here } |
|
||||||
|
MultiLocation { parents: 1, interior: X1(_) }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
pub type Barrier = (
|
pub type Barrier = (
|
||||||
TakeWeightCredit,
|
TakeWeightCredit,
|
||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||||
// ^^^ Parent and its exec plurality get free execution
|
// ^^^ Parent and its exec plurality get free execution
|
||||||
|
// Expected responses are OK.
|
||||||
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
|
// Subscriptions for version tracking are OK.
|
||||||
|
AllowSubscriptionsFrom<ParentOrSiblings>,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub struct XcmConfig;
|
pub struct XcmConfig;
|
||||||
|
|||||||
@@ -70,12 +70,13 @@ use polkadot_parachain::primitives::Sibling;
|
|||||||
use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpdate};
|
use polkadot_runtime_common::{BlockHashCount, RocksDbWeight, SlowAdjustingFeeUpdate};
|
||||||
use xcm::latest::prelude::*;
|
use xcm::latest::prelude::*;
|
||||||
use xcm_builder::{
|
use xcm_builder::{
|
||||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
|
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||||
AsPrefixedGeneralIndex, ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin,
|
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
|
||||||
FixedWeightBounds, FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset,
|
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||||
ParentAsSuperuser, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative,
|
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
|
||||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||||
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||||
|
UsingComponents,
|
||||||
};
|
};
|
||||||
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
||||||
|
|
||||||
@@ -526,6 +527,10 @@ pub type Barrier = (
|
|||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
|
||||||
// ^^^ Parent & its plurality gets free execution
|
// ^^^ Parent & its plurality gets free execution
|
||||||
|
// Expected responses are OK.
|
||||||
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
|
// Subscriptions for version tracking are OK.
|
||||||
|
AllowSubscriptionsFrom<Everything>,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub struct XcmConfig;
|
pub struct XcmConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user