-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathlib.rs
More file actions
2728 lines (2463 loc) · 126 KB
/
lib.rs
File metadata and controls
2728 lines (2463 loc) · 126 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2022-2025 Forecasting Technologies LTD.
// Copyright 2021-2022 Zeitgeist PM LLC.
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
//
// This file is part of Zeitgeist.
//
// Zeitgeist is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
//
// Zeitgeist is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Zeitgeist. If not, see <https://www.gnu.org/licenses/>.
//
// This file incorporates work covered by the following copyright and
// permission notice:
//
// Copyright (C) 2020-2022 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// This file incorporates work covered by the following copyright and
// permission notice:
//
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "512"]
#![allow(clippy::crate_in_macro_def)]
pub mod fees;
pub mod weights;
#[macro_export]
macro_rules! decl_common_types {
() => {
use core::marker::PhantomData;
use frame_support::{
migration::storage_key_iter,
migrations::RemovePallet,
pallet_prelude::StorageVersion,
parameter_types,
storage::child,
traits::{
fungible::HoldConsideration,
fungibles::Imbalance as FImbalance,
tokens::{PayFromAccount, UnityAssetBalanceConversion},
Currency, Get, Imbalance, LinearStoragePrice, NeverEnsureOrigin, OnRuntimeUpgrade,
OnUnbalanced, TransformOrigin,
},
Blake2_256, BoundedVec, Twox64Concat,
};
use frame_system::EnsureSigned;
use orml_traits::MultiCurrency;
use pallet_balances::{CreditOf, NegativeImbalance};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_consensus_slots::Slot;
use sp_core::storage::ChildInfo;
use sp_runtime::{
generic, traits::IdentityLookup, DispatchError, DispatchResult, RuntimeDebug,
SaturatedConversion,
};
use zeitgeist_primitives::{
constants::{BLOCK_PROCESSING_VELOCITY, UNINCLUDED_SEGMENT_CAPACITY},
traits::{DeployPoolApi, DistributeFees, MarketCommonsPalletApi},
};
use zrml_combinatorial_tokens::types::{CryptographicIdManager, Fuel};
use zrml_neo_swaps::types::DecisionMarketOracle;
#[cfg(feature = "try-runtime")]
use frame_try_runtime::{TryStateSelect, UpgradeCheckSelect};
#[cfg(feature = "runtime-benchmarks")]
use zrml_neo_swaps::types::DecisionMarketBenchmarkHelper;
#[cfg(feature = "runtime-benchmarks")]
use zrml_prediction_markets::types::PredictionMarketsCombinatorialTokensBenchmarkHelper;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
type Address = sp_runtime::MultiAddress<AccountId, ()>;
#[cfg(feature = "parachain")]
type Migrations = (
pallet_parachain_staking::migrations::MigrateRoundWithFirstSlot<Runtime>,
pallet_parachain_staking::migrations::MigrateParachainBondConfig<Runtime>,
cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<Runtime>,
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
// This `MigrateToLatestXcmVersion` migration can be permanently added to the runtime migrations. https://github.com/paritytech/polkadot-sdk/blob/87971b3e92721bdf10bf40b410eaae779d494ca0/polkadot/xcm/pallet-xcm/src/migration.rs#L83
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
// u64::MAX from here: https://github.com/paritytech/polkadot-sdk/blob/304bbb8711f61503ae7afa3a5bfd4f78af5cbd62/polkadot/runtime/rococo/src/lib.rs#L1629-L1630
pallet_identity::migration::versioned::V0ToV1<Runtime, { u64::MAX }>,
);
#[cfg(not(feature = "parachain"))]
type Migrations = (
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
// u64::MAX from here: https://github.com/paritytech/polkadot-sdk/blob/304bbb8711f61503ae7afa3a5bfd4f78af5cbd62/polkadot/runtime/rococo/src/lib.rs#L1629-L1630
pallet_identity::migration::versioned::V0ToV1<Runtime, { u64::MAX }>,
);
pub type Executive = frame_executive::Executive<
Runtime,
Block,
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub(crate) type NodeBlock = generic::Block<Header, sp_runtime::OpaqueExtrinsic>;
pub type SignedExtra = (
CheckNonZeroSender<Runtime>,
CheckSpecVersion<Runtime>,
CheckTxVersion<Runtime>,
CheckGenesis<Runtime>,
CheckEra<Runtime>,
CheckNonce<Runtime>,
CheckWeight<Runtime>,
// https://docs.rs/pallet-asset-tx-payment/latest/src/pallet_asset_tx_payment/lib.rs.html#32-34
pallet_asset_tx_payment::ChargeAssetTxPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
pub type EventRecord = frame_system::EventRecord<
<Runtime as frame_system::Config>::RuntimeEvent,
<Runtime as frame_system::Config>::Hash,
>;
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
// Governance
type AdvisoryCommitteeInstance = pallet_collective::Instance1;
type AdvisoryCommitteeMembershipInstance = pallet_membership::Instance1;
type CouncilInstance = pallet_collective::Instance2;
type CouncilMembershipInstance = pallet_membership::Instance2;
type TechnicalCommitteeInstance = pallet_collective::Instance3;
type TechnicalCommitteeMembershipInstance = pallet_membership::Instance3;
// Council vote proportions
// At least 50%
type EnsureRootOrHalfCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 2>,
>;
// At least 60%
type EnsureRootOrThreeFifthsCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, CouncilInstance, 3, 5>,
>;
// At least 66%
type EnsureRootOrTwoThirdsCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, CouncilInstance, 2, 3>,
>;
// At least 75%
type EnsureRootOrThreeFourthsCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, CouncilInstance, 3, 4>,
>;
// At least 100%
type EnsureRootOrAllCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 1>,
>;
// Technical committee vote proportions
// At least 50%
#[cfg(feature = "parachain")]
type EnsureRootOrHalfTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 1, 2>,
>;
// At least 60%
type EnsureRootOrThreeFifthsTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 3, 5>,
>;
// At least 66%
type EnsureRootOrTwoThirdsTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>,
>;
// At least 100%
type EnsureRootOrAllTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 1, 1>,
>;
// Advisory Committee vote proportions
// More than 33%
type EnsureRootOrMoreThanOneThirdAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionMoreThan<AccountId, AdvisoryCommitteeInstance, 1, 3>,
>;
// More than 50%
type EnsureRootOrMoreThanHalfAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionMoreThan<AccountId, AdvisoryCommitteeInstance, 1, 2>,
>;
// More than 66%
type EnsureRootOrMoreThanTwoThirdsAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionMoreThan<AccountId, AdvisoryCommitteeInstance, 2, 3>,
>;
// At least 66%
type EnsureRootOrTwoThirdsAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, AdvisoryCommitteeInstance, 2, 3>,
>;
#[cfg(feature = "std")]
/// The version information used to identify this runtime when compiled natively.
pub fn native_version() -> NativeVersion {
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
}
// Accounts protected from being deleted due to a too low amount of funds.
pub struct DustRemovalWhitelist;
impl Contains<AccountId> for DustRemovalWhitelist
where
frame_support::PalletId: AccountIdConversion<AccountId>,
{
fn contains(ai: &AccountId) -> bool {
let mut pallets = vec![
AuthorizedPalletId::get(),
CourtPalletId::get(),
GlobalDisputesPalletId::get(),
HybridRouterPalletId::get(),
OrderbookPalletId::get(),
ParimutuelPalletId::get(),
PmPalletId::get(),
SwapsPalletId::get(),
TreasuryPalletId::get(),
];
if let Some(pallet_id) = frame_support::PalletId::try_from_sub_account::<u128>(ai) {
return pallets.contains(&pallet_id.0);
}
for pallet_id in pallets {
let pallet_acc: AccountId = pallet_id.into_account_truncating();
if pallet_acc == *ai {
return true;
}
}
false
}
}
common_runtime::impl_fee_types!();
pub mod opaque {
//! Opaque types. These are used by the CLI to instantiate machinery that don't need to
//! know the specifics of the runtime. They can then be made to be agnostic over
//! specific formats of data like extrinsics, allowing for them to continue syncing the
//! network through upgrades to even the core data structures.
use super::Header;
use alloc::vec::Vec;
use sp_runtime::{generic, impl_opaque_keys};
pub type Block = generic::Block<Header, sp_runtime::OpaqueExtrinsic>;
#[cfg(feature = "parachain")]
impl_opaque_keys! {
pub struct SessionKeys {
pub nimbus: crate::AuthorInherent,
pub vrf: session_keys_primitives::VrfSessionKey,
}
}
#[cfg(not(feature = "parachain"))]
impl_opaque_keys! {
pub struct SessionKeys {
pub aura: crate::Aura,
pub grandpa: crate::Grandpa,
}
}
}
};
}
// Construct runtime
#[macro_export]
macro_rules! create_runtime {
($($additional_pallets:tt)*) => {
use alloc::{boxed::Box, vec::Vec};
// Pallets are enumerated based on the dependency graph.
//
// For example, `PredictionMarkets` is pĺaced after `MarketCommons` because
// `PredictionMarkets` depends on `MarketCommons`.
construct_runtime!(
pub enum Runtime {
// System
System: frame_system::{Call, Config<T>, Event<T>, Pallet, Storage} = 0,
Timestamp: pallet_timestamp::{Call, Pallet, Storage, Inherent} = 1,
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage} = 2,
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 3,
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>, HoldReason} = 4,
// Money
Balances: pallet_balances::{Call, Config<T>, Event<T>, Pallet, Storage} = 10,
TransactionPayment: pallet_transaction_payment::{Config<T>, Event<T>, Pallet, Storage} = 11,
Treasury: pallet_treasury::{Call, Config<T>, Event<T>, Pallet, Storage} = 12,
Vesting: pallet_vesting::{Call, Config<T>, Event<T>, Pallet, Storage} = 13,
Multisig: pallet_multisig::{Call, Event<T>, Pallet, Storage} = 14,
Bounties: pallet_bounties::{Call, Event<T>, Pallet, Storage} = 15,
AssetTxPayment: pallet_asset_tx_payment::{Event<T>, Pallet} = 16,
// Governance
Democracy: pallet_democracy::{Pallet, Call, Storage, Config<T>, Event<T>} = 20,
AdvisoryCommittee: pallet_collective::<Instance1>::{Call, Config<T>, Event<T>, Origin<T>, Pallet, Storage} = 21,
AdvisoryCommitteeMembership: pallet_membership::<Instance1>::{Call, Config<T>, Event<T>, Pallet, Storage} = 22,
Council: pallet_collective::<Instance2>::{Call, Config<T>, Event<T>, Origin<T>, Pallet, Storage} = 23,
CouncilMembership: pallet_membership::<Instance2>::{Call, Config<T>, Event<T>, Pallet, Storage} = 24,
TechnicalCommittee: pallet_collective::<Instance3>::{Call, Config<T>, Event<T>, Origin<T>, Pallet, Storage} = 25,
TechnicalCommitteeMembership: pallet_membership::<Instance3>::{Call, Config<T>, Event<T>, Pallet, Storage} = 26,
// Other Parity pallets
Identity: pallet_identity::{Call, Event<T>, Pallet, Storage} = 30,
Utility: pallet_utility::{Call, Event, Pallet, Storage} = 31,
Proxy: pallet_proxy::{Call, Event<T>, Pallet, Storage} = 32,
// Third-party
AssetManager: orml_currencies::{Call, Pallet, Storage} = 40,
Tokens: orml_tokens::{Config<T>, Event<T>, Pallet, Storage} = 41,
// Zeitgeist
MarketCommons: zrml_market_commons::{Pallet, Storage} = 50,
Authorized: zrml_authorized::{Call, Event<T>, Pallet, Storage} = 51,
Court: zrml_court::{Call, Event<T>, Pallet, Storage} = 52,
Swaps: zrml_swaps::{Call, Event<T>, Pallet, Storage} = 56,
PredictionMarkets: zrml_prediction_markets::{Call, Event<T>, Pallet, Storage} = 57,
Styx: zrml_styx::{Call, Event<T>, Pallet, Storage} = 58,
GlobalDisputes: zrml_global_disputes::{Call, Event<T>, Pallet, Storage} = 59,
NeoSwaps: zrml_neo_swaps::{Call, Event<T>, Pallet, Storage} = 60,
Orderbook: zrml_orderbook::{Call, Event<T>, Pallet, Storage} = 61,
Parimutuel: zrml_parimutuel::{Call, Event<T>, Pallet, Storage} = 62,
HybridRouter: zrml_hybrid_router::{Call, Event<T>, Pallet, Storage} = 64,
CombinatorialTokens: zrml_combinatorial_tokens::{Call, Event<T>, Pallet, Storage} = 65,
Futarchy: zrml_futarchy::{Call, Event<T>, Pallet, Storage} = 66,
$($additional_pallets)*
}
);
}
}
#[macro_export]
macro_rules! create_runtime_with_additional_pallets {
($($additional_pallets:tt)*) => {
#[cfg(feature = "parachain")]
create_runtime!(
// System
ParachainSystem: cumulus_pallet_parachain_system::{Call, Config<T>, Event<T>, Inherent, Pallet, Storage} = 100,
ParachainInfo: parachain_info::{Config<T>, Pallet, Storage} = 101,
// Consensus
ParachainStaking: pallet_parachain_staking::{Call, Config<T>, Event<T>, Pallet, Storage} = 110,
AuthorInherent: pallet_author_inherent::{Call, Inherent, Pallet, Storage} = 111,
AuthorFilter: pallet_author_slot_filter::{Call, Config<T>, Event, Pallet, Storage} = 112,
AuthorMapping: pallet_author_mapping::{Call, Config<T>, Event<T>, Pallet, Storage} = 113,
// XCM
CumulusXcm: cumulus_pallet_xcm::{Event<T>, Origin, Pallet} = 120,
// TODO Remove this pallet once the lazy migration is complete. https://github.com/paritytech/polkadot-sdk/blob/87971b3e92721bdf10bf40b410eaae779d494ca0/cumulus/pallets/dmp-queue/src/lib.rs#L45
DmpQueue: cumulus_pallet_dmp_queue::{Call, Event<T>, Pallet, Storage} = 121,
PolkadotXcm: pallet_xcm::{Call, Config<T>, Event<T>, Origin, Pallet, Storage} = 122,
XcmpQueue: cumulus_pallet_xcmp_queue::{Call, Event<T>, Pallet, Storage} = 123,
AssetRegistry: orml_asset_registry::module::{Call, Config<T>, Event<T>, Pallet, Storage} = 124,
UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 125,
XTokens: orml_xtokens::{Pallet, Storage, Call, Event<T>} = 126,
MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event<T>} = 127,
// Others
$($additional_pallets)*
);
#[cfg(not(feature = "parachain"))]
create_runtime!(
// Consensus
Aura: pallet_aura::{Config<T>, Pallet, Storage} = 100,
Grandpa: pallet_grandpa::{Call, Config<T>, Event, Pallet, Storage} = 101,
// Others
$($additional_pallets)*
);
}
}
#[macro_export]
macro_rules! impl_config_traits {
() => {
use common_runtime::weights;
#[cfg(feature = "parachain")]
use {
cumulus_primitives_core::{AggregateMessageOrigin, ParaId},
frame_support::traits::Nothing,
parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling},
xcm_config::config::*,
};
// TODO: Remove this pallet once the lazy migration is complete. https://github.com/paritytech/polkadot-sdk/blob/87971b3e92721bdf10bf40b410eaae779d494ca0/cumulus/pallets/dmp-queue/src/lib.rs#L45
#[cfg(feature = "parachain")]
impl cumulus_pallet_dmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type WeightInfo = weights::cumulus_pallet_dmp_queue::WeightInfo<Runtime>;
}
// Configure Pallets
#[cfg(feature = "parachain")]
impl cumulus_pallet_parachain_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type OutboundXcmpMessageSource = XcmpQueue;
type ReservedDmpWeight = crate::parachain_params::ReservedDmpWeight;
type ReservedXcmpWeight = crate::parachain_params::ReservedXcmpWeight;
type SelfParaId = parachain_info::Pallet<Runtime>;
type XcmpMessageHandler = XcmpQueue;
type CheckAssociatedRelayNumber =
cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
}
#[cfg(feature = "parachain")]
impl cumulus_pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = xcm_executor::XcmExecutor<XcmConfig>;
}
#[cfg(feature = "parachain")]
impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ChannelInfo = ParachainSystem;
type ControllerOrigin = EnsureRootOrThreeFifthsTechnicalCommittee;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type PriceForSiblingDelivery =
polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery<ParaId>;
type MaxActiveOutboundChannels = MaxActiveOutboundChannels;
// Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we
// need to set the page size larger than that until we reduce the channel size on-chain.
type MaxPageSize = MessageQueueHeapSize;
type RuntimeEvent = RuntimeEvent;
type VersionWrapper = PolkadotXcm;
type XcmpQueue =
TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
type MaxInboundSuspended = MaxInboundSuspended;
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
}
#[cfg(feature = "parachain")]
impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime {
// This must be the same as the `ChannelInfo` from the `Config`:
type ChannelList = ParachainSystem;
}
#[cfg(feature = "parachain")]
impl pallet_message_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
#[cfg(feature = "use-noop-message-processor")]
type MessageProcessor =
pallet_message_queue::mock_helpers::NoopMessageProcessor<AggregateMessageOrigin>;
#[cfg(not(feature = "use-noop-message-processor"))]
type MessageProcessor = xcm_builder::ProcessXcmMessage<
AggregateMessageOrigin,
xcm_executor::XcmExecutor<XcmConfig>,
RuntimeCall,
>;
type Size = u32;
type HeapSize = MessageQueueHeapSize;
type MaxStale = MessageQueueMaxStale;
type ServiceWeight = MessageQueueServiceWeight;
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
type WeightInfo = weights::pallet_message_queue::WeightInfo<Runtime>;
type IdleMaxServiceWeight = MessageQueueServiceWeight;
}
impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
type AccountId = AccountId;
type BaseCallFilter = IsCallable;
type Block = Block;
type BlockHashCount = BlockHashCount;
type BlockLength = RuntimeBlockLength;
type BlockWeights = RuntimeBlockWeights;
type RuntimeCall = RuntimeCall;
type DbWeight = RocksDbWeight;
type RuntimeEvent = RuntimeEvent;
type Hash = Hash;
type Hashing = BlakeTwo256;
type Lookup = AccountIdLookup<AccountId, ()>;
type Nonce = Nonce;
type MaxConsumers = ConstU32<16>;
type OnKilledAccount = ();
type OnNewAccount = ();
#[cfg(feature = "parachain")]
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
#[cfg(not(feature = "parachain"))]
type OnSetCode = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeTask = RuntimeTask;
type PalletInfo = PalletInfo;
type SS58Prefix = SS58Prefix;
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
type Version = Version;
type SingleBlockMigrations = ();
type MultiBlockMigrator = ();
type PreInherents = ();
type PostInherents = ();
type PostTransactions = ();
}
#[cfg(not(feature = "parachain"))]
impl pallet_aura::Config for Runtime {
type AllowMultipleBlocksPerSlot = AllowMultipleBlocksPerSlot;
type AuthorityId = sp_consensus_aura::sr25519::AuthorityId;
type DisabledValidators = ();
type MaxAuthorities = MaxAuthorities;
type SlotDuration = pallet_aura::MinimumPeriodTimesTwo<Runtime>;
}
#[cfg(feature = "parachain")]
impl pallet_author_inherent::Config for Runtime {
type AccountLookup = AuthorMapping;
type AuthorId = AccountId;
type CanAuthor = AuthorFilter;
type SlotBeacon = cumulus_pallet_parachain_system::RelaychainDataProvider<Self>;
type WeightInfo = weights::pallet_author_inherent::WeightInfo<Runtime>;
}
#[cfg(feature = "parachain")]
impl pallet_author_mapping::Config for Runtime {
type DepositAmount = CollatorDeposit;
type DepositCurrency = Balances;
type RuntimeEvent = RuntimeEvent;
type Keys = session_keys_primitives::VrfId;
type WeightInfo = weights::pallet_author_mapping::WeightInfo<Runtime>;
}
#[cfg(feature = "parachain")]
impl pallet_author_slot_filter::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RandomnessSource = RandomnessCollectiveFlip;
type PotentialAuthors = ParachainStaking;
type WeightInfo = weights::pallet_author_slot_filter::WeightInfo<Runtime>;
}
frame_support::parameter_types! {
pub const MaxSetIdSessionEntries: u32 = 12;
}
#[cfg(not(feature = "parachain"))]
impl pallet_grandpa::Config for Runtime {
type EquivocationReportSystem = ();
type KeyOwnerProof = sp_core::Void;
type MaxAuthorities = MaxAuthorities;
type MaxNominators = MaxNominators;
type MaxSetIdSessionEntries = MaxSetIdSessionEntries;
type RuntimeEvent = RuntimeEvent;
// Currently the benchmark does yield an invalid weight implementation
// type WeightInfo = weights::pallet_grandpa::WeightInfo<Runtime>;
type WeightInfo = ();
}
#[cfg(feature = "parachain")]
impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type UniversalLocation = UniversalLocation;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type XcmExecuteFilter = Nothing;
// ^ Disable dispatchable execute on the XCM pallet.
// Needs to be `Everything` for local testing.
type XcmExecutor = xcm_executor::XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Nothing;
type XcmRouter = XcmRouter;
type Currency = Balances;
type CurrencyMatcher = ();
type TrustedLockers = ();
type SovereignAccountOf = LocationToAccountId;
type MaxLockers = MaxLockers;
type MaxRemoteLockConsumers = MaxRemoteLockConsumers;
// TODO(#1425) use correct weight info after benchmarking
type WeightInfo = pallet_xcm::TestWeightInfo;
type RemoteLockConsumerIdentifier = ();
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
// ^ Override for AdvertisedXcmVersion default
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}
#[cfg(feature = "parachain")]
pub struct OnInactiveCollator;
#[cfg(feature = "parachain")]
impl pallet_parachain_staking::OnInactiveCollator<Runtime> for OnInactiveCollator {
fn on_inactive_collator(
collator_id: AccountId,
round: pallet_parachain_staking::RoundIndex,
) -> Result<
Weight,
sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>,
> {
use pallet_parachain_staking::WeightInfo;
ParachainStaking::go_offline_inner(collator_id)?;
let extra_weight =
<Runtime as pallet_parachain_staking::Config>::WeightInfo::go_offline(
pallet_parachain_staking::MAX_CANDIDATES,
);
Ok(<Runtime as frame_system::Config>::DbWeight::get()
.reads(1)
.saturating_add(extra_weight))
}
}
#[cfg(feature = "parachain")]
pub struct StakingRoundSlotProvider;
#[cfg(feature = "parachain")]
impl Get<Slot> for StakingRoundSlotProvider {
fn get() -> Slot {
let block_number: u64 =
frame_system::pallet::Pallet::<Runtime>::block_number().into();
Slot::from(block_number)
}
}
#[cfg(feature = "parachain")]
impl pallet_parachain_staking::Config for Runtime {
type BlockAuthor = AuthorInherent;
type BlockTime = BlockTime;
type CandidateBondLessDelay = CandidateBondLessDelay;
type Currency = Balances;
type DelegationBondLessDelay = DelegationBondLessDelay;
type RuntimeEvent = RuntimeEvent;
type LeaveCandidatesDelay = LeaveCandidatesDelay;
type LeaveDelegatorsDelay = LeaveDelegatorsDelay;
type MaxBottomDelegationsPerCandidate = MaxBottomDelegationsPerCandidate;
type MaxCandidates = MaxCandidates;
type MaxDelegationsPerDelegator = MaxDelegationsPerDelegator;
type MaxTopDelegationsPerCandidate = MaxTopDelegationsPerCandidate;
type MaxOfflineRounds = MaxOfflineRounds;
type MinBlocksPerRound = MinBlocksPerRound;
type MinCandidateStk = MinCandidateStk;
type MinDelegation = MinDelegation;
type MinSelectedCandidates = MinSelectedCandidates;
type MonetaryGovernanceOrigin = EnsureRoot<AccountId>;
type OnCollatorPayout = ();
type OnInactiveCollator = OnInactiveCollator;
type PayoutCollatorReward = ();
type OnNewRound = ();
type RevokeDelegationDelay = RevokeDelegationDelay;
type RewardPaymentDelay = RewardPaymentDelay;
type SlotDuration = SlotDuration;
type SlotProvider = StakingRoundSlotProvider;
type WeightInfo = weights::pallet_parachain_staking::WeightInfo<Runtime>;
}
#[cfg(feature = "parachain")]
impl orml_asset_registry::module::Config for Runtime {
type AssetId = CurrencyId;
type AssetProcessor = CustomAssetProcessor;
type AuthorityOrigin = AsEnsureOriginWithArg<EnsureRootOrThreeFifthsCouncil>;
type Balance = Balance;
type CustomMetadata = CustomMetadata;
type RuntimeEvent = RuntimeEvent;
type StringLimit = AssetRegistryStringLimit;
type WeightInfo = ();
}
impl orml_currencies::Config for Runtime {
type GetNativeCurrencyId = GetNativeCurrencyId;
type MultiCurrency = Tokens;
type NativeCurrency = BasicCurrencyAdapter<Runtime, Balances>;
type WeightInfo = weights::orml_currencies::WeightInfo<Runtime>;
}
pub struct CurrencyHooks<R>(sp_std::marker::PhantomData<R>);
impl<C: orml_tokens::Config>
orml_traits::currency::MutationHooks<AccountId, CurrencyId, Balance>
for CurrencyHooks<C>
{
type OnDust = orml_tokens::TransferDust<Runtime, ZeitgeistTreasuryAccount>;
type OnKilledTokenAccount = ();
type OnNewTokenAccount = ();
type OnSlash = ();
type PostDeposit = ();
type PostTransfer = ();
type PreDeposit = ();
type PreTransfer = ();
}
impl orml_tokens::Config for Runtime {
type Amount = Amount;
type Balance = Balance;
type CurrencyHooks = CurrencyHooks<Runtime>;
type CurrencyId = CurrencyId;
type DustRemovalWhitelist = DustRemovalWhitelist;
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposits = ExistentialDeposits;
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::orml_tokens::WeightInfo<Runtime>;
}
#[cfg(feature = "parachain")]
impl orml_unknown_tokens::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}
#[cfg(feature = "parachain")]
impl orml_xtokens::Config for Runtime {
type AccountIdToLocation = AccountIdToLocation;
type Balance = Balance;
type BaseXcmWeight = BaseXcmWeight;
type CurrencyId = CurrencyId;
type CurrencyIdConvert = AssetConvert;
type RuntimeEvent = RuntimeEvent;
type MaxAssetsForTransfer = MaxAssetsForTransfer;
type MinXcmFee = ParachainMinFee;
type LocationsFilter = Everything;
type RateLimiter = ();
type RateLimiterId = ();
type ReserveProvider = orml_traits::location::AbsoluteReserveProvider;
type SelfLocation = SelfLocation;
type UniversalLocation = UniversalLocation;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type XcmExecutor = xcm_executor::XcmExecutor<XcmConfig>;
}
pub struct DustIntoTreasury;
type CreditOfBalances = CreditOf<Runtime, ()>;
impl OnUnbalanced<CreditOfBalances> for DustIntoTreasury {
fn on_nonzero_unbalanced(mut dust: CreditOfBalances) {
let imbalance = NegativeImbalance::new(dust.peek());
Treasury::on_nonzero_unbalanced(imbalance);
// Ensure issuance is not reduced via OnDrop
core::mem::forget(dust);
}
}
impl pallet_balances::Config for Runtime {
type AccountStore = System;
type Balance = Balance;
type DustRemoval = DustIntoTreasury;
type ExistentialDeposit = ExistentialDeposit;
type FreezeIdentifier = ();
type MaxFreezes = MaxFreezes;
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type RuntimeEvent = RuntimeEvent;
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
}
impl pallet_collective::Config<AdvisoryCommitteeInstance> for Runtime {
type DefaultVote = PrimeDefaultVote;
type RuntimeEvent = RuntimeEvent;
type MaxMembers = AdvisoryCommitteeMaxMembers;
type MaxProposals = AdvisoryCommitteeMaxProposals;
type MaxProposalWeight = MaxProposalWeight;
type MotionDuration = AdvisoryCommitteeMotionDuration;
type RuntimeOrigin = RuntimeOrigin;
type SetMembersOrigin = EnsureRoot<AccountId>;
type Proposal = RuntimeCall;
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
}
impl pallet_collective::Config<CouncilInstance> for Runtime {
type DefaultVote = PrimeDefaultVote;
type RuntimeEvent = RuntimeEvent;
type MaxMembers = CouncilMaxMembers;
type MaxProposals = CouncilMaxProposals;
type MaxProposalWeight = MaxProposalWeight;
type MotionDuration = CouncilMotionDuration;
type RuntimeOrigin = RuntimeOrigin;
type SetMembersOrigin = EnsureRoot<AccountId>;
type Proposal = RuntimeCall;
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
}
impl pallet_collective::Config<TechnicalCommitteeInstance> for Runtime {
type DefaultVote = PrimeDefaultVote;
type RuntimeEvent = RuntimeEvent;
type MaxMembers = TechnicalCommitteeMaxMembers;
type MaxProposals = TechnicalCommitteeMaxProposals;
type MaxProposalWeight = MaxProposalWeight;
type MotionDuration = TechnicalCommitteeMotionDuration;
type RuntimeOrigin = RuntimeOrigin;
type SetMembersOrigin = EnsureRoot<AccountId>;
type Proposal = RuntimeCall;
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
}
impl pallet_democracy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type VoteLockingPeriod = VoteLockingPeriod;
type MinimumDeposit = MinimumDeposit;
/// Origin that can decide what their next motion is.
type ExternalOrigin = EnsureRootOrHalfCouncil;
/// Origin that can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin = EnsureRootOrHalfCouncil;
/// Origina that can have the next scheduled referendum be a straight default-carries
/// (NTB) vote.
type ExternalDefaultOrigin = EnsureRootOrAllCouncil;
/// Origin that can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = EnsureRootOrThreeFifthsTechnicalCommittee;
/// Origin from which the next majority-carries (or more permissive) referendum may be tabled
/// to vote immediately and asynchronously in a similar manner to the emergency origin.
type InstantOrigin = EnsureRootOrAllTechnicalCommittee;
type InstantAllowed = InstantAllowed;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
/// Origin from which any referendum may be cancelled in an emergency.
type CancellationOrigin = EnsureRootOrThreeFourthsCouncil;
/// Origin from which proposals may be blacklisted.
type BlacklistOrigin = EnsureRootOrAllCouncil;
/// Origin from which a proposal may be cancelled and its backers slashed.
type CancelProposalOrigin = EnsureRootOrAllTechnicalCommittee;
/// Origin for anyone able to veto proposals.
type VetoOrigin =
pallet_collective::EnsureMember<AccountId, TechnicalCommitteeInstance>;
type CooloffPeriod = CooloffPeriod;
type Slash = Treasury;
type Scheduler = Scheduler;
type SubmitOrigin = EnsureSigned<AccountId>;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
type MaxProposals = DemocracyMaxProposals;
type Preimages = Preimage;
type MaxBlacklisted = ConstU32<100>;
type MaxDeposits = ConstU32<100>;
}
impl pallet_identity::Config for Runtime {
type BasicDeposit = BasicDeposit;
type ByteDeposit = IdentityByteDeposit;
type Currency = Balances;
type IdentityInformation = pallet_identity::legacy::IdentityInfo<MaxAdditionalFields>;
type RuntimeEvent = RuntimeEvent;
type ForceOrigin = EnsureRootOrHalfCouncil;
type MaxRegistrars = MaxRegistrars;
type MaxSubAccounts = MaxSubAccounts;
type MaxSuffixLength = MaxSuffixLength;
type MaxUsernameLength = MaxUsernameLength;
type OffchainSignature = Signature;
type PendingUsernameExpiration = PendingUsernameExpiration;
type RegistrarOrigin = EnsureRootOrHalfCouncil;
type Slashed = Treasury;
type SubAccountDeposit = SubAccountDeposit;
type SigningPublicKey = <Signature as sp_runtime::traits::Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<AccountId>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}
impl pallet_membership::Config<AdvisoryCommitteeMembershipInstance> for Runtime {
type AddOrigin = EnsureRootOrThreeFifthsCouncil;
type RuntimeEvent = RuntimeEvent;
type MaxMembers = AdvisoryCommitteeMaxMembers;
type MembershipChanged = AdvisoryCommittee;
type MembershipInitialized = AdvisoryCommittee;
type PrimeOrigin = EnsureRootOrThreeFifthsCouncil;
type RemoveOrigin = EnsureRootOrThreeFifthsCouncil;
type ResetOrigin = EnsureRootOrThreeFifthsCouncil;
type SwapOrigin = EnsureRootOrThreeFifthsCouncil;
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
}
impl pallet_membership::Config<CouncilMembershipInstance> for Runtime {
type AddOrigin = EnsureRootOrThreeFifthsCouncil;
type RuntimeEvent = RuntimeEvent;
type MaxMembers = CouncilMaxMembers;
type MembershipChanged = Council;
type MembershipInitialized = Council;
type PrimeOrigin = EnsureRootOrThreeFifthsCouncil;
type RemoveOrigin = EnsureRootOrThreeFifthsCouncil;
type ResetOrigin = EnsureRootOrThreeFifthsCouncil;
type SwapOrigin = EnsureRootOrThreeFifthsCouncil;
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
}
impl pallet_membership::Config<TechnicalCommitteeMembershipInstance> for Runtime {
type AddOrigin = EnsureRootOrThreeFifthsCouncil;
type RuntimeEvent = RuntimeEvent;
type MaxMembers = TechnicalCommitteeMaxMembers;
type MembershipChanged = TechnicalCommittee;
type MembershipInitialized = TechnicalCommittee;
type PrimeOrigin = EnsureRootOrThreeFifthsCouncil;
type RemoveOrigin = EnsureRootOrThreeFifthsCouncil;
type ResetOrigin = EnsureRootOrThreeFifthsCouncil;
type SwapOrigin = EnsureRootOrThreeFifthsCouncil;
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
}
impl pallet_multisig::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = ConstU32<100>;
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
}
impl pallet_preimage::Config for Runtime {
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type Consideration = HoldConsideration<
AccountId,
Balances,
PreimageHoldReason,
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
>;
}
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::CancelProxy => {
matches!(
c,
RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })
)
}
ProxyType::Governance => matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Council(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::AdvisoryCommittee(..)
| RuntimeCall::Treasury(..)
),