Make pallets use construct_runtime (#7950)

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
Guillaume Thiolliere
2021-01-25 13:20:47 +01:00
committed by GitHub
parent 703c263079
commit 48810cd75b
19 changed files with 66 additions and 37 deletions
@@ -21,7 +21,7 @@
#![recursion_limit="128"]
use sp_runtime::{generic, traits::{BlakeTwo256, Block as _, Verify}, DispatchError};
use sp_runtime::{generic, traits::{BlakeTwo256, Verify}, DispatchError};
use sp_core::{H256, sr25519};
use sp_std::cell::RefCell;
use frame_support::traits::PalletInfo as _;
@@ -18,7 +18,7 @@
#![recursion_limit="128"]
use codec::{Codec, EncodeLike, Encode, Decode};
use sp_runtime::{generic, BuildStorage, traits::{BlakeTwo256, Block as _, Verify}};
use sp_runtime::{generic, BuildStorage, traits::{BlakeTwo256, Verify}};
use frame_support::{
Parameter, traits::Get, parameter_types,
metadata::{
@@ -16,7 +16,7 @@
// limitations under the License.
use frame_support::sp_runtime::generic;
use frame_support::sp_runtime::traits::{BlakeTwo256, Block as _, Verify};
use frame_support::sp_runtime::traits::{BlakeTwo256, Verify};
use frame_support::codec::{Encode, Decode};
use sp_core::{H256, sr25519};
use serde::{Serialize, Deserialize};
+1 -1
View File
@@ -23,7 +23,7 @@ use frame_support::{
dispatch::{UnfilteredDispatchable, Parameter},
storage::unhashed,
};
use sp_runtime::{traits::Block as _, DispatchError};
use sp_runtime::DispatchError;
use sp_io::{TestExternalities, hashing::{twox_64, twox_128, blake2_128}};
pub struct SomeType1;
@@ -15,8 +15,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use sp_runtime::traits::Block as _;
pub trait SomeAssociation {
type A: frame_support::dispatch::Parameter + Default;
}
@@ -15,8 +15,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use sp_runtime::traits::Block as _;
mod pallet_old {
use frame_support::{
decl_storage, decl_error, decl_event, decl_module, weights::Weight, traits::Get, Parameter
@@ -23,7 +23,7 @@ use frame_support::{
dispatch::UnfilteredDispatchable,
storage::unhashed,
};
use sp_runtime::{traits::Block as _, DispatchError};
use sp_runtime::DispatchError;
use sp_io::{TestExternalities, hashing::{twox_64, twox_128, blake2_128}};
#[frame_support::pallet]
@@ -20,7 +20,7 @@
#![recursion_limit="128"]
use codec::{Decode, Encode};
use sp_runtime::{generic, traits::{BlakeTwo256, Block as _, Verify}, BuildStorage};
use sp_runtime::{generic, traits::{BlakeTwo256, Verify}, BuildStorage};
use frame_support::{
traits::{PALLET_VERSION_STORAGE_KEY_POSTFIX, PalletVersion, OnRuntimeUpgrade, GetPalletVersion},
crate_to_pallet_version, weights::Weight,
@@ -88,7 +88,6 @@ mod tests {
use crate as pallet_test;
use frame_support::parameter_types;
use sp_runtime::traits::Block;
type SignedExtra = (
frame_system::CheckEra<Runtime>,