Skip to content

Commit

Permalink
Add name-service to Manta
Browse files Browse the repository at this point in the history
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
  • Loading branch information
ghzlatarev committed Jul 7, 2023
1 parent a0b52fc commit 205f7a5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions runtime/calamari/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ std = [
'orml-xtokens/std',
'pallet-manta-pay/std',
'pallet-manta-sbt/std',
'pallet-name-service/std',
'manta-support/std',
"zenlink-protocol/std",
"zenlink-protocol-runtime-api/std",
Expand Down
3 changes: 3 additions & 0 deletions runtime/manta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pallet-farming-rpc-runtime-api = { path = '../../pallets/farming/rpc/runtime-api
pallet-lottery = { path = '../../pallets/pallet-lottery', default-features = false }
pallet-manta-pay = { path = '../../pallets/manta-pay', default-features = false, features = ["runtime"] }
pallet-manta-sbt = { path = '../../pallets/manta-sbt', default-features = false, features = ["runtime"] }
pallet-name-service = { path = '../../pallets/name-service', default-features = false }
pallet-parachain-staking = { path = '../../pallets/parachain-staking', default-features = false }
pallet-randomness = { path = '../../pallets/randomness', default-features = false }
pallet-tx-pause = { path = '../../pallets/tx-pause', default-features = false }
Expand Down Expand Up @@ -157,6 +158,7 @@ runtime-benchmarks = [
'pallet-manta-pay/runtime-benchmarks',
'pallet-xcm-benchmarks/runtime-benchmarks',
'pallet-manta-sbt/runtime-benchmarks',
'pallet-name-service/runtime-benchmarks',
"zenlink-protocol/runtime-benchmarks",
'pallet-farming/runtime-benchmarks',
]
Expand Down Expand Up @@ -274,6 +276,7 @@ std = [
'orml-traits/std',
'orml-xtokens/std',
'pallet-manta-sbt/std',
'pallet-name-service/std',
'manta-support/std',
"zenlink-protocol/std",
"zenlink-protocol-runtime-api/std",
Expand Down
20 changes: 18 additions & 2 deletions runtime/manta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ use frame_system::{
};
use manta_primitives::{
constants::{
time::*, RocksDbWeight, LOTTERY_PALLET_ID, STAKING_PALLET_ID, TREASURY_PALLET_ID,
WEIGHT_PER_SECOND,
time::*, RocksDbWeight, LOTTERY_PALLET_ID, NAME_SERVICE_PALLET_ID, STAKING_PALLET_ID,
TREASURY_PALLET_ID, WEIGHT_PER_SECOND,
},
types::{AccountId, Balance, BlockNumber, Hash, Header, Index, PoolId, Signature},
};
Expand Down Expand Up @@ -272,6 +272,7 @@ impl Contains<RuntimeCall> for MantaFilter {
| RuntimeCall::Preimage(_)
| RuntimeCall::MantaPay(_)
| RuntimeCall::MantaSbt(_)
| RuntimeCall::NameService(_)
| RuntimeCall::TransactionPause(_)
| RuntimeCall::ZenlinkProtocol(_)
| RuntimeCall::Farming(_)
Expand Down Expand Up @@ -867,6 +868,20 @@ impl pallet_farming::Config for Runtime {
type WeightInfo = weights::pallet_farming::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const NameServicePalletId: PalletId = NAME_SERVICE_PALLET_ID;
}

impl pallet_name_service::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type PalletId = NameServicePalletId;
type RegisterWaitingPeriod = ConstU32<2>;
/// Register pricing around 5$ with estimated MANTA/USD
type RegisterPrice = ConstU128<{ 15 * MANTA }>;
type WeightInfo = (); // weights::pallet_name_service::SubstrateWeight<Runtime>;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Expand Down Expand Up @@ -928,6 +943,7 @@ construct_runtime!(
AssetManager: pallet_asset_manager::{Pallet, Call, Storage, Config<T>, Event<T>} = 46,
MantaPay: pallet_manta_pay::{Pallet, Call, Storage, Event<T>} = 47,
MantaSbt: pallet_manta_sbt::{Pallet, Call, Storage, Event<T>} = 49,
NameService: pallet_name_service::{Pallet, Call, Storage, Event<T>} = 52,

ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event<T>} = 51,
Farming: pallet_farming::{Pallet, Call, Storage, Event<T>} = 54,
Expand Down

0 comments on commit 205f7a5

Please sign in to comment.