mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
[Deprecation] Remove the deprecated Store trait (#3532)
# Description *Removes the deprecated `trait Store` feature from the code base* Fixes #222 --------- Co-authored-by: Dónal Murray <donalm@seadanda.dev>
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[frame_support::pallet]
|
||||
mod pallet {
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(trait Store)]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -1,10 +0,0 @@
|
||||
error: use of deprecated struct `pallet::_::Store`:
|
||||
Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023.
|
||||
Check https://github.com/paritytech/substrate/pull/13535 for more details.
|
||||
--> tests/pallet_ui/deprecated_store_attr.rs:24:3
|
||||
|
|
||||
24 | #[pallet::generate_store(trait Store)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
@@ -1,42 +0,0 @@
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[frame_support::pallet]
|
||||
mod pallet {
|
||||
use frame_support::pallet_prelude::Hooks;
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
use frame_support::pallet_prelude::StorageValue;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(trait Store)]
|
||||
#[pallet::generate_store(trait Store)]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
|
||||
#[pallet::storage]
|
||||
type Foo<T> = StorageValue<_, u8>;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -1,5 +0,0 @@
|
||||
error: Unexpected duplicated attribute
|
||||
--> tests/pallet_ui/duplicate_store_attr.rs:29:3
|
||||
|
|
||||
29 | #[pallet::generate_store(trait Store)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -1,4 +1,4 @@
|
||||
error: expected one of: `generate_store`, `without_storage_info`, `storage_version`
|
||||
error: expected `without_storage_info` or `storage_version`
|
||||
--> tests/pallet_ui/pallet_struct_invalid_attr.rs:24:12
|
||||
|
|
||||
24 | #[pallet::generate_storage_info] // invalid
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[frame_support::pallet]
|
||||
mod pallet {
|
||||
use frame_support::pallet_prelude::Hooks;
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
use frame_support::pallet_prelude::StorageValue;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub trait Store)]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
|
||||
#[pallet::storage]
|
||||
type Foo<T> = StorageValue<_, u8>;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
error: use of deprecated struct `pallet::_::Store`:
|
||||
Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023.
|
||||
Check https://github.com/paritytech/substrate/pull/13535 for more details.
|
||||
--> tests/pallet_ui/store_trait_leak_private.rs:28:3
|
||||
|
|
||||
28 | #[pallet::generate_store(pub trait Store)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error[E0446]: private type `_GeneratedPrefixForStorageFoo<T>` in public interface
|
||||
--> tests/pallet_ui/store_trait_leak_private.rs:28:37
|
||||
|
|
||||
28 | #[pallet::generate_store(pub trait Store)]
|
||||
| ^^^^^ can't leak private type
|
||||
...
|
||||
37 | #[pallet::storage]
|
||||
| ------- `_GeneratedPrefixForStorageFoo<T>` declared as private
|
||||
@@ -41,7 +41,6 @@ pub mod pallet {
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub (super) trait Store)]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
|
||||
Reference in New Issue
Block a user