Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 6c8f1f7

Browse files
rphmeierordianbkchr
authored
bump deps, fix aura-ext pallet, and fill in stubs for XCM (#600)
* bump deps, fix aura-ext pallet, and fill in stubs for XCM * response handler, asset trap, asset claims * subscription_service * update xcmp-queue mock * fix tests * Update polkadot deps Co-authored-by: Andronik Ordian <write@reusable.software> Co-authored-by: Bastian Köcher <info@kchr.de>
1 parent bf4024f commit 6c8f1f7

File tree

10 files changed

+386
-457
lines changed

10 files changed

+386
-457
lines changed

Cargo.lock

+337-446
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/collator/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ mod tests {
404404
let (sub_tx, sub_rx) = mpsc::channel(64);
405405

406406
let all_subsystems =
407-
AllSubsystems::<()>::dummy().replace_collation_generation(ForwardSubsystem(sub_tx));
407+
AllSubsystems::<()>::dummy().replace_collation_generation(|_| ForwardSubsystem(sub_tx));
408408
let (overseer, handle) = Overseer::new(
409409
Vec::new(),
410410
all_subsystems,

pallets/aura-ext/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub mod pallet {
6262
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
6363
fn on_finalize(_: BlockNumberFor<T>) {
6464
// Update to the latest AuRa authorities.
65-
Authorities::<T>::put(Aura::<T>::authorities());
65+
Authorities::<T>::put(Aura::<T>::authorities().into_inner());
6666
}
6767

6868
fn on_initialize(_: BlockNumberFor<T>) -> Weight {
@@ -98,7 +98,7 @@ pub mod pallet {
9898
"AuRa authorities empty, maybe wrong order in `construct_runtime!`?",
9999
);
100100

101-
Authorities::<T>::put(authorities);
101+
Authorities::<T>::put(authorities.into_inner());
102102
}
103103
}
104104
}

pallets/collator-selection/src/mock.rs

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl pallet_timestamp::Config for Test {
126126

127127
impl pallet_aura::Config for Test {
128128
type AuthorityId = sp_consensus_aura::sr25519::AuthorityId;
129+
type MaxAuthorities = MaxAuthorities;
129130
type DisabledValidators = ();
130131
}
131132

@@ -190,6 +191,7 @@ parameter_types! {
190191
pub const MaxCandidates: u32 = 20;
191192
pub const MaxInvulnerables: u32 = 20;
192193
pub const MinCandidates: u32 = 1;
194+
pub const MaxAuthorities: u32 = 100_000;
193195
}
194196

195197
pub struct IsRegistered;

pallets/xcmp-queue/src/mock.rs

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ impl xcm_executor::Config for XcmConfig {
142142
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
143143
type Trader = ();
144144
type ResponseHandler = ();
145+
type AssetTrap = ();
146+
type AssetClaims = ();
147+
type SubscriptionService = ();
145148
}
146149

147150
pub type XcmRouter = (

polkadot-parachains/rococo/src/lib.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ impl Config for XcmConfig {
348348
type Barrier = Barrier;
349349
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
350350
type Trader = UsingComponents<IdentityFee<Balance>, RocLocation, AccountId, Balances, ()>;
351-
type ResponseHandler = (); // Don't handle responses for now.
351+
type ResponseHandler = PolkadotXcm;
352+
type AssetTrap = PolkadotXcm;
353+
type AssetClaims = PolkadotXcm;
354+
type SubscriptionService = PolkadotXcm;
352355
}
353356

354357
/// No local origins on this chain are allowed to dispatch XCM sends/executions.
@@ -376,6 +379,8 @@ impl pallet_xcm::Config for Runtime {
376379
type LocationInverter = LocationInverter<Ancestry>;
377380
type Origin = Origin;
378381
type Call = Call;
382+
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
383+
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
379384
}
380385

381386
impl cumulus_pallet_xcm::Config for Runtime {
@@ -410,6 +415,7 @@ parameter_types! {
410415
pub const MetadataDepositBase: Balance = 1 * ROC;
411416
pub const MetadataDepositPerByte: Balance = 10 * MILLIROC;
412417
pub const UnitBody: BodyId = BodyId::Unit;
418+
pub const MaxAuthorities: u32 = 100_000;
413419
}
414420

415421
/// A majority of the Unit body from Rococo over XCM is our required administration origin.
@@ -434,6 +440,7 @@ impl pallet_assets::Config for Runtime {
434440
impl pallet_aura::Config for Runtime {
435441
type AuthorityId = AuraId;
436442
type DisabledValidators = ();
443+
type MaxAuthorities = MaxAuthorities;
437444
}
438445

439446
construct_runtime! {
@@ -589,7 +596,7 @@ impl_runtime_apis! {
589596
}
590597

591598
fn authorities() -> Vec<AuraId> {
592-
Aura::authorities()
599+
Aura::authorities().into_inner()
593600
}
594601
}
595602

polkadot-parachains/shell/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ impl Config for XcmConfig {
213213
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>; // balances not supported
214214
type Trader = (); // balances not supported
215215
type ResponseHandler = (); // Don't handle responses for now.
216+
type AssetTrap = (); // don't trap for now
217+
type AssetClaims = (); // don't claim for now
218+
type SubscriptionService = (); // don't handle subscriptions for now
216219
}
217220

218221
impl cumulus_pallet_xcm::Config for Runtime {

polkadot-parachains/statemine/src/lib.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,10 @@ impl Config for XcmConfig {
542542
type Barrier = Barrier;
543543
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
544544
type Trader = UsingComponents<IdentityFee<Balance>, KsmLocation, AccountId, Balances, ()>;
545-
type ResponseHandler = (); // Don't handle responses for now.
545+
type ResponseHandler = PolkadotXcm;
546+
type AssetTrap = PolkadotXcm;
547+
type AssetClaims = PolkadotXcm;
548+
type SubscriptionService = PolkadotXcm;
546549
}
547550

548551
parameter_types! {
@@ -574,6 +577,9 @@ impl pallet_xcm::Config for Runtime {
574577
type LocationInverter = LocationInverter<Ancestry>;
575578
type Origin = Origin;
576579
type Call = Call;
580+
581+
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
582+
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
577583
}
578584

579585
impl cumulus_pallet_xcm::Config for Runtime {
@@ -598,6 +604,7 @@ parameter_types! {
598604
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
599605
pub const Period: u32 = 6 * HOURS;
600606
pub const Offset: u32 = 0;
607+
pub const MaxAuthorities: u32 = 100_000;
601608
}
602609

603610
impl pallet_session::Config for Runtime {
@@ -618,6 +625,7 @@ impl pallet_session::Config for Runtime {
618625
impl pallet_aura::Config for Runtime {
619626
type AuthorityId = AuraId;
620627
type DisabledValidators = ();
628+
type MaxAuthorities = MaxAuthorities;
621629
}
622630

623631
parameter_types! {
@@ -743,7 +751,7 @@ impl_runtime_apis! {
743751
}
744752

745753
fn authorities() -> Vec<AuraId> {
746-
Aura::authorities()
754+
Aura::authorities().into_inner()
747755
}
748756
}
749757

polkadot-parachains/statemint/src/lib.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ impl Config for XcmConfig {
507507
type Barrier = Barrier;
508508
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
509509
type Trader = UsingComponents<IdentityFee<Balance>, DotLocation, AccountId, Balances, ()>;
510-
type ResponseHandler = (); // Don't handle responses for now.
510+
type ResponseHandler = PolkadotXcm;
511+
type AssetTrap = PolkadotXcm;
512+
type AssetClaims = PolkadotXcm;
513+
type SubscriptionService = PolkadotXcm;
511514
}
512515

513516
parameter_types! {
@@ -539,6 +542,8 @@ impl pallet_xcm::Config for Runtime {
539542
type LocationInverter = LocationInverter<Ancestry>;
540543
type Origin = Origin;
541544
type Call = Call;
545+
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
546+
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
542547
}
543548

544549
impl cumulus_pallet_xcm::Config for Runtime {
@@ -563,6 +568,7 @@ parameter_types! {
563568
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
564569
pub const Period: u32 = 6 * HOURS;
565570
pub const Offset: u32 = 0;
571+
pub const MaxAuthorities: u32 = 100_000;
566572
}
567573

568574
impl pallet_session::Config for Runtime {
@@ -583,6 +589,7 @@ impl pallet_session::Config for Runtime {
583589
impl pallet_aura::Config for Runtime {
584590
type AuthorityId = AuraId;
585591
type DisabledValidators = ();
592+
type MaxAuthorities = MaxAuthorities;
586593
}
587594

588595
parameter_types! {
@@ -726,7 +733,7 @@ impl_runtime_apis! {
726733
}
727734

728735
fn authorities() -> Vec<AuraId> {
729-
Aura::authorities()
736+
Aura::authorities().into_inner()
730737
}
731738
}
732739

polkadot-parachains/westmint/src/lib.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,10 @@ impl Config for XcmConfig {
505505
type Barrier = Barrier;
506506
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
507507
type Trader = UsingComponents<IdentityFee<Balance>, WestendLocation, AccountId, Balances, ()>;
508-
type ResponseHandler = (); // Don't handle responses for now.
508+
type ResponseHandler = PolkadotXcm;
509+
type AssetTrap = PolkadotXcm;
510+
type AssetClaims = PolkadotXcm;
511+
type SubscriptionService = PolkadotXcm;
509512
}
510513

511514
parameter_types! {
@@ -537,6 +540,9 @@ impl pallet_xcm::Config for Runtime {
537540
type LocationInverter = LocationInverter<Ancestry>;
538541
type Origin = Origin;
539542
type Call = Call;
543+
544+
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
545+
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
540546
}
541547

542548
impl cumulus_pallet_xcm::Config for Runtime {
@@ -561,6 +567,7 @@ parameter_types! {
561567
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
562568
pub const Period: u32 = 6 * HOURS;
563569
pub const Offset: u32 = 0;
570+
pub const MaxAuthorities: u32 = 100_000;
564571
}
565572

566573
impl pallet_session::Config for Runtime {
@@ -581,6 +588,7 @@ impl pallet_session::Config for Runtime {
581588
impl pallet_aura::Config for Runtime {
582589
type AuthorityId = AuraId;
583590
type DisabledValidators = ();
591+
type MaxAuthorities = MaxAuthorities;
584592
}
585593

586594
parameter_types! {
@@ -728,7 +736,7 @@ impl_runtime_apis! {
728736
}
729737

730738
fn authorities() -> Vec<AuraId> {
731-
Aura::authorities()
739+
Aura::authorities().into_inner()
732740
}
733741
}
734742

0 commit comments

Comments
 (0)