From 180cd0cb4d5dcf1d629cfae054b82e46f00b92a8 Mon Sep 17 00:00:00 2001 From: Aleksandar Brayanov Date: Wed, 19 Jul 2023 08:01:42 +0100 Subject: [PATCH] issue #1 - added storage fees to relevant auction pallet extrinsics --- pallets/auction/src/lib.rs | 14 +++ pallets/auction/src/tests.rs | 10 +- pallets/auction/src/weights.rs | 110 +++++++++--------- runtime/continuum/src/lib.rs | 7 +- .../continuum/src/weights/module_auction.rs | 30 ++--- runtime/metaverse/src/lib.rs | 7 +- .../metaverse/src/weights/module_auction.rs | 30 ++--- runtime/pioneer/src/lib.rs | 7 +- runtime/pioneer/src/weights/module_auction.rs | 30 ++--- 9 files changed, 135 insertions(+), 110 deletions(-) diff --git a/pallets/auction/src/lib.rs b/pallets/auction/src/lib.rs index fa96d0b67..8afd48829 100644 --- a/pallets/auction/src/lib.rs +++ b/pallets/auction/src/lib.rs @@ -393,6 +393,13 @@ pub mod pallet { Error::::AuctionTypeIsNotSupported ); + T::Currency::transfer( + &from, + &T::MetaverseInfoSource::get_network_treasury(), + T::StorageDepositFee::get(), + ExistenceRequirement::KeepAlive, + )?; + Self::auction_bid_handler(from, id, value)?; Ok(().into()) @@ -527,6 +534,13 @@ pub mod pallet { listing_fee = T::MetaverseInfoSource::get_metaverse_marketplace_listing_fee(metaverse_id)?; } + T::Currency::transfer( + &from, + &T::MetaverseInfoSource::get_network_treasury(), + T::StorageDepositFee::get(), + ExistenceRequirement::KeepAlive, + )?; + Self::create_auction( AuctionType::BuyNow, item_id, diff --git a/pallets/auction/src/tests.rs b/pallets/auction/src/tests.rs index 91082a61d..ab4a5b657 100644 --- a/pallets/auction/src/tests.rs +++ b/pallets/auction/src/tests.rs @@ -1053,7 +1053,7 @@ fn asset_transfers_after_auction() { // BOB only receive 200 - 2 (1% royalty fee) - 2 (1% network fee) - 4 (minting fee) = 193 // 500 + 193 = 693 assert_eq!(Balances::free_balance(BOB), 692); - assert_eq!(Balances::free_balance(ALICE), 99800); + assert_eq!(Balances::free_balance(ALICE), 99799); // Verify Alice has the NFT and Bob doesn't assert_eq!(NFTModule::::check_ownership(&ALICE, &(0, 0)), Ok(true)); @@ -1595,7 +1595,7 @@ fn on_finalize_should_work() { // check account received asset assert_eq!(NFTModule::::check_ownership(&ALICE, &(0, 0)), Ok(true)); // check balances were transferred - assert_eq!(Balances::free_balance(ALICE), 99900); + assert_eq!(Balances::free_balance(ALICE), 99899); // BOB's initial balance is 500 // 100 - 1 (1% of 100 as royalty fee) - 1 (1% of 100 as network fee) - 3 minting fee = 96 // 500 + 95 = 595 @@ -1639,8 +1639,8 @@ fn on_finalize_with_listing_fee_should_work() { // check account received asset assert_eq!(NFTModule::::check_ownership(&BOB, &(0, 0)), Ok(true)); // check balances were transferred - // Bob bid 100 for item, his new balance will be 500 - 100 - assert_eq!(Balances::free_balance(BOB), 400); + // Bob bid 100 for item, his new balance will be 500 - 100 - 1 + assert_eq!(Balances::free_balance(BOB), 399); // Alice only receive 88 for item sold: // cost breakdown 100 - 10 (listing fee) - 1 (1% network fee) - 1 (1% royalty fee) - 1 unit (class // stroage fee) Free balance of Alice is 99996 + 88 = 100084 @@ -1740,7 +1740,7 @@ fn on_finalize_with_bundle_with_listing_fee_should_work() { assert_eq!(NFTModule::::check_ownership(&BOB, &(0, 1)), Ok(true)); // check balances were transferred // Bob bid 400 for item, his new balance will be 500 - 400 - assert_eq!(Balances::free_balance(BOB), 100); + assert_eq!(Balances::free_balance(BOB), 99); // Alice only receive 176 for item solds // Cost breakdown 400 - 4 (royalty) - 4 (1% network fee) - 40 (listing fee) = 352 // Free balance of Alice is 99992 + 352 = 100344 diff --git a/pallets/auction/src/weights.rs b/pallets/auction/src/weights.rs index 97ebcd77a..153839116 100644 --- a/pallets/auction/src/weights.rs +++ b/pallets/auction/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for auction //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-21, STEPS: `20`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-07-19, STEPS: `20`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -75,15 +75,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Skipped: Auction Auctions (max_values: None, max_size: None, mode: Measured) fn create_new_auction() -> Weight { // Proof Size summary in bytes: - // Measured: `3359` - // Estimated: `54013` - // Minimum execution time: 75_737 nanoseconds. - Weight::from_parts(83_359_000, 54013) + // Measured: `3695` + // Estimated: `57373` + // Minimum execution time: 59_917 nanoseconds. + Weight::from_parts(61_885_000, 57373) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(7)) } // Storage: Metaverse Metaverses (r:1 w:0) // Proof Skipped: Metaverse Metaverses (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) // Storage: Auction ItemsInAuction (r:1 w:1) // Proof Skipped: Auction ItemsInAuction (max_values: None, max_size: None, mode: Measured) // Storage: OrmlNFT Tokens (r:1 w:1) @@ -96,8 +98,6 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Skipped: Metaverse MetaverseOwner (max_values: None, max_size: None, mode: Measured) // Storage: Auction AuctionEndTime (r:1 w:1) // Proof Skipped: Auction AuctionEndTime (max_values: None, max_size: None, mode: Measured) - // Storage: System Account (r:1 w:1) - // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) // Storage: Auction AuctionsIndex (r:1 w:1) // Proof Skipped: Auction AuctionsIndex (max_values: Some(1), max_size: None, mode: Measured) // Storage: Auction AuctionItems (r:0 w:1) @@ -106,15 +106,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Skipped: Auction Auctions (max_values: None, max_size: None, mode: Measured) fn create_new_buy_now() -> Weight { // Proof Size summary in bytes: - // Measured: `3359` - // Estimated: `54013` - // Minimum execution time: 58_587 nanoseconds. - Weight::from_parts(60_938_000, 54013) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(7)) + // Measured: `3868` + // Estimated: `61706` + // Minimum execution time: 72_460 nanoseconds. + Weight::from_parts(74_722_000, 61706) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) } // Storage: Auction AuctionItems (r:1 w:1) // Proof Skipped: Auction AuctionItems (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) // Storage: Auction Auctions (r:1 w:1) // Proof Skipped: Auction Auctions (max_values: None, max_size: None, mode: Measured) // Storage: Tokens Accounts (r:1 w:1) @@ -123,12 +125,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Skipped: Auction AuctionEndTime (max_values: None, max_size: None, mode: Measured) fn bid() -> Weight { // Proof Size summary in bytes: - // Measured: `3236` - // Estimated: `17254` - // Minimum execution time: 50_075 nanoseconds. - Weight::from_parts(52_851_000, 17254) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(5)) + // Measured: `4133` + // Estimated: `25151` + // Minimum execution time: 64_755 nanoseconds. + Weight::from_parts(75_918_000, 25151) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) } // Storage: Auction AuctionItems (r:1 w:1) // Proof Skipped: Auction AuctionItems (max_values: None, max_size: None, mode: Measured) @@ -154,10 +156,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Skipped: OrmlNFT TokensByOwner (max_values: None, max_size: None, mode: Measured) fn buy_now() -> Weight { // Proof Size summary in bytes: - // Measured: `4659` - // Estimated: `74974` - // Minimum execution time: 113_286 nanoseconds. - Weight::from_parts(117_267_000, 74974) + // Measured: `5079` + // Estimated: `78754` + // Minimum execution time: 117_209 nanoseconds. + Weight::from_parts(121_030_000, 78754) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) } @@ -175,10 +177,10 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Skipped: Auction AuctionEndTime (max_values: None, max_size: None, mode: Measured) fn cancel_listing() -> Weight { // Proof Size summary in bytes: - // Measured: `3664` - // Estimated: `28348` - // Minimum execution time: 50_526 nanoseconds. - Weight::from_parts(76_276_000, 28348) + // Measured: `4000` + // Estimated: `30028` + // Minimum execution time: 49_038 nanoseconds. + Weight::from_parts(50_823_000, 30028) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -190,8 +192,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Size summary in bytes: // Measured: `1307` // Estimated: `7564` - // Minimum execution time: 30_845 nanoseconds. - Weight::from_parts(35_078_000, 7564) + // Minimum execution time: 21_943 nanoseconds. + Weight::from_parts(23_046_000, 7564) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -203,8 +205,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Size summary in bytes: // Measured: `1360` // Estimated: `7670` - // Minimum execution time: 22_308 nanoseconds. - Weight::from_parts(24_963_000, 7670) + // Minimum execution time: 22_905 nanoseconds. + Weight::from_parts(23_607_000, 7670) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -220,8 +222,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Size summary in bytes: // Measured: `1805` // Estimated: `15443` - // Minimum execution time: 36_403 nanoseconds. - Weight::from_parts(38_021_000, 15443) + // Minimum execution time: 36_625 nanoseconds. + Weight::from_parts(38_079_000, 15443) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -233,8 +235,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Size summary in bytes: // Measured: `1534` // Estimated: `6612` - // Minimum execution time: 28_040 nanoseconds. - Weight::from_parts(29_056_000, 6612) + // Minimum execution time: 27_880 nanoseconds. + Weight::from_parts(28_621_000, 6612) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -256,8 +258,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Size summary in bytes: // Measured: `2326` // Estimated: `31537` - // Minimum execution time: 67_215 nanoseconds. - Weight::from_parts(69_244_000, 31537) + // Minimum execution time: 68_875 nanoseconds. + Weight::from_parts(72_454_000, 31537) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -265,63 +267,63 @@ impl WeightInfo for SubstrateWeight { // Storage: Me // Proof Size summary in bytes: // Measured: `774` // Estimated: `0` - // Minimum execution time: 5_355 nanoseconds. - Weight::from_parts(6_116_000, 0) + // Minimum execution time: 5_673 nanoseconds. + Weight::from_parts(7_467_000, 0) } } // For backwards compatibility and tests impl WeightInfo for () { fn create_new_auction() -> Weight { - Weight::from_parts(83_359_000, 54013) + Weight::from_parts(61_885_000, 57373) .saturating_add(RocksDbWeight::get().reads(9)) .saturating_add(RocksDbWeight::get().writes(7)) } fn create_new_buy_now() -> Weight { - Weight::from_parts(60_938_000, 54013) - .saturating_add(RocksDbWeight::get().reads(9)) - .saturating_add(RocksDbWeight::get().writes(7)) + Weight::from_parts(74_722_000, 61706) + .saturating_add(RocksDbWeight::get().reads(10)) + .saturating_add(RocksDbWeight::get().writes(8)) } fn bid() -> Weight { - Weight::from_parts(52_851_000, 17254) - .saturating_add(RocksDbWeight::get().reads(3)) - .saturating_add(RocksDbWeight::get().writes(5)) + Weight::from_parts(75_918_000, 25151) + .saturating_add(RocksDbWeight::get().reads(5)) + .saturating_add(RocksDbWeight::get().writes(7)) } fn buy_now() -> Weight { - Weight::from_parts(117_267_000, 74974) + Weight::from_parts(121_030_000, 78754) .saturating_add(RocksDbWeight::get().reads(13)) .saturating_add(RocksDbWeight::get().writes(12)) } fn cancel_listing() -> Weight { - Weight::from_parts(76_276_000, 28348) + Weight::from_parts(50_823_000, 30028) .saturating_add(RocksDbWeight::get().reads(4)) .saturating_add(RocksDbWeight::get().writes(6)) } fn authorise_metaverse_collection() -> Weight { - Weight::from_parts(35_078_000, 7564) + Weight::from_parts(23_046_000, 7564) .saturating_add(RocksDbWeight::get().reads(2)) .saturating_add(RocksDbWeight::get().writes(1)) } fn remove_authorise_metaverse_collection() -> Weight { - Weight::from_parts(24_963_000, 7670) + Weight::from_parts(23_607_000, 7670) .saturating_add(RocksDbWeight::get().reads(2)) .saturating_add(RocksDbWeight::get().writes(1)) } fn make_offer() -> Weight { - Weight::from_parts(38_021_000, 15443) + Weight::from_parts(38_079_000, 15443) .saturating_add(RocksDbWeight::get().reads(4)) .saturating_add(RocksDbWeight::get().writes(2)) } fn withdraw_offer() -> Weight { - Weight::from_parts(29_056_000, 6612) + Weight::from_parts(28_621_000, 6612) .saturating_add(RocksDbWeight::get().reads(2)) .saturating_add(RocksDbWeight::get().writes(2)) } fn accept_offer() -> Weight { - Weight::from_parts(69_244_000, 31537) + Weight::from_parts(72_454_000, 31537) .saturating_add(RocksDbWeight::get().reads(7)) .saturating_add(RocksDbWeight::get().writes(6)) } fn on_finalize() -> Weight { - Weight::from_parts(6_116_000, 0) + Weight::from_parts(7_467_000, 0) } } diff --git a/runtime/continuum/src/lib.rs b/runtime/continuum/src/lib.rs index fc9593997..7faa4f336 100644 --- a/runtime/continuum/src/lib.rs +++ b/runtime/continuum/src/lib.rs @@ -1543,7 +1543,7 @@ parameter_types! { pub const OfferDuration: BlockNumber = 100800; // Default 100800 Blocks pub const MinimumListingPrice: Balance = DOLLARS; pub const AntiSnipeDuration: BlockNumber = 50; // Minimum anti snipe duration is 50 blocks - pub const ContinuumStorageDeposit: Balance = BASE_STORAGE_FEE; + pub const AuctionStorageFee: Balance = 3 * BASE_STORAGE_FEE; } impl auction::Config for Runtime { @@ -1565,9 +1565,12 @@ impl auction::Config for Runtime { type OfferDuration = OfferDuration; type MinimumListingPrice = MinimumListingPrice; type AntiSnipeDuration = AntiSnipeDuration; - type StorageDepositFee = StorageDepositFee; + type StorageDepositFee = AuctionStorageFee; } +parameter_types! { + pub const ContinuumStorageDeposit: Balance = BASE_STORAGE_FEE; +} impl continuum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SessionDuration = ContinuumSessionDuration; diff --git a/runtime/continuum/src/weights/module_auction.rs b/runtime/continuum/src/weights/module_auction.rs index d83fe09af..fefdcf436 100644 --- a/runtime/continuum/src/weights/module_auction.rs +++ b/runtime/continuum/src/weights/module_auction.rs @@ -12,56 +12,56 @@ pub struct WeightInfo(PhantomData); impl auction::WeightInfo for WeightInfo { fn create_new_auction() -> Weight { - Weight::from_parts(83_359_000, 54013) + Weight::from_parts(61_885_000, 57373) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(7)) } fn create_new_buy_now() -> Weight { - Weight::from_parts(60_938_000, 54013) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(7)) + Weight::from_parts(74_722_000, 61706) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) } fn bid() -> Weight { - Weight::from_parts(52_851_000, 17254) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(5)) + Weight::from_parts(75_918_000, 25151) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) } fn buy_now() -> Weight { - Weight::from_parts(117_267_000, 74974) + Weight::from_parts(121_030_000, 78754) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) } fn cancel_listing() -> Weight { - Weight::from_parts(76_276_000, 28348) + Weight::from_parts(50_823_000, 30028) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(6)) } fn authorise_metaverse_collection() -> Weight { - Weight::from_parts(35_078_000, 7564) + Weight::from_parts(23_046_000, 7564) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn remove_authorise_metaverse_collection() -> Weight { - Weight::from_parts(24_963_000, 7670) + Weight::from_parts(23_607_000, 7670) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn make_offer() -> Weight { - Weight::from_parts(38_021_000, 15443) + Weight::from_parts(38_079_000, 15443) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } fn withdraw_offer() -> Weight { - Weight::from_parts(29_056_000, 6612) + Weight::from_parts(28_621_000, 6612) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } fn accept_offer() -> Weight { - Weight::from_parts(69_244_000, 31537) + Weight::from_parts(72_454_000, 31537) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) } fn on_finalize() -> Weight { - Weight::from_parts(6_116_000, 0) + Weight::from_parts(7_467_000, 0) } } diff --git a/runtime/metaverse/src/lib.rs b/runtime/metaverse/src/lib.rs index c11759428..7da3a3aa7 100644 --- a/runtime/metaverse/src/lib.rs +++ b/runtime/metaverse/src/lib.rs @@ -680,7 +680,7 @@ parameter_types! { pub const OfferDuration: BlockNumber = 100800; // Default 100800 Blocks pub const MinimumListingPrice: Balance = DOLLARS; pub const AntiSnipeDuration: BlockNumber = 50; // Minimum anti snipe duration is 50 blocks - pub const ContinuumStorageDeposit: Balance = BASE_STORAGE_FEE; + pub const AuctionStorageFee: Balance = 3 * BASE_STORAGE_FEE; } impl auction::Config for Runtime { @@ -702,9 +702,12 @@ impl auction::Config for Runtime { type OfferDuration = OfferDuration; type MinimumListingPrice = MinimumListingPrice; type AntiSnipeDuration = AntiSnipeDuration; - type StorageDepositFee = StorageDepositFee; + type StorageDepositFee = AuctionStorageFee; } +parameter_types! { + pub const ContinuumStorageDeposit: Balance = BASE_STORAGE_FEE; +} impl continuum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SessionDuration = ContinuumSessionDuration; diff --git a/runtime/metaverse/src/weights/module_auction.rs b/runtime/metaverse/src/weights/module_auction.rs index d83fe09af..fefdcf436 100644 --- a/runtime/metaverse/src/weights/module_auction.rs +++ b/runtime/metaverse/src/weights/module_auction.rs @@ -12,56 +12,56 @@ pub struct WeightInfo(PhantomData); impl auction::WeightInfo for WeightInfo { fn create_new_auction() -> Weight { - Weight::from_parts(83_359_000, 54013) + Weight::from_parts(61_885_000, 57373) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(7)) } fn create_new_buy_now() -> Weight { - Weight::from_parts(60_938_000, 54013) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(7)) + Weight::from_parts(74_722_000, 61706) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) } fn bid() -> Weight { - Weight::from_parts(52_851_000, 17254) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(5)) + Weight::from_parts(75_918_000, 25151) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) } fn buy_now() -> Weight { - Weight::from_parts(117_267_000, 74974) + Weight::from_parts(121_030_000, 78754) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) } fn cancel_listing() -> Weight { - Weight::from_parts(76_276_000, 28348) + Weight::from_parts(50_823_000, 30028) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(6)) } fn authorise_metaverse_collection() -> Weight { - Weight::from_parts(35_078_000, 7564) + Weight::from_parts(23_046_000, 7564) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn remove_authorise_metaverse_collection() -> Weight { - Weight::from_parts(24_963_000, 7670) + Weight::from_parts(23_607_000, 7670) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn make_offer() -> Weight { - Weight::from_parts(38_021_000, 15443) + Weight::from_parts(38_079_000, 15443) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } fn withdraw_offer() -> Weight { - Weight::from_parts(29_056_000, 6612) + Weight::from_parts(28_621_000, 6612) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } fn accept_offer() -> Weight { - Weight::from_parts(69_244_000, 31537) + Weight::from_parts(72_454_000, 31537) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) } fn on_finalize() -> Weight { - Weight::from_parts(6_116_000, 0) + Weight::from_parts(7_467_000, 0) } } diff --git a/runtime/pioneer/src/lib.rs b/runtime/pioneer/src/lib.rs index 6fe059fb7..ec66d3f43 100644 --- a/runtime/pioneer/src/lib.rs +++ b/runtime/pioneer/src/lib.rs @@ -1543,7 +1543,7 @@ parameter_types! { pub const OfferDuration: BlockNumber = 100800; // Default 100800 Blocks pub const MinimumListingPrice: Balance = DOLLARS; pub const AntiSnipeDuration: BlockNumber = 50; // Minimum anti snipe duration is 50 blocks - pub const ContinuumStorageDeposit: Balance = BASE_STORAGE_FEE; + pub const AuctionStorageFee: Balance = 3 * BASE_STORAGE_FEE; } impl auction::Config for Runtime { @@ -1565,9 +1565,12 @@ impl auction::Config for Runtime { type OfferDuration = OfferDuration; type MinimumListingPrice = MinimumListingPrice; type AntiSnipeDuration = AntiSnipeDuration; - type StorageDepositFee = StorageDepositFee; + type StorageDepositFee = AuctionStorageFee; } +parameter_types! { + pub const ContinuumStorageDeposit: Balance = BASE_STORAGE_FEE; +} impl continuum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SessionDuration = ContinuumSessionDuration; diff --git a/runtime/pioneer/src/weights/module_auction.rs b/runtime/pioneer/src/weights/module_auction.rs index d83fe09af..fefdcf436 100644 --- a/runtime/pioneer/src/weights/module_auction.rs +++ b/runtime/pioneer/src/weights/module_auction.rs @@ -12,56 +12,56 @@ pub struct WeightInfo(PhantomData); impl auction::WeightInfo for WeightInfo { fn create_new_auction() -> Weight { - Weight::from_parts(83_359_000, 54013) + Weight::from_parts(61_885_000, 57373) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(7)) } fn create_new_buy_now() -> Weight { - Weight::from_parts(60_938_000, 54013) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(7)) + Weight::from_parts(74_722_000, 61706) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) } fn bid() -> Weight { - Weight::from_parts(52_851_000, 17254) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(5)) + Weight::from_parts(75_918_000, 25151) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) } fn buy_now() -> Weight { - Weight::from_parts(117_267_000, 74974) + Weight::from_parts(121_030_000, 78754) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) } fn cancel_listing() -> Weight { - Weight::from_parts(76_276_000, 28348) + Weight::from_parts(50_823_000, 30028) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(6)) } fn authorise_metaverse_collection() -> Weight { - Weight::from_parts(35_078_000, 7564) + Weight::from_parts(23_046_000, 7564) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn remove_authorise_metaverse_collection() -> Weight { - Weight::from_parts(24_963_000, 7670) + Weight::from_parts(23_607_000, 7670) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn make_offer() -> Weight { - Weight::from_parts(38_021_000, 15443) + Weight::from_parts(38_079_000, 15443) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } fn withdraw_offer() -> Weight { - Weight::from_parts(29_056_000, 6612) + Weight::from_parts(28_621_000, 6612) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } fn accept_offer() -> Weight { - Weight::from_parts(69_244_000, 31537) + Weight::from_parts(72_454_000, 31537) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) } fn on_finalize() -> Weight { - Weight::from_parts(6_116_000, 0) + Weight::from_parts(7_467_000, 0) } }