Skip to content

Commit 26846f6

Browse files
authored
prepare minting cdot (#1211)
* prepare minting cdot Signed-off-by: Cheng JIANG <[email protected]> * cleanup Signed-off-by: Cheng JIANG <[email protected]>
1 parent 014cff3 commit 26846f6

File tree

3 files changed

+37
-27
lines changed

3 files changed

+37
-27
lines changed

runtime/heiko/src/lib.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use frame_support::{
3232
},
3333
PalletId,
3434
};
35+
3536
use orml_traits::{DataProvider, DataProviderExtended};
3637
use polkadot_runtime_common::SlowAdjustingFeeUpdate;
3738
use sp_api::impl_runtime_apis;
@@ -88,7 +89,9 @@ pub use impls::DealWithFees;
8889

8990
pub use pallet_liquid_staking;
9091
// pub use pallet_liquidation;
92+
pub use pallet_amm;
9193
pub use pallet_bridge;
94+
// pub use pallet_liquidity_mining;
9295
pub use pallet_loans;
9396
pub use pallet_multisig;
9497
pub use pallet_nominee_election;
@@ -207,6 +210,7 @@ impl Contains<Call> for BaseCallFilter {
207210
Call::System(_) |
208211
Call::Timestamp(_) |
209212
Call::Balances(_) |
213+
Call::Assets(pallet_assets::Call::mint { .. }) |
210214
// Governance
211215
Call::Sudo(_) |
212216
Call::Democracy(_) |
@@ -382,7 +386,7 @@ impl Convert<MultiAsset, Option<CurrencyId>> for CurrencyIdConvert {
382386
fn convert(a: MultiAsset) -> Option<CurrencyId> {
383387
if let MultiAsset {
384388
id: AssetId::Concrete(id),
385-
fun: Fungibility::Fungible(_amount),
389+
fun: _,
386390
} = a
387391
{
388392
Self::convert(id)
@@ -405,7 +409,8 @@ impl Convert<AccountId, MultiLocation> for AccountIdToMultiLocation {
405409

406410
parameter_types! {
407411
pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::parachain_id().into())));
408-
pub BaseXcmWeight: Weight = 150_000_000;
412+
pub const BaseXcmWeight: Weight = 150_000_000;
413+
pub const MaxInstructions: u32 = 100;
409414
}
410415

411416
impl orml_xtokens::Config for Runtime {
@@ -776,10 +781,6 @@ pub type XcmRouter = (
776781
XcmpQueue,
777782
);
778783

779-
parameter_types! {
780-
pub const MaxInstructions: u32 = 100;
781-
}
782-
783784
impl pallet_xcm::Config for Runtime {
784785
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
785786

@@ -841,7 +842,7 @@ parameter_types! {
841842
pub RelayCurrency: CurrencyId = KSM;
842843
pub HeikoNetwork: NetworkId = NetworkId::Named("heiko".into());
843844
pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
844-
pub Ancestry: MultiLocation = MultiLocation::new(0, X1(Parachain(ParachainInfo::parachain_id().into())));
845+
pub Ancestry: MultiLocation = MultiLocation::new(0, X1(Parachain(ParachainInfo::parachain_id().into())));
845846
}
846847

847848
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
@@ -918,6 +919,10 @@ pub type XcmOriginToTransactDispatchOrigin = (
918919
XcmPassthrough<Origin>,
919920
);
920921

922+
parameter_types! {
923+
pub KsmPerSecond: (AssetId, u128) = (AssetId::Concrete(MultiLocation::parent()), ksm_per_second());
924+
}
925+
921926
match_type! {
922927
pub type ParentOrSiblings: impl Contains<MultiLocation> = {
923928
MultiLocation { parents: 1, interior: Here } |
@@ -947,10 +952,6 @@ impl TakeRevenue for ToTreasury {
947952
}
948953
}
949954

950-
parameter_types! {
951-
pub KsmPerSecond: (AssetId, u128) = (AssetId::Concrete(MultiLocation::parent()), ksm_per_second());
952-
}
953-
954955
pub struct XcmConfig;
955956
impl Config for XcmConfig {
956957
type Call = Call;
@@ -1431,7 +1432,7 @@ impl pallet_currency_adapter::Config for Runtime {
14311432
// type Assets = CurrencyAdapter;
14321433
// type PalletId = LMPalletId;
14331434
// type MaxRewardTokens = MaxRewardTokens;
1434-
// type CreateOrigin = EnsureRoot<AccountId>;
1435+
// type CreateOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
14351436
// type WeightInfo = pallet_liquidity_mining::weights::SubstrateWeight<Runtime>;
14361437
// }
14371438

@@ -1440,10 +1441,11 @@ impl Contains<Call> for WhiteListFilter {
14401441
fn contains(call: &Call) -> bool {
14411442
matches!(
14421443
call,
1443-
// System
1444+
// System, Currencies
14441445
Call::System(_) |
14451446
Call::Timestamp(_) |
14461447
Call::Balances(_) |
1448+
Call::Assets(pallet_assets::Call::mint { .. }) |
14471449
// Governance
14481450
Call::Sudo(_) |
14491451
Call::Democracy(_) |
@@ -1820,6 +1822,7 @@ impl_runtime_apis! {
18201822
let weight = Executive::try_runtime_upgrade().unwrap();
18211823
(weight, RuntimeBlockWeights::get().max_block)
18221824
}
1825+
18231826
fn execute_block_no_check(block: Block) -> Weight {
18241827
Executive::execute_block_no_check(block)
18251828
}

runtime/parallel/src/lib.rs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use sp_version::RuntimeVersion;
5858

5959
use frame_system::{
6060
limits::{BlockLength, BlockWeights},
61-
EnsureOneOf, EnsureRoot, EnsureSigned,
61+
EnsureOneOf, EnsureRoot,
6262
};
6363
use orml_xcm_support::{IsNativeConcrete, MultiNativeAsset};
6464
use polkadot_parachain::primitives::Sibling;
@@ -87,15 +87,16 @@ pub use impls::DealWithFees;
8787

8888
pub use pallet_liquid_staking;
8989
// pub use pallet_liquidation;
90-
use currency::*;
91-
use fee::*;
9290
pub use pallet_amm;
9391
pub use pallet_bridge;
9492
// pub use pallet_liquidity_mining;
9593
pub use pallet_loans;
9694
pub use pallet_multisig;
9795
pub use pallet_nominee_election;
9896
pub use pallet_prices;
97+
98+
use currency::*;
99+
use fee::*;
99100
use time::*;
100101

101102
pub use frame_support::{
@@ -110,6 +111,7 @@ pub use frame_support::{
110111
use pallet_xcm::XcmPassthrough;
111112
#[cfg(any(feature = "std", test))]
112113
pub use sp_runtime::BuildStorage;
114+
113115
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
114116
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
115117
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
@@ -202,9 +204,10 @@ impl Contains<Call> for BaseCallFilter {
202204
fn contains(call: &Call) -> bool {
203205
matches!(
204206
call,
205-
// System
207+
// System, Currencies
206208
Call::System(_) |
207209
Call::Timestamp(_) |
210+
Call::Assets(pallet_assets::Call::mint { .. }) |
208211
// Governance
209212
Call::Sudo(_) |
210213
Call::Democracy(_) |
@@ -221,6 +224,7 @@ impl Contains<Call> for BaseCallFilter {
221224
Call::Utility(_) |
222225
Call::Multisig(_) |
223226
Call::Proxy(_) |
227+
Call::EmergencyShutdown(_) |
224228
// 3rd Party
225229
Call::Vesting(_) |
226230
// Membership
@@ -334,14 +338,14 @@ impl Convert<CurrencyId, Option<MultiLocation>> for CurrencyIdConvert {
334338
DOT => Some(MultiLocation::parent()),
335339
XDOT => Some(MultiLocation::new(
336340
1,
337-
Junctions::X2(
341+
X2(
338342
Parachain(ParachainInfo::parachain_id().into()),
339343
GeneralKey(b"xDOT".to_vec()),
340344
),
341345
)),
342346
PARA => Some(MultiLocation::new(
343347
1,
344-
Junctions::X2(
348+
X2(
345349
Parachain(ParachainInfo::parachain_id().into()),
346350
GeneralKey(b"PARA".to_vec()),
347351
),
@@ -472,11 +476,11 @@ impl pallet_liquid_staking::Config for Runtime {
472476
type WeightInfo = ();
473477
type SelfParaId = ParachainInfo;
474478
type Assets = Assets;
475-
type StakingCurrency = StakingCurrency;
476-
type LiquidCurrency = LiquidCurrency;
477479
type RelayOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
478480
type UpdateOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
479481
type DerivativeIndex = DerivativeIndex;
482+
type StakingCurrency = StakingCurrency;
483+
type LiquidCurrency = LiquidCurrency;
480484
type AccountIdToMultiLocation = AccountIdToMultiLocation;
481485
type UnstakeQueueCapacity = UnstakeQueueCapacity;
482486
type MinStakeAmount = MinStakeAmount;
@@ -776,6 +780,7 @@ pub type XcmRouter = (
776780

777781
impl pallet_xcm::Config for Runtime {
778782
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
783+
779784
type Origin = Origin;
780785
type Call = Call;
781786
type Event = Event;
@@ -1299,7 +1304,7 @@ impl orml_vesting::Config for Runtime {
12991304
type Event = Event;
13001305
type Currency = Balances;
13011306
type MinVestedTransfer = MinVestedTransfer;
1302-
type VestedTransferOrigin = EnsureSigned<AccountId>;
1307+
type VestedTransferOrigin = frame_system::EnsureSigned<AccountId>;
13031308
type WeightInfo = ();
13041309
type MaxVestingSchedules = MaxVestingSchedules;
13051310
type BlockNumberProvider = frame_system::Pallet<Runtime>;
@@ -1318,8 +1323,8 @@ impl pallet_amm::Config for Runtime {
13181323
type Assets = CurrencyAdapter;
13191324
type PalletId = AMMPalletId;
13201325
type LockAccountId = OneAccount;
1321-
type AMMWeightInfo = pallet_amm::weights::SubstrateWeight<Runtime>;
13221326
type CreatePoolOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
1327+
type AMMWeightInfo = pallet_amm::weights::SubstrateWeight<Runtime>;
13231328
type LpFee = DefaultLpFee;
13241329
type ProtocolFee = DefaultProtocolFee;
13251330
type MinimumLiquidity = MinimumLiquidity;
@@ -1424,18 +1429,19 @@ impl pallet_currency_adapter::Config for Runtime {
14241429
// type Assets = CurrencyAdapter;
14251430
// type PalletId = LMPalletId;
14261431
// type MaxRewardTokens = MaxRewardTokens;
1427-
// type CreateOrigin = EnsureRoot<AccountId>;
1428-
// type WeightInfo = pallet_liquidity_mining::weights::SubstrateWeight<Runtime>;
1432+
// type CreateOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
1433+
// type WeightInfo = pallet_liquidity_mining::weights::SubstrateWeight<Runtime>;
14291434
// }
14301435

14311436
pub struct WhiteListFilter;
14321437
impl Contains<Call> for WhiteListFilter {
14331438
fn contains(call: &Call) -> bool {
14341439
matches!(
14351440
call,
1436-
// System
1441+
// System, Currencies
14371442
Call::System(_) |
14381443
Call::Timestamp(_) |
1444+
Call::Assets(pallet_assets::Call::mint { .. }) |
14391445
// Governance
14401446
Call::Sudo(_) |
14411447
Call::Democracy(_) |
@@ -1452,6 +1458,7 @@ impl Contains<Call> for WhiteListFilter {
14521458
Call::Utility(_) |
14531459
Call::Multisig(_) |
14541460
Call::Proxy(_) |
1461+
Call::EmergencyShutdown(_) |
14551462
// 3rd Party
14561463
Call::Vesting(_) |
14571464
// Membership

runtime/vanilla/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ impl pallet_liquidity_mining::Config for Runtime {
14581458
type Assets = CurrencyAdapter;
14591459
type PalletId = LMPalletId;
14601460
type MaxRewardTokens = MaxRewardTokens;
1461-
type CreateOrigin = EnsureRoot<AccountId>;
1461+
type CreateOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
14621462
type WeightInfo = pallet_liquidity_mining::weights::SubstrateWeight<Runtime>;
14631463
}
14641464

0 commit comments

Comments
 (0)