diff --git a/Cargo.lock b/Cargo.lock index 7c4006e1..9e199ddc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3557,13 +3557,13 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", + "pallet-ownership", "pallet-permissions", "pallet-posts", "pallet-profiles", "pallet-reactions", "pallet-roles", "pallet-space-follows", - "pallet-space-ownership", "pallet-spaces", "pallet-timestamp", "parity-scale-codec", @@ -6076,6 +6076,47 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-ownership" +version = "0.2.2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-permissions", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", + "subsocial-support", +] + +[[package]] +name = "pallet-ownership-tests" +version = "0.2.2" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "pallet-domains", + "pallet-ownership", + "pallet-permissions", + "pallet-posts", + "pallet-profiles", + "pallet-roles", + "pallet-space-follows", + "pallet-spaces", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "subsocial-support", +] + [[package]] name = "pallet-permissions" version = "0.2.2" @@ -6156,12 +6197,12 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", + "pallet-ownership", "pallet-permissions", "pallet-posts", "pallet-profiles", "pallet-roles", "pallet-space-follows", - "pallet-space-ownership", "pallet-spaces", "pallet-timestamp", "parity-scale-codec", @@ -6468,44 +6509,6 @@ dependencies = [ "subsocial-support", ] -[[package]] -name = "pallet-space-ownership" -version = "0.2.2" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-spaces", - "parity-scale-codec", - "scale-info", - "sp-std", - "subsocial-support", -] - -[[package]] -name = "pallet-space-ownership-tests" -version = "0.2.2" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "pallet-permissions", - "pallet-profiles", - "pallet-roles", - "pallet-space-follows", - "pallet-space-ownership", - "pallet-spaces", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "subsocial-support", -] - [[package]] name = "pallet-spaces" version = "0.2.2" @@ -11755,6 +11758,7 @@ dependencies = [ "pallet-free-proxy", "pallet-insecure-randomness-collective-flip", "pallet-multisig", + "pallet-ownership", "pallet-permissions", "pallet-post-follows", "pallet-posts", @@ -11766,7 +11770,6 @@ dependencies = [ "pallet-roles", "pallet-session", "pallet-space-follows", - "pallet-space-ownership", "pallet-spaces", "pallet-sudo", "pallet-timestamp", diff --git a/pallets/space-ownership/tests/Cargo.toml b/pallets/space-ownership/tests/Cargo.toml index 8e201206..24098b54 100644 --- a/pallets/space-ownership/tests/Cargo.toml +++ b/pallets/space-ownership/tests/Cargo.toml @@ -34,8 +34,10 @@ sp-std = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.40', default-features = false } sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.40', default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-roles = { default-features = false, path = '../../roles' } +pallet-domains = { default-features = false, path = '../../domains' } +pallet-posts = { default-features = false, path = '../../posts' } pallet-profiles = { default-features = false, path = '../../profiles' } +pallet-roles = { default-features = false, path = '../../roles' } pallet-spaces = { default-features = false, path = '../../spaces' } pallet-space-follows = { default-features = false, path = '../../space-follows' } @@ -51,8 +53,8 @@ std = [ 'sp-std/std', 'pallet-permissions/std', 'pallet-balances/std', + 'pallet-profiles/std', 'pallet-roles/std', 'pallet-space-follows/std', - 'pallet-profiles/std', ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/space-ownership/tests/src/mock.rs b/pallets/space-ownership/tests/src/mock.rs index 7410d60a..bd648045 100644 --- a/pallets/space-ownership/tests/src/mock.rs +++ b/pallets/space-ownership/tests/src/mock.rs @@ -30,6 +30,8 @@ frame_support::construct_runtime!( SpaceFollows: pallet_space_follows, SpaceOwnership: pallet_ownership, Spaces: pallet_spaces, + Domains: pallet_domains, + Posts: pallet_posts, } ); @@ -37,6 +39,8 @@ pub(super) type AccountId = u64; pub(super) type Balance = u64; pub(super) type BlockNumber = u64; +pub(crate) const DOMAIN_DEPOSIT: Balance = 10; + parameter_types! { pub const BlockHashCount: u64 = 250; pub const SS58Prefix: u8 = 42; @@ -136,9 +140,44 @@ impl pallet_space_follows::Config for Test { type WeightInfo = (); } +impl pallet_posts::Config for Test { + type RuntimeEvent = RuntimeEvent; + type MaxCommentDepth = ConstU32<10>; + type IsPostBlocked = (); + type WeightInfo = (); +} + +parameter_types! { + pub const BaseDomainDeposit: Balance = DOMAIN_DEPOSIT; + pub const OuterValueByteDeposit: Balance = 5; + pub const RegistrationPeriodLimit: BlockNumber = 5; + pub const InitialPaymentBeneficiary: AccountId = 1; + pub InitialPricesConfig: pallet_domains::types::PricesConfigVec = Vec::new(); +} + +impl pallet_domains::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type MinDomainLength = ConstU32<1>; + type MaxDomainLength = ConstU32<64>; + type MaxDomainsPerAccount = ConstU32<5>; + type DomainsInsertLimit = ConstU32<5>; + type RegistrationPeriodLimit = RegistrationPeriodLimit; + type MaxOuterValueLength = ConstU32<64>; + type BaseDomainDeposit = BaseDomainDeposit; + type OuterValueByteDeposit = OuterValueByteDeposit; + type InitialPaymentBeneficiary = InitialPaymentBeneficiary; + type InitialPricesConfig = InitialPricesConfig; + type WeightInfo = (); +} + impl pallet_ownership::Config for Test { type RuntimeEvent = RuntimeEvent; type ProfileManager = Profiles; + type SpacesInterface = Spaces; + type SpacePermissionsProvider = Spaces; type CreatorStakingProvider = (); + type DomainsProvider = Domains; + type PostsProvider = Posts; type WeightInfo = (); }