Switch to Rust 2021 (#10170)

* Switch to Rust 2021

* Update trybuild to fix errors
This commit is contained in:
Bastian Köcher
2021-11-04 19:54:48 +01:00
committed by GitHub
parent 9fb9d7b8f0
commit b08d3017a8
245 changed files with 264 additions and 279 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-assets"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-atomic-swap"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-aura"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-authority-discovery"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "pallet-authorship"
version = "4.0.0-dev"
description = "Block and Uncle Author tracking for the FRAME"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-babe"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-bags-list"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-bags-list-fuzzer"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-bags-list-remote-tests"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-balances"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-beefy-mmr"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
description = "BEEFY + MMR runtime utilities"
@@ -2,7 +2,7 @@
name = "beefy-merkle-tree"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
description = "A no-std/Substrate compatible library to construct binary merkle tree."
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-beefy"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
[dependencies]
+1 -1
View File
@@ -2,7 +2,7 @@
name = "frame-benchmarking"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-bounties"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-collective"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-contracts"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-contracts-primitives"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-contracts-proc-macro"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-contracts-rpc"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-contracts-rpc-runtime-api"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-democracy"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-election-provider-multi-phase"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "frame-election-provider-support"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-elections-phragmen"
version = "5.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-elections"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-example-offchain-worker"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Unlicense"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-example-parallel"
version = "3.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Unlicense"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -105,7 +105,6 @@ impl EnlistedParticipant {
fn verify(&self, event_id: &[u8]) -> bool {
use sp_core::Public;
use sp_runtime::traits::Verify;
use std::convert::TryFrom;
match sp_core::sr25519::Signature::try_from(&self.signature[..]) {
Ok(signature) => {
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-example"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Unlicense"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "frame-executive"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-gilt"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-grandpa"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-identity"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-im-online"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-indices"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-lottery"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-membership"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-mmr"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-mmr-primitives"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-mmr-rpc"
version = "3.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-multisig"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-nicks"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-node-authorization"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-offences"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-offences-benchmarking"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-proxy"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-randomness-collective-flip"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-recovery"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-scheduler"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Unlicense"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-scored-pool"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-session"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-session-benchmarking"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-society"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-staking"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-staking-reward-curve"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-staking-reward-fn"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -926,7 +926,6 @@ impl<T: Config> ElectionDataProvider<T::AccountId, BlockNumberFor<T>> for Pallet
#[cfg(feature = "runtime-benchmarks")]
fn add_voter(voter: T::AccountId, weight: VoteWeight, targets: Vec<T::AccountId>) {
use sp_std::convert::TryFrom;
let stake = <BalanceOf<T>>::try_from(weight).unwrap_or_else(|_| {
panic!("cannot convert a VoteWeight into BalanceOf, benchmark needs reconfiguring.")
});
@@ -981,7 +980,6 @@ impl<T: Config> ElectionDataProvider<T::AccountId, BlockNumberFor<T>> for Pallet
targets: Vec<T::AccountId>,
target_stake: Option<VoteWeight>,
) {
use sp_std::convert::TryFrom;
targets.into_iter().for_each(|v| {
let stake: BalanceOf<T> = target_stake
.and_then(|w| <BalanceOf<T>>::try_from(w).ok())
@@ -1256,7 +1254,6 @@ impl<T: Config> VoteWeightProvider<T::AccountId> for Pallet<T> {
fn set_vote_weight_of(who: &T::AccountId, weight: VoteWeight) {
// this will clearly results in an inconsistent state, but it should not matter for a
// benchmark.
use sp_std::convert::TryInto;
let active: BalanceOf<T> = weight.try_into().map_err(|_| ()).unwrap();
let mut ledger = Self::ledger(who).unwrap_or_default();
ledger.active = active;
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-sudo"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "frame-support"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "frame-support-procedural"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -52,7 +52,7 @@ pub fn expand_constants(def: &mut Def) -> proc_macro2::TokenStream {
type_: const_.type_.clone(),
doc: const_.doc.clone(),
default_byte_impl: quote::quote!(
let value = <<T as Config#trait_use_gen>::#ident as
let value = <<T as Config #trait_use_gen>::#ident as
#frame_support::traits::Get<#const_type>>::get();
#frame_support::codec::Encode::encode(&value)
),
@@ -134,12 +134,12 @@ pub fn expand_event(def: &mut Def) -> proc_macro2::TokenStream {
impl<#type_impl_gen> Pallet<#type_use_gen> #completed_where_clause {
#fn_vis fn deposit_event(event: Event<#event_use_gen>) {
let event = <
<T as Config#trait_use_gen>::Event as
<T as Config #trait_use_gen>::Event as
From<Event<#event_use_gen>>
>::from(event);
let event = <
<T as Config#trait_use_gen>::Event as
<T as Config #trait_use_gen>::Event as
Into<<T as #frame_system::Config>::Event>
>::into(event);
@@ -75,12 +75,12 @@ fn decl_genesis_config_and_impl_default(
#[serde(deny_unknown_fields)]
#[serde(crate = #serde_crate)]
#serde_bug_bound
pub struct GenesisConfig#genesis_struct_decl #genesis_where_clause {
pub struct GenesisConfig #genesis_struct_decl #genesis_where_clause {
#( #config_fields )*
}
#[cfg(feature = "std")]
impl#genesis_impl Default for GenesisConfig#genesis_struct #genesis_where_clause {
impl #genesis_impl Default for GenesisConfig #genesis_struct #genesis_where_clause {
fn default() -> Self {
GenesisConfig {
#( #config_field_defaults )*
@@ -137,7 +137,7 @@ fn impl_build_storage(
quote! {
#[cfg(feature = "std")]
impl#genesis_impl GenesisConfig#genesis_struct #genesis_where_clause {
impl #genesis_impl GenesisConfig #genesis_struct #genesis_where_clause {
/// Build the storage for this module.
pub fn build_storage #fn_generic (&self) -> std::result::Result<
#scrate::sp_runtime::Storage,
@@ -161,7 +161,7 @@ fn impl_build_storage(
}
#[cfg(feature = "std")]
impl#build_storage_impl #build_storage_impl_trait for GenesisConfig#genesis_struct
impl #build_storage_impl #build_storage_impl_trait for GenesisConfig #genesis_struct
#where_clause
{
fn build_module_genesis_storage(
@@ -92,7 +92,7 @@ pub fn impl_getters(def: &DeclStorageDefExt) -> TokenStream {
let where_clause = &def.where_clause;
quote!(
impl#module_impl #module_struct #where_clause {
impl #module_impl #module_struct #where_clause {
#getters
}
)
@@ -207,7 +207,7 @@ pub fn impl_metadata(def: &DeclStorageDefExt) -> TokenStream {
quote!(
#default_byte_getter_struct_defs
impl#module_impl #module_struct #where_clause {
impl #module_impl #module_struct #where_clause {
#[doc(hidden)]
pub fn storage_metadata() -> #scrate::metadata::PalletStorageMetadata {
#store_metadata
@@ -48,7 +48,7 @@ pub fn impl_storage_info(def: &DeclStorageDefExt) -> TokenStream {
let where_clause = &def.where_clause;
quote!(
impl#module_impl #scrate::traits::StorageInfoTrait for #module_struct #where_clause {
impl #module_impl #scrate::traits::StorageInfoTrait for #module_struct #where_clause {
fn storage_info() -> #scrate::sp_std::vec::Vec<#scrate::traits::StorageInfo> {
let mut res = #scrate::sp_std::vec![];
#res_append_storage
@@ -48,7 +48,7 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
#visibility trait #store_trait {
#decl_store_items
}
impl#module_impl #store_trait for #module_struct #where_clause {
impl #module_impl #store_trait for #module_struct #where_clause {
#impl_store_items
}
)
@@ -2,7 +2,7 @@
name = "frame-support-procedural-tools"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "frame-support-procedural-tools-derive"
version = "3.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -131,7 +131,7 @@ fn derive_totokens_enum(input: syn::ItemEnum) -> TokenStream {
};
let field = fields_idents(v.fields.iter().map(Clone::clone));
quote! {
#ident::#v_ident#fields_build => {
#ident::#v_ident #fields_build => {
#(
#field.to_tokens(tokens);
)*
@@ -70,7 +70,7 @@ impl<T> Contains<T> for Tuple {
/// to `matches!`.
#[macro_export]
macro_rules! match_type {
( pub type $n:ident: impl Contains<$t:ty> = { $phead:pat $( | $ptail:pat )* } ; ) => {
( pub type $n:ident: impl Contains<$t:ty> = { $phead:pat_param $( | $ptail:pat )* } ; ) => {
pub struct $n;
impl $crate::traits::Contains<$t> for $n {
fn contains(l: &$t) -> bool {
+5 -3
View File
@@ -2,7 +2,7 @@
name = "frame-support-test"
version = "3.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
publish = false
homepage = "https://substrate.io"
@@ -23,7 +23,7 @@ sp-runtime = { version = "4.0.0-dev", default-features = false, path = "../../..
sp-core = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/core" }
sp-std = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/std" }
sp-version = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/version" }
trybuild = "1.0.43"
trybuild = "1.0.52"
pretty_assertions = "1.0.0"
rustversion = "1.0.0"
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" }
@@ -36,13 +36,15 @@ std = [
"serde/std",
"codec/std",
"scale-info/std",
"sp-io/std",
"frame-support/std",
"frame-system/std",
"sp-core/std",
"sp-std/std",
"sp-io/std",
"sp-runtime/std",
"sp-state-machine",
"sp-arithmetic/std",
"sp-version/std",
]
try-runtime = ["frame-support/try-runtime"]
# WARNING: CI only execute pallet test with this feature,
@@ -2,7 +2,7 @@
name = "frame-support-test-compile-pass"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
publish = false
homepage = "https://substrate.dev"
@@ -2,7 +2,7 @@
name = "frame-support-test-pallet"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
publish = false
homepage = "https://substrate.io"
+17 -17
View File
@@ -166,25 +166,25 @@ pub mod pallet {
T::AccountId: From<SomeType2> + From<SomeType1> + SomeAssociation1,
{
fn on_initialize(_: BlockNumberFor<T>) -> Weight {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType2); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType2); // Test for where clause
Self::deposit_event(Event::Something(10));
10
}
fn on_finalize(_: BlockNumberFor<T>) {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType2); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType2); // Test for where clause
Self::deposit_event(Event::Something(20));
}
fn on_runtime_upgrade() -> Weight {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType2); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType2); // Test for where clause
Self::deposit_event(Event::Something(30));
30
}
fn integrity_test() {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType2); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType2); // Test for where clause
}
}
@@ -200,8 +200,8 @@ pub mod pallet {
#[pallet::compact] _foo: u32,
_bar: u32,
) -> DispatchResultWithPostInfo {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType3); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType3); // Test for where clause
let _ = origin;
Self::deposit_event(Event::Something(3));
Ok(().into())
@@ -268,7 +268,7 @@ pub mod pallet {
where
T::AccountId: From<SomeType7> + From<SomeType1> + SomeAssociation1,
{
T::AccountId::from(SomeType7); // Test where clause works
let _ = T::AccountId::from(SomeType7); // Test where clause works
4u16
}
@@ -352,8 +352,8 @@ pub mod pallet {
T::AccountId: From<SomeType1> + SomeAssociation1 + From<SomeType4>,
{
fn build(&self) {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType4); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType4); // Test for where clause
}
}
@@ -370,8 +370,8 @@ pub mod pallet {
{
type Call = Call<T>;
fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType5); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType5); // Test for where clause
if matches!(call, Call::foo_transactional { .. }) {
return Ok(ValidTransaction::default())
}
@@ -390,8 +390,8 @@ pub mod pallet {
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER;
fn create_inherent(_data: &InherentData) -> Option<Self::Call> {
T::AccountId::from(SomeType1); // Test for where clause
T::AccountId::from(SomeType6); // Test for where clause
let _ = T::AccountId::from(SomeType1); // Test for where clause
let _ = T::AccountId::from(SomeType6); // Test for where clause
Some(Call::foo_no_post_info {})
}
+1 -1
View File
@@ -2,7 +2,7 @@
name = "frame-system"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "frame-system-benchmarking"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "frame-system-rpc-runtime-api"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-timestamp"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-tips"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-transaction-payment"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-transaction-payment-rpc"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-transaction-payment-rpc-runtime-api"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
@@ -2,7 +2,7 @@
name = "pallet-transaction-storage"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Unlicense"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-treasury"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "frame-try-runtime"
version = "0.10.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-uniques"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-utility"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
+1 -1
View File
@@ -2,7 +2,7 @@
name = "pallet-vesting"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"