From dcbbc7f037d7b929667361afa5930f8b4fff0095 Mon Sep 17 00:00:00 2001 From: Vlad Proshchavaiev <32250097+F3Joule@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:40:54 +0200 Subject: [PATCH] chore: Rename space-ownership to ownership (#259) * Rename space-ownership to ownership * Rename space-ownership tests * Rebuild weights for ownership pallet --- integration-tests/Cargo.toml | 2 +- integration-tests/src/mock.rs | 4 +- integration-tests/src/tests/mod.rs | 2 +- .../{space_ownership.rs => ownership.rs} | 24 +-- integration-tests/src/tests/posts.rs | 2 +- integration-tests/src/utils/mod.rs | 2 +- ..._ownership_utils.rs => ownership_utils.rs} | 6 +- pallets/creator-staking/src/functions.rs | 2 +- .../{space-ownership => ownership}/Cargo.toml | 0 .../src/benchmarking.rs | 0 .../{space-ownership => ownership}/src/lib.rs | 0 .../src/migration.rs | 0 .../src/weights.rs | 170 +++++++++--------- .../tests/Cargo.toml | 0 .../tests/src/lib.rs | 0 .../tests/src/mock.rs | 0 .../tests/src/tests.rs | 0 .../tests/src/tests_utils.rs | 0 pallets/posts/tests/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- 20 files changed, 105 insertions(+), 113 deletions(-) rename integration-tests/src/tests/{space_ownership.rs => ownership.rs} (85%) rename integration-tests/src/utils/{space_ownership_utils.rs => ownership_utils.rs} (93%) rename pallets/{space-ownership => ownership}/Cargo.toml (100%) rename pallets/{space-ownership => ownership}/src/benchmarking.rs (100%) rename pallets/{space-ownership => ownership}/src/lib.rs (100%) rename pallets/{space-ownership => ownership}/src/migration.rs (100%) rename pallets/{space-ownership => ownership}/src/weights.rs (60%) rename pallets/{space-ownership => ownership}/tests/Cargo.toml (100%) rename pallets/{space-ownership => ownership}/tests/src/lib.rs (100%) rename pallets/{space-ownership => ownership}/tests/src/mock.rs (100%) rename pallets/{space-ownership => ownership}/tests/src/tests.rs (100%) rename pallets/{space-ownership => ownership}/tests/src/tests_utils.rs (100%) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 00a371a2..50adc6d0 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -55,7 +55,7 @@ pallet-profiles = { path = '../pallets/profiles', default-features = false } pallet-reactions = { path = '../pallets/reactions', default-features = false } pallet-roles = { path = '../pallets/roles', default-features = false } pallet-space-follows = { path = '../pallets/space-follows', default-features = false } -pallet-ownership = { path = '../pallets/space-ownership', default-features = false } +pallet-ownership = { path = '../pallets/ownership', default-features = false } pallet-spaces = { path = '../pallets/spaces', default-features = false } subsocial-support = { path = '../pallets/support', default-features = false } diff --git a/integration-tests/src/mock.rs b/integration-tests/src/mock.rs index d652b35e..61d2d864 100644 --- a/integration-tests/src/mock.rs +++ b/integration-tests/src/mock.rs @@ -48,7 +48,7 @@ frame_support::construct_runtime!( Reactions: pallet_reactions, Roles: pallet_roles, SpaceFollows: pallet_space_follows, - SpaceOwnership: pallet_ownership, + Ownership: pallet_ownership, Spaces: pallet_spaces, Domains: pallet_domains, } @@ -217,7 +217,7 @@ pub struct ExtBuilder; use crate::utils::posts_utils::*; use crate::utils::spaces_utils::*; use crate::utils::roles_utils::*; -use crate::utils::space_ownership_utils::*; +use crate::utils::ownership_utils::*; use crate::utils::reactions_utils::*; use crate::utils::space_follows_utils::*; diff --git a/integration-tests/src/tests/mod.rs b/integration-tests/src/tests/mod.rs index a36dd437..64ec04ed 100644 --- a/integration-tests/src/tests/mod.rs +++ b/integration-tests/src/tests/mod.rs @@ -15,4 +15,4 @@ mod spaces; mod space_follows; -mod space_ownership; +mod ownership; diff --git a/integration-tests/src/tests/space_ownership.rs b/integration-tests/src/tests/ownership.rs similarity index 85% rename from integration-tests/src/tests/space_ownership.rs rename to integration-tests/src/tests/ownership.rs index 4553db70..c8f7975f 100644 --- a/integration-tests/src/tests/space_ownership.rs +++ b/integration-tests/src/tests/ownership.rs @@ -7,12 +7,12 @@ use frame_support::{assert_ok, assert_noop}; use sp_runtime::traits::Zero; -use pallet_ownership::{OwnableEntity, Error as SpaceOwnershipError}; +use pallet_ownership::{OwnableEntity, Error as OwnershipError}; use pallet_spaces::Error as SpacesError; use crate::mock::*; use crate::utils::*; -use crate::utils::space_ownership_utils::*; +use crate::utils::ownership_utils::*; #[test] fn transfer_space_ownership_should_work() { @@ -20,7 +20,7 @@ fn transfer_space_ownership_should_work() { assert_ok!(_transfer_default_space_ownership()); // Transfer SpaceId 1 owned by ACCOUNT1 to ACCOUNT2 assert_eq!( - SpaceOwnership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).unwrap(), + Ownership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).unwrap(), ACCOUNT2 ); }); @@ -51,7 +51,7 @@ fn transfer_space_ownership_should_fail_when_trying_to_transfer_to_current_owner ExtBuilder::build_with_space().execute_with(|| { assert_noop!( _transfer_space_ownership(Some(RuntimeOrigin::signed(ACCOUNT1)), None, Some(ACCOUNT1)), - SpaceOwnershipError::::CannotTransferToCurrentOwner + OwnershipError::::CannotTransferToCurrentOwner ); }); } @@ -70,7 +70,7 @@ fn accept_pending_ownership_should_work() { assert_eq!(space.owner, ACCOUNT2); // Check that pending storage is cleared: - assert!(SpaceOwnership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).is_none()); + assert!(Ownership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).is_none()); assert!(Balances::reserved_balance(ACCOUNT1).is_zero()); @@ -96,7 +96,7 @@ fn accept_pending_ownership_should_fail_when_no_pending_transfer_for_space() { ExtBuilder::build_with_space().execute_with(|| { assert_noop!( _accept_default_pending_ownership(), - SpaceOwnershipError::::NoPendingTransfer + OwnershipError::::NoPendingTransfer ); }); } @@ -108,7 +108,7 @@ fn accept_pending_ownership_should_fail_if_origin_is_already_an_owner() { assert_noop!( _accept_pending_ownership(Some(RuntimeOrigin::signed(ACCOUNT1)), None), - SpaceOwnershipError::::NotAllowedToAcceptOwnershipTransfer, + OwnershipError::::NotAllowedToAcceptOwnershipTransfer, ); }); } @@ -120,7 +120,7 @@ fn accept_pending_ownership_should_fail_if_origin_is_not_equal_to_pending_accoun assert_noop!( _accept_pending_ownership(Some(RuntimeOrigin::signed(ACCOUNT3)), None), - SpaceOwnershipError::::NotAllowedToAcceptOwnershipTransfer + OwnershipError::::NotAllowedToAcceptOwnershipTransfer ); }); } @@ -137,7 +137,7 @@ fn reject_pending_ownership_should_work() { assert_eq!(space.owner, ACCOUNT1); // Check whether storage state is correct - assert!(SpaceOwnership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).is_none()); + assert!(Ownership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).is_none()); }); } @@ -153,7 +153,7 @@ fn reject_pending_ownership_should_work_when_proposal_rejected_by_current_space_ assert_eq!(space.owner, ACCOUNT1); // Check whether storage state is correct - assert!(SpaceOwnership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).is_none()); + assert!(Ownership::pending_ownership_transfer(OwnableEntity::Space(SPACE1)).is_none()); }); } @@ -172,7 +172,7 @@ fn reject_pending_ownership_should_fail_when_no_pending_transfer_on_space() { ExtBuilder::build_with_space().execute_with(|| { assert_noop!( _reject_default_pending_ownership(), - SpaceOwnershipError::::NoPendingTransfer + OwnershipError::::NoPendingTransfer ); // Rejecting a transfer from ACCOUNT2 }); } @@ -184,7 +184,7 @@ fn reject_pending_ownership_should_fail_when_account_is_not_allowed_to_reject() assert_noop!( _reject_pending_ownership(Some(RuntimeOrigin::signed(ACCOUNT3)), None), - SpaceOwnershipError::::NotAllowedToRejectOwnershipTransfer + OwnershipError::::NotAllowedToRejectOwnershipTransfer ); // Rejecting a transfer from ACCOUNT2 }); } diff --git a/integration-tests/src/tests/posts.rs b/integration-tests/src/tests/posts.rs index be962ab1..963664c7 100644 --- a/integration-tests/src/tests/posts.rs +++ b/integration-tests/src/tests/posts.rs @@ -17,7 +17,7 @@ use crate::utils::posts_utils::*; use crate::utils::spaces_utils::*; use crate::utils::moderation_utils::*; use crate::utils::roles_utils::*; -use crate::utils::space_ownership_utils::*; +use crate::utils::ownership_utils::*; #[test] diff --git a/integration-tests/src/utils/mod.rs b/integration-tests/src/utils/mod.rs index 55222a3f..d061b578 100644 --- a/integration-tests/src/utils/mod.rs +++ b/integration-tests/src/utils/mod.rs @@ -12,7 +12,7 @@ pub(crate) mod spaces_utils; pub(crate) mod permissions_utils; pub(crate) mod moderation_utils; pub(crate) mod roles_utils; -pub(crate) mod space_ownership_utils; +pub(crate) mod ownership_utils; pub(crate) mod reactions_utils; pub(crate) mod space_follows_utils; pub(crate) mod posts_utils; diff --git a/integration-tests/src/utils/space_ownership_utils.rs b/integration-tests/src/utils/ownership_utils.rs similarity index 93% rename from integration-tests/src/utils/space_ownership_utils.rs rename to integration-tests/src/utils/ownership_utils.rs index 49aa955d..d13ca0a6 100644 --- a/integration-tests/src/utils/space_ownership_utils.rs +++ b/integration-tests/src/utils/ownership_utils.rs @@ -21,7 +21,7 @@ pub(crate) fn _transfer_space_ownership( space_id: Option, transfer_to: Option, ) -> DispatchResult { - SpaceOwnership::transfer_ownership( + Ownership::transfer_ownership( origin.unwrap_or_else(|| RuntimeOrigin::signed(ACCOUNT1)), space_id.map_or(OwnableEntity::Space(SPACE1), |id| OwnableEntity::Space(id)), transfer_to.unwrap_or(ACCOUNT2), @@ -33,7 +33,7 @@ pub(crate) fn _accept_default_pending_ownership() -> DispatchResult { } pub(crate) fn _accept_pending_ownership(origin: Option, space_id: Option) -> DispatchResult { - SpaceOwnership::accept_pending_ownership( + Ownership::accept_pending_ownership( origin.unwrap_or_else(|| RuntimeOrigin::signed(ACCOUNT2)), space_id.map_or(OwnableEntity::Space(SPACE1), |id| OwnableEntity::Space(id)), ) @@ -48,7 +48,7 @@ pub(crate) fn _reject_default_pending_ownership_by_current_owner() -> DispatchRe } pub(crate) fn _reject_pending_ownership(origin: Option, space_id: Option) -> DispatchResult { - SpaceOwnership::reject_pending_ownership( + Ownership::reject_pending_ownership( origin.unwrap_or_else(|| RuntimeOrigin::signed(ACCOUNT2)), space_id.map_or(OwnableEntity::Space(SPACE1), |id| OwnableEntity::Space(id)), ) diff --git a/pallets/creator-staking/src/functions.rs b/pallets/creator-staking/src/functions.rs index 88fdcc85..e227800b 100644 --- a/pallets/creator-staking/src/functions.rs +++ b/pallets/creator-staking/src/functions.rs @@ -482,7 +482,7 @@ impl Pallet { /// Implementation of `CreatorStakingProvider` for `creator-staking` pallet. /// -/// This is used in space-ownership pallet to forbid ownership transfer for spaces, which +/// This is used in ownership pallet to forbid ownership transfer for spaces, which /// are registered as creators. impl CreatorStakingProvider for Pallet { fn is_creator_active( diff --git a/pallets/space-ownership/Cargo.toml b/pallets/ownership/Cargo.toml similarity index 100% rename from pallets/space-ownership/Cargo.toml rename to pallets/ownership/Cargo.toml diff --git a/pallets/space-ownership/src/benchmarking.rs b/pallets/ownership/src/benchmarking.rs similarity index 100% rename from pallets/space-ownership/src/benchmarking.rs rename to pallets/ownership/src/benchmarking.rs diff --git a/pallets/space-ownership/src/lib.rs b/pallets/ownership/src/lib.rs similarity index 100% rename from pallets/space-ownership/src/lib.rs rename to pallets/ownership/src/lib.rs diff --git a/pallets/space-ownership/src/migration.rs b/pallets/ownership/src/migration.rs similarity index 100% rename from pallets/space-ownership/src/migration.rs rename to pallets/ownership/src/migration.rs diff --git a/pallets/space-ownership/src/weights.rs b/pallets/ownership/src/weights.rs similarity index 60% rename from pallets/space-ownership/src/weights.rs rename to pallets/ownership/src/weights.rs index b3d1ad04..e3a95c6c 100644 --- a/pallets/space-ownership/src/weights.rs +++ b/pallets/ownership/src/weights.rs @@ -8,9 +8,9 @@ //! Autogenerated weights for pallet_ownership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-02-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-03-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `MacBook-Pro-Vladislav.local`, CPU: `` +//! HOSTNAME: `benchmarks-ci`, CPU: `Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -27,7 +27,7 @@ // --execution=wasm // --wasm-execution=Compiled // --heap-pages=4096 -// --output=pallets/space-ownership/src/weights.rs +// --output=pallets/ownership/src/weights.rs // --template=./.maintain/weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -56,49 +56,45 @@ impl WeightInfo for SubstrateWeight { /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) /// Storage: CreatorStaking RegisteredCreators (r:1 w:0) /// Proof: CreatorStaking RegisteredCreators (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:0 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:0 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) fn transfer_space_ownership() -> Weight { // Proof Size summary in bytes: // Measured: `1447` // Estimated: `8430` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 8430) + // Minimum execution time: 31_653_000 picoseconds. + Weight::from_parts(32_800_000, 8430) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Posts PostById (r:1 w:0) /// Proof Skipped: Posts PostById (max_values: None, max_size: None, mode: Measured) - /// Storage: Spaces SpaceById (r:1 w:0) - /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) - /// Storage: SpaceFollows SpaceFollowedByAccount (r:1 w:0) - /// Proof Skipped: SpaceFollows SpaceFollowedByAccount (max_values: None, max_size: None, mode: Measured) - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:0 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:0 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) fn transfer_post_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `1700` - // Estimated: `15495` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 15495) - .saturating_add(T::DbWeight::get().reads(3_u64)) + // Measured: `252` + // Estimated: `3717` + // Minimum execution time: 24_693_000 picoseconds. + Weight::from_parts(25_221_000, 3717) + .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Domains RegisteredDomains (r:1 w:0) /// Proof Skipped: Domains RegisteredDomains (max_values: None, max_size: None, mode: Measured) - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:0 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:0 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) fn transfer_domain_ownership() -> Weight { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3747` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 3747) + // Minimum execution time: 25_951_000 picoseconds. + Weight::from_parts(26_708_000, 3747) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Spaces SpaceById (r:1 w:1) /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) /// Storage: CreatorStaking RegisteredCreators (r:1 w:0) @@ -109,28 +105,28 @@ impl WeightInfo for SubstrateWeight { /// Proof: Profiles ProfileSpaceIdByAccount (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen) fn accept_pending_space_ownership_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1638` - // Estimated: `23290` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(37_000_000, 23290) + // Measured: `1567` + // Estimated: `23148` + // Minimum execution time: 56_648_000 picoseconds. + Weight::from_parts(58_216_000, 23148) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Posts PostById (r:1 w:1) /// Proof Skipped: Posts PostById (max_values: None, max_size: None, mode: Measured) fn accept_pending_post_ownership_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `403` - // Estimated: `7438` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_000_000, 7438) + // Measured: `332` + // Estimated: `7367` + // Minimum execution time: 32_696_000 picoseconds. + Weight::from_parts(33_637_000, 7367) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Domains RegisteredDomains (r:1 w:1) /// Proof Skipped: Domains RegisteredDomains (max_values: None, max_size: None, mode: Measured) /// Storage: Domains DomainsByOwner (r:2 w:2) @@ -139,23 +135,23 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn accept_pending_domain_ownership_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `688` - // Estimated: `20547` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(57_000_000, 20547) + // Measured: `617` + // Estimated: `20405` + // Minimum execution time: 86_996_000 picoseconds. + Weight::from_parts(88_268_000, 20405) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Spaces SpaceById (r:1 w:0) /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) fn reject_pending_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `1595` - // Estimated: `8630` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 8630) + // Measured: `1524` + // Estimated: `8559` + // Minimum execution time: 32_607_000 picoseconds. + Weight::from_parts(33_346_000, 8559) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -167,49 +163,45 @@ impl WeightInfo for () { /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) /// Storage: CreatorStaking RegisteredCreators (r:1 w:0) /// Proof: CreatorStaking RegisteredCreators (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:0 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:0 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) fn transfer_space_ownership() -> Weight { // Proof Size summary in bytes: // Measured: `1447` // Estimated: `8430` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 8430) + // Minimum execution time: 31_653_000 picoseconds. + Weight::from_parts(32_800_000, 8430) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Posts PostById (r:1 w:0) /// Proof Skipped: Posts PostById (max_values: None, max_size: None, mode: Measured) - /// Storage: Spaces SpaceById (r:1 w:0) - /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) - /// Storage: SpaceFollows SpaceFollowedByAccount (r:1 w:0) - /// Proof Skipped: SpaceFollows SpaceFollowedByAccount (max_values: None, max_size: None, mode: Measured) - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:0 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:0 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) fn transfer_post_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `1700` - // Estimated: `15495` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 15495) - .saturating_add(RocksDbWeight::get().reads(3_u64)) + // Measured: `252` + // Estimated: `3717` + // Minimum execution time: 24_693_000 picoseconds. + Weight::from_parts(25_221_000, 3717) + .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Domains RegisteredDomains (r:1 w:0) /// Proof Skipped: Domains RegisteredDomains (max_values: None, max_size: None, mode: Measured) - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:0 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:0 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) fn transfer_domain_ownership() -> Weight { // Proof Size summary in bytes: // Measured: `282` // Estimated: `3747` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 3747) + // Minimum execution time: 25_951_000 picoseconds. + Weight::from_parts(26_708_000, 3747) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Spaces SpaceById (r:1 w:1) /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) /// Storage: CreatorStaking RegisteredCreators (r:1 w:0) @@ -220,28 +212,28 @@ impl WeightInfo for () { /// Proof: Profiles ProfileSpaceIdByAccount (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen) fn accept_pending_space_ownership_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1638` - // Estimated: `23290` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(37_000_000, 23290) + // Measured: `1567` + // Estimated: `23148` + // Minimum execution time: 56_648_000 picoseconds. + Weight::from_parts(58_216_000, 23148) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Posts PostById (r:1 w:1) /// Proof Skipped: Posts PostById (max_values: None, max_size: None, mode: Measured) fn accept_pending_post_ownership_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `403` - // Estimated: `7438` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_000_000, 7438) + // Measured: `332` + // Estimated: `7367` + // Minimum execution time: 32_696_000 picoseconds. + Weight::from_parts(33_637_000, 7367) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Domains RegisteredDomains (r:1 w:1) /// Proof Skipped: Domains RegisteredDomains (max_values: None, max_size: None, mode: Measured) /// Storage: Domains DomainsByOwner (r:2 w:2) @@ -250,23 +242,23 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn accept_pending_domain_ownership_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `688` - // Estimated: `20547` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(57_000_000, 20547) + // Measured: `617` + // Estimated: `20405` + // Minimum execution time: 86_996_000 picoseconds. + Weight::from_parts(88_268_000, 20405) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } - /// Storage: SpaceOwnership PendingOwnershipTransfers (r:1 w:1) - /// Proof: SpaceOwnership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) + /// Storage: Ownership PendingOwnershipTransfers (r:1 w:1) + /// Proof: Ownership PendingOwnershipTransfers (max_values: None, max_size: Some(105), added: 2580, mode: MaxEncodedLen) /// Storage: Spaces SpaceById (r:1 w:0) /// Proof Skipped: Spaces SpaceById (max_values: None, max_size: None, mode: Measured) fn reject_pending_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `1595` - // Estimated: `8630` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 8630) + // Measured: `1524` + // Estimated: `8559` + // Minimum execution time: 32_607_000 picoseconds. + Weight::from_parts(33_346_000, 8559) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/space-ownership/tests/Cargo.toml b/pallets/ownership/tests/Cargo.toml similarity index 100% rename from pallets/space-ownership/tests/Cargo.toml rename to pallets/ownership/tests/Cargo.toml diff --git a/pallets/space-ownership/tests/src/lib.rs b/pallets/ownership/tests/src/lib.rs similarity index 100% rename from pallets/space-ownership/tests/src/lib.rs rename to pallets/ownership/tests/src/lib.rs diff --git a/pallets/space-ownership/tests/src/mock.rs b/pallets/ownership/tests/src/mock.rs similarity index 100% rename from pallets/space-ownership/tests/src/mock.rs rename to pallets/ownership/tests/src/mock.rs diff --git a/pallets/space-ownership/tests/src/tests.rs b/pallets/ownership/tests/src/tests.rs similarity index 100% rename from pallets/space-ownership/tests/src/tests.rs rename to pallets/ownership/tests/src/tests.rs diff --git a/pallets/space-ownership/tests/src/tests_utils.rs b/pallets/ownership/tests/src/tests_utils.rs similarity index 100% rename from pallets/space-ownership/tests/src/tests_utils.rs rename to pallets/ownership/tests/src/tests_utils.rs diff --git a/pallets/posts/tests/Cargo.toml b/pallets/posts/tests/Cargo.toml index daeb5a96..c27ac6a1 100644 --- a/pallets/posts/tests/Cargo.toml +++ b/pallets/posts/tests/Cargo.toml @@ -35,7 +35,7 @@ sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0 pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } pallet-roles = { default-features = false, path = '../../roles' } pallet-space-follows = { default-features = false, path = '../../space-follows' } -pallet-ownership = { default-features = false, path = '../../space-ownership' } +pallet-ownership = { default-features = false, path = '../../ownership' } pallet-profiles = { default-features = false, path = '../../profiles' } pallet-posts = { default-features = false, path = '..' } pallet-spaces = { default-features = false, path = '../../spaces' } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c534f7c5..2d1aecab 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -36,7 +36,7 @@ pallet-reactions = { path = '../pallets/reactions', default-features = false } pallet-resource-discussions = { path = '../pallets/resource-discussions', default-features = false } pallet-roles = { path = '../pallets/roles', default-features = false } pallet-space-follows = { path = '../pallets/space-follows', default-features = false } -pallet-ownership = { path = '../pallets/space-ownership', default-features = false } +pallet-ownership = { path = '../pallets/ownership', default-features = false } pallet-spaces = { path = '../pallets/spaces', default-features = false } subsocial-support = { path = '../pallets/support', default-features = false } pallet-free-proxy = { path = "../pallets/free-proxy", default-features = false }