From c7221472c5fc451dfdfd7219b38f70ed8d9a7f5e Mon Sep 17 00:00:00 2001 From: Marcel Ebert Date: Fri, 14 Jul 2023 18:57:33 +0200 Subject: [PATCH] Add asset registry pallet to Amplitude runtime --- runtime/amplitude/Cargo.toml | 2 ++ runtime/amplitude/src/lib.rs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/runtime/amplitude/Cargo.toml b/runtime/amplitude/Cargo.toml index 365208f3f..734215ddc 100644 --- a/runtime/amplitude/Cargo.toml +++ b/runtime/amplitude/Cargo.toml @@ -88,6 +88,7 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } # Open Runtime Module Library +orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.40" } orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.40" } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.40" } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.40" } @@ -150,6 +151,7 @@ std = [ "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", + "orml-asset-registry/std", "orml-currencies/std", "orml-traits/std", "orml-tokens/std", diff --git a/runtime/amplitude/src/lib.rs b/runtime/amplitude/src/lib.rs index 36c5ee734..fd756b1e4 100644 --- a/runtime/amplitude/src/lib.rs +++ b/runtime/amplitude/src/lib.rs @@ -58,8 +58,8 @@ use frame_system::{ pub use sp_runtime::{MultiAddress, Perbill, Permill, Perquintill}; use runtime_common::{ - opaque, AccountId, Amount, AuraId, Balance, BlockNumber, Hash, Index, ReserveIdentifier, - Signature, EXISTENTIAL_DEPOSIT, MILLIUNIT, NANOUNIT, UNIT, + asset_registry, opaque, AccountId, Amount, AuraId, Balance, BlockNumber, Hash, Index, + ReserveIdentifier, Signature, EXISTENTIAL_DEPOSIT, MILLIUNIT, NANOUNIT, UNIT, }; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; @@ -819,6 +819,16 @@ impl orml_currencies::Config for Runtime { type WeightInfo = (); } +impl orml_asset_registry::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CustomMetadata = asset_registry::CustomMetadata; + type AssetId = CurrencyId; + type AuthorityOrigin = asset_registry::AssetAuthority; + type AssetProcessor = asset_registry::CustomAssetProcessor; + type Balance = Balance; + type WeightInfo = weights::orml_asset_registry::WeightInfo; +} + parameter_types! { pub const MinBlocksPerRound: BlockNumber = HOURS; pub const DefaultBlocksPerRound: BlockNumber = 2 * HOURS; @@ -1251,6 +1261,8 @@ construct_runtime!( VaultRewards: reward::{Pallet, Call, Storage, Event} = 70, VaultStaking: staking::{Pallet, Storage, Event} = 71, + AssetRegistry: orml_asset_registry::{Pallet, Storage, Call, Event, Config} = 91, + VestingManager: vesting_manager::{Pallet, Call, Event} = 100 } );