From 18f1905d8f24b85f9b8b09ad77af2771d05fd242 Mon Sep 17 00:00:00 2001 From: Leouarz Date: Thu, 1 Jun 2023 09:35:55 +0200 Subject: [PATCH] remove unused storage --- avail-subxt/src/api_dev.rs | 23 ----------------------- pallets/dactr/src/lib.rs | 17 ----------------- pallets/dactr/src/weights.rs | 8 ++------ 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/avail-subxt/src/api_dev.rs b/avail-subxt/src/api_dev.rs index 8557714ac..35f2e13c6 100644 --- a/avail-subxt/src/api_dev.rs +++ b/avail-subxt/src/api_dev.rs @@ -16478,29 +16478,6 @@ pub mod api { ) } - #[doc = " Last block length proposal."] - #[doc = " # TODO"] - #[doc = " - It is not used, could we removed it?"] - pub fn last_block_len_id( - &self, - ) -> ::subxt::storage::address::StaticStorageAddress< - ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, - ::subxt::storage::address::Yes, - ::subxt::storage::address::Yes, - (), - > { - ::subxt::storage::address::StaticStorageAddress::new( - "DataAvailability", - "LastBlockLenId", - vec![], - [ - 51u8, 88u8, 3u8, 49u8, 185u8, 211u8, 12u8, 141u8, 53u8, 34u8, 47u8, - 67u8, 163u8, 215u8, 249u8, 135u8, 80u8, 9u8, 236u8, 177u8, 219u8, 94u8, - 56u8, 168u8, 176u8, 149u8, 104u8, 19u8, 20u8, 189u8, 124u8, 213u8, - ], - ) - } - #[doc = " Store all application keys."] pub fn app_keys( &self, diff --git a/pallets/dactr/src/lib.rs b/pallets/dactr/src/lib.rs index f6dd416ec..76f3d303a 100644 --- a/pallets/dactr/src/lib.rs +++ b/pallets/dactr/src/lib.rs @@ -89,13 +89,6 @@ pub mod pallet { #[pallet::getter(fn peek_next_application_id)] pub type NextAppId = StorageValue<_, AppId, ValueQuery>; - /// Last block length proposal. - /// # TODO - /// - It is not used, could we removed it? - #[pallet::storage] - #[pallet::getter(fn last_block_length_proposal_id)] - pub type LastBlockLenId = StorageValue<_, T::BlockLenProposalId, ValueQuery>; - /// Store all application keys. #[pallet::storage] #[pallet::getter(fn application_key)] @@ -164,7 +157,6 @@ pub mod pallet { BlockLength::with_normal_ratio(rows, cols, BLOCK_CHUNK_SIZE, NORMAL_DISPATCH_RATIO) .map_err(|_| Error::::BlockDimensionsOutOfBounds)?; - let _id = Self::next_block_len_proposal_id()?; DynamicBlockLength::::put(block_length); Self::deposit_event(Event::BlockLengthProposalSubmitted { rows, cols }); @@ -281,13 +273,4 @@ impl Pallet { Ok(replace(id, new_id)) }) } - - pub fn next_block_len_proposal_id() -> Result> { - LastBlockLenId::::try_mutate(|id| { - let new_id = id - .checked_add(&One::one()) - .ok_or(Error::::LastBlockLenProposalIdOverflowed)?; - Ok(replace(id, new_id)) - }) - } } diff --git a/pallets/dactr/src/weights.rs b/pallets/dactr/src/weights.rs index 93d54d910..03bf9831c 100644 --- a/pallets/dactr/src/weights.rs +++ b/pallets/dactr/src/weights.rs @@ -70,13 +70,11 @@ impl WeightInfo for SubstrateWeight { // Standard Error: 3 .saturating_add(Weight::from_ref_time(1_328_u64).saturating_mul(i as u64)) } - // Storage: DataAvailability LastBlockLenId (r:1 w:1) // Storage: System DynamicBlockLength (r:0 w:1) fn submit_block_length_proposal() -> Weight { // Minimum execution time: 34_500 nanoseconds. Weight::from_ref_time(35_272_000_u64) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -97,12 +95,10 @@ impl WeightInfo for () { // Standard Error: 3 .saturating_add(Weight::from_ref_time(1_328_u64).saturating_mul(i as u64)) } - // Storage: DataAvailability LastBlockLenId (r:1 w:1) // Storage: System DynamicBlockLength (r:0 w:1) fn submit_block_length_proposal() -> Weight { // Minimum execution time: 34_500 nanoseconds. Weight::from_ref_time(35_272_000_u64) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } }