mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
Switch to Rust 2021 (#10170)
* Switch to Rust 2021 * Update trybuild to fix errors
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user