diff --git a/artifacts/polkadot_metadata.scale b/artifacts/polkadot_metadata.scale index f0676eace6..50ff19cea9 100644 Binary files a/artifacts/polkadot_metadata.scale and b/artifacts/polkadot_metadata.scale differ diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index 0f222735a4..4fa13388e9 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -22,31 +22,8 @@ use quote::{ }; use scale_info::form::PortableForm; -/// Generate calls from the provided pallet's metadata. -/// -/// The function creates a new module named `calls` under the pallet's module. -/// ```ignore -/// pub mod PalletName { -/// pub mod calls { -/// ... -/// } -/// } -/// ``` -/// -/// The function generates the calls as rust structs that implement the `subxt::Call` trait -/// to uniquely identify the call's identity when creating the extrinsic. -/// -/// ```ignore -/// pub struct CallName { -/// pub call_param: type, -/// } -/// impl ::subxt::Call for CallName { -/// ... -/// } -/// ``` -/// -/// Calls are extracted from the API and wrapped into the generated `TransactionApi` of -/// each module. +/// Generate calls from the provided pallet's metadata. Each call returns a `StaticTxPayload` +/// that can be passed to the subxt client to submit/sign/encode. /// /// # Arguments /// @@ -76,35 +53,42 @@ pub fn generate_calls( let (call_structs, call_fns): (Vec<_>, Vec<_>) = struct_defs .iter_mut() .map(|(variant_name, struct_def)| { - let (call_fn_args, call_args): (Vec<_>, Vec<_>) = - match struct_def.fields { - CompositeDefFields::Named(ref named_fields) => { - named_fields - .iter() - .map(|(name, field)| { - let fn_arg_type = &field.type_path; - let call_arg = if field.is_boxed() { - quote! { #name: ::std::boxed::Box::new(#name) } - } else { - quote! { #name } - }; - (quote!( #name: #fn_arg_type ), call_arg) - }) - .unzip() - } - CompositeDefFields::NoFields => Default::default(), - CompositeDefFields::Unnamed(_) => - abort_call_site!( - "Call variant for type {} must have all named fields", - call.ty.id() - ) - }; + let (call_fn_args, call_args): (Vec<_>, Vec<_>) = match struct_def.fields { + CompositeDefFields::Named(ref named_fields) => { + named_fields + .iter() + .map(|(name, field)| { + let fn_arg_type = &field.type_path; + let call_arg = if field.is_boxed() { + quote! { #name: ::std::boxed::Box::new(#name) } + } else { + quote! { #name } + }; + (quote!( #name: #fn_arg_type ), call_arg) + }) + .unzip() + } + CompositeDefFields::NoFields => Default::default(), + CompositeDefFields::Unnamed(_) => { + abort_call_site!( + "Call variant for type {} must have all named fields", + call.ty.id() + ) + } + }; let pallet_name = &pallet.name; let call_name = &variant_name; let struct_name = &struct_def.name; - let call_hash = subxt_metadata::get_call_hash(metadata, pallet_name, call_name) - .unwrap_or_else(|_| abort_call_site!("Metadata information for the call {}_{} could not be found", pallet_name, call_name)); + let call_hash = + subxt_metadata::get_call_hash(metadata, pallet_name, call_name) + .unwrap_or_else(|_| { + abort_call_site!( + "Metadata information for the call {}_{} could not be found", + pallet_name, + call_name + ) + }); let fn_name = format_ident!("{}", variant_name.to_snake_case()); // Propagate the documentation just to `TransactionApi` methods, while @@ -113,29 +97,19 @@ pub fn generate_calls( // The call structure's documentation was stripped above. let call_struct = quote! { #struct_def - - impl ::subxt::Call for #struct_name { - const PALLET: &'static str = #pallet_name; - const FUNCTION: &'static str = #call_name; - } }; let client_fn = quote! { #docs pub fn #fn_name( &self, #( #call_fn_args, )* - ) -> Result<::subxt::SubmittableExtrinsic<'a, T, X, #struct_name, DispatchError, root_mod::Event>, ::subxt::BasicError> { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::<#struct_name>()? - }; - if runtime_call_hash == [#(#call_hash,)*] { - let call = #struct_name { #( #call_args, )* }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload<#struct_name> { + ::subxt::tx::StaticTxPayload::new( + #pallet_name, + #call_name, + #struct_name { #( #call_args, )* }, + [#(#call_hash,)*] + ) } }; (call_struct, client_fn) @@ -155,20 +129,9 @@ pub fn generate_calls( #( #call_structs )* - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client, marker: ::core::marker::PhantomData } - } + pub struct TransactionApi; + impl TransactionApi { #( #call_fns )* } } diff --git a/codegen/src/api/constants.rs b/codegen/src/api/constants.rs index ade0a3b5c3..6925570ec9 100644 --- a/codegen/src/api/constants.rs +++ b/codegen/src/api/constants.rs @@ -63,17 +63,12 @@ pub fn generate_constants( quote! { #( #[doc = #docs ] )* - pub fn #fn_name(&self) -> ::core::result::Result<#return_ty, ::subxt::BasicError> { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash(#pallet_name, #constant_name)? == [#(#constant_hash,)*] { - let pallet = metadata.pallet(#pallet_name)?; - let constant = pallet.constant(#constant_name)?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + pub fn #fn_name(&self) -> ::subxt::constants::StaticConstantAddress<::subxt::metadata::DecodeStaticType<#return_ty>> { + ::subxt::constants::StaticConstantAddress::new( + #pallet_name, + #constant_name, + [#(#constant_hash,)*] + ) } } }); @@ -82,15 +77,9 @@ pub fn generate_constants( pub mod constants { use super::#types_mod_ident; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #(#constant_fns)* } } diff --git a/codegen/src/api/errors.rs b/codegen/src/api/errors.rs deleted file mode 100644 index 1bdd98a68f..0000000000 --- a/codegen/src/api/errors.rs +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use frame_metadata::v14::RuntimeMetadataV14; -use proc_macro2::TokenStream as TokenStream2; -use proc_macro_error::abort_call_site; -use quote::quote; -use scale_info::{ - form::PortableForm, - Field, - TypeDef, - TypeDefPrimitive, -}; - -/// Different substrate versions will have a different `DispatchError::Module`. -/// The following cases are ordered by versions. -enum ModuleErrorType { - /// Case 1: `DispatchError::Module { index: u8, error: u8 }` - /// - /// This is the first supported `DispatchError::Module` format. - NamedField, - /// Case 2: `DispatchError::Module ( sp_runtime::ModuleError { index: u8, error: u8 } )` - /// - /// Substrate introduced `sp_runtime::ModuleError`, while keeping the error `u8`. - LegacyError, - /// Case 3: `DispatchError::Module ( sp_runtime::ModuleError { index: u8, error: [u8; 4] } )` - /// - /// The substrate error evolved into `[u8; 4]`. - ArrayError, -} - -impl quote::ToTokens for ModuleErrorType { - fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { - let trait_fn_body = match self { - ModuleErrorType::NamedField => { - quote! { - if let &Self::Module { index, error } = self { - Some(::subxt::ModuleErrorData { pallet_index: index, error: [error, 0, 0, 0] }) - } else { - None - } - } - } - ModuleErrorType::LegacyError => { - quote! { - if let Self::Module (module_error) = self { - Some(::subxt::ModuleErrorData { pallet_index: module_error.index, error: [module_error.error, 0, 0, 0] }) - } else { - None - } - } - } - ModuleErrorType::ArrayError => { - quote! { - if let Self::Module (module_error) = self { - Some(::subxt::ModuleErrorData { pallet_index: module_error.index, error: module_error.error }) - } else { - None - } - } - } - }; - - tokens.extend(trait_fn_body); - } -} - -/// Determine the `ModuleError` type for the `ModuleErrorType::LegacyError` and -/// `ModuleErrorType::ErrorArray` cases. -fn module_error_type( - module_field: &Field, - metadata: &RuntimeMetadataV14, -) -> ModuleErrorType { - // Fields are named. - if module_field.name().is_some() { - return ModuleErrorType::NamedField - } - - // Get the `sp_runtime::ModuleError` structure. - let module_err = metadata - .types - .resolve(module_field.ty().id()) - .unwrap_or_else(|| { - abort_call_site!("sp_runtime::ModuleError type expected in metadata") - }); - - let error_type_def = match module_err.type_def() { - TypeDef::Composite(composite) => composite, - _ => abort_call_site!("sp_runtime::ModuleError type should be a composite type"), - }; - - // Get the error field from the `sp_runtime::ModuleError` structure. - let error_field = error_type_def - .fields() - .iter() - .find(|field| field.name() == Some(&"error".to_string())) - .unwrap_or_else(|| { - abort_call_site!("sp_runtime::ModuleError expected to contain error field") - }); - - // Resolve the error type from the metadata. - let error_field_ty = metadata - .types - .resolve(error_field.ty().id()) - .unwrap_or_else(|| { - abort_call_site!("sp_runtime::ModuleError::error type expected in metadata") - }); - - match error_field_ty.type_def() { - // Check for legacy error type. - TypeDef::Primitive(TypeDefPrimitive::U8) => ModuleErrorType::LegacyError, - TypeDef::Array(array) => { - // Check new error type of len 4 and type u8. - if array.len() != 4 { - abort_call_site!("sp_runtime::ModuleError::error array length is not 4"); - } - - let array_ty = metadata - .types - .resolve(array.type_param().id()) - .unwrap_or_else(|| { - abort_call_site!( - "sp_runtime::ModuleError::error array type expected in metadata" - ) - }); - - if let TypeDef::Primitive(TypeDefPrimitive::U8) = array_ty.type_def() { - ModuleErrorType::ArrayError - } else { - abort_call_site!( - "sp_runtime::ModuleError::error array type expected to be u8" - ) - } - } - _ => { - abort_call_site!( - "sp_runtime::ModuleError::error array type or primitive expected" - ) - } - } -} - -/// The aim of this is to implement the `::subxt::HasModuleError` trait for -/// the generated `DispatchError`, so that we can obtain the module error details, -/// if applicable, from it. -pub fn generate_has_module_error_impl( - metadata: &RuntimeMetadataV14, - types_mod_ident: &syn::Ident, -) -> TokenStream2 { - let dispatch_error = metadata - .types - .types() - .iter() - .find(|&ty| ty.ty().path().segments() == ["sp_runtime", "DispatchError"]) - .unwrap_or_else(|| { - abort_call_site!("sp_runtime::DispatchError type expected in metadata") - }) - .ty() - .type_def(); - - // Get the `DispatchError::Module` variant (either struct or named fields). - let module_variant = match dispatch_error { - TypeDef::Variant(variant) => { - variant - .variants() - .iter() - .find(|variant| variant.name() == "Module") - .unwrap_or_else(|| { - abort_call_site!("DispatchError::Module variant expected in metadata") - }) - } - _ => abort_call_site!("DispatchError expected to contain variant in metadata"), - }; - - let module_field = module_variant.fields().get(0).unwrap_or_else(|| { - abort_call_site!("DispatchError::Module expected to contain 1 or more fields") - }); - - let error_type = module_error_type(module_field, metadata); - - quote! { - impl ::subxt::HasModuleError for #types_mod_ident::sp_runtime::DispatchError { - fn module_error_data(&self) -> Option<::subxt::ModuleErrorData> { - #error_type - } - } - } -} diff --git a/codegen/src/api/events.rs b/codegen/src/api/events.rs index f960e3bb0d..5e16964265 100644 --- a/codegen/src/api/events.rs +++ b/codegen/src/api/events.rs @@ -11,6 +11,7 @@ use scale_info::form::PortableForm; /// Generate events from the provided pallet metadata. /// /// The function creates a new module named `events` under the pallet's module. +/// /// ```ignore /// pub mod PalletName { /// pub mod events { @@ -19,14 +20,14 @@ use scale_info::form::PortableForm; /// } /// ``` /// -/// The function generates the events as rust structs that implement the `subxt::Event` trait +/// The function generates the events as rust structs that implement the `subxt::event::StaticEvent` trait /// to uniquely identify the event's identity when creating the extrinsic. /// /// ```ignore /// pub struct EventName { /// pub event_param: type, /// } -/// impl ::subxt::Event for EventName { +/// impl ::subxt::events::StaticEvent for EventName { /// ... /// } /// ``` @@ -62,7 +63,7 @@ pub fn generate_events( quote! { #struct_def - impl ::subxt::Event for #event_struct { + impl ::subxt::events::StaticEvent for #event_struct { const PALLET: &'static str = #pallet_name; const EVENT: &'static str = #event_name; } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 541d943eac..cf592bd8bd 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -6,7 +6,6 @@ mod calls; mod constants; -mod errors; mod events; mod storage; @@ -110,33 +109,33 @@ impl RuntimeGenerator { let mut type_substitutes = [ ( "bitvec::order::Lsb0", - parse_quote!(::subxt::bitvec::order::Lsb0), + parse_quote!(::subxt::ext::bitvec::order::Lsb0), ), ( "bitvec::order::Msb0", - parse_quote!(::subxt::bitvec::order::Msb0), + parse_quote!(::subxt::ext::bitvec::order::Msb0), ), ( "sp_core::crypto::AccountId32", - parse_quote!(::subxt::sp_core::crypto::AccountId32), + parse_quote!(::subxt::ext::sp_core::crypto::AccountId32), ), ( "primitive_types::H256", - parse_quote!(::subxt::sp_core::H256), + parse_quote!(::subxt::ext::sp_core::H256), ), ( "sp_runtime::multiaddress::MultiAddress", - parse_quote!(::subxt::sp_runtime::MultiAddress), + parse_quote!(::subxt::ext::sp_runtime::MultiAddress), ), ( "frame_support::traits::misc::WrapperKeepOpaque", - parse_quote!(::subxt::WrapperKeepOpaque), + parse_quote!(::subxt::utils::WrapperKeepOpaque), ), // BTreeMap and BTreeSet impose an `Ord` constraint on their key types. This // can cause an issue with generated code that doesn't impl `Ord` by default. // Decoding them to Vec by default (KeyedVec is just an alias for Vec with // suitable type params) avoids these issues. - ("BTreeMap", parse_quote!(::subxt::KeyedVec)), + ("BTreeMap", parse_quote!(::subxt::utils::KeyedVec)), ("BTreeSet", parse_quote!(::std::vec::Vec)), ] .iter() @@ -256,9 +255,6 @@ impl RuntimeGenerator { }) .collect(); - let has_module_error_impl = - errors::generate_has_module_error_impl(&self.metadata, types_mod_ident); - quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod #mod_ident { @@ -271,128 +267,58 @@ impl RuntimeGenerator { #( #modules )* #types_mod - /// The default error type returned when there is a runtime issue. + /// The default error type returned when there is a runtime issue, + /// exposed here for ease of use. pub type DispatchError = #types_mod_ident::sp_runtime::DispatchError; - // Impl HasModuleError on DispatchError so we can pluck out module error details. - #has_module_error_impl - pub struct RuntimeApi { - pub client: ::subxt::Client, - marker: ::core::marker::PhantomData, + pub fn constants() -> ConstantsApi { + ConstantsApi } - impl Clone for RuntimeApi { - fn clone(&self) -> Self { - Self { client: self.client.clone(), marker: ::core::marker::PhantomData } - } - } - - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams - { - fn from(client: ::subxt::Client) -> Self { - Self { client, marker: ::core::marker::PhantomData } - } - } - - impl<'a, T, X> RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn validate_metadata(&'a self) -> Result<(), ::subxt::MetadataError> { - let runtime_metadata_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.metadata_hash(&PALLETS) - }; - if runtime_metadata_hash != [ #(#metadata_hash,)* ] { - Err(::subxt::MetadataError::IncompatibleMetadata) - } else { - Ok(()) - } - } - - pub fn constants(&'a self) -> ConstantsApi<'a, T> { - ConstantsApi { client: &self.client } - } - - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { client: &self.client } - } - - pub fn tx(&'a self) -> TransactionApi<'a, T, X> { - TransactionApi { client: &self.client, marker: ::core::marker::PhantomData } - } - - pub fn events(&'a self) -> EventsApi<'a, T> { - EventsApi { client: &self.client } - } + pub fn storage() -> StorageApi { + StorageApi } - pub struct EventsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + pub fn tx() -> TransactionApi { + TransactionApi } - impl <'a, T: ::subxt::Config> EventsApi<'a, T> { - pub async fn at(&self, block_hash: T::Hash) -> Result<::subxt::events::Events, ::subxt::BasicError> { - ::subxt::events::at::(self.client, block_hash).await - } - - pub async fn subscribe(&self) -> Result<::subxt::events::EventSubscription<'a, ::subxt::events::EventSub, T, Event>, ::subxt::BasicError> { - ::subxt::events::subscribe::(self.client).await - } - - pub async fn subscribe_finalized(&self) -> Result<::subxt::events::EventSubscription<'a, ::subxt::events::FinalizedEventSub<'a, T::Header>, T, Event>, ::subxt::BasicError> { - ::subxt::events::subscribe_finalized::(self.client).await - } - } - - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub struct ConstantsApi; + impl ConstantsApi { #( - pub fn #pallets_with_constants(&self) -> #pallets_with_constants::constants::ConstantsApi<'a, T> { - #pallets_with_constants::constants::ConstantsApi::new(self.client) + pub fn #pallets_with_constants(&self) -> #pallets_with_constants::constants::ConstantsApi { + #pallets_with_constants::constants::ConstantsApi } )* } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config, - { + pub struct StorageApi; + impl StorageApi { #( - pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { - #pallets_with_storage::storage::StorageApi::new(self.client) + pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi { + #pallets_with_storage::storage::StorageApi } )* } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { + pub struct TransactionApi; + impl TransactionApi { #( - pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T, X> { - #pallets_with_calls::calls::TransactionApi::new(self.client) + pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi { + #pallets_with_calls::calls::TransactionApi } )* } + + /// check whether the Client you are using is aligned with the statically generated codegen. + pub fn validate_codegen>(client: &C) -> Result<(), ::subxt::error::MetadataError> { + let runtime_metadata_hash = client.metadata().metadata_hash(&PALLETS); + if runtime_metadata_hash != [ #(#metadata_hash,)* ] { + Err(::subxt::error::MetadataError::IncompatibleMetadata) + } else { + Ok(()) + } + } } } } diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index 195778bb0d..5d0e0b1674 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -23,32 +23,8 @@ use scale_info::{ TypeDef, }; -/// Generate storage from the provided pallet's metadata. -/// -/// The function creates a new module named `storage` under the pallet's module. -/// -/// ```ignore -/// pub mod PalletName { -/// pub mod storage { -/// ... -/// } -/// } -/// ``` -/// -/// The function generates the storage as rust structs that implement the `subxt::StorageEntry` -/// trait to uniquely identify the storage's identity when creating the extrinsic. -/// -/// ```ignore -/// pub struct StorageName { -/// pub storage_param: type, -/// } -/// impl ::subxt::StorageEntry for StorageName { -/// ... -/// } -/// ``` -/// -/// Storages are extracted from the API and wrapped into the generated `StorageApi` of -/// each module. +/// Generate functions which create storage addresses from the provided pallet's metadata. +/// These addresses can be used to access and iterate over storage values. /// /// # Arguments /// @@ -68,27 +44,19 @@ pub fn generate_storage( return quote!() }; - let (storage_structs, storage_fns): (Vec<_>, Vec<_>) = storage + let storage_fns: Vec<_> = storage .entries .iter() .map(|entry| generate_storage_entry_fns(metadata, type_gen, pallet, entry)) - .unzip(); + .collect(); quote! { pub mod storage { use super::#types_mod_ident; - #( #storage_structs )* - - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #( #storage_fns )* } } @@ -100,16 +68,9 @@ fn generate_storage_entry_fns( type_gen: &TypeGenerator, pallet: &PalletMetadata, storage_entry: &StorageEntryMetadata, -) -> (TokenStream2, TokenStream2) { - let entry_struct_ident = format_ident!("{}", storage_entry.name); - let (fields, entry_struct, constructor, key_impl, should_ref) = match storage_entry.ty - { - StorageEntryType::Plain(_) => { - let entry_struct = quote!( pub struct #entry_struct_ident; ); - let constructor = quote!( #entry_struct_ident ); - let key_impl = quote!(::subxt::StorageEntryKey::Plain); - (vec![], entry_struct, constructor, key_impl, false) - } +) -> TokenStream2 { + let (fields, key_impl) = match storage_entry.ty { + StorageEntryType::Plain(_) => (vec![], quote!(vec![])), StorageEntryType::Map { ref key, ref hashers, @@ -129,7 +90,7 @@ fn generate_storage_entry_fns( StorageHasher::Identity => "Identity", }; let hasher = format_ident!("{}", hasher); - quote!( ::subxt::StorageHasher::#hasher ) + quote!( ::subxt::storage::address::StorageHasher::#hasher ) }) .collect::>(); match key_ty.type_def() { @@ -145,60 +106,28 @@ fn generate_storage_entry_fns( }) .collect::>(); - let field_names = fields.iter().map(|(n, _)| n); - let field_types = fields.iter().map(|(_, t)| { - // If the field type is `::std::vec::Vec` obtain the type parameter and - // surround with slice brackets. Otherwise, utilize the field_type as is. - match t.vec_type_param() { - Some(ty) => quote!([#ty]), - None => quote!(#t), - } - }); - // There cannot be a reference without a parameter. - let should_ref = !fields.is_empty(); - let (entry_struct, constructor) = if should_ref { - ( - quote! { - pub struct #entry_struct_ident <'a>( #( pub &'a #field_types ),* ); - }, - quote!( #entry_struct_ident( #( #field_names ),* ) ), - ) - } else { - ( - quote!( pub struct #entry_struct_ident; ), - quote!( #entry_struct_ident ), - ) - }; - let key_impl = if hashers.len() == fields.len() { // If the number of hashers matches the number of fields, we're dealing with // something shaped like a StorageNMap, and each field should be hashed separately // according to the corresponding hasher. let keys = hashers .into_iter() - .enumerate() - .map(|(field_idx, hasher)| { - let index = syn::Index::from(field_idx); - quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) + .zip(&fields) + .map(|(hasher, (field_name, _))| { + quote!( ::subxt::storage::address::StorageMapKey::new(#field_name.borrow(), #hasher) ) }); quote! { - ::subxt::StorageEntryKey::Map( - vec![ #( #keys ),* ] - ) + vec![ #( #keys ),* ] } } else if hashers.len() == 1 { // If there is one hasher, then however many fields we have, we want to hash a // tuple of them using the one hasher we're told about. This corresponds to a // StorageMap. let hasher = hashers.get(0).expect("checked for 1 hasher"); - let items = (0..fields.len()).map(|field_idx| { - let index = syn::Index::from(field_idx); - quote!( &self.#index ) - }); + let items = + fields.iter().map(|(field_name, _)| quote!( #field_name )); quote! { - ::subxt::StorageEntryKey::Map( - vec![ ::subxt::StorageMapKey::new(&(#( #items ),*), #hasher) ] - ) + vec![ ::subxt::storage::address::StorageMapKey::new(&(#( #items.borrow() ),*), #hasher) ] } } else { // If we hit this condition, we don't know how to handle the number of hashes vs fields @@ -210,33 +139,18 @@ fn generate_storage_entry_fns( ) }; - (fields, entry_struct, constructor, key_impl, should_ref) + (fields, key_impl) } _ => { - let (lifetime_param, lifetime_ref) = (quote!(<'a>), quote!(&'a)); - let ty_path = type_gen.resolve_type_path(key.id(), &[]); - let fields = vec![(format_ident!("_0"), ty_path.clone())]; - - // `ty_path` can be `std::vec::Vec`. In such cases, the entry struct - // should contain a slice reference. - let ty_slice = match ty_path.vec_type_param() { - Some(ty) => quote!([#ty]), - None => quote!(#ty_path), - }; - let entry_struct = quote! { - pub struct #entry_struct_ident #lifetime_param( pub #lifetime_ref #ty_slice ); - }; - let constructor = quote!( #entry_struct_ident(_0) ); + let fields = vec![(format_ident!("_0"), ty_path)]; let hasher = hashers.get(0).unwrap_or_else(|| { abort_call_site!("No hasher found for single key") }); let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] - ) + vec![ ::subxt::storage::address::StorageMapKey::new(_0.borrow(), #hasher) ] }; - (fields, entry_struct, constructor, key_impl, true) + (fields, key_impl) } } } @@ -255,133 +169,85 @@ fn generate_storage_entry_fns( }); let fn_name = format_ident!("{}", storage_entry.name.to_snake_case()); - let fn_name_iter = format_ident!("{}_iter", fn_name); let storage_entry_ty = match storage_entry.ty { StorageEntryType::Plain(ref ty) => ty, StorageEntryType::Map { ref value, .. } => value, }; let storage_entry_value_ty = type_gen.resolve_type_path(storage_entry_ty.id(), &[]); - let (return_ty, fetch) = match storage_entry.modifier { - StorageEntryModifier::Default => { - (quote!( #storage_entry_value_ty ), quote!(fetch_or_default)) - } - StorageEntryModifier::Optional => { - ( - quote!( ::core::option::Option<#storage_entry_value_ty> ), - quote!(fetch), - ) - } - }; - let storage_entry_impl = quote! ( - const PALLET: &'static str = #pallet_name; - const STORAGE: &'static str = #storage_name; - type Value = #storage_entry_value_ty; - fn key(&self) -> ::subxt::StorageEntryKey { - #key_impl - } - ); + let docs = &storage_entry.docs; + let docs_token = quote! { #( #[doc = #docs ] )* }; - let anon_lifetime = match should_ref { - true => quote!(<'_>), - false => quote!(), - }; - let storage_entry_type = quote! { - #entry_struct - impl ::subxt::StorageEntry for #entry_struct_ident #anon_lifetime { - #storage_entry_impl - } + let key_args = fields.iter().map(|(field_name, field_type)| { + // The field type is translated from `std::vec::Vec` to `[T]`. We apply + // AsRef to all types, so this just makes it a little more ergonomic. + // + // TODO [jsdw]: Support mappings like `String -> str` too for better borrow + // ergonomics. + let field_ty = match field_type.vec_type_param() { + Some(ty) => quote!([#ty]), + _ => quote!(#field_type), + }; + quote!( #field_name: impl ::std::borrow::Borrow<#field_ty> ) + }); + + let is_map_type = matches!(storage_entry.ty, StorageEntryType::Map { .. }); + + // Is the entry iterable? + let is_iterable_type = if is_map_type { + quote!(::subxt::storage::address::Yes) + } else { + quote!(()) }; - let docs = &storage_entry.docs; - let docs_token = quote! { #( #[doc = #docs ] )* }; + let has_default_value = match storage_entry.modifier { + StorageEntryModifier::Default => true, + StorageEntryModifier::Optional => false, + }; - let lifetime_param = match should_ref { - true => quote!(<'a>), - false => quote!(), + // Does the entry have a default value? + let is_defaultable_type = if has_default_value { + quote!(::subxt::storage::address::Yes) + } else { + quote!(()) }; - let client_iter_fn = if matches!(storage_entry.ty, StorageEntryType::Map { .. }) { + + // If the item is a map, we want a way to access the root entry to do things like iterate over it, + // so expose a function to create this entry, too: + let root_entry_fn = if is_map_type { + let fn_name_root = format_ident!("{}_root", fn_name); quote! ( #docs_token - pub fn #fn_name_iter( + pub fn #fn_name_root( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result<::subxt::KeyIter<'a, T, #entry_struct_ident #lifetime_param>, ::subxt::BasicError> - > + 'a { - // Instead of an async fn which borrows all of self, - // we make sure that the returned future only borrows - // client, which allows you to chain calls a little better. - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::<#entry_struct_ident>() { - Ok(hash) => hash, - Err(e) => return Err(e.into()) - } - }; - if runtime_storage_hash == [#(#storage_hash,)*] { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress::<::subxt::metadata::DecodeStaticType<#storage_entry_value_ty>, (), #is_defaultable_type, #is_iterable_type> { + ::subxt::storage::address::StaticStorageAddress::new( + #pallet_name, + #storage_name, + Vec::new(), + [#(#storage_hash,)*] + ) } ) } else { quote!() }; - let key_args_ref = match should_ref { - true => quote!(&'a), - false => quote!(), - }; - let key_args = fields.iter().map(|(field_name, field_type)| { - // The field type is translated from `std::vec::Vec` to `[T]`, if the - // interface should generate a reference. In such cases, the vector ultimately is - // a slice. - let field_ty = match field_type.vec_type_param() { - Some(ty) if should_ref => quote!([#ty]), - _ => quote!(#field_type), - }; - quote!( #field_name: #key_args_ref #field_ty ) - }); - - let client_fns = quote! { + quote! { + // Access a specific value from a storage entry #docs_token pub fn #fn_name( &self, #( #key_args, )* - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result<#return_ty, ::subxt::BasicError> - > + 'a { - // Instead of an async fn which borrows all of self, - // we make sure that the returned future only borrows - // client, which allows you to chain calls a little better. - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::<#entry_struct_ident>() { - Ok(hash) => hash, - Err(e) => return Err(e.into()) - } - }; - if runtime_storage_hash == [#(#storage_hash,)*] { - let entry = #constructor; - client.storage().#fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress::<::subxt::metadata::DecodeStaticType<#storage_entry_value_ty>, ::subxt::storage::address::Yes, #is_defaultable_type, #is_iterable_type> { + ::subxt::storage::address::StaticStorageAddress::new( + #pallet_name, + #storage_name, + #key_impl, + [#(#storage_hash,)*] + ) } - #client_iter_fn - }; - - (storage_entry_type, client_fns) + #root_entry_fn + } } diff --git a/codegen/src/types/derives.rs b/codegen/src/types/derives.rs index e94664c0eb..7ae2a180b9 100644 --- a/codegen/src/types/derives.rs +++ b/codegen/src/types/derives.rs @@ -69,9 +69,9 @@ impl FromIterator for Derives { } impl Derives { - /// Add `::subxt::codec::CompactAs` to the derives. + /// Add `::subxt::ext::codec::CompactAs` to the derives. pub fn insert_codec_compact_as(&mut self) { - self.insert(parse_quote!(::subxt::codec::CompactAs)); + self.insert(parse_quote!(::subxt::ext::codec::CompactAs)); } pub fn append(&mut self, derives: impl Iterator) { @@ -88,8 +88,8 @@ impl Derives { impl Default for Derives { fn default() -> Self { let mut derives = HashSet::new(); - derives.insert(syn::parse_quote!(::subxt::codec::Encode)); - derives.insert(syn::parse_quote!(::subxt::codec::Decode)); + derives.insert(syn::parse_quote!(::subxt::ext::codec::Encode)); + derives.insert(syn::parse_quote!(::subxt::ext::codec::Decode)); derives.insert(syn::parse_quote!(Debug)); Self { derives } } diff --git a/codegen/src/types/tests.rs b/codegen/src/types/tests.rs index 9233a793e4..c789bbab50 100644 --- a/codegen/src/types/tests.rs +++ b/codegen/src/types/tests.rs @@ -53,7 +53,7 @@ fn generate_struct_with_primitives() { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { pub a: ::core::primitive::bool, pub b: ::core::primitive::u32, @@ -99,12 +99,12 @@ fn generate_struct_with_a_struct_field() { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Child { pub a: ::core::primitive::i32, } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Parent { pub a: ::core::primitive::bool, pub b: root::subxt_codegen::types::tests::Child, @@ -144,10 +144,10 @@ fn generate_tuple_struct() { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Child(pub ::core::primitive::i32,); - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Parent(pub ::core::primitive::bool, pub root::subxt_codegen::types::tests::Child,); } } @@ -226,34 +226,34 @@ fn derive_compact_as_for_uint_wrapper_structs() { pub mod tests { use super::root; - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Su128 { pub a: ::core::primitive::u128, } - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Su16 { pub a: ::core::primitive::u16, } - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Su32 { pub a: ::core::primitive::u32, } - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Su64 { pub a: ::core::primitive::u64, } - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Su8 { pub a: ::core::primitive::u8, } - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct TSu128(pub ::core::primitive::u128,); - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct TSu16(pub ::core::primitive::u16,); - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct TSu32(pub ::core::primitive::u32,); - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct TSu64(pub ::core::primitive::u64,); - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct TSu8(pub ::core::primitive::u8,); } } @@ -289,7 +289,7 @@ fn generate_enum() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub enum E { # [codec (index = 0)] A, @@ -347,7 +347,7 @@ fn compact_fields() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub enum E { # [codec (index = 0)] A { @@ -358,12 +358,12 @@ fn compact_fields() { B( #[codec(compact)] ::core::primitive::u32,), } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { #[codec(compact)] pub a: ::core::primitive::u32, } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct TupleStruct(#[codec(compact)] pub ::core::primitive::u32,); } } @@ -397,7 +397,7 @@ fn generate_array_field() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { pub a: [::core::primitive::u8; 32usize], } @@ -434,7 +434,7 @@ fn option_fields() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { pub a: ::core::option::Option<::core::primitive::bool>, pub b: ::core::option::Option<::core::primitive::u32>, @@ -474,7 +474,7 @@ fn box_fields_struct() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { pub a: ::std::boxed::Box<::core::primitive::bool>, pub b: ::std::boxed::Box<::core::primitive::u32>, @@ -514,7 +514,7 @@ fn box_fields_enum() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub enum E { # [codec (index = 0)] A(::std::boxed::Box<::core::primitive::bool>,), @@ -554,7 +554,7 @@ fn range_fields() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { pub a: ::core::ops::Range<::core::primitive::u32>, pub b: ::core::ops::RangeInclusive<::core::primitive::u32>, @@ -598,12 +598,12 @@ fn generics() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Bar { pub b: root::subxt_codegen::types::tests::Foo<::core::primitive::u32>, pub c: root::subxt_codegen::types::tests::Foo<::core::primitive::u8>, } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Foo<_0> { pub a: _0, } @@ -646,12 +646,12 @@ fn generics_nested() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Bar<_0> { pub b: root::subxt_codegen::types::tests::Foo<_0, ::core::primitive::u32>, } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Foo<_0, _1> { pub a: _0, pub b: ::core::option::Option<(_0, _1,)>, @@ -697,10 +697,10 @@ fn generate_bitvec() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct S { - pub lsb: ::subxt::bitvec::vec::BitVec<::core::primitive::u8, root::bitvec::order::Lsb0>, - pub msb: ::subxt::bitvec::vec::BitVec<::core::primitive::u16, root::bitvec::order::Msb0>, + pub lsb: ::subxt::ext::bitvec::vec::BitVec<::core::primitive::u8, root::bitvec::order::Lsb0>, + pub msb: ::subxt::ext::bitvec::vec::BitVec<::core::primitive::u16, root::bitvec::order::Msb0>, } } } @@ -750,12 +750,12 @@ fn generics_with_alias_adds_phantom_data_marker() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::CompactAs, ::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::CompactAs, ::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct NamedFields<_0> { pub b: ::core::primitive::u32, #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0> } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct UnnamedFields<_0, _1> ( pub (::core::primitive::u32, ::core::primitive::u32,), #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)> @@ -818,20 +818,20 @@ fn modules() { pub mod b { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Bar { pub a: root::subxt_codegen::types::tests::m::a::Foo, } } - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Foo; } pub mod c { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct Foo { pub a: root::subxt_codegen::types::tests::m::a::b::Bar, } @@ -868,7 +868,7 @@ fn dont_force_struct_names_camel_case() { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug)] pub struct AB; } } @@ -905,10 +905,10 @@ fn apply_user_defined_derives_for_all_types() { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Clone, Debug, Eq)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Clone, Debug, Eq)] pub struct A(pub root :: subxt_codegen :: types :: tests :: B,); - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Clone, Debug, Eq)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Clone, Debug, Eq)] pub struct B; } } @@ -964,13 +964,13 @@ fn apply_user_defined_derives_for_specific_types() { pub mod tests { use super::root; - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug, Eq)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug, Eq)] pub struct A(pub root :: subxt_codegen :: types :: tests :: B,); - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug, Eq, Hash)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug, Eq, Hash)] pub struct B(pub root :: subxt_codegen :: types :: tests :: C,); - #[derive(::subxt::codec::Decode, ::subxt::codec::Encode, Debug, Eq, Ord, PartialOrd)] + #[derive(::subxt::ext::codec::Decode, ::subxt::ext::codec::Encode, Debug, Eq, Ord, PartialOrd)] pub struct C; } } diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs index c26b21bd6e..646a18ad2c 100644 --- a/codegen/src/types/type_path.rs +++ b/codegen/src/types/type_path.rs @@ -182,7 +182,7 @@ impl TypePathType { let bit_order_type = &self.params[0]; let bit_store_type = &self.params[1]; - let type_path = parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_store_type, #bit_order_type> }; + let type_path = parse_quote! { ::subxt::ext::bitvec::vec::BitVec<#bit_store_type, #bit_order_type> }; syn::Type::Path(type_path) } diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 36934d30cc..7f5ab9d08c 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -19,3 +19,4 @@ futures = "0.3.13" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } hex = "0.4.3" tracing-subscriber = "0.3.11" + diff --git a/examples/examples/balance_transfer.rs b/examples/examples/balance_transfer.rs index cacca2e853..c58361cc95 100644 --- a/examples/examples/balance_transfer.rs +++ b/examples/examples/balance_transfer.rs @@ -2,20 +2,19 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use sp_keyring::AccountKeyring; use subxt::{ - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + tx::PairSigner, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -26,23 +25,20 @@ async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); let signer = PairSigner::new(AccountKeyring::Alice.pair()); - - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); - - // Submit the `transfer` extrinsic from Alice's account to Bob's. let dest = AccountKeyring::Bob.to_account_id().into(); - // Obtain an extrinsic, calling the "transfer" function in - // the "balances" pallet. - let extrinsic = api.tx().balances().transfer(dest, 123_456_789_012_345)?; + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Create a transaction to submit: + let tx = polkadot::tx() + .balances() + .transfer(dest, 123_456_789_012_345); - // Sign and submit the extrinsic, returning its hash. - let tx_hash = extrinsic.sign_and_submit_default(&signer).await?; + // Submit the transaction with default params: + let hash = api.tx().sign_and_submit_default(&tx, &signer).await?; - println!("Balance transfer extrinsic submitted: {}", tx_hash); + println!("Balance transfer extrinsic submitted: {}", hash); Ok(()) } diff --git a/examples/examples/balance_transfer_with_params.rs b/examples/examples/balance_transfer_with_params.rs index 5d5344c0b2..51527ddf2c 100644 --- a/examples/examples/balance_transfer_with_params.rs +++ b/examples/examples/balance_transfer_with_params.rs @@ -2,25 +2,24 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use sp_keyring::AccountKeyring; use subxt::{ - extrinsic::{ + tx::{ Era, + PairSigner, PlainTip, + PolkadotExtrinsicParamsBuilder as Params, }, - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, - PolkadotExtrinsicParamsBuilder as Params, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -33,23 +32,21 @@ async fn main() -> Result<(), Box> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Create a transaction to submit: + let tx = polkadot::tx() + .balances() + .transfer(dest, 123_456_789_012_345); // Configure the transaction tip and era: let tx_params = Params::new() .tip(PlainTip::new(20_000_000_000)) - .era(Era::Immortal, *api.client.genesis()); + .era(Era::Immortal, api.genesis_hash()); - // Send the transaction: - let hash = api - .tx() - .balances() - .transfer(dest, 123_456_789_012_345)? - .sign_and_submit(&signer, tx_params) - .await?; + // submit the transaction: + let hash = api.tx().sign_and_submit(&tx, &signer, tx_params).await?; println!("Balance transfer extrinsic submitted: {}", hash); diff --git a/examples/examples/concurrent_storage_requests.rs b/examples/examples/concurrent_storage_requests.rs index 51f0396310..01dba1e36f 100644 --- a/examples/examples/concurrent_storage_requests.rs +++ b/examples/examples/concurrent_storage_requests.rs @@ -2,12 +2,19 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + use futures::join; use sp_keyring::AccountKeyring; use subxt::{ - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -15,17 +22,18 @@ pub mod polkadot {} #[tokio::main] async fn main() -> Result<(), Box> { - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + let api = OnlineClient::::new().await?; let addr = AccountKeyring::Bob.to_account_id(); + // Construct storage addresses to access: + let staking_bonded = polkadot::storage().staking().bonded(&addr); + let staking_ledger = polkadot::storage().staking().ledger(&addr); + // For storage requests, we can join futures together to // await multiple futures concurrently: - let a_fut = api.storage().staking().bonded(&addr, None); - let b_fut = api.storage().staking().ledger(&addr, None); + let a_fut = api.storage().fetch(&staking_bonded, None); + let b_fut = api.storage().fetch(&staking_ledger, None); let (a, b) = join!(a_fut, b_fut); println!("{a:?}, {b:?}"); diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index a1d89212c4..5b2c00d75c 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -2,21 +2,20 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. -//! -//! E.g. -//! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location -//! polkadot --dev --tmp -//! ``` +//! This example should compile but should aos fail to work, since we've modified the +//! config to not align with a Polkadot node. use sp_keyring::AccountKeyring; use subxt::{ - ClientBuilder, - Config, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + config::{ + Config, + SubstrateConfig, + }, + tx::{ + PairSigner, + SubstrateExtrinsicParams, + }, + OnlineClient, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -33,32 +32,34 @@ impl Config for MyConfig { // polkadot runtime used, so some operations will fail. Normally when using a custom `Config` // impl types MUST match exactly those used in the actual runtime. type Index = u64; - type BlockNumber = ::BlockNumber; - type Hash = ::Hash; - type Hashing = ::Hashing; - type AccountId = ::AccountId; - type Address = ::Address; - type Header = ::Header; - type Signature = ::Signature; - type Extrinsic = ::Extrinsic; + type BlockNumber = ::BlockNumber; + type Hash = ::Hash; + type Hashing = ::Hashing; + type AccountId = ::AccountId; + type Address = ::Address; + type Header = ::Header; + type Signature = ::Signature; + type Extrinsic = ::Extrinsic; + // ExtrinsicParams makes use of the index type, so we need to adjust it + // too to align with our modified index type, above: + type ExtrinsicParams = SubstrateExtrinsicParams; } #[tokio::main] async fn main() -> Result<(), Box> { - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); - let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let hash = api - .tx() + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Create a transaction to submit: + let tx = polkadot::tx() .balances() - .transfer(dest, 10_000)? - .sign_and_submit_default(&signer) - .await?; + .transfer(dest, 123_456_789_012_345); + + // submit the transaction with default params: + let hash = api.tx().sign_and_submit_default(&tx, &signer).await?; println!("Balance transfer extrinsic submitted: {}", hash); diff --git a/examples/examples/custom_type_derives.rs b/examples/examples/custom_type_derives.rs index e972ad7a88..ac73aed6c7 100644 --- a/examples/examples/custom_type_derives.rs +++ b/examples/examples/custom_type_derives.rs @@ -2,8 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. - +//! Example verified against polkadot polkadot 0.9.25-5174e9ae75b. #![allow(clippy::redundant_clone)] #[subxt::subxt( diff --git a/examples/examples/dynamic_queries.rs b/examples/examples/dynamic_queries.rs new file mode 100644 index 0000000000..45392135b6 --- /dev/null +++ b/examples/examples/dynamic_queries.rs @@ -0,0 +1,82 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +// This example showcases working with dynamic values rather than those that are generated via the subxt proc macro. + +use sp_keyring::AccountKeyring; +use subxt::{ + dynamic::Value, + tx::PairSigner, + OnlineClient, + PolkadotConfig, +}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let api = OnlineClient::::new().await?; + + // 1. Dynamic Balance Transfer (the dynamic equivalent to the balance_transfer example). + + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let dest = AccountKeyring::Bob.to_account_id(); + + // Create a transaction to submit: + let tx = subxt::dynamic::tx( + "Balances", + "transfer", + vec![ + // A value representing a MultiAddress. We want the "Id" variant, and that + // will ultimately contain the bytes for our destination address (there is a new type wrapping + // the address, but our encoding will happily ignore such things and do it's best to line up what + // we provide with what it needs). + Value::unnamed_variant("Id", [Value::from_bytes(&dest)]), + // A value representing the amount we'd like to transfer. + Value::u128(123_456_789_012_345), + ], + ); + + // submit the transaction with default params: + let hash = api.tx().sign_and_submit_default(&tx, &signer).await?; + println!("Balance transfer extrinsic submitted: {}", hash); + + // 2. Dynamic constant access (the dynamic equivalent to the fetch_constants example). + + let constant_address = subxt::dynamic::constant("Balances", "ExistentialDeposit"); + let existential_deposit = api.constants().at(&constant_address)?; + println!("Existential Deposit: {}", existential_deposit); + + // 3. Dynamic storage access + + let storage_address = subxt::dynamic::storage( + "System", + "Account", + vec![ + // Something that encodes to an AccountId32 is what we need for the map key here: + Value::from_bytes(&dest), + ], + ); + let account = api + .storage() + .fetch_or_default(&storage_address, None) + .await?; + println!("Bob's account details: {account}"); + + // 4. Dynamic storage iteration (the dynamic equivalent to the fetch_all_accounts example). + + let storage_address = subxt::dynamic::storage_root("System", "Account"); + let mut iter = api.storage().iter(storage_address, 10, None).await?; + while let Some((key, account)) = iter.next().await? { + println!("{}: {}", hex::encode(key), account); + } + + Ok(()) +} diff --git a/examples/examples/fetch_all_accounts.rs b/examples/examples/fetch_all_accounts.rs index cc3298d8cf..a34af6d63d 100644 --- a/examples/examples/fetch_all_accounts.rs +++ b/examples/examples/fetch_all_accounts.rs @@ -2,18 +2,17 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use subxt::{ - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -23,12 +22,11 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + let api = OnlineClient::::new().await?; - let mut iter = api.storage().system().account_iter(None).await?; + let address = polkadot::storage().system().account_root(); + + let mut iter = api.storage().iter(address, 10, None).await?; while let Some((key, account)) = iter.next().await? { println!("{}: {}", hex::encode(key), account.data.free); diff --git a/examples/examples/fetch_constants.rs b/examples/examples/fetch_constants.rs index 6066b9628f..6868ed2d5a 100644 --- a/examples/examples/fetch_constants.rs +++ b/examples/examples/fetch_constants.rs @@ -2,18 +2,17 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use subxt::{ - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; // Generate the API from a static metadata path. @@ -24,22 +23,14 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - // Upon connecting to the target polkadot node, the node's metadata is downloaded (referred to - // as the runtime metadata). - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); - - // Constants are queried from the node's runtime metadata. - // Query the `ExistentialDeposit` constant from the `Balances` pallet. - let existential_deposit = api - // This is the constants query. - .constants() - // Constant from the `Balances` pallet. - .balances() - // Constant name. - .existential_deposit()?; + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Build a constant address to query: + let address = polkadot::constants().balances().existential_deposit(); + + // Look it up: + let existential_deposit = api.constants().at(&address)?; println!("Existential Deposit: {}", existential_deposit); diff --git a/examples/examples/fetch_staking_details.rs b/examples/examples/fetch_staking_details.rs index f487807ef0..5dfde2c81d 100644 --- a/examples/examples/fetch_staking_details.rs +++ b/examples/examples/fetch_staking_details.rs @@ -2,24 +2,25 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use sp_keyring::AccountKeyring; use subxt::{ - sp_core::{ - sr25519, - Pair, + ext::{ + sp_core::{ + sr25519, + Pair, + }, + sp_runtime::AccountId32, }, - sp_runtime::AccountId32, - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -29,12 +30,11 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + // Create a client to use: + let api = OnlineClient::::new().await?; - let era = api.storage().staking().active_era(None).await?.unwrap(); + let active_era_addr = polkadot::storage().staking().active_era(); + let era = api.storage().fetch(&active_era_addr, None).await?.unwrap(); println!( "Staking active era: index: {:?}, start: {:?}", era.index, era.start @@ -51,19 +51,16 @@ async fn main() -> Result<(), Box> { println!(" Alice//stash account id: {:?}", alice_stash_id); // Map from all locked "stash" accounts to the controller account. + let controller_acc_addr = polkadot::storage().staking().bonded(&alice_stash_id); let controller_acc = api .storage() - .staking() - .bonded(&alice_stash_id, None) + .fetch(&controller_acc_addr, None) .await? .unwrap(); println!(" account controlled by: {:?}", controller_acc); - let era_result = api - .storage() - .staking() - .eras_reward_points(&era.index, None) - .await?; + let era_reward_addr = polkadot::storage().staking().eras_reward_points(&era.index); + let era_result = api.storage().fetch(&era_reward_addr, None).await?; println!("Era reward points: {:?}", era_result); Ok(()) diff --git a/examples/examples/metadata_compatibility.rs b/examples/examples/metadata_compatibility.rs index b006215fb7..96b35412ea 100644 --- a/examples/examples/metadata_compatibility.rs +++ b/examples/examples/metadata_compatibility.rs @@ -2,18 +2,17 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use subxt::{ - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -23,18 +22,15 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + let api = OnlineClient::::new().await?; - // Full metadata validation is not enabled by default; instead, the individual calls, - // storage requests and constant accesses are runtime type checked against the node - // metadata to ensure that they are compatible with the generated code. - // - // To make sure that all of our statically generated pallets are compatible with the - // runtime node, we can run this check: - api.validate_metadata()?; + // Each individual request will be validated against the static code that was + // used to construct it, if possible. We can also validate the entirety of the + // statically generated code against some client at a given point in time using + // this check. If it fails, then there is some breaking change between the metadata + // used to generate this static code, and the runtime metadata from a node that the + // client is using. + polkadot::validate_codegen(&api)?; Ok(()) } diff --git a/examples/examples/rpc_call.rs b/examples/examples/rpc_call.rs index 4306fd5502..25464b869a 100644 --- a/examples/examples/rpc_call.rs +++ b/examples/examples/rpc_call.rs @@ -2,40 +2,28 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use subxt::{ - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -pub mod polkadot {} - #[tokio::main] async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .set_url("wss://rpc.polkadot.io:443") - .build() - .await? - .to_runtime_api::>>(); + let api = OnlineClient::::new().await?; let block_number = 1u32; - let block_hash = api - .client - .rpc() - .block_hash(Some(block_number.into())) - .await?; + let block_hash = api.rpc().block_hash(Some(block_number.into())).await?; if let Some(hash) = block_hash { println!("Block hash for block number {block_number}: {hash}"); diff --git a/examples/examples/rpc_call_subscribe_blocks.rs b/examples/examples/rpc_call_subscribe_blocks.rs index e0dfce057e..a39af4fea2 100644 --- a/examples/examples/rpc_call_subscribe_blocks.rs +++ b/examples/examples/rpc_call_subscribe_blocks.rs @@ -2,41 +2,34 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.13/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use subxt::{ - rpc::Subscription, - sp_runtime::{ + ext::sp_runtime::{ generic::Header, traits::BlakeTwo256, }, - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, + rpc::Subscription, + OnlineClient, + PolkadotConfig, }; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -pub mod polkadot {} - #[tokio::main] async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .set_url("wss://rpc.polkadot.io:443") - .build() - .await? - .to_runtime_api::>>(); + let api = + OnlineClient::::from_url("wss://rpc.polkadot.io:443").await?; // For non-finalised blocks use `.subscribe_blocks()` let mut blocks: Subscription> = - api.client.rpc().subscribe_finalized_blocks().await?; + api.rpc().subscribe_finalized_blocks().await?; while let Some(Ok(block)) = blocks.next().await { println!( diff --git a/examples/examples/storage_iterating.rs b/examples/examples/storage_iterating.rs new file mode 100644 index 0000000000..6f5ec30c3e --- /dev/null +++ b/examples/examples/storage_iterating.rs @@ -0,0 +1,107 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +use codec::Decode; +use subxt::{ + storage::address::{ + StorageHasher, + StorageMapKey, + }, + OnlineClient, + PolkadotConfig, +}; + +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +pub mod polkadot {} + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Example 1. Iterate over (keys, value) using the storage client. + // This is the standard and most ergonomic approach. + { + let key_addr = polkadot::storage().xcm_pallet().version_notifiers_root(); + + let mut iter = api.storage().iter(key_addr, 10, None).await?; + + println!("\nExample 1. Obtained keys:"); + while let Some((key, value)) = iter.next().await? { + println!("Key: 0x{}", hex::encode(&key)); + println!(" Value: {}", value); + } + } + + // Example 2. Iterate over fetched keys manually. Here, you forgo any static type + // safety and work directly with the bytes on either side. + { + let key_addr = polkadot::storage().xcm_pallet().version_notifiers_root(); + + // Fetch at most 10 keys from below the prefix XcmPallet' VersionNotifiers. + let keys = api + .storage() + .fetch_keys(&key_addr.to_root_bytes(), 10, None, None) + .await?; + + println!("Example 2. Obtained keys:"); + for key in keys.iter() { + println!("Key: 0x{}", hex::encode(&key)); + + if let Some(storage_data) = api.storage().fetch_raw(&key.0, None).await? { + // We know the return value to be `QueryId` (`u64`) from inspecting either: + // - polkadot code + // - polkadot.rs generated file under `version_notifiers()` fn + // - metadata in json format + let value = u64::decode(&mut &*storage_data)?; + println!(" Value: {}", value); + } + } + } + + // Example 3. Custom iteration over double maps. Here, we manually append one lookup + // key to the root and just iterate over the values underneath that. + { + let key_addr = polkadot::storage().xcm_pallet().version_notifiers_root(); + + // Obtain the root bytes (`twox_128("XcmPallet") ++ twox_128("VersionNotifiers")`). + let mut query_key = key_addr.to_root_bytes(); + + // We know that the first key is a u32 (the `XcmVersion`) and is hashed by twox64_concat. + // We can build a `StorageMapKey` that replicates that, and append those bytes to the above. + StorageMapKey::new(&2u32, StorageHasher::Twox64Concat).to_bytes(&mut query_key); + + // The final query key is essentially the result of: + // `twox_128("XcmPallet") ++ twox_128("VersionNotifiers") ++ twox_64(2u32) ++ 2u32` + println!("\nExample 3\nQuery key: 0x{}", hex::encode(&query_key)); + + let keys = api.storage().fetch_keys(&query_key, 10, None, None).await?; + + println!("Obtained keys:"); + for key in keys.iter() { + println!("Key: 0x{}", hex::encode(&key)); + + if let Some(storage_data) = api.storage().fetch_raw(&key.0, None).await? { + // We know the return value to be `QueryId` (`u64`) from inspecting either: + // - polkadot code + // - polkadot.rs generated file under `version_notifiers()` fn + // - metadata in json format + let value = u64::decode(&mut &storage_data[..])?; + println!(" Value: {}", value); + } + } + } + + Ok(()) +} diff --git a/examples/examples/storage_query.rs b/examples/examples/storage_query.rs deleted file mode 100644 index a387432258..0000000000 --- a/examples/examples/storage_query.rs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. -//! -//! E.g. -//! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location -//! polkadot --dev --tmp -//! ``` - -use codec::Decode; -use subxt::{ - rpc::Rpc, - storage::{ - StorageClient, - StorageKeyPrefix, - }, - ClientBuilder, - DefaultConfig, - PolkadotExtrinsicParams, - StorageEntryKey, - StorageMapKey, -}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); - - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); - - // Obtain the storage client wrapper from the API. - let storage: StorageClient<_> = api.client.storage(); - - // The VersionNotifiers type of the XcmPallet is defined as: - // - // ``` - // All locations that we have requested version notifications from. - // #[pallet::storage] - // pub(super) type VersionNotifiers = StorageDoubleMap< - // _, - // Twox64Concat, - // XcmVersion, - // Blake2_128Concat, - // VersionedMultiLocation, - // QueryId, - // OptionQuery, - // >; - // ``` - - // Example 1. Iterate over fetched keys manually. - { - // Fetch at most 10 keys from below the prefix XcmPallet' VersionNotifiers. - let keys = storage - .fetch_keys::(10, None, None) - .await?; - - println!("Example 1. Obtained keys:"); - for key in keys.iter() { - println!("Key: 0x{}", hex::encode(&key)); - - if let Some(storage_data) = storage.fetch_raw(key.clone(), None).await? { - // We know the return value to be `QueryId` (`u64`) from inspecting either: - // - polkadot code - // - polkadot.rs generated file under `version_notifiers()` fn - // - metadata in json format - let value = u64::decode(&mut &storage_data.0[..])?; - println!(" Value: {}", value); - } - } - } - - // Example 2. Iterate over (keys, value) using the storage client. - { - let mut iter = storage - .iter::(None) - .await?; - - println!("\nExample 2. Obtained keys:"); - while let Some((key, value)) = iter.next().await? { - println!("Key: 0x{}", hex::encode(&key)); - println!(" Value: {}", value); - } - } - - // Example 3. Iterate over (keys, value) using the polkadot API. - { - let mut iter = api - .storage() - .xcm_pallet() - .version_notifiers_iter(None) - .await?; - - println!("\nExample 3. Obtained keys:"); - while let Some((key, value)) = iter.next().await? { - println!("Key: 0x{}", hex::encode(&key)); - println!(" Value: {}", value); - } - } - - // Example 4. Custom iteration over double maps. - { - // Obtain the inner RPC from the API. - let rpc: &Rpc<_> = api.client.rpc(); - - // Obtain the prefixed `twox_128("XcmPallet") ++ twox_128("VersionNotifiers")` - let prefix = - StorageKeyPrefix::new::(); - // From the VersionNotifiers definition above, the first key is represented by - // ``` - // Twox64Concat, - // XcmVersion, - // ``` - // while `XcmVersion` is `u32`. - // Pass `2` as `XcmVersion` and concatenate the key to the prefix. - let entry_key = StorageEntryKey::Map(vec![StorageMapKey::new( - &2u32, - ::subxt::StorageHasher::Twox64Concat, - )]); - - // The final query key is: - // `twox_128("XcmPallet") ++ twox_128("VersionNotifiers") ++ twox_64(2u32) ++ 2u32` - let query_key = entry_key.final_key(prefix); - println!("\nExample 4\nQuery key: 0x{}", hex::encode(&query_key)); - - let keys = rpc - .storage_keys_paged(Some(query_key), 10, None, None) - .await?; - - println!("Obtained keys:"); - for key in keys.iter() { - println!("Key: 0x{}", hex::encode(&key)); - - if let Some(storage_data) = storage.fetch_raw(key.clone(), None).await? { - // We know the return value to be `QueryId` (`u64`) from inspecting either: - // - polkadot code - // - polkadot.rs generated file under `version_notifiers()` fn - // - metadata in json format - let value = u64::decode(&mut &storage_data.0[..])?; - println!(" Value: {}", value); - } - } - } - - Ok(()) -} diff --git a/examples/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs index deebc167d5..ae6ff29161 100644 --- a/examples/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -2,21 +2,20 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` use futures::StreamExt; use sp_keyring::AccountKeyring; use subxt::{ - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + tx::PairSigner, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -40,16 +39,13 @@ async fn simple_transfer() -> Result<(), Box> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + let api = OnlineClient::::new().await?; + + let balance_transfer_tx = polkadot::tx().balances().transfer(dest, 10_000); let balance_transfer = api .tx() - .balances() - .transfer(dest, 10_000)? - .sign_and_submit_then_watch_default(&signer) + .sign_and_submit_then_watch_default(&balance_transfer_tx, &signer) .await? .wait_for_finalized_success() .await?; @@ -72,16 +68,13 @@ async fn simple_transfer_separate_events() -> Result<(), Box>>(); + let api = OnlineClient::::new().await?; + + let balance_transfer_tx = polkadot::tx().balances().transfer(dest, 10_000); let balance_transfer = api .tx() - .balances() - .transfer(dest, 10_000)? - .sign_and_submit_then_watch_default(&signer) + .sign_and_submit_then_watch_default(&balance_transfer_tx, &signer) .await? .wait_for_finalized() .await?; @@ -123,21 +116,18 @@ async fn handle_transfer_events() -> Result<(), Box> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + let api = OnlineClient::::new().await?; + + let balance_transfer_tx = polkadot::tx().balances().transfer(dest, 10_000); let mut balance_transfer_progress = api .tx() - .balances() - .transfer(dest, 10_000)? - .sign_and_submit_then_watch_default(&signer) + .sign_and_submit_then_watch_default(&balance_transfer_tx, &signer) .await?; while let Some(ev) = balance_transfer_progress.next().await { let ev = ev?; - use subxt::TransactionStatus::*; + use subxt::tx::TxStatus::*; // Made it into a block, but not finalized. if let InBlock(details) = ev { diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index eed6ae7037..dcdffa2717 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -2,11 +2,11 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` @@ -14,10 +14,9 @@ use futures::StreamExt; use sp_keyring::AccountKeyring; use std::time::Duration; use subxt::{ - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + tx::PairSigner, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -29,41 +28,33 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + // Create a client to use: + let api = OnlineClient::::new().await?; // Subscribe to any events that occur: let mut event_sub = api.events().subscribe().await?; // While this subscription is active, balance transfers are made somewhere: - tokio::task::spawn(async { - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let api = - ClientBuilder::new() - .build() - .await - .unwrap() - .to_runtime_api::, - >>(); - - let mut transfer_amount = 1_000_000_000; - - // Make small balance transfers from Alice to Bob in a loop: - loop { - api.tx() - .balances() - .transfer(AccountKeyring::Bob.to_account_id().into(), transfer_amount) - .expect("compatible transfer call on runtime node") - .sign_and_submit_default(&signer) - .await - .unwrap(); - - tokio::time::sleep(Duration::from_secs(10)).await; - transfer_amount += 100_000_000; + tokio::task::spawn({ + let api = api.clone(); + async move { + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let mut transfer_amount = 1_000_000_000; + + // Make small balance transfers from Alice to Bob in a loop: + loop { + let transfer_tx = polkadot::tx().balances().transfer( + AccountKeyring::Bob.to_account_id().into(), + transfer_amount, + ); + api.tx() + .sign_and_submit_default(&transfer_tx, &signer) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_secs(10)).await; + transfer_amount += 100_000_000; + } } }); @@ -72,29 +63,21 @@ async fn main() -> Result<(), Box> { let events = events?; let block_hash = events.block_hash(); - // We can iterate, statically decoding all events if we want: - println!("All events in block {block_hash:?}:"); - println!(" Static event details:"); - for event in events.iter() { - let event = event?; - println!(" {event:?}"); - } - - // Or we can dynamically decode events: + // We can dynamically decode events: println!(" Dynamic event details: {block_hash:?}:"); - for event in events.iter_raw() { + for event in events.iter() { let event = event?; let is_balance_transfer = event .as_event::()? .is_some(); - let pallet = event.pallet; - let variant = event.variant; + let pallet = event.pallet_name(); + let variant = event.variant_name(); println!( " {pallet}::{variant} (is balance transfer? {is_balance_transfer})" ); } - // Or we can dynamically find the first transfer event, ignoring any others: + // Or we can find the first transfer event, ignoring any others: let transfer_event = events.find_first::()?; diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index 06d641a9a8..10d29fd36f 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -2,11 +2,11 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` @@ -14,10 +14,9 @@ use futures::StreamExt; use sp_keyring::AccountKeyring; use std::time::Duration; use subxt::{ - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + tx::PairSigner, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -29,11 +28,8 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - // Subscribe to any events that occur: - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + // Create a client to use: + let api = OnlineClient::::new().await?; // Subscribe to just balance transfer events, making use of `filter_events` // to select a single event type (note the 1-tuple) to filter out and return. @@ -43,29 +39,27 @@ async fn main() -> Result<(), Box> { .await? .filter_events::<(polkadot::balances::events::Transfer,)>(); - // While this subscription is active, we imagine some balance transfers are made somewhere else: - tokio::task::spawn(async { - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let api = - ClientBuilder::new() - .build() - .await - .unwrap() - .to_runtime_api::, - >>(); + // While this subscription is active, balance transfers are made somewhere: + tokio::task::spawn({ + let api = api.clone(); + async move { + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let mut transfer_amount = 1_000_000_000; + + // Make small balance transfers from Alice to Bob in a loop: + loop { + let transfer_tx = polkadot::tx().balances().transfer( + AccountKeyring::Bob.to_account_id().into(), + transfer_amount, + ); + api.tx() + .sign_and_submit_default(&transfer_tx, &signer) + .await + .unwrap(); - // Make small balance transfers from Alice to Bob in a loop: - loop { - api.tx() - .balances() - .transfer(AccountKeyring::Bob.to_account_id().into(), 1_000_000_000) - .expect("compatible transfer call on runtime node") - .sign_and_submit_default(&signer) - .await - .unwrap(); - tokio::time::sleep(Duration::from_secs(10)).await; + tokio::time::sleep(Duration::from_secs(10)).await; + transfer_amount += 100_000_000; + } } }); diff --git a/examples/examples/subscribe_runtime_updates.rs b/examples/examples/subscribe_runtime_updates.rs index 85ed51a7e1..af77ce9bee 100644 --- a/examples/examples/subscribe_runtime_updates.rs +++ b/examples/examples/subscribe_runtime_updates.rs @@ -2,67 +2,38 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` -use sp_keyring::AccountKeyring; use std::time::Duration; use subxt::{ - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + OnlineClient, + PolkadotConfig, }; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -pub mod polkadot {} - #[tokio::main] async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + // Create a client to use: + let api = OnlineClient::::new().await?; // Start a new tokio task to perform the runtime updates while // utilizing the API for other use cases. - let update_client = api.client.updates(); + let update_client = api.subscribe_to_updates(); tokio::spawn(async move { let result = update_client.perform_runtime_updates().await; println!("Runtime update failed with result={:?}", result); }); - // Make multiple transfers to simulate a long running `subxt::Client` use-case. - // - // Meanwhile, the tokio task above will perform any necessary updates to keep in sync - // with the node we've connected to. Transactions submitted in the vicinity of a runtime - // update may still fail, however, owing to a race between the update happening and - // subxt synchronising its internal state with it. - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - // Make small balance transfers from Alice to Bob: - for _ in 0..10 { - let hash = api - .tx() - .balances() - .transfer( - AccountKeyring::Bob.to_account_id().into(), - 123_456_789_012_345, - ) - .unwrap() - .sign_and_submit_default(&signer) - .await - .unwrap(); - - println!("Balance transfer extrinsic submitted: {}", hash); - tokio::time::sleep(Duration::from_secs(30)).await; - } + // If this client is kept in use a while, it'll update its metadata and such + // as needed when the node it's pointed at updates. + tokio::time::sleep(Duration::from_secs(10_000)).await; Ok(()) } diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index 6dbe01d727..4fa7819c05 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -2,11 +2,11 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-4542a603cc-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot polkadot 0.9.25-5174e9ae75b. //! //! E.g. //! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.25/polkadot" --output /usr/local/bin/polkadot --location //! polkadot --dev --tmp //! ``` @@ -14,10 +14,9 @@ use futures::StreamExt; use sp_keyring::AccountKeyring; use std::time::Duration; use subxt::{ - ClientBuilder, - DefaultConfig, - PairSigner, - PolkadotExtrinsicParams, + tx::PairSigner, + OnlineClient, + PolkadotConfig, }; #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] @@ -29,11 +28,8 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); - // Subscribe to any events that occur: - let api = ClientBuilder::new() - .build() - .await? - .to_runtime_api::>>(); + // Create a client to use: + let api = OnlineClient::::new().await?; // Subscribe to several balance related events. If we ask for more than one event, // we'll be given a correpsonding tuple of `Option`'s, with exactly one @@ -44,29 +40,27 @@ async fn main() -> Result<(), Box> { polkadot::balances::events::Deposit, )>(); - // While this subscription is active, we imagine some balance transfers are made somewhere else: - tokio::task::spawn(async { - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let api = - ClientBuilder::new() - .build() - .await - .unwrap() - .to_runtime_api::, - >>(); + // While this subscription is active, balance transfers are made somewhere: + tokio::task::spawn({ + let api = api.clone(); + async move { + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let mut transfer_amount = 1_000_000_000; - // Make small balance transfers from Alice to Bob in a loop: - loop { - api.tx() - .balances() - .transfer(AccountKeyring::Bob.to_account_id().into(), 1_000_000_000) - .expect("compatible transfer call on runtime node") - .sign_and_submit_default(&signer) - .await - .unwrap(); - tokio::time::sleep(Duration::from_secs(10)).await; + // Make small balance transfers from Alice to Bob in a loop: + loop { + let transfer_tx = polkadot::tx().balances().transfer( + AccountKeyring::Bob.to_account_id().into(), + transfer_amount, + ); + api.tx() + .sign_and_submit_default(&transfer_tx, &signer) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_secs(10)).await; + transfer_amount += 100_000_000; + } } }); diff --git a/integration-tests/src/client/mod.rs b/integration-tests/src/client/mod.rs deleted file mode 100644 index 52d1e0650d..0000000000 --- a/integration-tests/src/client/mod.rs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - test_node_process, - test_node_process_with, - utils::{ - node_runtime::system, - pair_signer, - test_context, - }, -}; - -use sp_core::{ - sr25519::Pair, - storage::{ - well_known_keys, - StorageKey, - }, - Pair as _, -}; -use sp_keyring::AccountKeyring; -use sp_runtime::DispatchOutcome; -use subxt::Error; - -#[tokio::test] -async fn insert_key() { - let test_node_process = test_node_process_with(AccountKeyring::Bob).await; - let client = test_node_process.client(); - let public = AccountKeyring::Alice.public().as_array_ref().to_vec(); - client - .rpc() - .insert_key( - "aura".to_string(), - "//Alice".to_string(), - public.clone().into(), - ) - .await - .unwrap(); - assert!(client - .rpc() - .has_key(public.clone().into(), "aura".to_string()) - .await - .unwrap()); -} - -#[tokio::test] -async fn fetch_block_hash() { - let node_process = test_node_process().await; - node_process.client().rpc().block_hash(None).await.unwrap(); -} - -#[tokio::test] -async fn fetch_block() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client.rpc().block(block_hash).await.unwrap(); -} - -#[tokio::test] -async fn fetch_read_proof() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client - .rpc() - .read_proof( - vec![ - StorageKey(well_known_keys::HEAP_PAGES.to_vec()), - StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), - ], - block_hash, - ) - .await - .unwrap(); -} - -#[tokio::test] -async fn chain_subscribe_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_blocks().await.unwrap(); - blocks.next().await.unwrap().unwrap(); -} - -#[tokio::test] -async fn chain_subscribe_finalized_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_finalized_blocks().await.unwrap(); - blocks.next().await.unwrap().unwrap(); -} - -#[tokio::test] -async fn fetch_keys() { - let node_process = test_node_process().await; - let client = node_process.client(); - let keys = client - .storage() - .fetch_keys::(4, None, None) - .await - .unwrap(); - assert_eq!(keys.len(), 4) -} - -#[tokio::test] -async fn test_iter() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut iter = client - .storage() - .iter::(None) - .await - .unwrap(); - let mut i = 0; - while iter.next().await.unwrap().is_some() { - i += 1; - } - assert_eq!(i, 13); -} - -#[tokio::test] -async fn fetch_system_info() { - let node_process = test_node_process().await; - let client = node_process.client(); - assert_eq!(client.rpc().system_chain().await.unwrap(), "Development"); - assert_eq!(client.rpc().system_name().await.unwrap(), "Substrate Node"); - assert!(!client.rpc().system_version().await.unwrap().is_empty()); -} - -#[tokio::test] -async fn dry_run_passes() { - let node_process = test_node_process().await; - let client = node_process.client(); - - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = pair_signer(AccountKeyring::Bob.pair()); - let bob_address = bob.account_id().clone().into(); - let cxt = test_context().await; - let api = &cxt.api; - let signed_extrinsic = api - .tx() - .balances() - .transfer(bob_address, 10_000) - .unwrap() - .create_signed(&alice, Default::default()) - .await - .unwrap(); - - client - .rpc() - .dry_run(signed_extrinsic.encoded(), None) - .await - .expect("dryrunning failed") - .expect("expected dryrunning to be successful") - .unwrap(); - signed_extrinsic - .submit_and_watch() - .await - .unwrap() - .wait_for_finalized_success() - .await - .unwrap(); -} - -#[tokio::test] -async fn dry_run_fails() { - let node_process = test_node_process().await; - let client = node_process.client(); - - let alice = pair_signer(AccountKeyring::Alice.pair()); - let hans = pair_signer(Pair::generate().0); - let hans_address = hans.account_id().clone().into(); - let cxt = test_context().await; - let api = &cxt.api; - let signed_extrinsic = api - .tx() - .balances() - .transfer( - hans_address, - 100_000_000_000_000_000_000_000_000_000_000_000, - ) - .unwrap() - .create_signed(&alice, Default::default()) - .await - .unwrap(); - - let dry_run_res: DispatchOutcome = client - .rpc() - .dry_run(signed_extrinsic.encoded(), None) - .await - .expect("dryrunning failed") - .expect("expected dryrun transaction to be valid"); - if let Err(sp_runtime::DispatchError::Module(module_error)) = dry_run_res { - assert_eq!(module_error.index, 6); - assert_eq!(module_error.error, 2); - } else { - panic!("expected a module error when dryrunning"); - } - let res = signed_extrinsic - .submit_and_watch() - .await - .unwrap() - .wait_for_finalized_success() - .await; - if let Err(Error::Module(err)) = res { - assert_eq!(err.pallet, "Balances"); - assert_eq!(err.error, "InsufficientBalance"); - } else { - panic!("expected a runtime module error"); - } -} diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 132cb44f66..f56b67e12a 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -22,7 +22,7 @@ integration-tests = [] bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } scale-info = { version = "2.0.0", features = ["bit-vec"] } -scale-value = "0.2.0" +scale-value = "0.4.0" futures = "0.3.13" hex = "0.4.3" jsonrpsee = { version = "0.14.0", features = ["async-client", "client-ws-transport"] } @@ -42,4 +42,4 @@ frame-metadata = "15.0.0" derivative = "2.2.0" [dev-dependencies] -tokio = { version = "1.8", features = ["macros", "time"] } +tokio = { version = "1.8", features = ["macros", "time", "rt-multi-thread"] } diff --git a/subxt/src/client.rs b/subxt/src/client.rs deleted file mode 100644 index 674a612f1f..0000000000 --- a/subxt/src/client.rs +++ /dev/null @@ -1,503 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use futures::future; -pub use sp_runtime::traits::SignedExtension; -use sp_runtime::{ - traits::Hash, - ApplyExtrinsicResult, -}; - -use crate::{ - error::{ - BasicError, - HasModuleError, - }, - extrinsic::{ - ExtrinsicParams, - Signer, - }, - rpc::{ - Rpc, - RpcClient, - RuntimeVersion, - SystemProperties, - }, - storage::StorageClient, - transaction::TransactionProgress, - updates::UpdateClient, - Call, - Config, - Encoded, - Metadata, -}; -use codec::{ - Compact, - Decode, - Encode, -}; -use derivative::Derivative; -use parking_lot::RwLock; -use std::sync::Arc; - -/// ClientBuilder for constructing a Client. -#[derive(Default)] -pub struct ClientBuilder { - url: Option, - client: Option, - metadata: Option, - page_size: Option, -} - -impl ClientBuilder { - /// Creates a new ClientBuilder. - pub fn new() -> Self { - Self { - url: None, - client: None, - metadata: None, - page_size: None, - } - } - - /// Sets the jsonrpsee client. - pub fn set_client>(mut self, client: C) -> Self { - self.client = Some(client.into()); - self - } - - /// Set the substrate rpc address. - pub fn set_url>(mut self, url: P) -> Self { - self.url = Some(url.into()); - self - } - - /// Set the page size. - pub fn set_page_size(mut self, size: u32) -> Self { - self.page_size = Some(size); - self - } - - /// Set the metadata. - /// - /// *Note:* Metadata will no longer be downloaded from the runtime node. - #[cfg(feature = "integration-tests")] - pub fn set_metadata(mut self, metadata: Metadata) -> Self { - self.metadata = Some(metadata); - self - } - - /// Builder for [Client]. - /// - /// # Examples - /// - /// ```no_run - /// use subxt::{ClientBuilder, DefaultConfig}; - /// - /// #[tokio::main] - /// async fn main() { - /// // Build the client. - /// let client = ClientBuilder::new() - /// .set_url("wss://rpc.polkadot.io:443") - /// .build::() - /// .await - /// .unwrap(); - /// // Use the client... - /// } - /// ``` - pub async fn build(self) -> Result, BasicError> { - let client = if let Some(client) = self.client { - client - } else { - let url = self.url.as_deref().unwrap_or("ws://127.0.0.1:9944"); - crate::rpc::ws_client(url).await? - }; - let rpc = Rpc::new(client); - let (genesis_hash, runtime_version, properties) = future::join3( - rpc.genesis_hash(), - rpc.runtime_version(None), - rpc.system_properties(), - ) - .await; - - let metadata = if let Some(metadata) = self.metadata { - metadata - } else { - rpc.metadata().await? - }; - - Ok(Client { - rpc, - genesis_hash: genesis_hash?, - metadata: Arc::new(RwLock::new(metadata)), - properties: properties.unwrap_or_else(|_| Default::default()), - runtime_version: Arc::new(RwLock::new(runtime_version?)), - iter_page_size: self.page_size.unwrap_or(10), - }) - } -} - -/// Client to interface with a substrate node. -#[derive(Derivative)] -#[derivative(Clone(bound = ""))] -pub struct Client { - rpc: Rpc, - genesis_hash: T::Hash, - metadata: Arc>, - properties: SystemProperties, - runtime_version: Arc>, - iter_page_size: u32, -} - -impl std::fmt::Debug for Client { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("Client") - .field("rpc", &"") - .field("genesis_hash", &self.genesis_hash) - .field("metadata", &"") - .field("events_decoder", &"") - .field("properties", &self.properties) - .field("runtime_version", &self.runtime_version) - .field("iter_page_size", &self.iter_page_size) - .finish() - } -} - -impl Client { - /// Returns the genesis hash. - pub fn genesis(&self) -> &T::Hash { - &self.genesis_hash - } - - /// Returns the chain metadata. - pub fn metadata(&self) -> Arc> { - Arc::clone(&self.metadata) - } - - /// Returns the properties defined in the chain spec as a JSON object. - /// - /// # Note - /// - /// Many chains use this to define common properties such as `token_decimals` and `token_symbol` - /// required for UIs, but this is merely a convention. It is up to the library user to - /// deserialize the JSON into the appropriate type or otherwise extract the properties defined - /// in the target chain's spec. - pub fn properties(&self) -> &SystemProperties { - &self.properties - } - - /// Returns the rpc client. - pub fn rpc(&self) -> &Rpc { - &self.rpc - } - - /// Create a client for accessing runtime storage - pub fn storage(&self) -> StorageClient { - StorageClient::new(&self.rpc, self.metadata(), self.iter_page_size) - } - - /// Create a wrapper for performing runtime updates on this client. - /// - /// # Note - /// - /// The update client is intended to be used in the background for - /// performing runtime updates, while the API is still in use. - /// Without performing runtime updates the submitted extrinsics may fail. - /// - /// # Examples - /// - /// ```no_run - /// # use subxt::{ClientBuilder, DefaultConfig}; - /// # - /// # #[tokio::main] - /// # async fn main() { - /// # let client = ClientBuilder::new() - /// # .set_url("wss://rpc.polkadot.io:443") - /// # .build::() - /// # .await - /// # .unwrap(); - /// # - /// let update_client = client.updates(); - /// // Spawn a new background task to handle runtime updates. - /// tokio::spawn(async move { - /// let result = update_client.perform_runtime_updates().await; - /// println!("Runtime update finished with result={:?}", result); - /// }); - /// # } - /// ``` - pub fn updates(&self) -> UpdateClient { - UpdateClient::new( - self.rpc.clone(), - self.metadata(), - self.runtime_version.clone(), - ) - } - - /// Convert the client to a runtime api wrapper for custom runtime access. - /// - /// The `subxt` proc macro will provide methods to submit extrinsics and read storage specific - /// to the target runtime. - pub fn to_runtime_api>(self) -> R { - self.into() - } - - /// Returns the client's Runtime Version. - pub fn runtime_version(&self) -> Arc> { - Arc::clone(&self.runtime_version) - } -} - -/// A constructed call ready to be signed and submitted. -pub struct SubmittableExtrinsic<'client, T: Config, X, C, E: Decode, Evs: Decode> { - client: &'client Client, - call: C, - marker: std::marker::PhantomData<(X, E, Evs)>, -} - -impl<'client, T, X, C, E, Evs> SubmittableExtrinsic<'client, T, X, C, E, Evs> -where - T: Config, - X: ExtrinsicParams, - C: Call + Send + Sync, - E: Decode + HasModuleError, - Evs: Decode, -{ - /// Create a new [`SubmittableExtrinsic`]. - pub fn new(client: &'client Client, call: C) -> Self { - Self { - client, - call, - marker: Default::default(), - } - } - - /// Creates and signs an extrinsic and submits it to the chain. Passes default parameters - /// to construct the "signed extra" and "additional" payloads needed by the extrinsic. - /// - /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction - /// and obtain details about it, once it has made it into a block. - pub async fn sign_and_submit_then_watch_default( - &self, - signer: &(dyn Signer + Send + Sync), - ) -> Result, BasicError> - where - X::OtherParams: Default, - { - self.sign_and_submit_then_watch(signer, Default::default()) - .await - } - - /// Creates and signs an extrinsic and submits it to the chain. - /// - /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction - /// and obtain details about it, once it has made it into a block. - pub async fn sign_and_submit_then_watch( - &self, - signer: &(dyn Signer + Send + Sync), - other_params: X::OtherParams, - ) -> Result, BasicError> { - self.create_signed(signer, other_params) - .await? - .submit_and_watch() - .await - } - - /// Creates and signs an extrinsic and submits to the chain for block inclusion. Passes - /// default parameters to construct the "signed extra" and "additional" payloads needed - /// by the extrinsic. - /// - /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. - /// - /// # Note - /// - /// Success does not mean the extrinsic has been included in the block, just that it is valid - /// and has been included in the transaction pool. - pub async fn sign_and_submit_default( - &self, - signer: &(dyn Signer + Send + Sync), - ) -> Result - where - X::OtherParams: Default, - { - self.sign_and_submit(signer, Default::default()).await - } - - /// Creates and signs an extrinsic and submits to the chain for block inclusion. - /// - /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. - /// - /// # Note - /// - /// Success does not mean the extrinsic has been included in the block, just that it is valid - /// and has been included in the transaction pool. - pub async fn sign_and_submit( - &self, - signer: &(dyn Signer + Send + Sync), - other_params: X::OtherParams, - ) -> Result { - self.create_signed(signer, other_params) - .await? - .submit() - .await - } - - /// Return the SCALE encoded bytes representing the call data of the transaction. - pub fn call_data(&self) -> Result, BasicError> { - let mut bytes = Vec::new(); - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - let pallet = metadata.pallet(C::PALLET)?; - bytes.push(pallet.index()); - bytes.push(pallet.call_index::()?); - self.call.encode_to(&mut bytes); - Ok(bytes) - } - - /// Creates a returns a raw signed extrinsic, without submitting it. - pub async fn create_signed( - &self, - signer: &(dyn Signer + Send + Sync), - other_params: X::OtherParams, - ) -> Result, BasicError> { - // 1. Get nonce - let account_nonce = if let Some(nonce) = signer.nonce() { - nonce - } else { - self.client - .rpc() - .system_account_next_index(signer.account_id()) - .await? - }; - - // 2. SCALE encode call data to bytes (pallet u8, call u8, call params). - let call_data = Encoded(self.call_data()?); - - // 3. Construct our custom additional/extra params. - let additional_and_extra_params = { - // Obtain spec version and transaction version from the runtime version of the client. - let locked_runtime = self.client.runtime_version(); - let runtime = locked_runtime.read(); - X::new( - runtime.spec_version, - runtime.transaction_version, - account_nonce, - self.client.genesis_hash, - other_params, - ) - }; - - tracing::debug!( - "additional_and_extra_params: {:?}", - additional_and_extra_params - ); - - // 4. Construct signature. This is compatible with the Encode impl - // for SignedPayload (which is this payload of bytes that we'd like) - // to sign. See: - // https://github.com/paritytech/substrate/blob/9a6d706d8db00abb6ba183839ec98ecd9924b1f8/primitives/runtime/src/generic/unchecked_extrinsic.rs#L215) - let signature = { - let mut bytes = Vec::new(); - call_data.encode_to(&mut bytes); - additional_and_extra_params.encode_extra_to(&mut bytes); - additional_and_extra_params.encode_additional_to(&mut bytes); - if bytes.len() > 256 { - signer.sign(&sp_core::blake2_256(&bytes)) - } else { - signer.sign(&bytes) - } - }; - - tracing::info!("xt signature: {}", hex::encode(signature.encode())); - - // 5. Encode extrinsic, now that we have the parts we need. This is compatible - // with the Encode impl for UncheckedExtrinsic (protocol version 4). - let extrinsic = { - let mut encoded_inner = Vec::new(); - // "is signed" + transaction protocol version (4) - (0b10000000 + 4u8).encode_to(&mut encoded_inner); - // from address for signature - signer.address().encode_to(&mut encoded_inner); - // the signature bytes - signature.encode_to(&mut encoded_inner); - // attach custom extra params - additional_and_extra_params.encode_extra_to(&mut encoded_inner); - // and now, call data - call_data.encode_to(&mut encoded_inner); - // now, prefix byte length: - let len = Compact( - u32::try_from(encoded_inner.len()) - .expect("extrinsic size expected to be <4GB"), - ); - let mut encoded = Vec::new(); - len.encode_to(&mut encoded); - encoded.extend(encoded_inner); - encoded - }; - - // Wrap in Encoded to ensure that any more "encode" calls leave it in the right state. - // maybe we can just return the raw bytes.. - Ok(SignedSubmittableExtrinsic { - client: self.client, - encoded: Encoded(extrinsic), - marker: self.marker, - }) - } -} - -pub struct SignedSubmittableExtrinsic<'client, T: Config, X, E: Decode, Evs: Decode> { - client: &'client Client, - encoded: Encoded, - marker: std::marker::PhantomData<(X, E, Evs)>, -} - -impl<'client, T, X, E, Evs> SignedSubmittableExtrinsic<'client, T, X, E, Evs> -where - T: Config, - X: ExtrinsicParams, - E: Decode + HasModuleError, - Evs: Decode, -{ - /// Submits the extrinsic to the chain. - /// - /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction - /// and obtain details about it, once it has made it into a block. - pub async fn submit_and_watch( - &self, - ) -> Result, BasicError> { - // Get a hash of the extrinsic (we'll need this later). - let ext_hash = T::Hashing::hash_of(&self.encoded); - - // Submit and watch for transaction progress. - let sub = self.client.rpc().watch_extrinsic(&self.encoded).await?; - - Ok(TransactionProgress::new(sub, self.client, ext_hash)) - } - - /// Submits the extrinsic to the chain for block inclusion. - /// - /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. - /// - /// # Note - /// - /// Success does not mean the extrinsic has been included in the block, just that it is valid - /// and has been included in the transaction pool. - pub async fn submit(&self) -> Result { - self.client.rpc().submit_extrinsic(&self.encoded).await - } - - /// Submits the extrinsic to the dry_run RPC, to test if it would succeed. - /// - /// Returns `Ok` with an [`ApplyExtrinsicResult`], which is the result of applying of an extrinsic. - pub async fn dry_run( - &self, - at: Option, - ) -> Result { - self.client.rpc().dry_run(self.encoded(), at).await - } - - /// Returns the SCALE encoded extrinsic bytes. - pub fn encoded(&self) -> &[u8] { - &self.encoded.0 - } -} diff --git a/subxt/src/client/mod.rs b/subxt/src/client/mod.rs new file mode 100644 index 0000000000..2e782ed4bb --- /dev/null +++ b/subxt/src/client/mod.rs @@ -0,0 +1,21 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module provides two clients that can be used to work with +//! transactions, storage and events. The [`OfflineClient`] works +//! entirely offline and can be passed to any function that doesn't +//! require network access. The [`OnlineClient`] requires network +//! access. + +mod offline_client; +mod online_client; + +pub use offline_client::{ + OfflineClient, + OfflineClientT, +}; +pub use online_client::{ + OnlineClient, + OnlineClientT, +}; diff --git a/subxt/src/client/offline_client.rs b/subxt/src/client/offline_client.rs new file mode 100644 index 0000000000..630bb745ac --- /dev/null +++ b/subxt/src/client/offline_client.rs @@ -0,0 +1,140 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::{ + constants::ConstantsClient, + events::EventsClient, + rpc::RuntimeVersion, + storage::StorageClient, + tx::TxClient, + Config, + Metadata, +}; +use derivative::Derivative; +use std::sync::Arc; + +/// A trait representing a client that can perform +/// offline-only actions. +pub trait OfflineClientT: Clone + Send + Sync + 'static { + /// Return the provided [`Metadata`]. + fn metadata(&self) -> Metadata; + /// Return the provided genesis hash. + fn genesis_hash(&self) -> T::Hash; + /// Return the provided [`RuntimeVersion`]. + fn runtime_version(&self) -> RuntimeVersion; + + /// Work with transactions. + fn tx(&self) -> TxClient { + TxClient::new(self.clone()) + } + + /// Work with events. + fn events(&self) -> EventsClient { + EventsClient::new(self.clone()) + } + + /// Work with storage. + fn storage(&self) -> StorageClient { + StorageClient::new(self.clone()) + } + + /// Access constants. + fn constants(&self) -> ConstantsClient { + ConstantsClient::new(self.clone()) + } +} + +/// A client that is capable of performing offline-only operations. +/// Can be constructed as long as you can populate the required fields. +#[derive(Derivative)] +#[derivative(Debug(bound = ""), Clone(bound = ""))] +pub struct OfflineClient { + inner: Arc>, +} + +#[derive(Derivative)] +#[derivative(Debug(bound = ""), Clone(bound = ""))] +struct Inner { + genesis_hash: T::Hash, + runtime_version: RuntimeVersion, + metadata: Metadata, +} + +impl OfflineClient { + /// Construct a new [`OfflineClient`], providing + /// the necessary runtime and compile-time arguments. + pub fn new( + genesis_hash: T::Hash, + runtime_version: RuntimeVersion, + metadata: Metadata, + ) -> OfflineClient { + OfflineClient { + inner: Arc::new(Inner { + genesis_hash, + runtime_version, + metadata, + }), + } + } + + /// Return the genesis hash. + pub fn genesis_hash(&self) -> T::Hash { + self.inner.genesis_hash + } + + /// Return the runtime version. + pub fn runtime_version(&self) -> RuntimeVersion { + self.inner.runtime_version.clone() + } + + /// Return the [`Metadata`] used in this client. + pub fn metadata(&self) -> Metadata { + self.inner.metadata.clone() + } + + // Just a copy of the most important trait methods so that people + // don't need to import the trait for most things: + + /// Work with transactions. + pub fn tx(&self) -> TxClient { + >::tx(self) + } + + /// Work with events. + pub fn events(&self) -> EventsClient { + >::events(self) + } + + /// Work with storage. + pub fn storage(&self) -> StorageClient { + >::storage(self) + } + + /// Access constants. + pub fn constants(&self) -> ConstantsClient { + >::constants(self) + } +} + +impl OfflineClientT for OfflineClient { + fn genesis_hash(&self) -> T::Hash { + self.genesis_hash() + } + fn runtime_version(&self) -> RuntimeVersion { + self.runtime_version() + } + fn metadata(&self) -> Metadata { + self.metadata() + } +} + +// For ergonomics; cloning a client is deliberately fairly cheap (via Arc), +// so this allows users to pass references to a client rather than explicitly +// cloning. This is partly for consistency with OnlineClient, which can be +// easily converted into an OfflineClient for ergonomics. +impl<'a, T: Config> From<&'a OfflineClient> for OfflineClient { + fn from(c: &'a OfflineClient) -> Self { + c.clone() + } +} diff --git a/subxt/src/client/online_client.rs b/subxt/src/client/online_client.rs new file mode 100644 index 0000000000..7043d58cfc --- /dev/null +++ b/subxt/src/client/online_client.rs @@ -0,0 +1,234 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::{ + OfflineClient, + OfflineClientT, +}; +use crate::{ + constants::ConstantsClient, + error::Error, + events::EventsClient, + rpc::{ + Rpc, + RpcClient, + RuntimeVersion, + }, + storage::StorageClient, + tx::TxClient, + Config, + Metadata, +}; +use derivative::Derivative; +use futures::future; +use parking_lot::RwLock; +use std::sync::Arc; + +/// A trait representing a client that can perform +/// online actions. +pub trait OnlineClientT: OfflineClientT { + /// Return an RPC client that can be used to communicate with a node. + fn rpc(&self) -> &Rpc; +} + +/// A client that can be used to perform API calls (that is, either those +/// requiriing an [`OfflineClientT`] or those requiring an [`OnlineClientT`]). +#[derive(Derivative)] +#[derivative(Clone(bound = ""))] +pub struct OnlineClient { + inner: Arc>>, + rpc: Rpc, +} + +#[derive(Derivative)] +#[derivative(Debug(bound = ""))] +struct Inner { + genesis_hash: T::Hash, + runtime_version: RuntimeVersion, + metadata: Metadata, +} + +impl std::fmt::Debug for OnlineClient { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Client") + .field("rpc", &"") + .field("inner", &self.inner) + .finish() + } +} + +impl OnlineClient { + /// Construct a new [`OnlineClient`] using default settings which + /// point to a locally running node on `ws://127.0.0.1:9944`. + pub async fn new() -> Result, Error> { + let url = "ws://127.0.0.1:9944"; + OnlineClient::from_url(url).await + } + + /// Construct a new [`OnlineClient`], providing a URL to connect to. + pub async fn from_url(url: impl AsRef) -> Result, Error> { + let client = crate::rpc::ws_client(url.as_ref()).await?; + OnlineClient::from_rpc_client(client).await + } + + /// Construct a new [`OnlineClient`] by providing the underlying [`RpcClient`] + /// to use to drive the connection. + pub async fn from_rpc_client( + rpc_client: impl Into, + ) -> Result, Error> { + let rpc = Rpc::new(rpc_client.into()); + + let (genesis_hash, runtime_version, metadata) = future::join3( + rpc.genesis_hash(), + rpc.runtime_version(None), + rpc.metadata(), + ) + .await; + + Ok(OnlineClient { + inner: Arc::new(RwLock::new(Inner { + genesis_hash: genesis_hash?, + runtime_version: runtime_version?, + metadata: metadata?, + })), + rpc, + }) + } + + /// Create an object which can be used to keep the runtime uptodate + /// in a separate thread. + /// + /// # Example + /// + /// ```no_run + /// # #[tokio::main] + /// # async fn main() { + /// use subxt::{ OnlineClient, PolkadotConfig }; + /// + /// let client = OnlineClient::::new().await.unwrap(); + /// + /// let update_task = client.subscribe_to_updates(); + /// tokio::spawn(async move { + /// update_task.perform_runtime_updates().await; + /// }); + /// # } + /// ``` + pub fn subscribe_to_updates(&self) -> ClientRuntimeUpdater { + ClientRuntimeUpdater(self.clone()) + } + + /// Return the [`Metadata`] used in this client. + pub fn metadata(&self) -> Metadata { + let inner = self.inner.read(); + inner.metadata.clone() + } + + /// Return the genesis hash. + pub fn genesis_hash(&self) -> T::Hash { + let inner = self.inner.read(); + inner.genesis_hash + } + + /// Return the runtime version. + pub fn runtime_version(&self) -> RuntimeVersion { + let inner = self.inner.read(); + inner.runtime_version.clone() + } + + /// Return an RPC client to make raw requests with. + pub fn rpc(&self) -> &Rpc { + &self.rpc + } + + /// Return an offline client with the same configuration as this. + pub fn offline(&self) -> OfflineClient { + let inner = self.inner.read(); + OfflineClient::new( + inner.genesis_hash, + inner.runtime_version.clone(), + inner.metadata.clone(), + ) + } + + // Just a copy of the most important trait methods so that people + // don't need to import the trait for most things: + + /// Work with transactions. + pub fn tx(&self) -> TxClient { + >::tx(self) + } + + /// Work with events. + pub fn events(&self) -> EventsClient { + >::events(self) + } + + /// Work with storage. + pub fn storage(&self) -> StorageClient { + >::storage(self) + } + + /// Access constants. + pub fn constants(&self) -> ConstantsClient { + >::constants(self) + } +} + +impl OfflineClientT for OnlineClient { + fn metadata(&self) -> Metadata { + self.metadata() + } + fn genesis_hash(&self) -> T::Hash { + self.genesis_hash() + } + fn runtime_version(&self) -> RuntimeVersion { + self.runtime_version() + } +} + +impl OnlineClientT for OnlineClient { + fn rpc(&self) -> &Rpc { + &self.rpc + } +} + +/// Client wrapper for performing runtime updates. See [`OnlineClient::subscribe_to_updates()`] +/// for example usage. +pub struct ClientRuntimeUpdater(OnlineClient); + +impl ClientRuntimeUpdater { + fn is_runtime_version_different(&self, new: &RuntimeVersion) -> bool { + let curr = self.0.inner.read(); + &curr.runtime_version != new + } + + /// Performs runtime updates indefinitely unless encountering an error. + /// + /// *Note:* This will run indefinitely until it errors, so the typical usage + /// would be to run it in a separate background task. + pub async fn perform_runtime_updates(&self) -> Result<(), Error> { + // Obtain an update subscription to further detect changes in the runtime version of the node. + let mut update_subscription = self.0.rpc.subscribe_runtime_version().await?; + + while let Some(new_runtime_version) = update_subscription.next().await { + // The Runtime Version obtained via subscription. + let new_runtime_version = new_runtime_version?; + + // Ignore this update if there is no difference. + if !self.is_runtime_version_different(&new_runtime_version) { + continue + } + + // Fetch new metadata. + let new_metadata = self.0.rpc.metadata().await?; + + // Do the update. + let mut writable = self.0.inner.write(); + writable.metadata = new_metadata; + writable.runtime_version = new_runtime_version; + } + + Ok(()) + } +} diff --git a/subxt/src/config.rs b/subxt/src/config.rs index 884af45ae7..11dcd6009a 100644 --- a/subxt/src/config.rs +++ b/subxt/src/config.rs @@ -2,6 +2,12 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +//! This module provides a [`Config`] type, which is used to define various +//! types that are important in order to speak to a particular chain. +//! [`SubstrateConfig`] provides a default set of these types suitable for the +//! default Substrate node implementation, and [`PolkadotConfig`] for a +//! Polkadot node. + use codec::{ Codec, Encode, @@ -22,7 +28,7 @@ use sp_runtime::traits::{ // Note: the 'static bound isn't strictly required, but currently deriving TypeInfo // automatically applies a 'static bound to all generic types (including this one), // and so until that is resolved, we'll keep the (easy to satisfy) constraint here. -pub trait Config: Debug + 'static { +pub trait Config: 'static { /// Account index (aka nonce) type. This stores the number of previous /// transactions associated with a sender account. type Index: Parameter @@ -74,6 +80,9 @@ pub trait Config: Debug + 'static { /// Extrinsic type within blocks. type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; + + /// This type defines the extrinsic extra and additional parameters. + type ExtrinsicParams: crate::tx::ExtrinsicParams; } /// Parameter trait copied from `substrate::frame_support` @@ -83,10 +92,9 @@ impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug {} /// Default set of commonly used types by Substrate runtimes. // Note: We only use this at the type level, so it should be impossible to // create an instance of it. -#[derive(Debug)] -pub enum DefaultConfig {} +pub enum SubstrateConfig {} -impl Config for DefaultConfig { +impl Config for SubstrateConfig { type Index = u32; type BlockNumber = u32; type Hash = sp_core::H256; @@ -97,4 +105,46 @@ impl Config for DefaultConfig { sp_runtime::generic::Header; type Signature = sp_runtime::MultiSignature; type Extrinsic = sp_runtime::OpaqueExtrinsic; + type ExtrinsicParams = crate::tx::SubstrateExtrinsicParams; +} + +/// Default set of commonly used types by Polkadot nodes. +pub type PolkadotConfig = WithExtrinsicParams< + SubstrateConfig, + crate::tx::PolkadotExtrinsicParams, +>; + +/// Take a type implementing [`Config`] (eg [`SubstrateConfig`]), and some type which describes the +/// additional and extra parameters to pass to an extrinsic (see [`crate::tx::ExtrinsicParams`]), +/// and returns a type implementing [`Config`] with those new `ExtrinsicParams`. +/// +/// # Example +/// +/// ``` +/// use subxt::config::{ SubstrateConfig, WithExtrinsicParams }; +/// use subxt::tx::PolkadotExtrinsicParams; +/// +/// // This is how PolkadotConfig is implemented: +/// type PolkadotConfig = WithExtrinsicParams>; +/// ``` +pub struct WithExtrinsicParams< + T: Config, + E: crate::tx::ExtrinsicParams, +> { + _marker: std::marker::PhantomData<(T, E)>, +} + +impl> Config + for WithExtrinsicParams +{ + type Index = T::Index; + type BlockNumber = T::BlockNumber; + type Hash = T::Hash; + type Hashing = T::Hashing; + type AccountId = T::AccountId; + type Address = T::Address; + type Header = T::Header; + type Signature = T::Signature; + type Extrinsic = T::Extrinsic; + type ExtrinsicParams = E; } diff --git a/subxt/src/constants/constant_address.rs b/subxt/src/constants/constant_address.rs new file mode 100644 index 0000000000..545c25afc7 --- /dev/null +++ b/subxt/src/constants/constant_address.rs @@ -0,0 +1,109 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::{ + dynamic::DecodedValue, + metadata::DecodeWithMetadata, +}; +use std::borrow::Cow; + +/// This represents a constant address. Anything implementing this trait +/// can be used to fetch constants. +pub trait ConstantAddress { + /// The target type of the value that lives at this address. + type Target: DecodeWithMetadata; + + /// The name of the pallet that the constant lives under. + fn pallet_name(&self) -> &str; + + /// The name of the constant in a given pallet. + fn constant_name(&self) -> &str; + + /// An optional hash which, if present, will be checked against + /// the node metadata to confirm that the return type matches what + /// we are expecting. + fn validation_hash(&self) -> Option<[u8; 32]> { + None + } +} + +/// This represents a statically generated constant lookup address. +pub struct StaticConstantAddress { + pallet_name: &'static str, + constant_name: &'static str, + constant_hash: Option<[u8; 32]>, + _marker: std::marker::PhantomData, +} + +impl StaticConstantAddress { + /// Create a new [`StaticConstantAddress`] that will be validated + /// against node metadata using the hash given. + pub fn new( + pallet_name: &'static str, + constant_name: &'static str, + hash: [u8; 32], + ) -> Self { + Self { + pallet_name, + constant_name, + constant_hash: Some(hash), + _marker: std::marker::PhantomData, + } + } + + /// Do not validate this constant prior to accessing it. + pub fn unvalidated(self) -> Self { + Self { + pallet_name: self.pallet_name, + constant_name: self.constant_name, + constant_hash: None, + _marker: self._marker, + } + } +} + +impl ConstantAddress for StaticConstantAddress { + type Target = ReturnTy; + + fn pallet_name(&self) -> &str { + self.pallet_name + } + + fn constant_name(&self) -> &str { + self.constant_name + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + self.constant_hash + } +} + +/// This represents a dynamically generated constant address. +pub struct DynamicConstantAddress<'a> { + pallet_name: Cow<'a, str>, + constant_name: Cow<'a, str>, +} + +/// Construct a new dynamic constant lookup. +pub fn dynamic<'a>( + pallet_name: impl Into>, + constant_name: impl Into>, +) -> DynamicConstantAddress<'a> { + DynamicConstantAddress { + pallet_name: pallet_name.into(), + constant_name: constant_name.into(), + } +} + +impl<'a> ConstantAddress for DynamicConstantAddress<'a> { + type Target = DecodedValue; + + fn pallet_name(&self) -> &str { + &self.pallet_name + } + + fn constant_name(&self) -> &str { + &self.constant_name + } +} diff --git a/subxt/src/constants/constants_client.rs b/subxt/src/constants/constants_client.rs new file mode 100644 index 0000000000..5a12889b2c --- /dev/null +++ b/subxt/src/constants/constants_client.rs @@ -0,0 +1,78 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::ConstantAddress; +use crate::{ + client::OfflineClientT, + error::Error, + metadata::{ + DecodeWithMetadata, + MetadataError, + }, + Config, +}; +use derivative::Derivative; + +/// A client for accessing constants. +#[derive(Derivative)] +#[derivative(Clone(bound = "Client: Clone"))] +pub struct ConstantsClient { + client: Client, + _marker: std::marker::PhantomData, +} + +impl ConstantsClient { + /// Create a new [`ConstantsClient`]. + pub fn new(client: Client) -> Self { + Self { + client, + _marker: std::marker::PhantomData, + } + } +} + +impl> ConstantsClient { + /// Run the validation logic against some constant address you'd like to access. Returns `Ok(())` + /// if the address is valid (or if it's not possible to check since the address has no validation hash). + /// Return an error if the address was not valid or something went wrong trying to validate it (ie + /// the pallet or constant in question do not exist at all). + pub fn validate( + &self, + address: &Address, + ) -> Result<(), Error> { + if let Some(actual_hash) = address.validation_hash() { + let expected_hash = self + .client + .metadata() + .constant_hash(address.pallet_name(), address.constant_name())?; + if actual_hash != expected_hash { + return Err(MetadataError::IncompatibleMetadata.into()) + } + } + Ok(()) + } + + /// Access the constant at the address given, returning the type defined by this address. + /// This is probably used with addresses given from static codegen, although you can manually + /// construct your own, too. + pub fn at( + &self, + address: &Address, + ) -> Result<::Target, Error> { + let metadata = self.client.metadata(); + + // 1. Validate constant shape if hash given: + self.validate(address)?; + + // 2. Attempt to decode the constant into the type given: + let pallet = metadata.pallet(address.pallet_name())?; + let constant = pallet.constant(address.constant_name())?; + let value = Address::Target::decode_with_metadata( + &mut &*constant.value, + constant.ty.id(), + &metadata, + )?; + Ok(value) + } +} diff --git a/subxt/src/constants/mod.rs b/subxt/src/constants/mod.rs new file mode 100644 index 0000000000..e4b3ec98b3 --- /dev/null +++ b/subxt/src/constants/mod.rs @@ -0,0 +1,16 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! Types associated with accessing constants. + +mod constant_address; +mod constants_client; + +pub use constant_address::{ + dynamic, + ConstantAddress, + DynamicConstantAddress, + StaticConstantAddress, +}; +pub use constants_client::ConstantsClient; diff --git a/subxt/src/dynamic.rs b/subxt/src/dynamic.rs new file mode 100644 index 0000000000..29dd3dc262 --- /dev/null +++ b/subxt/src/dynamic.rs @@ -0,0 +1,26 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module provides the entry points to create dynamic +//! transactions, storage and constant lookups. + +pub use scale_value::Value; + +/// A [`scale_value::Value`] type endowed with contextual information +/// regarding what type was used to decode each part of it. This implements +/// [`crate::metadata::DecodeWithMetadata`], and is used as a return type +/// for dynamic requests. +pub type DecodedValue = scale_value::Value; + +// Submit dynamic transactions. +pub use crate::tx::dynamic as tx; + +// Lookup constants dynamically. +pub use crate::constants::dynamic as constant; + +// Lookup storage values dynamically. +pub use crate::storage::{ + dynamic as storage, + dynamic_root as storage_root, +}; diff --git a/subxt/src/error.rs b/subxt/src/error.rs index 6e870e282b..85c61e98b7 100644 --- a/subxt/src/error.rs +++ b/subxt/src/error.rs @@ -2,27 +2,32 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::metadata::{ +//! Types representing the errors that can be returned. + +use crate::metadata::Metadata; +use codec::Decode; +use core::fmt::Debug; +use scale_info::TypeDef; +use std::borrow::Cow; + +// Re-expose the errors we use from other crates here: +pub use crate::metadata::{ InvalidMetadataError, MetadataError, }; -use core::fmt::Debug; -use jsonrpsee::core::error::Error as RequestError; -use scale_value::scale::DecodeError; -use sp_core::crypto::SecretStringError; -use sp_runtime::transaction_validity::TransactionValidityError; - -/// An error that may contain some runtime error `E` -pub type Error = GenericError>; - -/// An error that will never contain a runtime error. -pub type BasicError = GenericError; +pub use jsonrpsee::core::error::Error as RequestError; +pub use scale_value::scale::{ + DecodeError, + EncodeError, +}; +pub use sp_core::crypto::SecretStringError; +pub use sp_runtime::transaction_validity::TransactionValidityError; /// The underlying error enum, generic over the type held by the `Runtime` -/// variant. Prefer to use the [`Error`] and [`BasicError`] aliases over +/// variant. Prefer to use the [`Error`] and [`Error`] aliases over /// using this type directly. #[derive(Debug, thiserror::Error)] -pub enum GenericError { +pub enum Error { /// Io error. #[error("Io error: {0}")] Io(#[from] std::io::Error), @@ -49,99 +54,174 @@ pub enum GenericError { Metadata(#[from] MetadataError), /// Runtime error. #[error("Runtime error: {0:?}")] - Runtime(E), - /// Events decoding error. - #[error("Events decoding error: {0}")] - EventsDecoding(#[from] DecodeError), + Runtime(DispatchError), + /// Error decoding to a [`crate::dynamic::Value`]. + #[error("Error decoding into dynamic value: {0}")] + DecodeValue(#[from] DecodeError), + /// Error encoding from a [`crate::dynamic::Value`]. + #[error("Error encoding from dynamic value: {0}")] + EncodeValue(#[from] EncodeError<()>), /// Transaction progress error. #[error("Transaction error: {0}")] Transaction(#[from] TransactionError), - #[error("Module error: {0}")] - /// An error from the `Module` variant of the generated `DispatchError`. - Module(ModuleError), + /// An error encoding a storage address. + #[error("Error encoding storage address: {0}")] + StorageAddress(#[from] StorageAddressError), /// Other error. #[error("Other error: {0}")] Other(String), } -impl GenericError { - /// [`GenericError`] is parameterised over the type that it holds in the `Runtime` - /// variant. This function allows us to map the Runtime error contained within (if present) - /// to a different type. - pub fn map_runtime_err(self, f: F) -> GenericError - where - F: FnOnce(E) -> NewE, - { - match self { - GenericError::Io(e) => GenericError::Io(e), - GenericError::Codec(e) => GenericError::Codec(e), - GenericError::Rpc(e) => GenericError::Rpc(e), - GenericError::Serialization(e) => GenericError::Serialization(e), - GenericError::SecretString(e) => GenericError::SecretString(e), - GenericError::Invalid(e) => GenericError::Invalid(e), - GenericError::InvalidMetadata(e) => GenericError::InvalidMetadata(e), - GenericError::Metadata(e) => GenericError::Metadata(e), - GenericError::EventsDecoding(e) => GenericError::EventsDecoding(e), - GenericError::Transaction(e) => GenericError::Transaction(e), - GenericError::Module(e) => GenericError::Module(e), - GenericError::Other(e) => GenericError::Other(e), - // This is the only branch we really care about: - GenericError::Runtime(e) => GenericError::Runtime(f(e)), - } +impl From for Error { + fn from(error: SecretStringError) -> Self { + Error::SecretString(error) } } -impl BasicError { - /// Convert an [`BasicError`] into any - /// arbitrary [`Error`]. - pub fn into_error(self) -> Error { - self.map_runtime_err(|e| match e {}) +impl From for Error { + fn from(error: TransactionValidityError) -> Self { + Error::Invalid(error) } } -impl From for Error { - fn from(err: BasicError) -> Self { - err.into_error() +impl From<&str> for Error { + fn from(error: &str) -> Self { + Error::Other(error.into()) } } -impl From for GenericError { - fn from(error: SecretStringError) -> Self { - GenericError::SecretString(error) +impl From for Error { + fn from(error: String) -> Self { + Error::Other(error) } } -impl From for GenericError { - fn from(error: TransactionValidityError) -> Self { - GenericError::Invalid(error) +impl From for Error { + fn from(error: DispatchError) -> Self { + Error::Runtime(error) } } -impl From<&str> for GenericError { - fn from(error: &str) -> Self { - GenericError::Other(error.into()) - } +/// This is our attempt to decode a runtime DispatchError. We either +/// successfully decode it into a [`ModuleError`], or we fail and keep +/// hold of the bytes, which we can attempt to decode if we have an +/// appropriate static type to hand. +#[derive(Debug, thiserror::Error)] +pub enum DispatchError { + /// An error was emitted from a specific pallet/module. + #[error("Module error: {0}")] + Module(ModuleError), + /// Some other error was emitted. + #[error("Undecoded dispatch error: {0:?}")] + Other(Vec), } -impl From for GenericError { - fn from(error: String) -> Self { - GenericError::Other(error) - } -} +impl DispatchError { + /// Attempt to decode a runtime DispatchError, returning either the [`ModuleError`] it decodes + /// to, along with additional details on the error, or returning the raw bytes if it could not + /// be decoded. + pub fn decode_from<'a>(bytes: impl Into>, metadata: &Metadata) -> Self { + let bytes = bytes.into(); -/// This is used in the place of the `E` in [`GenericError`] when we may have a -/// Runtime Error. We use this wrapper so that it is possible to implement -/// `From` for `Error>`. -/// -/// This should not be used as a type; prefer to use the alias [`Error`] when referring -/// to errors which may contain some Runtime error `E`. -#[derive(Clone, Debug, PartialEq)] -pub struct RuntimeError(pub E); - -impl RuntimeError { - /// Extract the actual runtime error from this struct. - pub fn inner(self) -> E { - self.0 + let dispatch_error_ty_id = match metadata.dispatch_error_ty() { + Some(id) => id, + None => { + tracing::warn!( + "Can't decode error: sp_runtime::DispatchError was not found in Metadata" + ); + return DispatchError::Other(bytes.into_owned()) + } + }; + + let dispatch_error_ty = match metadata.types().resolve(dispatch_error_ty_id) { + Some(ty) => ty, + None => { + tracing::warn!("Can't decode error: sp_runtime::DispatchError type ID doesn't resolve to a known type"); + return DispatchError::Other(bytes.into_owned()) + } + }; + + let variant = match dispatch_error_ty.type_def() { + TypeDef::Variant(var) => var, + _ => { + tracing::warn!( + "Can't decode error: sp_runtime::DispatchError type is not a Variant" + ); + return DispatchError::Other(bytes.into_owned()) + } + }; + + let module_variant_idx = variant + .variants() + .iter() + .find(|v| v.name() == "Module") + .map(|v| v.index()); + let module_variant_idx = match module_variant_idx { + Some(idx) => idx, + None => { + tracing::warn!("Can't decode error: sp_runtime::DispatchError does not have a 'Module' variant"); + return DispatchError::Other(bytes.into_owned()) + } + }; + + // If the error bytes don't correspond to a ModuleError, just return the bytes. + // This is perfectly reasonable and expected, so no logging. + if bytes[0] != module_variant_idx { + return DispatchError::Other(bytes.into_owned()) + } + + // The remaining bytes are the module error, all being well: + let bytes = &bytes[1..]; + + // The oldest and second oldest type of error decode to this shape: + #[derive(Decode)] + struct LegacyModuleError { + index: u8, + error: u8, + } + + // The newer case expands the error for forward compat: + #[derive(Decode)] + struct CurrentModuleError { + index: u8, + error: [u8; 4], + } + + // try to decode into the new shape, or the old if that doesn't work + let err = match CurrentModuleError::decode(&mut &*bytes) { + Ok(e) => e, + Err(_) => { + let old_e = match LegacyModuleError::decode(&mut &*bytes) { + Ok(err) => err, + Err(_) => { + tracing::warn!("Can't decode error: sp_runtime::DispatchError does not match known formats"); + return DispatchError::Other(bytes.to_vec()) + } + }; + CurrentModuleError { + index: old_e.index, + error: [old_e.error, 0, 0, 0], + } + } + }; + + let error_details = match metadata.error(err.index, err.error[0]) { + Ok(details) => details, + Err(_) => { + tracing::warn!("Can't decode error: sp_runtime::DispatchError::Module details do not match known information"); + return DispatchError::Other(bytes.to_vec()) + } + }; + + DispatchError::Module(ModuleError { + pallet: error_details.pallet().to_string(), + error: error_details.error().to_string(), + description: error_details.docs().to_vec(), + error_data: ModuleErrorData { + pallet_index: err.index, + error: err.error, + }, + }) } } @@ -192,11 +272,33 @@ impl ModuleErrorData { } } -/// This trait is automatically implemented for the generated `DispatchError`, -/// so that we can pluck out information about the `Module` error variant, if` -/// it exists. -pub trait HasModuleError { - /// If the error has a `Module` variant, return a tuple of the - /// pallet index and error index. Else, return `None`. - fn module_error_data(&self) -> Option; +/// Something went wrong trying to encode a storage address. +#[derive(Clone, Debug, thiserror::Error)] +pub enum StorageAddressError { + /// Storage map type must be a composite type. + #[error("Storage map type must be a composite type")] + MapTypeMustBeTuple, + /// Storage lookup does not have the expected number of keys. + #[error("Storage lookup requires {expected} keys but got {actual} keys")] + WrongNumberOfKeys { + /// The actual number of keys needed, based on the metadata. + actual: usize, + /// The number of keys provided in the storage address. + expected: usize, + }, + /// Storage lookup requires a type that wasn't found in the metadata. + #[error( + "Storage lookup requires type {0} to exist in the metadata, but it was not found" + )] + TypeNotFound(u32), + /// This storage entry in the metadata does not have the correct number of hashers to fields. + #[error( + "Storage entry in metadata does not have the correct number of hashers to fields" + )] + WrongNumberOfHashers { + /// The number of hashers in the metadata for this storage entry. + hashers: usize, + /// The number of fields in the metadata for this storage entry. + fields: usize, + }, } diff --git a/subxt/src/events/event_subscription.rs b/subxt/src/events/event_subscription.rs index c9c729c60b..704a31c82f 100644 --- a/subxt/src/events/event_subscription.rs +++ b/subxt/src/events/event_subscription.rs @@ -5,18 +5,14 @@ //! Subscribing to events. use crate::{ - error::BasicError, - Client, + client::OnlineClientT, + error::Error, + events::EventsClient, Config, }; -use codec::Decode; use derivative::Derivative; use futures::{ - future::Either, - stream::{ - self, - BoxStream, - }, + stream::BoxStream, Future, FutureExt, Stream, @@ -30,112 +26,16 @@ use std::{ }; pub use super::{ - at, EventDetails, EventFilter, Events, FilterEvents, - RawEventDetails, }; -/// Subscribe to events from blocks. -/// -/// **Note:** these blocks haven't necessarily been finalised yet; prefer -/// [`Events::subscribe_finalized()`] if that is important. -/// -/// **Note:** This function is hidden from the documentation -/// and is exposed only to be called via the codegen. It may -/// break between minor releases. -#[doc(hidden)] -pub async fn subscribe( - client: &Client, -) -> Result, T, Evs>, BasicError> { - let block_subscription = client.rpc().subscribe_blocks().await?; - Ok(EventSubscription::new(client, block_subscription)) -} - -/// Subscribe to events from finalized blocks. -/// -/// **Note:** This function is hidden from the documentation -/// and is exposed only to be called via the codegen. It may -/// break between minor releases. -#[doc(hidden)] -pub async fn subscribe_finalized( - client: &Client, -) -> Result, T, Evs>, BasicError> { - // fetch the last finalised block details immediately, so that we'll get - // events for each block after this one. - let last_finalized_block_hash = client.rpc().finalized_head().await?; - let last_finalized_block_number = client - .rpc() - .header(Some(last_finalized_block_hash)) - .await? - .map(|h| (*h.number()).into()); - - // Fill in any gaps between the block above and the finalized blocks reported. - let block_subscription = subscribe_to_block_headers_filling_in_gaps( - client, - last_finalized_block_number, - client.rpc().subscribe_finalized_blocks().await?, - ); - - Ok(EventSubscription::new(client, Box::pin(block_subscription))) -} - -/// Take a subscription that returns block headers, and if any block numbers are missed out -/// betweem the block number provided and what's returned from the subscription, we fill in -/// the gaps and get hold of all intermediate block headers. -/// -/// **Note:** This is exposed so that we can run integration tests on it, but otherwise -/// should not be used directly and may break between minor releases. -#[doc(hidden)] -pub fn subscribe_to_block_headers_filling_in_gaps<'a, S, E, T: Config>( - client: &'a Client, - mut last_block_num: Option, - sub: S, -) -> impl Stream> + Send + 'a -where - S: Stream> + Send + 'a, - E: Into + Send + 'static, -{ - sub.flat_map(move |s| { - // Get the header, or return a stream containing just the error. Our EventSubscription - // stream will return `None` as soon as it hits an error like this. - let header = match s { - Ok(header) => header, - Err(e) => return Either::Left(stream::once(async { Err(e.into()) })), - }; - - // We want all previous details up to, but not including this current block num. - let end_block_num = (*header.number()).into(); - - // This is one after the last block we returned details for last time. - let start_block_num = last_block_num.map(|n| n + 1).unwrap_or(end_block_num); - - // Iterate over all of the previous blocks we need headers for, ignoring the current block - // (which we already have the header info for): - let previous_headers = stream::iter(start_block_num..end_block_num) - .then(move |n| { - async move { - let hash = client.rpc().block_hash(Some(n.into())).await?; - let header = client.rpc().header(hash).await?; - Ok::<_, BasicError>(header) - } - }) - .filter_map(|h| async { h.transpose() }); - - // On the next iteration, we'll get details starting just after this end block. - last_block_num = Some(end_block_num); - - // Return a combination of any previous headers plus the new header. - Either::Right(previous_headers.chain(stream::once(async { Ok(header) }))) - }) -} - /// A `jsonrpsee` Subscription. This forms a part of the `EventSubscription` type handed back /// in codegen from `subscribe_finalized`, and is exposed to be used in codegen. #[doc(hidden)] -pub type FinalizedEventSub<'a, Header> = BoxStream<'a, Result>; +pub type FinalizedEventSub
= BoxStream<'static, Result>; /// A `jsonrpsee` Subscription. This forms a part of the `EventSubscription` type handed back /// in codegen from `subscribe`, and is exposed to be used in codegen. @@ -144,52 +44,80 @@ pub type EventSub = Subscription; /// A subscription to events that implements [`Stream`], and returns [`Events`] objects for each block. #[derive(Derivative)] -#[derivative(Debug(bound = "Sub: std::fmt::Debug"))] -pub struct EventSubscription<'a, Sub, T: Config, Evs: 'static> { +#[derivative(Debug(bound = "Sub: std::fmt::Debug, Client: std::fmt::Debug"))] +pub struct EventSubscription { finished: bool, - client: &'a Client, + client: Client, block_header_subscription: Sub, #[derivative(Debug = "ignore")] - at: Option< - std::pin::Pin< - Box, BasicError>> + Send + 'a>, - >, - >, - _event_type: std::marker::PhantomData, + at: Option, Error>> + Send>>>, } -impl<'a, Sub, T: Config, Evs: Decode, E: Into> - EventSubscription<'a, Sub, T, Evs> +impl> EventSubscription where - Sub: Stream> + Unpin + 'a, + Sub: Stream> + Unpin, { - fn new(client: &'a Client, block_header_subscription: Sub) -> Self { + /// Create a new [`EventSubscription`] from a client and a subscription + /// which returns block headers. + pub fn new(client: Client, block_header_subscription: Sub) -> Self { EventSubscription { finished: false, client, block_header_subscription, at: None, - _event_type: std::marker::PhantomData, } } /// Return only specific events matching the tuple of 1 or more event /// types that has been provided as the `Filter` type parameter. - pub fn filter_events(self) -> FilterEvents<'a, Self, T, Filter> { + /// + /// # Example + /// + /// ```no_run + /// use futures::StreamExt; + /// use subxt::{OnlineClient, PolkadotConfig}; + /// + /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] + /// pub mod polkadot {} + /// + /// # #[tokio::main] + /// # async fn main() { + /// let api = OnlineClient::::new().await.unwrap(); + /// + /// let mut events = api + /// .events() + /// .subscribe() + /// .await + /// .unwrap() + /// .filter_events::<( + /// polkadot::balances::events::Transfer, + /// polkadot::balances::events::Deposit + /// )>(); + /// + /// while let Some(ev) = events.next().await { + /// let event_details = ev.unwrap(); + /// match event_details.event { + /// (Some(transfer), None) => println!("Balance transfer event: {transfer:?}"), + /// (None, Some(deposit)) => println!("Balance deposit event: {deposit:?}"), + /// _ => unreachable!() + /// } + /// } + /// # } + /// ``` + pub fn filter_events( + self, + ) -> FilterEvents<'static, Self, T, Filter> { FilterEvents::new(self) } } -impl<'a, T: Config, Sub: Unpin, Evs: Decode> Unpin - for EventSubscription<'a, Sub, T, Evs> -{ -} +impl Unpin for EventSubscription {} // We want `EventSubscription` to implement Stream. The below implementation is the rather verbose // way to roughly implement the following function: // // ``` -// fn subscribe_events(client: &'_ Client, block_sub: Subscription) -> impl Stream, BasicError>> + '_ { +// fn subscribe_events(client: &'_ Client, block_sub: Subscription) -> impl Stream, Error>> + '_ { // use futures::StreamExt; // block_sub.then(move |block_header_res| async move { // use sp_runtime::traits::Header; @@ -202,14 +130,14 @@ impl<'a, T: Config, Sub: Unpin, Evs: Decode> Unpin // // The advantage of this manual implementation is that we have a named type that we (and others) // can derive things on, store away, alias etc. -impl<'a, Sub, T, Evs, E> Stream for EventSubscription<'a, Sub, T, Evs> +impl Stream for EventSubscription where T: Config, - Evs: Decode, - Sub: Stream> + Unpin + 'a, - E: Into, + Client: OnlineClientT, + Sub: Stream> + Unpin, + E: Into, { - type Item = Result, BasicError>; + type Item = Result, Error>; fn poll_next( mut self: std::pin::Pin<&mut Self>, @@ -235,7 +163,9 @@ where Some(Ok(block_header)) => { // Note [jsdw]: We may be able to get rid of the per-item allocation // with https://github.com/oblique/reusable-box-future. - self.at = Some(Box::pin(at(self.client, block_header.hash()))); + let at = EventsClient::new(self.client.clone()) + .at(Some(block_header.hash())); + self.at = Some(Box::pin(at)); // Continue, so that we poll this function future we've just created. } } @@ -263,16 +193,16 @@ mod test { fn assert_send() {} assert_send::< EventSubscription< - EventSub<::Header>, - crate::DefaultConfig, + crate::SubstrateConfig, (), + EventSub<::Header>, >, >(); assert_send::< EventSubscription< - FinalizedEventSub<::Header>, - crate::DefaultConfig, + crate::SubstrateConfig, (), + FinalizedEventSub<::Header>, >, >(); } diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs new file mode 100644 index 0000000000..27afcc5fd5 --- /dev/null +++ b/subxt/src/events/events_client.rs @@ -0,0 +1,249 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::{ + client::OnlineClientT, + error::Error, + events::{ + EventSub, + EventSubscription, + Events, + FinalizedEventSub, + }, + Config, +}; +use derivative::Derivative; +use futures::{ + future::Either, + stream, + Stream, + StreamExt, +}; +use sp_core::{ + storage::StorageKey, + twox_128, +}; +use sp_runtime::traits::Header; +use std::future::Future; + +/// A client for working with events. +#[derive(Derivative)] +#[derivative(Clone(bound = "Client: Clone"))] +pub struct EventsClient { + client: Client, + _marker: std::marker::PhantomData, +} + +impl EventsClient { + /// Create a new [`EventsClient`]. + pub fn new(client: Client) -> Self { + Self { + client, + _marker: std::marker::PhantomData, + } + } +} + +impl EventsClient +where + T: Config, + Client: OnlineClientT, +{ + /// Obtain events at some block hash. + pub fn at( + &self, + block_hash: Option, + ) -> impl Future, Error>> + Send + 'static { + // Clone and pass the client in like this so that we can explicitly + // return a Future that's Send + 'static, rather than tied to &self. + let client = self.client.clone(); + async move { at(client, block_hash).await } + } + + /// Subscribe to all events from blocks. + /// + /// **Note:** these blocks haven't necessarily been finalised yet; prefer + /// [`EventsClient::subscribe_finalized()`] if that is important. + /// + /// # Example + /// + /// ```no_run + /// # #[tokio::main] + /// # async fn main() { + /// use futures::StreamExt; + /// use subxt::{ OnlineClient, PolkadotConfig }; + /// + /// let api = OnlineClient::::new().await.unwrap(); + /// + /// let mut events = api.events().subscribe().await.unwrap(); + /// + /// while let Some(ev) = events.next().await { + /// // Obtain all events from this block. + /// let ev = ev.unwrap(); + /// // Print block hash. + /// println!("Event at block hash {:?}", ev.block_hash()); + /// // Iterate over all events. + /// let mut iter = ev.iter(); + /// while let Some(event_details) = iter.next() { + /// println!("Event details {:?}", event_details); + /// } + /// } + /// # } + /// ``` + pub fn subscribe( + &self, + ) -> impl Future< + Output = Result>, Error>, + > + Send + + 'static { + let client = self.client.clone(); + async move { subscribe(client).await } + } + + /// Subscribe to events from finalized blocks. See [`EventsClient::subscribe()`] for details. + pub fn subscribe_finalized( + &self, + ) -> impl Future< + Output = Result< + EventSubscription>, + Error, + >, + > + Send + + 'static + where + Client: Send + Sync + 'static, + { + let client = self.client.clone(); + async move { subscribe_finalized(client).await } + } +} + +async fn at( + client: Client, + block_hash: Option, +) -> Result, Error> +where + T: Config, + Client: OnlineClientT, +{ + // If block hash is not provided, get the hash + // for the latest block and use that. + let block_hash = match block_hash { + Some(hash) => hash, + None => { + client + .rpc() + .block_hash(None) + .await? + .expect("didn't pass a block number; qed") + } + }; + + let event_bytes = client + .rpc() + .storage(&*system_events_key().0, Some(block_hash)) + .await? + .map(|e| e.0) + .unwrap_or_else(Vec::new); + + Ok(Events::new(client.metadata(), block_hash, event_bytes)) +} + +async fn subscribe( + client: Client, +) -> Result>, Error> +where + T: Config, + Client: OnlineClientT, +{ + let block_subscription = client.rpc().subscribe_blocks().await?; + Ok(EventSubscription::new(client, block_subscription)) +} + +/// Subscribe to events from finalized blocks. +async fn subscribe_finalized( + client: Client, +) -> Result>, Error> +where + T: Config, + Client: OnlineClientT, +{ + // fetch the last finalised block details immediately, so that we'll get + // events for each block after this one. + let last_finalized_block_hash = client.rpc().finalized_head().await?; + let last_finalized_block_number = client + .rpc() + .header(Some(last_finalized_block_hash)) + .await? + .map(|h| (*h.number()).into()); + + let sub = client.rpc().subscribe_finalized_blocks().await?; + + // Fill in any gaps between the block above and the finalized blocks reported. + let block_subscription = subscribe_to_block_headers_filling_in_gaps( + client.clone(), + last_finalized_block_number, + sub, + ); + + Ok(EventSubscription::new(client, Box::pin(block_subscription))) +} + +/// Note: This is exposed for testing but is not considered stable and may change +/// without notice in a patch release. +#[doc(hidden)] +pub fn subscribe_to_block_headers_filling_in_gaps( + client: Client, + mut last_block_num: Option, + sub: S, +) -> impl Stream> + Send +where + T: Config, + Client: OnlineClientT + Send + Sync, + S: Stream> + Send, + E: Into + Send + 'static, +{ + sub.flat_map(move |s| { + let client = client.clone(); + + // Get the header, or return a stream containing just the error. Our EventSubscription + // stream will return `None` as soon as it hits an error like this. + let header = match s { + Ok(header) => header, + Err(e) => return Either::Left(stream::once(async { Err(e.into()) })), + }; + + // We want all previous details up to, but not including this current block num. + let end_block_num = (*header.number()).into(); + + // This is one after the last block we returned details for last time. + let start_block_num = last_block_num.map(|n| n + 1).unwrap_or(end_block_num); + + // Iterate over all of the previous blocks we need headers for, ignoring the current block + // (which we already have the header info for): + let previous_headers = stream::iter(start_block_num..end_block_num) + .then(move |n| { + let client = client.clone(); + async move { + let hash = client.rpc().block_hash(Some(n.into())).await?; + let header = client.rpc().header(hash).await?; + Ok::<_, Error>(header) + } + }) + .filter_map(|h| async { h.transpose() }); + + // On the next iteration, we'll get details starting just after this end block. + last_block_num = Some(end_block_num); + + // Return a combination of any previous headers plus the new header. + Either::Right(previous_headers.chain(stream::once(async { Ok(header) }))) + }) +} + +// The storage key needed to access events. +fn system_events_key() -> StorageKey { + let mut storage_key = twox_128(b"System").to_vec(); + storage_key.extend(twox_128(b"Events").to_vec()); + StorageKey(storage_key) +} diff --git a/subxt/src/events/events_type.rs b/subxt/src/events/events_type.rs index 25f563c6cd..6897cad439 100644 --- a/subxt/src/events/events_type.rs +++ b/subxt/src/events/events_type.rs @@ -4,13 +4,15 @@ //! A representation of a block of events. +use super::{ + Phase, + StaticEvent, +}; use crate::{ - error::BasicError, - Client, + dynamic::DecodedValue, + error::Error, Config, - Event, Metadata, - Phase, }; use codec::{ Compact, @@ -19,77 +21,48 @@ use codec::{ Input, }; use derivative::Derivative; -use parking_lot::RwLock; -use sp_core::{ - storage::StorageKey, - twox_128, -}; use std::sync::Arc; -/// Obtain events at some block hash. The generic parameter is what we -/// will attempt to decode each event into if using [`Events::iter()`], -/// and is expected to be the outermost event enum that contains all of -/// the possible events across all pallets. -/// -/// **Note:** This function is hidden from the documentation -/// and is exposed only to be called via the codegen. Thus, prefer to use -/// `api.events().at(block_hash)` over calling this directly. -#[doc(hidden)] -pub async fn at( - client: &'_ Client, - block_hash: T::Hash, -) -> Result, BasicError> { - let mut event_bytes = client - .rpc() - .storage(&system_events_key(), Some(block_hash)) - .await? - .map(|s| s.0) - .unwrap_or_else(Vec::new); - - // event_bytes is a SCALE encoded vector of events. So, pluck the - // compact encoded length from the front, leaving the remaining bytes - // for our iterating to decode. - // - // Note: if we get no bytes back, avoid an error reading vec length - // and default to 0 events. - let cursor = &mut &*event_bytes; - let num_events = >::decode(cursor).unwrap_or(Compact(0)).0; - let event_bytes_len = event_bytes.len(); - let remaining_len = cursor.len(); - event_bytes.drain(0..event_bytes_len - remaining_len); - - Ok(Events { - metadata: client.metadata(), - block_hash, - event_bytes, - num_events, - _event_type: std::marker::PhantomData, - }) -} - -// The storage key needed to access events. -fn system_events_key() -> StorageKey { - let mut storage_key = twox_128(b"System").to_vec(); - storage_key.extend(twox_128(b"Events").to_vec()); - StorageKey(storage_key) -} - /// A collection of events obtained from a block, bundled with the necessary /// information needed to decode and iterate over them. #[derive(Derivative)] #[derivative(Debug(bound = ""))] -pub struct Events { - metadata: Arc>, +pub struct Events { + metadata: Metadata, block_hash: T::Hash, // Note; raw event bytes are prefixed with a Compact containing // the number of events to be decoded. We should have stripped that off // before storing the bytes here. - event_bytes: Vec, + event_bytes: Arc<[u8]>, num_events: u32, - _event_type: std::marker::PhantomData, } -impl<'a, T: Config, Evs: Decode> Events { +impl Events { + pub(crate) fn new( + metadata: Metadata, + block_hash: T::Hash, + mut event_bytes: Vec, + ) -> Self { + // event_bytes is a SCALE encoded vector of events. So, pluck the + // compact encoded length from the front, leaving the remaining bytes + // for our iterating to decode. + // + // Note: if we get no bytes back, avoid an error reading vec length + // and default to 0 events. + let cursor = &mut &*event_bytes; + let num_events = >::decode(cursor).unwrap_or(Compact(0)).0; + let event_bytes_len = event_bytes.len(); + let remaining_len = cursor.len(); + event_bytes.drain(0..event_bytes_len - remaining_len); + + Self { + metadata, + block_hash, + event_bytes: event_bytes.into(), + num_events, + } + } + /// The number of events. pub fn len(&self) -> u32 { self.num_events @@ -106,83 +79,23 @@ impl<'a, T: Config, Evs: Decode> Events { self.block_hash } - /// Iterate over the events, statically decoding them as we go. - /// If an event is encountered that cannot be statically decoded, - /// a [`codec::Error`] will be returned. - /// - /// If the generated code does not know about all of the pallets that exist - /// in the runtime being targeted, it may not know about all of the - /// events either, and so this method should be avoided in favout of [`Events::iter_raw()`], - /// which uses runtime metadata to skip over unknown events. - pub fn iter( - &self, - ) -> impl Iterator, BasicError>> + '_ { - let event_bytes = &self.event_bytes; - - let mut pos = 0; - let mut index = 0; - std::iter::from_fn(move || { - let cursor = &mut &event_bytes[pos..]; - let start_len = cursor.len(); - - if start_len == 0 || self.num_events == index { - None - } else { - let mut decode_one_event = || -> Result<_, BasicError> { - let phase = Phase::decode(cursor)?; - let ev = Evs::decode(cursor)?; - let _topics = Vec::::decode(cursor)?; - Ok((phase, ev)) - }; - match decode_one_event() { - Ok((phase, event)) => { - // Skip over decoded bytes in next iteration: - pos += start_len - cursor.len(); - // Gather the event details before incrementing the index for the next iter. - let res = Some(Ok(EventDetails { - phase, - index, - event, - })); - index += 1; - res - } - Err(e) => { - // By setting the position to the "end" of the event bytes, - // the cursor len will become 0 and the iterator will return `None` - // from now on: - pos = event_bytes.len(); - Some(Err(e)) - } - } - } - }) - } - /// Iterate over all of the events, using metadata to dynamically /// decode them as we go, and returning the raw bytes and other associated /// details. If an error occurs, all subsequent iterations return `None`. - /// - /// This method is safe to use even if you do not statically know about - /// all of the possible events; it splits events up using the metadata - /// obtained at runtime, which does. - pub fn iter_raw( + pub fn iter( &self, - ) -> impl Iterator> + '_ { - let event_bytes = &self.event_bytes; - - let metadata = { - let metadata = self.metadata.read(); - metadata.clone() - }; + ) -> impl Iterator> + Send + Sync + 'static { + let event_bytes = self.event_bytes.clone(); + let num_events = self.num_events; + let metadata = self.metadata.clone(); let mut pos = 0; let mut index = 0; std::iter::from_fn(move || { let cursor = &mut &event_bytes[pos..]; let start_len = cursor.len(); - if start_len == 0 || self.num_events == index { + if start_len == 0 || num_events == index { None } else { match decode_raw_event_details::(&metadata, index, cursor) { @@ -206,62 +119,11 @@ impl<'a, T: Config, Evs: Decode> Events { }) } - /// Iterate over all of the events, using metadata to dynamically - /// decode them as we go, and returning the raw bytes and other associated - /// details. If an error occurs, all subsequent iterations return `None`. - /// - /// This method is safe to use even if you do not statically know about - /// all of the possible events; it splits events up using the metadata - /// obtained at runtime, which does. - /// - /// Unlike [`Events::iter_raw()`] this consumes `self`, which can be useful - /// if you need to store the iterator somewhere and avoid lifetime issues. - pub fn into_iter_raw( - self, - ) -> impl Iterator> + 'a { - let mut pos = 0; - let mut index = 0; - let metadata = { - let metadata = self.metadata.read(); - metadata.clone() - }; - - std::iter::from_fn(move || { - let cursor = &mut &self.event_bytes[pos..]; - let start_len = cursor.len(); - - if start_len == 0 || self.num_events == index { - None - } else { - match decode_raw_event_details::(&metadata, index, cursor) { - Ok(raw_event) => { - // Skip over decoded bytes in next iteration: - pos += start_len - cursor.len(); - // Increment the index: - index += 1; - // Return the event details: - Some(Ok(raw_event)) - } - Err(e) => { - // By setting the position to the "end" of the event bytes, - // the cursor len will become 0 and the iterator will return `None` - // from now on: - pos = self.event_bytes.len(); - Some(Err(e)) - } - } - } - }) - } - /// Iterate through the events using metadata to dynamically decode and skip /// them, and return only those which should decode to the provided `Ev` type. /// If an error occurs, all subsequent iterations return `None`. - /// - /// **Note:** This method internally uses [`Events::iter_raw()`], so it is safe to - /// use even if you do not statically know about all of the possible events. - pub fn find(&self) -> impl Iterator> + '_ { - self.iter_raw().filter_map(|ev| { + pub fn find(&self) -> impl Iterator> + '_ { + self.iter().filter_map(|ev| { ev.and_then(|ev| ev.as_event::().map_err(Into::into)) .transpose() }) @@ -269,67 +131,147 @@ impl<'a, T: Config, Evs: Decode> Events { /// Iterate through the events using metadata to dynamically decode and skip /// them, and return the first event found which decodes to the provided `Ev` type. - /// - /// **Note:** This method internally uses [`Events::iter_raw()`], so it is safe to - /// use even if you do not statically know about all of the possible events. - pub fn find_first(&self) -> Result, BasicError> { + pub fn find_first(&self) -> Result, Error> { self.find::().next().transpose() } /// Find an event that decodes to the type provided. Returns true if it was found. - /// - /// **Note:** This method internally uses [`Events::iter_raw()`], so it is safe to - /// use even if you do not statically know about all of the possible events. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some()) } } -/// A decoded event and associated details. +/// The event details. #[derive(Debug, Clone, PartialEq)] -pub struct EventDetails { - /// During which [`Phase`] was the event produced? - pub phase: Phase, - /// What index is this event in the stored events for this block. - pub index: u32, - /// The event itself. - pub event: Evs, +pub struct EventDetails { + phase: Phase, + index: u32, + pallet: String, + variant: String, + bytes: Vec, + // Dev note: this is here because we've pretty much had to generate it + // anyway, but expect it to be generated on the fly in future versions, + // and so don't expose it. + fields: Vec<(Option, DecodedValue)>, } -/// A Value which has been decoded from some raw bytes. -pub type DecodedValue = scale_value::Value; - -/// The raw bytes for an event with associated details about -/// where and when it was emitted. +/// The raw data associated with some event. #[derive(Debug, Clone, PartialEq)] -pub struct RawEventDetails { +pub struct EventDetailParts { /// When was the event produced? pub phase: Phase, /// What index is this event in the stored events for this block. pub index: u32, /// The name of the pallet from whence the Event originated. pub pallet: String, - /// The index of the pallet from whence the Event originated. - pub pallet_index: u8, - /// The name of the pallet Event variant. + /// The name of the pallet's Event variant. pub variant: String, - /// The index of the pallet Event variant. - pub variant_index: u8, - /// The bytes representing the fields contained within the event. + /// All of the bytes representing this event, including the pallet + /// and variant index that the event originated from. pub bytes: Vec, - /// Generic values representing each field of the event. - pub fields: Vec, } -impl RawEventDetails { - /// Attempt to decode this [`RawEventDetails`] into a specific event. - pub fn as_event(&self) -> Result, CodecError> { +impl EventDetails { + /// Return the raw data associated with this event. Useful if you want + /// ownership over parts of the event data. + pub fn parts(self) -> EventDetailParts { + EventDetailParts { + phase: self.phase, + index: self.index, + pallet: self.pallet, + variant: self.variant, + bytes: self.bytes, + } + } + + /// When was the event produced? + pub fn phase(&self) -> Phase { + self.phase + } + + /// What index is this event in the stored events for this block. + pub fn index(&self) -> u32 { + self.index + } + + /// The index of the pallet that the event originated from. + pub fn pallet_index(&self) -> u8 { + // Note: never panics because we set the first two bytes + // in `decode_event_details` to build this. + self.bytes[0] + } + + /// The index of the event variant that the event originated from. + pub fn variant_index(&self) -> u8 { + // Note: never panics because we set the first two bytes + // in `decode_event_details` to build this. + self.bytes[1] + } + + /// The name of the pallet from whence the Event originated. + pub fn pallet_name(&self) -> &str { + &self.pallet + } + + /// The name of the pallet's Event variant. + pub fn variant_name(&self) -> &str { + &self.variant + } + + /// Return the bytes representing this event, which include the pallet + /// and variant index that the event originated from. + pub fn bytes(&self) -> &[u8] { + &self.bytes + } + + /// Return the bytes representing the fields stored in this event. + pub fn field_bytes(&self) -> &[u8] { + &self.bytes[2..] + } + + /// Decode and provide the event fields back in the form of a composite + /// type, which represents either the named or unnamed fields that were + /// present. + // Dev note: if we can optimise Value decoding to avoid allocating + // while working through events, or if the event structure changes + // to allow us to skip over them, we'll no longer keep a copy of the + // decoded events in the event, and the actual decoding will happen + // when this method is called. This is why we return an owned vec and + // not a reference. + pub fn field_values(&self) -> scale_value::Composite { + if self.fields.is_empty() { + scale_value::Composite::Unnamed(vec![]) + } else if self.fields[0].0.is_some() { + let named = self + .fields + .iter() + .map(|(n, f)| (n.clone().unwrap_or_default(), f.clone())) + .collect(); + scale_value::Composite::Named(named) + } else { + let unnamed = self.fields.iter().map(|(_n, f)| f.clone()).collect(); + scale_value::Composite::Unnamed(unnamed) + } + } + + /// Attempt to decode these [`EventDetails`] into a specific static event. + /// This targets the fields within the event directly. You can also attempt to + /// decode the entirety of the event type (including the pallet and event + /// variants) using [`EventDetails::as_root_event()`]. + pub fn as_event(&self) -> Result, CodecError> { if self.pallet == E::PALLET && self.variant == E::EVENT { - Ok(Some(E::decode(&mut &self.bytes[..])?)) + Ok(Some(E::decode(&mut &self.bytes[2..])?)) } else { Ok(None) } } + + /// Attempt to decode these [`EventDetails`] into a root event type (which includes + /// the pallet and event enum variants as well as the event fields). A compatible + /// type for this is exposed via static codegen as a root level `Event` type. + pub fn as_root_event(&self) -> Result { + E::decode(&mut &self.bytes[..]) + } } // Attempt to dynamically decode a single event from our events input. @@ -337,7 +279,7 @@ fn decode_raw_event_details( metadata: &Metadata, index: u32, input: &mut &[u8], -) -> Result { +) -> Result { // Decode basic event details: let phase = Phase::decode(input)?; let pallet_index = input.read_byte()?; @@ -358,19 +300,20 @@ fn decode_raw_event_details( event_metadata.event() ); - // Use metadata to figure out which bytes belong to this event: - let mut event_bytes = Vec::new(); + // Use metadata to figure out which bytes belong to this event. + // the event bytes also include the pallet/variant index so that, if we + // like, we can decode them quite easily into a top level event type. + let mut event_bytes = vec![pallet_index, variant_index]; let mut event_fields = Vec::new(); - for arg in event_metadata.variant().fields() { - let type_id = arg.ty().id(); + for (name, type_id) in event_metadata.fields() { let all_bytes = *input; // consume some bytes for each event field, moving the cursor forward: let value = scale_value::scale::decode_as_type( input, - type_id, + *type_id, &metadata.runtime_metadata().types, )?; - event_fields.push(value); + event_fields.push((name.clone(), value)); // count how many bytes were consumed based on remaining length: let consumed_len = all_bytes.len() - input.len(); // move those consumed bytes to the output vec unaltered: @@ -382,12 +325,10 @@ fn decode_raw_event_details( let topics = Vec::::decode(input)?; tracing::debug!("topics: {:?}", topics); - Ok(RawEventDetails { + Ok(EventDetails { phase, index, - pallet_index, pallet: event_metadata.pallet().to_string(), - variant_index, variant: event_metadata.event().to_string(), bytes: event_bytes, fields: event_fields, @@ -400,8 +341,7 @@ pub(crate) mod test_utils { use super::*; use crate::{ Config, - DefaultConfig, - Phase, + SubstrateConfig, }; use codec::Encode; use frame_metadata::{ @@ -431,7 +371,7 @@ pub(crate) mod test_utils { pub struct EventRecord { phase: Phase, event: AllEvents, - topics: Vec<::Hash>, + topics: Vec<::Hash>, } /// Build an EventRecord, which encoded events in the format expected @@ -474,9 +414,9 @@ pub(crate) mod test_utils { /// Build an `Events` object for test purposes, based on the details provided, /// and with a default block hash. pub fn events( - metadata: Arc>, + metadata: Metadata, event_records: Vec>, - ) -> Events> { + ) -> Events { let num_events = event_records.len() as u32; let mut event_bytes = Vec::new(); for ev in event_records { @@ -487,17 +427,16 @@ pub(crate) mod test_utils { /// Much like [`events`], but takes pre-encoded events and event count, so that we can /// mess with the bytes in tests if we need to. - pub fn events_raw( - metadata: Arc>, + pub fn events_raw( + metadata: Metadata, event_bytes: Vec, num_events: u32, - ) -> Events> { + ) -> Events { Events { - block_hash: ::Hash::default(), - event_bytes, + block_hash: ::Hash::default(), + event_bytes: event_bytes.into(), metadata, num_events, - _event_type: std::marker::PhantomData, } } } @@ -509,18 +448,16 @@ mod tests { event_record, events, events_raw, - AllEvents, }, *, }; - use crate::Phase; use codec::Encode; use scale_info::TypeInfo; use scale_value::Value; /// Build a fake wrapped metadata. - fn metadata() -> Arc> { - Arc::new(RwLock::new(test_utils::metadata::())) + fn metadata() -> Metadata { + test_utils::metadata::() } /// [`RawEventDetails`] can be annoying to test, because it contains @@ -542,170 +479,42 @@ mod tests { pub fn assert_raw_events_match( // Just for convenience, pass in the metadata type constructed // by the `metadata` function above to simplify caller code. - metadata: &Arc>, - actual: RawEventDetails, + metadata: &Metadata, + actual: EventDetails, expected: TestRawEventDetails, ) { - let metadata = metadata.read(); let types = &metadata.runtime_metadata().types; // Make sure that the bytes handed back line up with the fields handed back; // encode the fields back into bytes and they should be equal. let mut actual_bytes = vec![]; - for field in &actual.fields { + for (_name, field) in &actual.fields { scale_value::scale::encode_as_type( - field.clone(), + field, field.context, types, &mut actual_bytes, ) .expect("should be able to encode properly"); } - assert_eq!(actual_bytes, actual.bytes); + assert_eq!(actual_bytes, actual.field_bytes()); let actual_fields_no_context: Vec<_> = actual - .fields - .into_iter() - .map(|f| f.remove_context()) + .field_values() + .into_values() + .map(|value| value.remove_context()) .collect(); // Check each of the other fields: - assert_eq!(actual.phase, expected.phase); - assert_eq!(actual.index, expected.index); - assert_eq!(actual.pallet, expected.pallet); - assert_eq!(actual.pallet_index, expected.pallet_index); - assert_eq!(actual.variant, expected.variant); - assert_eq!(actual.variant_index, expected.variant_index); + assert_eq!(actual.phase(), expected.phase); + assert_eq!(actual.index(), expected.index); + assert_eq!(actual.pallet_name(), expected.pallet); + assert_eq!(actual.pallet_index(), expected.pallet_index); + assert_eq!(actual.variant_name(), expected.variant); + assert_eq!(actual.variant_index(), expected.variant_index); assert_eq!(actual_fields_no_context, expected.fields); } - #[test] - fn statically_decode_single_event() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(u8), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - // Encode our events in the format we expect back from a node, and - // construct an Events object to iterate them: - let events = events::( - metadata, - vec![event_record(Phase::Finalization, Event::A(1))], - ); - - let event_details: Vec>> = - events.iter().collect::>().unwrap(); - assert_eq!( - event_details, - vec![EventDetails { - index: 0, - phase: Phase::Finalization, - event: AllEvents::Test(Event::A(1)) - }] - ); - } - - #[test] - fn statically_decode_multiple_events() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(u8), - B(bool), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode our events in the format we expect back from a node, and - // construst an Events object to iterate them: - let events = events::( - metadata, - vec![ - event_record(Phase::Initialization, Event::A(1)), - event_record(Phase::ApplyExtrinsic(123), Event::B(true)), - event_record(Phase::Finalization, Event::A(234)), - ], - ); - - let event_details: Vec>> = - events.iter().collect::>().unwrap(); - assert_eq!( - event_details, - vec![ - EventDetails { - index: 0, - phase: Phase::Initialization, - event: AllEvents::Test(Event::A(1)) - }, - EventDetails { - index: 1, - phase: Phase::ApplyExtrinsic(123), - event: AllEvents::Test(Event::B(true)) - }, - EventDetails { - index: 2, - phase: Phase::Finalization, - event: AllEvents::Test(Event::A(234)) - }, - ] - ); - } - - #[test] - fn statically_decode_multiple_events_until_error() { - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum Event { - A(u8), - B(bool), - } - - // Create fake metadata that knows about our single event, above: - let metadata = metadata::(); - - // Encode 2 events: - let mut event_bytes = vec![]; - event_record(Phase::Initialization, Event::A(1)).encode_to(&mut event_bytes); - event_record(Phase::ApplyExtrinsic(123), Event::B(true)) - .encode_to(&mut event_bytes); - - // Push a few naff bytes to the end (a broken third event): - event_bytes.extend_from_slice(&[3, 127, 45, 0, 2]); - - // Encode our events in the format we expect back from a node, and - // construst an Events object to iterate them: - let events = events_raw::( - metadata, - event_bytes, - 3, // 2 "good" events, and then it'll hit the naff bytes. - ); - - let mut events_iter = events.iter(); - assert_eq!( - events_iter.next().unwrap().unwrap(), - EventDetails { - index: 0, - phase: Phase::Initialization, - event: AllEvents::Test(Event::A(1)) - } - ); - assert_eq!( - events_iter.next().unwrap().unwrap(), - EventDetails { - index: 1, - phase: Phase::ApplyExtrinsic(123), - event: AllEvents::Test(Event::B(true)) - } - ); - - // We'll hit an error trying to decode the third event: - assert!(events_iter.next().unwrap().is_err()); - // ... and then "None" from then on. - assert!(events_iter.next().is_none()); - assert!(events_iter.next().is_none()); - } - #[test] fn dynamically_decode_single_event() { #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] @@ -724,7 +533,7 @@ mod tests { vec![event_record(Phase::ApplyExtrinsic(123), event)], ); - let mut event_details = events.iter_raw(); + let mut event_details = events.iter(); assert_raw_events_match( &metadata, event_details.next().unwrap().unwrap(), @@ -736,7 +545,7 @@ mod tests { variant: "A".to_string(), variant_index: 0, fields: vec![ - Value::uint(1u8), + Value::u128(1), Value::bool(true), Value::unnamed_composite(vec![Value::string("Hi")]), ], @@ -771,7 +580,7 @@ mod tests { ], ); - let mut event_details = events.iter_raw(); + let mut event_details = events.iter(); assert_raw_events_match( &metadata, @@ -783,7 +592,7 @@ mod tests { pallet_index: 0, variant: "A".to_string(), variant_index: 0, - fields: vec![Value::uint(1u8)], + fields: vec![Value::u128(1)], }, ); assert_raw_events_match( @@ -809,7 +618,7 @@ mod tests { pallet_index: 0, variant: "A".to_string(), variant_index: 0, - fields: vec![Value::uint(234u8)], + fields: vec![Value::u128(234)], }, ); assert!(event_details.next().is_none()); @@ -837,13 +646,13 @@ mod tests { // Encode our events in the format we expect back from a node, and // construst an Events object to iterate them: - let events = events_raw::( + let events = events_raw( metadata.clone(), event_bytes, 3, // 2 "good" events, and then it'll hit the naff bytes. ); - let mut events_iter = events.iter_raw(); + let mut events_iter = events.iter(); assert_raw_events_match( &metadata, events_iter.next().unwrap().unwrap(), @@ -854,7 +663,7 @@ mod tests { pallet_index: 0, variant: "A".to_string(), variant_index: 0, - fields: vec![Value::uint(1u8)], + fields: vec![Value::u128(1)], }, ); assert_raw_events_match( @@ -895,20 +704,8 @@ mod tests { vec![event_record(Phase::Finalization, Event::A(1))], ); - // Statically decode: - let event_details: Vec>> = - events.iter().collect::>().unwrap(); - assert_eq!( - event_details, - vec![EventDetails { - index: 0, - phase: Phase::Finalization, - event: AllEvents::Test(Event::A(1)) - }] - ); - // Dynamically decode: - let mut event_details = events.iter_raw(); + let mut event_details = events.iter(); assert_raw_events_match( &metadata, event_details.next().unwrap().unwrap(), @@ -919,7 +716,7 @@ mod tests { pallet_index: 0, variant: "A".to_string(), variant_index: 0, - fields: vec![Value::uint(1u8)], + fields: vec![Value::u128(1)], }, ); assert!(event_details.next().is_none()); @@ -948,20 +745,8 @@ mod tests { )], ); - // Statically decode: - let event_details: Vec>> = - events.iter().collect::>().unwrap(); - assert_eq!( - event_details, - vec![EventDetails { - index: 0, - phase: Phase::Finalization, - event: AllEvents::Test(Event::A(CompactWrapper(1))) - }] - ); - // Dynamically decode: - let mut event_details = events.iter_raw(); + let mut event_details = events.iter(); assert_raw_events_match( &metadata, event_details.next().unwrap().unwrap(), @@ -972,7 +757,7 @@ mod tests { pallet_index: 0, variant: "A".to_string(), variant_index: 0, - fields: vec![Value::unnamed_composite(vec![Value::uint(1u8)])], + fields: vec![Value::unnamed_composite(vec![Value::u128(1)])], }, ); assert!(event_details.next().is_none()); @@ -1002,20 +787,8 @@ mod tests { vec![event_record(Phase::Finalization, Event::A(MyType::B))], ); - // Statically decode: - let event_details: Vec>> = - events.iter().collect::>().unwrap(); - assert_eq!( - event_details, - vec![EventDetails { - index: 0, - phase: Phase::Finalization, - event: AllEvents::Test(Event::A(MyType::B)) - }] - ); - // Dynamically decode: - let mut event_details = events.iter_raw(); + let mut event_details = events.iter(); assert_raw_events_match( &metadata, event_details.next().unwrap().unwrap(), diff --git a/subxt/src/events/filter_events.rs b/subxt/src/events/filter_events.rs index cc9dba11ff..718d168048 100644 --- a/subxt/src/events/filter_events.rs +++ b/subxt/src/events/filter_events.rs @@ -4,14 +4,15 @@ //! Filtering individual events from subscriptions. -use super::Events; +use super::{ + Events, + Phase, + StaticEvent, +}; use crate::{ - BasicError, Config, - Event, - Phase, + Error, }; -use codec::Decode; use futures::{ Stream, StreamExt, @@ -28,7 +29,7 @@ use std::{ /// exactly one of these will be `Some(event)` each iteration. pub struct FilterEvents<'a, Sub: 'a, T: Config, Filter: EventFilter> { // A subscription; in order for the Stream impl to apply, this will - // impl `Stream, BasicError>> + Unpin + 'a`. + // impl `Stream, Error>> + Unpin + 'a`. sub: Sub, // Each time we get Events from our subscription, they are stored here // and iterated through in future stream iterations until exhausted. @@ -37,7 +38,7 @@ pub struct FilterEvents<'a, Sub: 'a, T: Config, Filter: EventFilter> { dyn Iterator< Item = Result< FilteredEventDetails, - BasicError, + Error, >, > + Send + 'a, @@ -56,14 +57,13 @@ impl<'a, Sub: 'a, T: Config, Filter: EventFilter> FilterEvents<'a, Sub, T, Filte } } -impl<'a, Sub, T, Evs, Filter> Stream for FilterEvents<'a, Sub, T, Filter> +impl<'a, Sub, T, Filter> Stream for FilterEvents<'a, Sub, T, Filter> where - Sub: Stream, BasicError>> + Unpin + 'a, + Sub: Stream, Error>> + Unpin + 'a, T: Config, - Evs: Decode + 'static, Filter: EventFilter, { - type Item = Result, BasicError>; + type Item = Result, Error>; fn poll_next( mut self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>, @@ -112,14 +112,11 @@ pub trait EventFilter: private::Sealed { /// The type we'll be handed back from filtering. type ReturnType; /// Filter the events based on the type implementing this trait. - fn filter<'a, T: Config, Evs: Decode + 'static>( - events: Events, + fn filter<'a, T: Config>( + events: Events, ) -> Box< dyn Iterator< - Item = Result< - FilteredEventDetails, - BasicError, - >, + Item = Result, Error>, > + Send + 'a, >; @@ -134,18 +131,16 @@ pub(crate) mod private { // A special case impl for searching for a tuple of exactly one event (in this case, we don't // need to return an `(Option,)`; we can just return `Event`. -impl private::Sealed for (Ev,) {} -impl EventFilter for (Ev,) { +impl private::Sealed for (Ev,) {} +impl EventFilter for (Ev,) { type ReturnType = Ev; - fn filter<'a, T: Config, Evs: Decode + 'static>( - events: Events, + fn filter<'a, T: Config>( + events: Events, ) -> Box< - dyn Iterator, BasicError>> - + Send - + 'a, + dyn Iterator, Error>> + Send + 'a, > { let block_hash = events.block_hash(); - let mut iter = events.into_iter_raw(); + let mut iter = events.iter(); Box::new(std::iter::from_fn(move || { for ev in iter.by_ref() { // Forward any error immediately: @@ -158,7 +153,7 @@ impl EventFilter for (Ev,) { if let Ok(Some(event)) = ev { // We found a match; return our tuple. return Some(Ok(FilteredEventDetails { - phase: raw_event.phase, + phase: raw_event.phase(), block_hash, event, })) @@ -176,14 +171,14 @@ impl EventFilter for (Ev,) { // A generalised impl for tuples of sizes greater than 1: macro_rules! impl_event_filter { ($($ty:ident $idx:tt),+) => { - impl <$($ty: Event),+> private::Sealed for ( $($ty,)+ ) {} - impl <$($ty: Event),+> EventFilter for ( $($ty,)+ ) { + impl <$($ty: StaticEvent),+> private::Sealed for ( $($ty,)+ ) {} + impl <$($ty: StaticEvent),+> EventFilter for ( $($ty,)+ ) { type ReturnType = ( $(Option<$ty>,)+ ); - fn filter<'a, T: Config, Evs: Decode + 'static>( - events: Events - ) -> Box, BasicError>> + Send + 'a> { + fn filter<'a, T: Config>( + events: Events + ) -> Box, Error>> + Send + 'a> { let block_hash = events.block_hash(); - let mut iter = events.into_iter_raw(); + let mut iter = events.iter(); Box::new(std::iter::from_fn(move || { let mut out: ( $(Option<$ty>,)+ ) = Default::default(); for ev in iter.by_ref() { @@ -199,7 +194,7 @@ macro_rules! impl_event_filter { // We found a match; return our tuple. out.$idx = Some(ev); return Some(Ok(FilteredEventDetails { - phase: raw_event.phase, + phase: raw_event.phase(), block_hash, event: out })) @@ -232,24 +227,24 @@ mod test { event_record, events, metadata, - AllEvents, }, *, }; use crate::{ Config, - DefaultConfig, Metadata, + SubstrateConfig, + }; + use codec::{ + Decode, + Encode, }; - use codec::Encode; use futures::{ stream, Stream, StreamExt, }; - use parking_lot::RwLock; use scale_info::TypeInfo; - use std::sync::Arc; // Some pretend events in a pallet #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] @@ -262,7 +257,7 @@ mod test { // An event in our pallet that we can filter on. #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] struct EventA(u8); - impl crate::Event for EventA { + impl StaticEvent for EventA { const PALLET: &'static str = "Test"; const EVENT: &'static str = "A"; } @@ -270,7 +265,7 @@ mod test { // An event in our pallet that we can filter on. #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] struct EventB(bool); - impl crate::Event for EventB { + impl StaticEvent for EventB { const PALLET: &'static str = "Test"; const EVENT: &'static str = "B"; } @@ -278,16 +273,15 @@ mod test { // An event in our pallet that we can filter on. #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] struct EventC(u8, bool); - impl crate::Event for EventC { + impl StaticEvent for EventC { const PALLET: &'static str = "Test"; const EVENT: &'static str = "C"; } // A stream of fake events for us to try filtering on. fn events_stream( - metadata: Arc>, - ) -> impl Stream>, BasicError>> - { + metadata: Metadata, + ) -> impl Stream, Error>> { stream::iter(vec![ events::( metadata.clone(), @@ -312,16 +306,16 @@ mod test { ], ), ]) - .map(Ok::<_, BasicError>) + .map(Ok::<_, Error>) } #[tokio::test] async fn filter_one_event_from_stream() { - let metadata = Arc::new(RwLock::new(metadata::())); + let metadata = metadata::(); // Filter out fake event stream to select events matching `EventA` only. let actual: Vec<_> = - FilterEvents::<_, DefaultConfig, (EventA,)>::new(events_stream(metadata)) + FilterEvents::<_, SubstrateConfig, (EventA,)>::new(events_stream(metadata)) .map(|e| e.unwrap()) .collect() .await; @@ -329,17 +323,17 @@ mod test { let expected = vec![ FilteredEventDetails { phase: Phase::Initialization, - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: EventA(1), }, FilteredEventDetails { phase: Phase::Finalization, - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: EventA(2), }, FilteredEventDetails { phase: Phase::ApplyExtrinsic(3), - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: EventA(3), }, ]; @@ -349,10 +343,10 @@ mod test { #[tokio::test] async fn filter_some_events_from_stream() { - let metadata = Arc::new(RwLock::new(metadata::())); + let metadata = metadata::(); // Filter out fake event stream to select events matching `EventA` or `EventB`. - let actual: Vec<_> = FilterEvents::<_, DefaultConfig, (EventA, EventB)>::new( + let actual: Vec<_> = FilterEvents::<_, SubstrateConfig, (EventA, EventB)>::new( events_stream(metadata), ) .map(|e| e.unwrap()) @@ -362,32 +356,32 @@ mod test { let expected = vec![ FilteredEventDetails { phase: Phase::Initialization, - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: (Some(EventA(1)), None), }, FilteredEventDetails { phase: Phase::ApplyExtrinsic(0), - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: (None, Some(EventB(true))), }, FilteredEventDetails { phase: Phase::Finalization, - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: (Some(EventA(2)), None), }, FilteredEventDetails { phase: Phase::ApplyExtrinsic(1), - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: (None, Some(EventB(false))), }, FilteredEventDetails { phase: Phase::ApplyExtrinsic(2), - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: (None, Some(EventB(true))), }, FilteredEventDetails { phase: Phase::ApplyExtrinsic(3), - block_hash: ::Hash::default(), + block_hash: ::Hash::default(), event: (Some(EventA(3)), None), }, ]; @@ -397,11 +391,11 @@ mod test { #[tokio::test] async fn filter_no_events_from_stream() { - let metadata = Arc::new(RwLock::new(metadata::())); + let metadata = metadata::(); // Filter out fake event stream to select events matching `EventC` (none exist). let actual: Vec<_> = - FilterEvents::<_, DefaultConfig, (EventC,)>::new(events_stream(metadata)) + FilterEvents::<_, SubstrateConfig, (EventC,)>::new(events_stream(metadata)) .map(|e| e.unwrap()) .collect() .await; diff --git a/subxt/src/events/mod.rs b/subxt/src/events/mod.rs index 83fc828321..d0c9ba0f5b 100644 --- a/subxt/src/events/mod.rs +++ b/subxt/src/events/mod.rs @@ -2,108 +2,65 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -//! This module exposes the ability to work with events generated by a given block. -//! Subxt can either attempt to statically decode events into known types, or it -//! can hand back details of the raw event without knowing what shape its contents -//! are (this may be useful if we don't know what exactly we're looking for). -//! -//! This module is wrapped by the generated API in `RuntimeAPI::EventsApi`. -//! -//! # Examples -//! -//! ## Subscribe to all events -//! -//! Users can subscribe to all emitted events from blocks using `subscribe()`. -//! -//! To subscribe to all events from just the finalized blocks use `subscribe_finalized()`. -//! -//! To obtain the events from a given block use `at()`. -//! -//! ```no_run -//! # use futures::StreamExt; -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! # pub mod polkadot {} -//! # #[tokio::main] -//! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! let mut events = api.events().subscribe().await.unwrap(); -//! -//! while let Some(ev) = events.next().await { -//! // Obtain all events from this block. -//! let ev: subxt::Events<_, _> = ev.unwrap(); -//! // Print block hash. -//! println!("Event at block hash {:?}", ev.block_hash()); -//! // Iterate over all events. -//! let mut iter = ev.iter(); -//! while let Some(event_details) = iter.next() { -//! println!("Event details {:?}", event_details); -//! } -//! } -//! # } -//! ``` -//! -//! ## Filter events -//! -//! The subxt exposes the ability to filter events via the `filter_events()` function. -//! -//! The function filters events from the provided tuple. If 1-tuple is provided, the events are -//! returned directly. Otherwise, we'll be given a corresponding tuple of `Option`'s, with exactly -//! one variant populated each time. -//! -//! ```no_run -//! # use futures::StreamExt; -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! pub mod polkadot {} -//! -//! # #[tokio::main] -//! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! -//! let mut transfer_events = api -//! .events() -//! .subscribe() -//! .await -//! .unwrap() -//! .filter_events::<(polkadot::balances::events::Transfer,)>(); -//! -//! while let Some(transfer_event) = transfer_events.next().await { -//! println!("Balance transfer event: {transfer_event:?}"); -//! } -//! # } -//! ``` +//! This module exposes the types and such necessary for working with events. +//! The two main entry points into events are [`crate::OnlineClient::events()`] +//! and calls like [crate::tx::TxProgress::wait_for_finalized_success()]. mod event_subscription; +mod events_client; mod events_type; mod filter_events; pub use event_subscription::{ - subscribe, - subscribe_finalized, - subscribe_to_block_headers_filling_in_gaps, EventSub, EventSubscription, FinalizedEventSub, }; +pub use events_client::{ + // Exposed only for testing: + subscribe_to_block_headers_filling_in_gaps, + EventsClient, +}; pub use events_type::{ - at, - DecodedValue, EventDetails, Events, - RawEventDetails, }; pub use filter_events::{ EventFilter, FilterEvents, FilteredEventDetails, }; + +use codec::{ + Decode, + Encode, +}; + +/// Trait to uniquely identify the events's identity from the runtime metadata. +/// +/// Generated API structures that represent an event implement this trait. +/// +/// The trait is utilized to decode emitted events from a block, via obtaining the +/// form of the `Event` from the metadata. +pub trait StaticEvent: Decode { + /// Pallet name. + const PALLET: &'static str; + /// Event name. + const EVENT: &'static str; + + /// Returns true if the given pallet and event names match this event. + fn is_event(pallet: &str, event: &str) -> bool { + Self::PALLET == pallet && Self::EVENT == event + } +} + +/// A phase of a block's execution. +#[derive(Copy, Clone, Debug, Eq, PartialEq, Decode, Encode)] +pub enum Phase { + /// Applying an extrinsic. + ApplyExtrinsic(u32), + /// Finalizing the block. + Finalization, + /// Initializing the block. + Initialization, +} diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index 245340ff10..53b0a78c08 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -10,164 +10,80 @@ //! - [Query constants](https://docs.substrate.io/how-to-guides/v3/basics/configurable-constants/) (Constants) //! - [Subscribe to events](https://docs.substrate.io/v3/runtime/events-and-errors/) (Events) //! -//! -//! # Generate the runtime API -//! -//! Subxt generates a runtime API from downloaded static metadata. The metadata can be downloaded using the -//! [subxt-cli](https://crates.io/crates/subxt-cli) tool. -//! -//! To generate the runtime API, use the `subxt` attribute which points at downloaded static metadata. -//! -//! ```ignore -//! #[subxt::subxt(runtime_metadata_path = "metadata.scale")] -//! pub mod node_runtime { } -//! ``` -//! -//! The `node_runtime` has the following hierarchy: -//! -//! ```rust -//! pub mod node_runtime { -//! pub mod PalletName { -//! pub mod calls { } -//! pub mod storage { } -//! pub mod constants { } -//! pub mod events { } -//! } -//! } -//! ``` -//! -//! For more information regarding the `node_runtime` hierarchy, please visit the -//! [subxt-codegen](https://docs.rs/subxt-codegen/latest/subxt_codegen/) documentation. -//! -//! //! # Initializing the API client //! -//! ```no_run -//! use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; +//! To interact with a node, you'll need to construct a client. //! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! pub mod polkadot {} +//! ```no_run +//! use subxt::{OnlineClient, PolkadotConfig}; //! //! # #[tokio::main] //! # async fn main() { -//! let api = ClientBuilder::new() -//! .set_url("wss://rpc.polkadot.io:443") -//! .build() -//! .await -//! .unwrap() -//! .to_runtime_api::>>(); +//! let api = OnlineClient::::new().await.unwrap(); //! # } //! ``` //! -//! The `RuntimeApi` type is generated by the `subxt` macro from the supplied metadata. This can be parameterized with user -//! supplied implementations for the `Config` and `Extra` types, if the default implementation differs from the target -//! chain. +//! This default client connects to a locally running node, but can be configured to point anywhere. +//! Additionally, an [`crate::OfflineClient`] is available to perform operations that don't require a +//! network connection to a node. //! -//! To ensure that extrinsics are properly submitted, during the build phase of the Client the -//! runtime metadata of the node is downloaded. If the URL is not specified (`set_url`), the local host is used instead. +//! The client takes a type parameter, here [`crate::PolkadotConfig`], which bakes in assumptions about +//! the structure of extrinsics and the underlying types used by the node for things like block numbers. +//! If the node you'd like to interact with deviates from Polkadot or the default Substrate node in these +//! areas, you'll need to configure them by implementing the [`crate::config::Config`] type yourself. //! +//! # Generating runtime types //! -//! # Submit Extrinsics -//! -//! Extrinsics are obtained using the API's `RuntimeApi::tx()` method, followed by `pallet_name()` and then the -//! `call_item_name()`. -//! -//! Submit an extrinsic, returning success once the transaction is validated and accepted into the pool: -//! -//! Please visit the [balance_transfer](../examples/examples/balance_transfer.rs) example for more details. -//! -//! -//! # Querying Storage -//! -//! The runtime storage is queried via the generated `RuntimeApi::storage()` method, followed by the `pallet_name()` and -//! then the `storage_item_name()`. -//! -//! Please visit the [fetch_staking_details](../examples/examples/fetch_staking_details.rs) example for more details. -//! -//! # Query Constants -//! -//! Constants are embedded into the node's metadata. -//! -//! The subxt offers the ability to query constants from the runtime metadata (metadata downloaded when constructing -//! the client, *not* the one provided for API generation). -//! -//! To query constants use the generated `RuntimeApi::constants()` method, followed by the `pallet_name()` and then the -//! `constant_item_name()`. +//! Subxt can generate types at compile time to help you interact with a node. The metadata can be downloaded using the +//! [subxt-cli](https://crates.io/crates/subxt-cli) tool. //! -//! Please visit the [fetch_constants](../examples/examples/fetch_constants.rs) example for more details. +//! To generate the types, use the `subxt` attribute which points at downloaded static metadata. //! -//! # Subscribe to Events +//! ```ignore +//! #[subxt::subxt(runtime_metadata_path = "metadata.scale")] +//! pub mod node_runtime { } +//! ``` //! -//! To subscribe to events, use the generated `RuntimeApi::events()` method which exposes: -//! - `subscribe()` - Subscribe to events emitted from blocks. These blocks haven't necessarily been finalised. -//! - `subscribe_finalized()` - Subscribe to events from finalized blocks. -//! - `at()` - Obtain events at a given block hash. +//! For more information, please visit the [subxt-codegen](https://docs.rs/subxt-codegen/latest/subxt_codegen/) +//! documentation. //! +//! # Interacting with the API //! -//! *Examples* -//! - [subscribe_all_events](../examples/examples/subscribe_all_events.rs): Subscribe to events emitted from blocks. -//! - [subscribe_one_event](../examples/examples/subscribe_one_event.rs): Subscribe and filter by one event. -//! - [subscribe_some_events](../examples/examples/subscribe_some_events.rs): Subscribe and filter event. +//! Once instantiated, a client, exposes four functions: +//! - `.tx()` for submitting extrinsics/transactions. See [`crate::tx::TxClient`] for more details, or see +//! the [balance_transfer](../examples/examples/balance_transfer.rs) example. +//! - `.storage()` for fetching and iterating over storage entries. See [`crate::storage::StorageClient`] for more details, or see +//! the [fetch_staking_details](../examples/examples/fetch_staking_details.rs) example. +//! - `.constants()` for getting hold of constants. See [`crate::constants::ConstantsClient`] for more details, or see +//! the [fetch_constants](../examples/examples/fetch_constants.rs) example. +//! - `.events()` for subscribing/obtaining events. See [`crate::events::EventsClient`] for more details, or see: +//! - [subscribe_all_events](../examples/examples/subscribe_all_events.rs): Subscribe to events emitted from blocks. +//! - [subscribe_one_event](../examples/examples/subscribe_one_event.rs): Subscribe and filter by one event. +//! - [subscribe_some_events](../examples/examples/subscribe_some_events.rs): Subscribe and filter event. //! //! # Static Metadata Validation //! -//! There are two types of metadata that the subxt is aware of: -//! - static metadata: Metadata used for generating the API. -//! - runtime metadata: Metadata downloaded from the target node when a subxt client is created. -//! -//! There are cases when the static metadata is different from the runtime metadata of a node. -//! Such is the case when the node performs a runtime update. -//! -//! To ensure that subxt can properly communicate with the target node the static metadata is validated -//! against the runtime metadata of the node. +//! If you use types generated by the [`crate::subxt`] macro, there is a chance that they will fall out of sync +//! with the actual state of the node you're trying to interact with. //! -//! This validation is performed at the Call, Constant, and Storage levels, as well for the entire metadata. -//! The level of granularity ensures that the users can still submit a given call, even if another -//! call suffered changes. +//! When you attempt to use any of these static types to interact with a node, Subxt will validate that they are +//! still compatible and issue an error if they have deviated. //! -//! Full metadata validation: +//! Additionally, you can validate that the entirety of the statically generated code aligns with a node like so: //! //! ```no_run -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! # pub mod polkadot {} -//! # #[tokio::main] -//! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! // To make sure that all of our statically generated pallets are compatible with the -//! // runtime node, we can run this check: -//! api.validate_metadata().unwrap(); -//! # } -//! ``` +//! use subxt::{OnlineClient, PolkadotConfig}; //! -//! Call level validation: +//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +//! pub mod polkadot {} //! -//! ```ignore -//! # use sp_keyring::AccountKeyring; -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! # pub mod polkadot {} //! # #[tokio::main] //! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! // Submit the `transfer` extrinsic from Alice's account to Bob's. -//! let dest = AccountKeyring::Bob.to_account_id().into(); +//! let api = OnlineClient::::new().await.unwrap(); //! -//! let extrinsic = api -//! .tx() -//! .balances() -//! // Constructing an extrinsic will fail if the metadata -//! // is not in sync with the generated API. -//! .transfer(dest, 123_456_789_012_345) -//! .unwrap(); +//! if let Err(_e) = polkadot::validate_codegen(&api) { +//! println!("Generated code is not up to date with node we're connected to"); +//! } //! # } //! ``` //! @@ -204,221 +120,42 @@ )] #![allow(clippy::type_complexity)] -pub use frame_metadata::StorageHasher; pub use subxt_macro::subxt; -pub use bitvec; -pub use codec; -pub use sp_core; -pub use sp_runtime; - -use codec::{ - Decode, - DecodeAll, - Encode, -}; -use core::fmt::Debug; -use derivative::Derivative; - -mod client; -mod config; -mod error; +pub mod client; +pub mod config; +pub mod constants; +pub mod dynamic; +pub mod error; pub mod events; -pub mod extrinsic; -mod metadata; +pub mod metadata; pub mod rpc; pub mod storage; -mod transaction; -pub mod updates; +pub mod tx; +pub mod utils; +// Expose a few of the most common types at root, +// but leave most types behind their respoctive modules. pub use crate::{ client::{ - Client, - ClientBuilder, - SubmittableExtrinsic, + OfflineClient, + OnlineClient, }, config::{ Config, - DefaultConfig, - }, - error::{ - BasicError, - Error, - GenericError, - HasModuleError, - ModuleError, - ModuleErrorData, - RuntimeError, - TransactionError, - }, - events::{ - EventDetails, - Events, - RawEventDetails, - }, - extrinsic::{ - PairSigner, - PolkadotExtrinsicParams, - PolkadotExtrinsicParamsBuilder, - SubstrateExtrinsicParams, - SubstrateExtrinsicParamsBuilder, - }, - metadata::{ - ErrorMetadata, - Metadata, - MetadataError, - PalletMetadata, - }, - rpc::{ - BlockNumber, - ReadProof, - RpcClient, - SystemProperties, - }, - storage::{ - KeyIter, - StorageEntry, - StorageEntryKey, - StorageMapKey, - }, - transaction::{ - TransactionEvents, - TransactionInBlock, - TransactionProgress, - TransactionStatus, + PolkadotConfig, + SubstrateConfig, }, + error::Error, + metadata::Metadata, }; -/// Trait to uniquely identify the call (extrinsic)'s identity from the runtime metadata. -/// -/// Generated API structures that represent each of the different possible -/// calls to a node each implement this trait. -/// -/// When encoding an extrinsic, we use this information to know how to map -/// the call to the specific pallet and call index needed by a particular node. -pub trait Call: Encode { - /// Pallet name. - const PALLET: &'static str; - /// Function name. - const FUNCTION: &'static str; - - /// Returns true if the given pallet and function names match this call. - fn is_call(pallet: &str, function: &str) -> bool { - Self::PALLET == pallet && Self::FUNCTION == function - } -} - -/// Trait to uniquely identify the events's identity from the runtime metadata. -/// -/// Generated API structures that represent an event implement this trait. -/// -/// The trait is utilized to decode emitted events from a block, via obtaining the -/// form of the `Event` from the metadata. -pub trait Event: Decode { - /// Pallet name. - const PALLET: &'static str; - /// Event name. - const EVENT: &'static str; - - /// Returns true if the given pallet and event names match this event. - fn is_event(pallet: &str, event: &str) -> bool { - Self::PALLET == pallet && Self::EVENT == event - } +/// Re-export external crates that are made use of in the subxt API. +pub mod ext { + pub use bitvec; + pub use codec; + pub use frame_metadata; + pub use scale_value; + pub use sp_core; + pub use sp_runtime; } - -/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of -/// the transaction payload -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct Encoded(pub Vec); - -impl codec::Encode for Encoded { - fn encode(&self) -> Vec { - self.0.to_owned() - } -} - -/// A phase of a block's execution. -#[derive(Clone, Debug, Eq, PartialEq, Decode, Encode)] -pub enum Phase { - /// Applying an extrinsic. - ApplyExtrinsic(u32), - /// Finalizing the block. - Finalization, - /// Initializing the block. - Initialization, -} - -/// A wrapper for any type `T` which implement encode/decode in a way compatible with `Vec`. -/// -/// [`WrapperKeepOpaque`] stores the type only in its opaque format, aka as a `Vec`. To -/// access the real type `T` [`Self::try_decode`] needs to be used. -#[derive(Derivative, Encode, Decode)] -#[derivative( - Debug(bound = ""), - Clone(bound = ""), - PartialEq(bound = ""), - Eq(bound = ""), - Default(bound = ""), - Hash(bound = "") -)] -pub struct WrapperKeepOpaque { - data: Vec, - _phantom: PhantomDataSendSync, -} - -impl WrapperKeepOpaque { - /// Try to decode the wrapped type from the inner `data`. - /// - /// Returns `None` if the decoding failed. - pub fn try_decode(&self) -> Option { - T::decode_all(&mut &self.data[..]).ok() - } - - /// Returns the length of the encoded `T`. - pub fn encoded_len(&self) -> usize { - self.data.len() - } - - /// Returns the encoded data. - pub fn encoded(&self) -> &[u8] { - &self.data - } - - /// Create from the given encoded `data`. - pub fn from_encoded(data: Vec) -> Self { - Self { - data, - _phantom: PhantomDataSendSync::new(), - } - } -} - -/// A version of [`std::marker::PhantomData`] that is also Send and Sync (which is fine -/// because regardless of the generic param, it is always possible to Send + Sync this -/// 0 size type). -#[derive(Derivative, Encode, Decode, scale_info::TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = ""), - Default(bound = ""), - Hash(bound = "") -)] -#[scale_info(skip_type_params(T))] -#[doc(hidden)] -pub struct PhantomDataSendSync(core::marker::PhantomData); - -impl PhantomDataSendSync { - pub(crate) fn new() -> Self { - Self(core::marker::PhantomData) - } -} - -unsafe impl Send for PhantomDataSendSync {} -unsafe impl Sync for PhantomDataSendSync {} - -/// This represents a key-value collection and is SCALE compatible -/// with collections like BTreeMap. This has the same type params -/// as `BTreeMap` which allows us to easily swap the two during codegen. -pub type KeyedVec = Vec<(K, V)>; diff --git a/subxt/src/metadata/decode_with_metadata.rs b/subxt/src/metadata/decode_with_metadata.rs new file mode 100644 index 0000000000..aa87447f34 --- /dev/null +++ b/subxt/src/metadata/decode_with_metadata.rs @@ -0,0 +1,79 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::Metadata; +use crate::{ + dynamic::DecodedValue, + error::Error, +}; +use codec::Decode; +use frame_metadata::StorageEntryType; + +/// This trait is implemented for types which can be decoded with the help of metadata. +pub trait DecodeWithMetadata { + /// The type that we'll get back from decoding. + type Target; + /// Given some metadata and a type ID, attempt to SCALE decode the provided bytes into `Self`. + fn decode_with_metadata( + bytes: &mut &[u8], + type_id: u32, + metadata: &Metadata, + ) -> Result; + + /// Decode a storage item using metadata. By default, this uses the metadata to + /// work out the type ID to use, but for static items we can short circuit this + /// lookup. + fn decode_storage_with_metadata( + bytes: &mut &[u8], + pallet_name: &str, + storage_entry: &str, + metadata: &Metadata, + ) -> Result { + let ty = &metadata.pallet(pallet_name)?.storage(storage_entry)?.ty; + + let id = match ty { + StorageEntryType::Plain(ty) => ty.id(), + StorageEntryType::Map { value, .. } => value.id(), + }; + + Self::decode_with_metadata(bytes, id, metadata) + } +} + +// Things can be dynamically decoded to our Value type: +impl DecodeWithMetadata for DecodedValue { + type Target = Self; + fn decode_with_metadata( + bytes: &mut &[u8], + type_id: u32, + metadata: &Metadata, + ) -> Result { + let res = scale_value::scale::decode_as_type(bytes, type_id, metadata.types())?; + Ok(res) + } +} + +/// Any type implementing [`Decode`] can also be decoded with the help of metadata. +pub struct DecodeStaticType(std::marker::PhantomData); + +impl DecodeWithMetadata for DecodeStaticType { + type Target = T; + + fn decode_with_metadata( + bytes: &mut &[u8], + _type_id: u32, + _metadata: &Metadata, + ) -> Result { + T::decode(bytes).map_err(|e| e.into()) + } + + fn decode_storage_with_metadata( + bytes: &mut &[u8], + _pallet_name: &str, + _storage_entry: &str, + _metadata: &Metadata, + ) -> Result { + T::decode(bytes).map_err(|e| e.into()) + } +} diff --git a/subxt/src/metadata/encode_with_metadata.rs b/subxt/src/metadata/encode_with_metadata.rs new file mode 100644 index 0000000000..387c20fd00 --- /dev/null +++ b/subxt/src/metadata/encode_with_metadata.rs @@ -0,0 +1,67 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::{ + dynamic::Value, + error::Error, + metadata::Metadata, +}; +use codec::Encode; + +/// This trait is implemented for types which can be encoded with the help of metadata. +pub trait EncodeWithMetadata { + /// SCALE encode this type to bytes, possibly with the help of metadata. + fn encode_with_metadata( + &self, + type_id: u32, + metadata: &Metadata, + bytes: &mut Vec, + ) -> Result<(), Error>; +} + +impl EncodeWithMetadata for Value<()> { + fn encode_with_metadata( + &self, + type_id: u32, + metadata: &Metadata, + bytes: &mut Vec, + ) -> Result<(), Error> { + scale_value::scale::encode_as_type(self, type_id, metadata.types(), bytes) + .map_err(|e| e.into()) + } +} + +/// Any type implementing [`Encode`] can also be encoded with the help of metadata. +pub struct EncodeStaticType(pub T); + +impl EncodeWithMetadata for EncodeStaticType { + fn encode_with_metadata( + &self, + _type_id: u32, + _metadata: &Metadata, + bytes: &mut Vec, + ) -> Result<(), Error> { + self.0.encode_to(bytes); + Ok(()) + } +} + +// We can transparently Encode anything wrapped in EncodeStaticType, too. +impl Encode for EncodeStaticType { + fn size_hint(&self) -> usize { + self.0.size_hint() + } + fn encode_to(&self, dest: &mut T) { + self.0.encode_to(dest) + } + fn encode(&self) -> Vec { + self.0.encode() + } + fn using_encoded R>(&self, f: F) -> R { + self.0.using_encoded(f) + } + fn encoded_size(&self) -> usize { + self.0.encoded_size() + } +} diff --git a/subxt/src/metadata/metadata_location.rs b/subxt/src/metadata/metadata_location.rs new file mode 100644 index 0000000000..fb7b925530 --- /dev/null +++ b/subxt/src/metadata/metadata_location.rs @@ -0,0 +1,14 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +/// Locate an item of a known type in the metadata. +/// We should already know that the item we're looking +/// for is a call or event for instance, and then with this, +/// we can dig up details for that item in the metadata. +pub trait MetadataLocation { + /// The pallet in which the item lives. + fn pallet(&self) -> &str; + /// The name of the item. + fn item(&self) -> &str; +} diff --git a/subxt/src/metadata/metadata_type.rs b/subxt/src/metadata/metadata_type.rs index fe0fea1dc2..6c199470fa 100644 --- a/subxt/src/metadata/metadata_type.rs +++ b/subxt/src/metadata/metadata_type.rs @@ -3,7 +3,6 @@ // see LICENSE for license details. use super::hash_cache::HashCache; -use crate::Call; use codec::Error as CodecError; use frame_metadata::{ PalletConstantMetadata, @@ -16,8 +15,8 @@ use frame_metadata::{ use parking_lot::RwLock; use scale_info::{ form::PortableForm, + PortableRegistry, Type, - Variant, }; use std::{ collections::HashMap, @@ -75,7 +74,11 @@ struct MetadataInner { metadata: RuntimeMetadataV14, pallets: HashMap, events: HashMap<(u8, u8), EventMetadata>, + // Errors are hashed by pallet index. errors: HashMap<(u8, u8), ErrorMetadata>, + // Type of the DispatchError type, which is what comes back if + // an extrinsic fails. + dispatch_error_ty: Option, // The hashes uniquely identify parts of the metadata; different // hashes mean some type difference exists between static and runtime // versions. We cache them here to avoid recalculating: @@ -93,7 +96,7 @@ pub struct Metadata { impl Metadata { /// Returns a reference to [`PalletMetadata`]. - pub fn pallet(&self, name: &'static str) -> Result<&PalletMetadata, MetadataError> { + pub fn pallet(&self, name: &str) -> Result<&PalletMetadata, MetadataError> { self.inner .pallets .get(name) @@ -128,6 +131,16 @@ impl Metadata { Ok(error) } + /// Return the DispatchError type ID if it exists. + pub fn dispatch_error_ty(&self) -> Option { + self.inner.dispatch_error_ty + } + + /// Return the type registry embedded within the metadata. + pub fn types(&self) -> &PortableRegistry { + &self.inner.metadata.types + } + /// Resolve a type definition. pub fn resolve_type(&self, id: u32) -> Option<&Type> { self.inner.metadata.types.resolve(id) @@ -139,23 +152,25 @@ impl Metadata { } /// Obtain the unique hash for a specific storage entry. - pub fn storage_hash( + pub fn storage_hash( &self, + pallet: &str, + storage: &str, ) -> Result<[u8; 32], MetadataError> { self.inner .cached_storage_hashes - .get_or_insert(S::PALLET, S::STORAGE, || { - subxt_metadata::get_storage_hash( - &self.inner.metadata, - S::PALLET, - S::STORAGE, - ) - .map_err(|e| { - match e { - subxt_metadata::NotFound::Pallet => MetadataError::PalletNotFound, - subxt_metadata::NotFound::Item => MetadataError::StorageNotFound, - } - }) + .get_or_insert(pallet, storage, || { + subxt_metadata::get_storage_hash(&self.inner.metadata, pallet, storage) + .map_err(|e| { + match e { + subxt_metadata::NotFound::Pallet => { + MetadataError::PalletNotFound + } + subxt_metadata::NotFound::Item => { + MetadataError::StorageNotFound + } + } + }) }) } @@ -183,21 +198,23 @@ impl Metadata { } /// Obtain the unique hash for a call. - pub fn call_hash(&self) -> Result<[u8; 32], MetadataError> { + pub fn call_hash( + &self, + pallet: &str, + function: &str, + ) -> Result<[u8; 32], MetadataError> { self.inner .cached_call_hashes - .get_or_insert(C::PALLET, C::FUNCTION, || { - subxt_metadata::get_call_hash( - &self.inner.metadata, - C::PALLET, - C::FUNCTION, - ) - .map_err(|e| { - match e { - subxt_metadata::NotFound::Pallet => MetadataError::PalletNotFound, - subxt_metadata::NotFound::Item => MetadataError::CallNotFound, - } - }) + .get_or_insert(pallet, function, || { + subxt_metadata::get_call_hash(&self.inner.metadata, pallet, function) + .map_err(|e| { + match e { + subxt_metadata::NotFound::Pallet => { + MetadataError::PalletNotFound + } + subxt_metadata::NotFound::Item => MetadataError::CallNotFound, + } + }) }) } @@ -222,7 +239,8 @@ impl Metadata { pub struct PalletMetadata { index: u8, name: String, - calls: HashMap, + call_indexes: HashMap, + call_ty_id: Option, storage: HashMap>, constants: HashMap>, } @@ -238,15 +256,18 @@ impl PalletMetadata { self.index } + /// If calls exist for this pallet, this returns the type ID of the variant + /// representing the different possible calls. + pub fn call_ty_id(&self) -> Option { + self.call_ty_id + } + /// Attempt to resolve a call into an index in this pallet, failing /// if the call is not found in this pallet. - pub fn call_index(&self) -> Result - where - C: Call, - { + pub fn call_index(&self, function: &str) -> Result { let fn_index = *self - .calls - .get(C::FUNCTION) + .call_indexes + .get(function) .ok_or(MetadataError::CallNotFound)?; Ok(fn_index) } @@ -273,9 +294,12 @@ impl PalletMetadata { /// Metadata for specific events. #[derive(Clone, Debug)] pub struct EventMetadata { - pallet: String, + // The pallet name is shared across every event, so put it + // behind an Arc to avoid lots of needless clones of it existing. + pallet: Arc, event: String, - variant: Variant, + fields: Vec<(Option, u32)>, + docs: Vec, } impl EventMetadata { @@ -289,21 +313,25 @@ impl EventMetadata { &self.event } - /// Get the type def variant for the pallet event. - pub fn variant(&self) -> &Variant { - &self.variant + /// The names and types of each field in the event. + pub fn fields(&self) -> &[(Option, u32)] { + &self.fields + } + + /// Documentation for this event. + pub fn docs(&self) -> &[String] { + &self.docs } } -/// Metadata for specific errors obtained from the pallet's `PalletErrorMetadata`. -/// -/// This holds in memory information regarding the Pallet's name, Error's name, and the underlying -/// metadata representation. +/// Details about a specific runtime error. #[derive(Clone, Debug)] pub struct ErrorMetadata { - pallet: String, + // The pallet name is shared across every event, so put it + // behind an Arc to avoid lots of needless clones of it existing. + pallet: Arc, error: String, - variant: Variant, + docs: Vec, } impl ErrorMetadata { @@ -312,29 +340,31 @@ impl ErrorMetadata { &self.pallet } - /// Get the name of the specific pallet error. + /// The name of the error. pub fn error(&self) -> &str { &self.error } - /// Get the description of the specific pallet error. - pub fn description(&self) -> &[String] { - self.variant.docs() + /// Documentation for the error. + pub fn docs(&self) -> &[String] { + &self.docs } } /// Error originated from converting a runtime metadata [RuntimeMetadataPrefixed] to /// the internal [Metadata] representation. -/// -/// The runtime metadata is converted when building the [crate::client::Client]. #[derive(Debug, thiserror::Error)] pub enum InvalidMetadataError { + /// Invalid prefix #[error("Invalid prefix")] InvalidPrefix, + /// Invalid version #[error("Invalid version")] InvalidVersion, + /// Type missing from type registry #[error("Type {0} missing from type registry")] MissingType(u32), + /// Type was not a variant/enum type #[error("Type {0} was not a variant/enum type")] TypeDefNotVariant(u32), } @@ -366,15 +396,18 @@ impl TryFrom for Metadata { .pallets .iter() .map(|pallet| { - let calls = pallet.calls.as_ref().map_or(Ok(HashMap::new()), |call| { - let type_def_variant = get_type_def_variant(call.ty.id())?; - let calls = type_def_variant - .variants() - .iter() - .map(|v| (v.name().clone(), v.index())) - .collect(); - Ok(calls) - })?; + let call_ty_id = pallet.calls.as_ref().map(|c| c.ty.id()); + + let call_indexes = + pallet.calls.as_ref().map_or(Ok(HashMap::new()), |call| { + let type_def_variant = get_type_def_variant(call.ty.id())?; + let call_indexes = type_def_variant + .variants() + .iter() + .map(|v| (v.name().clone(), v.index())) + .collect(); + Ok(call_indexes) + })?; let storage = pallet.storage.as_ref().map_or(HashMap::new(), |storage| { storage @@ -393,7 +426,8 @@ impl TryFrom for Metadata { let pallet_metadata = PalletMetadata { index: pallet.index, name: pallet.name.to_string(), - calls, + call_indexes, + call_ty_id, storage, constants, }; @@ -402,55 +436,54 @@ impl TryFrom for Metadata { }) .collect::>()?; - let pallet_events = metadata - .pallets - .iter() - .filter_map(|pallet| { - pallet.event.as_ref().map(|event| { - let type_def_variant = get_type_def_variant(event.ty.id())?; - Ok((pallet, type_def_variant)) - }) - }) - .collect::, _>>()?; - let events = pallet_events - .iter() - .flat_map(|(pallet, type_def_variant)| { - type_def_variant.variants().iter().map(move |var| { - let key = (pallet.index, var.index()); - let value = EventMetadata { - pallet: pallet.name.clone(), - event: var.name().clone(), - variant: var.clone(), - }; - (key, value) - }) - }) - .collect(); + let mut events = HashMap::<(u8, u8), EventMetadata>::new(); + for pallet in &metadata.pallets { + if let Some(event) = &pallet.event { + let pallet_name: Arc = pallet.name.to_string().into(); + let event_type_id = event.ty.id(); + let event_variant = get_type_def_variant(event_type_id)?; + for variant in event_variant.variants() { + events.insert( + (pallet.index, variant.index()), + EventMetadata { + pallet: pallet_name.clone(), + event: variant.name().to_owned(), + fields: variant + .fields() + .iter() + .map(|f| (f.name().map(|n| n.to_owned()), f.ty().id())) + .collect(), + docs: variant.docs().to_vec(), + }, + ); + } + } + } - let pallet_errors = metadata - .pallets - .iter() - .filter_map(|pallet| { - pallet.error.as_ref().map(|error| { - let type_def_variant = get_type_def_variant(error.ty.id())?; - Ok((pallet, type_def_variant)) - }) - }) - .collect::, _>>()?; - let errors = pallet_errors + let mut errors = HashMap::<(u8, u8), ErrorMetadata>::new(); + for pallet in &metadata.pallets { + if let Some(error) = &pallet.error { + let pallet_name: Arc = pallet.name.to_string().into(); + let error_variant = get_type_def_variant(error.ty.id())?; + for variant in error_variant.variants() { + errors.insert( + (pallet.index, variant.index()), + ErrorMetadata { + pallet: pallet_name.clone(), + error: variant.name().clone(), + docs: variant.docs().to_vec(), + }, + ); + } + } + } + + let dispatch_error_ty = metadata + .types + .types() .iter() - .flat_map(|(pallet, type_def_variant)| { - type_def_variant.variants().iter().map(move |var| { - let key = (pallet.index, var.index()); - let value = ErrorMetadata { - pallet: pallet.name.clone(), - error: var.name().clone(), - variant: var.clone(), - }; - (key, value) - }) - }) - .collect(); + .find(|ty| ty.ty().path().segments() == ["sp_runtime", "DispatchError"]) + .map(|ty| ty.id()); Ok(Metadata { inner: Arc::new(MetadataInner { @@ -458,6 +491,7 @@ impl TryFrom for Metadata { pallets, events, errors, + dispatch_error_ty, cached_metadata_hash: Default::default(), cached_call_hashes: Default::default(), cached_constant_hashes: Default::default(), @@ -470,7 +504,6 @@ impl TryFrom for Metadata { #[cfg(test)] mod tests { use super::*; - use crate::StorageEntryKey; use frame_metadata::{ ExtrinsicMetadata, PalletStorageMetadata, @@ -553,14 +586,7 @@ mod tests { fn metadata_call_inner_cache() { let metadata = load_metadata(); - #[derive(codec::Encode)] - struct ValidCall; - impl crate::Call for ValidCall { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "fill_block"; - } - - let hash = metadata.call_hash::(); + let hash = metadata.call_hash("System", "fill_block"); let mut call_number = 0; let hash_cached = metadata.inner.cached_call_hashes.get_or_insert( @@ -601,20 +627,7 @@ mod tests { #[test] fn metadata_storage_inner_cache() { let metadata = load_metadata(); - - #[derive(codec::Encode)] - struct ValidStorage; - impl crate::StorageEntry for ValidStorage { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Account"; - type Value = (); - - fn key(&self) -> StorageEntryKey { - unreachable!("Should not be called"); - } - } - - let hash = metadata.storage_hash::(); + let hash = metadata.storage_hash("System", "Account"); let mut call_number = 0; let hash_cached = metadata.inner.cached_storage_hashes.get_or_insert( diff --git a/subxt/src/metadata/mod.rs b/subxt/src/metadata/mod.rs index 23d6eaf7bc..ae521e7a76 100644 --- a/subxt/src/metadata/mod.rs +++ b/subxt/src/metadata/mod.rs @@ -2,9 +2,16 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +//! Types representing the metadata obtained from a node. + +mod decode_with_metadata; +mod encode_with_metadata; mod hash_cache; +mod metadata_location; mod metadata_type; +pub use metadata_location::MetadataLocation; + pub use metadata_type::{ ErrorMetadata, EventMetadata, @@ -13,3 +20,13 @@ pub use metadata_type::{ MetadataError, PalletMetadata, }; + +pub use decode_with_metadata::{ + DecodeStaticType, + DecodeWithMetadata, +}; + +pub use encode_with_metadata::{ + EncodeStaticType, + EncodeWithMetadata, +}; diff --git a/subxt/src/rpc.rs b/subxt/src/rpc.rs index 7425086266..5265608422 100644 --- a/subxt/src/rpc.rs +++ b/subxt/src/rpc.rs @@ -7,67 +7,29 @@ //! This is used behind the scenes by various `subxt` APIs, but can //! also be used directly. //! -//! # Examples +//! # Example //! -//! ## Fetch Storage +//! Fetching storage keys //! //! ```no_run -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # use subxt::storage::StorageKeyPrefix; -//! # use subxt::rpc::Rpc; +//! use subxt::{ PolkadotConfig, OnlineClient, storage::StorageKey }; //! //! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] //! pub mod polkadot {} //! //! # #[tokio::main] //! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! // Storage prefix is `twox_128("System") ++ twox_128("ExtrinsicCount")`. -//! let key = StorageKeyPrefix::new::() -//! .to_storage_key(); +//! let api = OnlineClient::::new().await.unwrap(); //! -//! // Obtain the RPC from a generated API -//! let rpc: &Rpc<_> = api -//! .client -//! .rpc(); -//! -//! let result = rpc.storage(&key, None).await.unwrap(); -//! println!("Storage result: {:?}", result); -//! # } -//! ``` -//! -//! ## Fetch Keys -//! -//! ```no_run -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # use subxt::storage::StorageKeyPrefix; -//! # use subxt::rpc::Rpc; -//! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! pub mod polkadot {} -//! -//! # #[tokio::main] -//! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! let key = StorageKeyPrefix::new::() -//! .to_storage_key(); -//! -//! // Obtain the RPC from a generated API -//! let rpc: &Rpc<_> = api -//! .client -//! .rpc(); +//! let key = polkadot::storage() +//! .xcm_pallet() +//! .version_notifiers_root() +//! .to_bytes(); //! //! // Fetch up to 10 keys. -//! let keys = rpc -//! .storage_keys_paged(Some(key), 10, None, None) +//! let keys = api +//! .rpc() +//! .storage_keys_paged(&key, 10, None, None) //! .await //! .unwrap(); //! @@ -88,10 +50,10 @@ use std::{ }; use crate::{ - error::BasicError, + error::Error, + utils::PhantomDataSendSync, Config, Metadata, - PhantomDataSendSync, }; use codec::{ Decode, @@ -198,7 +160,7 @@ pub type SystemProperties = serde_json::Map; /// must be kept compatible with that type from the target substrate version. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub enum SubstrateTransactionStatus { +pub enum SubstrateTxStatus { /// Transaction is part of the future queue. Future, /// Transaction is part of the ready queue. @@ -324,13 +286,13 @@ impl Rpc { } } - /// Fetch a storage key + /// Fetch the raw bytes for a given storage key pub async fn storage( &self, - key: &StorageKey, + key: &[u8], hash: Option, - ) -> Result, BasicError> { - let params = rpc_params![key, hash]; + ) -> Result, Error> { + let params = rpc_params![to_hex(key), hash]; let data = self.client.request("state_getStorage", params).await?; Ok(data) } @@ -340,12 +302,13 @@ impl Rpc { /// If `start_key` is passed, return next keys in storage in lexicographic order. pub async fn storage_keys_paged( &self, - key: Option, + key: &[u8], count: u32, - start_key: Option, + start_key: Option<&[u8]>, hash: Option, - ) -> Result, BasicError> { - let params = rpc_params![key, count, start_key, hash]; + ) -> Result, Error> { + let start_key = start_key.map(to_hex); + let params = rpc_params![to_hex(key), count, start_key, hash]; let data = self.client.request("state_getKeysPaged", params).await?; Ok(data) } @@ -353,10 +316,11 @@ impl Rpc { /// Query historical storage entries pub async fn query_storage( &self, - keys: Vec, + keys: impl IntoIterator, from: T::Hash, to: Option, - ) -> Result>, BasicError> { + ) -> Result>, Error> { + let keys: Vec = keys.into_iter().map(to_hex).collect(); let params = rpc_params![keys, from, to]; self.client .request("state_queryStorage", params) @@ -367,9 +331,10 @@ impl Rpc { /// Query historical storage entries pub async fn query_storage_at( &self, - keys: &[StorageKey], + keys: impl IntoIterator, at: Option, - ) -> Result>, BasicError> { + ) -> Result>, Error> { + let keys: Vec = keys.into_iter().map(to_hex).collect(); let params = rpc_params![keys, at]; self.client .request("state_queryStorageAt", params) @@ -378,7 +343,7 @@ impl Rpc { } /// Fetch the genesis hash - pub async fn genesis_hash(&self) -> Result { + pub async fn genesis_hash(&self) -> Result { let block_zero = 0u32; let params = rpc_params![block_zero]; let genesis_hash: Option = @@ -387,7 +352,7 @@ impl Rpc { } /// Fetch the metadata - pub async fn metadata(&self) -> Result { + pub async fn metadata(&self) -> Result { let bytes: Bytes = self .client .request("state_getMetadata", rpc_params![]) @@ -398,7 +363,7 @@ impl Rpc { } /// Fetch system properties - pub async fn system_properties(&self) -> Result { + pub async fn system_properties(&self) -> Result { Ok(self .client .request("system_properties", rpc_params![]) @@ -406,22 +371,22 @@ impl Rpc { } /// Fetch system health - pub async fn system_health(&self) -> Result { + pub async fn system_health(&self) -> Result { Ok(self.client.request("system_health", rpc_params![]).await?) } /// Fetch system chain - pub async fn system_chain(&self) -> Result { + pub async fn system_chain(&self) -> Result { Ok(self.client.request("system_chain", rpc_params![]).await?) } /// Fetch system name - pub async fn system_name(&self) -> Result { + pub async fn system_name(&self) -> Result { Ok(self.client.request("system_name", rpc_params![]).await?) } /// Fetch system version - pub async fn system_version(&self) -> Result { + pub async fn system_version(&self) -> Result { Ok(self.client.request("system_version", rpc_params![]).await?) } @@ -429,7 +394,7 @@ impl Rpc { pub async fn system_account_next_index( &self, account: &T::AccountId, - ) -> Result { + ) -> Result { Ok(self .client .request("system_accountNextIndex", rpc_params![account]) @@ -440,7 +405,7 @@ impl Rpc { pub async fn header( &self, hash: Option, - ) -> Result, BasicError> { + ) -> Result, Error> { let params = rpc_params![hash]; let header = self.client.request("chain_getHeader", params).await?; Ok(header) @@ -450,14 +415,14 @@ impl Rpc { pub async fn block_hash( &self, block_number: Option, - ) -> Result, BasicError> { + ) -> Result, Error> { let params = rpc_params![block_number]; let block_hash = self.client.request("chain_getBlockHash", params).await?; Ok(block_hash) } /// Get a block hash of the latest finalized block - pub async fn finalized_head(&self) -> Result { + pub async fn finalized_head(&self) -> Result { let hash = self .client .request("chain_getFinalizedHead", rpc_params![]) @@ -469,7 +434,7 @@ impl Rpc { pub async fn block( &self, hash: Option, - ) -> Result>, BasicError> { + ) -> Result>, Error> { let params = rpc_params![hash]; let block = self.client.request("chain_getBlock", params).await?; Ok(block) @@ -483,7 +448,7 @@ impl Rpc { pub async fn block_stats( &self, block_hash: T::Hash, - ) -> Result, BasicError> { + ) -> Result, Error> { let params = rpc_params![block_hash]; let stats = self.client.request("dev_getBlockStats", params).await?; Ok(stats) @@ -492,9 +457,10 @@ impl Rpc { /// Get proof of storage entries at a specific block's state. pub async fn read_proof( &self, - keys: Vec, + keys: impl IntoIterator, hash: Option, - ) -> Result, BasicError> { + ) -> Result, Error> { + let keys: Vec = keys.into_iter().map(to_hex).collect(); let params = rpc_params![keys, hash]; let proof = self.client.request("state_getReadProof", params).await?; Ok(proof) @@ -504,7 +470,7 @@ impl Rpc { pub async fn runtime_version( &self, at: Option, - ) -> Result { + ) -> Result { let params = rpc_params![at]; let version = self .client @@ -514,7 +480,7 @@ impl Rpc { } /// Subscribe to blocks. - pub async fn subscribe_blocks(&self) -> Result, BasicError> { + pub async fn subscribe_blocks(&self) -> Result, Error> { let subscription = self .client .subscribe( @@ -530,7 +496,7 @@ impl Rpc { /// Subscribe to finalized blocks. pub async fn subscribe_finalized_blocks( &self, - ) -> Result, BasicError> { + ) -> Result, Error> { let subscription = self .client .subscribe( @@ -545,7 +511,7 @@ impl Rpc { /// Subscribe to runtime version updates that produce changes in the metadata. pub async fn subscribe_runtime_version( &self, - ) -> Result, BasicError> { + ) -> Result, Error> { let subscription = self .client .subscribe( @@ -561,7 +527,7 @@ impl Rpc { pub async fn submit_extrinsic( &self, extrinsic: X, - ) -> Result { + ) -> Result { let bytes: Bytes = extrinsic.encode().into(); let params = rpc_params![bytes]; let xt_hash = self @@ -575,8 +541,7 @@ impl Rpc { pub async fn watch_extrinsic( &self, extrinsic: X, - ) -> Result>, BasicError> - { + ) -> Result>, Error> { let bytes: Bytes = extrinsic.encode().into(); let params = rpc_params![bytes]; let subscription = self @@ -596,14 +561,14 @@ impl Rpc { key_type: String, suri: String, public: Bytes, - ) -> Result<(), BasicError> { + ) -> Result<(), Error> { let params = rpc_params![key_type, suri, public]; self.client.request("author_insertKey", params).await?; Ok(()) } /// Generate new session keys and returns the corresponding public keys. - pub async fn rotate_keys(&self) -> Result { + pub async fn rotate_keys(&self) -> Result { Ok(self .client .request("author_rotateKeys", rpc_params![]) @@ -615,10 +580,7 @@ impl Rpc { /// `session_keys` is the SCALE encoded session keys object from the runtime. /// /// Returns `true` iff all private keys could be found. - pub async fn has_session_keys( - &self, - session_keys: Bytes, - ) -> Result { + pub async fn has_session_keys(&self, session_keys: Bytes) -> Result { let params = rpc_params![session_keys]; Ok(self.client.request("author_hasSessionKeys", params).await?) } @@ -630,7 +592,7 @@ impl Rpc { &self, public_key: Bytes, key_type: String, - ) -> Result { + ) -> Result { let params = rpc_params![public_key, key_type]; Ok(self.client.request("author_hasKey", params).await?) } @@ -642,8 +604,8 @@ impl Rpc { &self, encoded_signed: &[u8], at: Option, - ) -> Result { - let params = rpc_params![format!("0x{}", hex::encode(encoded_signed)), at]; + ) -> Result { + let params = rpc_params![to_hex(encoded_signed), at]; let result_bytes: Bytes = self.client.request("system_dryRun", params).await?; let data: ApplyExtrinsicResult = codec::Decode::decode(&mut result_bytes.0.as_slice())?; @@ -669,6 +631,10 @@ async fn ws_transport(url: &str) -> Result<(WsSender, WsReceiver), RpcError> { .map_err(|e| RpcError::Transport(e.into())) } +fn to_hex(bytes: impl AsRef<[u8]>) -> String { + format!("0x{}", hex::encode(bytes.as_ref())) +} + #[cfg(test)] mod test { use super::*; diff --git a/subxt/src/storage.rs b/subxt/src/storage.rs deleted file mode 100644 index 18efe82730..0000000000 --- a/subxt/src/storage.rs +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Query the runtime storage using [StorageClient]. -//! -//! This module is the core of performing runtime storage queries. While you can -//! work with it directly, it's prefer to use the generated `storage()` interface where -//! possible. -//! -//! The exposed API is performing RPC calls to `state_getStorage` and `state_getKeysPaged`. -//! -//! A runtime storage entry can be of type: -//! - [StorageEntryKey::Plain] for keys constructed just from the prefix -//! `twox_128(pallet) ++ twox_128(storage_item)` -//! - [StorageEntryKey::Map] for mapped keys constructed from the prefix, -//! plus other arguments `twox_128(pallet) ++ twox_128(storage_item) ++ hash(arg1) ++ arg1` -//! -//! # Examples -//! -//! ## Fetch Storage Keys -//! -//! ```no_run -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # use subxt::storage::StorageClient; -//! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! pub mod polkadot {} -//! -//! # #[tokio::main] -//! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! # // Obtain the storage client wrapper from the API. -//! # let storage: StorageClient<_> = api.client.storage(); -//! // Fetch just the keys, returning up to 10 keys. -//! let keys = storage -//! .fetch_keys::(10, None, None) -//! .await -//! .unwrap(); -//! // Iterate over each key -//! for key in keys.iter() { -//! println!("Key: 0x{}", hex::encode(&key)); -//! } -//! # } -//! ``` -//! -//! ## Iterate over Storage -//! -//! ```no_run -//! # use subxt::{ClientBuilder, DefaultConfig, PolkadotExtrinsicParams}; -//! # use subxt::storage::StorageClient; -//! -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -//! pub mod polkadot {} -//! -//! # #[tokio::main] -//! # async fn main() { -//! # let api = ClientBuilder::new() -//! # .build() -//! # .await -//! # .unwrap() -//! # .to_runtime_api::>>(); -//! # // Obtain the storage client wrapper from the API. -//! # let storage: StorageClient<_> = api.client.storage(); -//! // Iterate over keys and values. -//! let mut iter = storage -//! .iter::(None) -//! .await -//! .unwrap(); -//! while let Some((key, value)) = iter.next().await.unwrap() { -//! println!("Key: 0x{}", hex::encode(&key)); -//! println!("Value: {}", value); -//! } -//! # } -//! ``` - -use codec::{ - Decode, - Encode, -}; -use parking_lot::RwLock; -use sp_core::storage::{ - StorageChangeSet, - StorageData, - StorageKey, -}; -pub use sp_runtime::traits::SignedExtension; -use std::{ - marker::PhantomData, - sync::Arc, -}; - -use crate::{ - error::BasicError, - metadata::{ - Metadata, - MetadataError, - }, - rpc::Rpc, - Config, - StorageHasher, -}; - -/// Storage entry trait. -pub trait StorageEntry { - /// Pallet name. - const PALLET: &'static str; - /// Storage name. - const STORAGE: &'static str; - /// Type of the storage entry value. - type Value: Decode; - /// Get the key data for the storage. - fn key(&self) -> StorageEntryKey; -} - -/// The prefix of the key to a [`StorageEntry`] -pub struct StorageKeyPrefix(Vec); - -impl StorageKeyPrefix { - /// Create the storage key prefix for a [`StorageEntry`] - pub fn new() -> Self { - let mut bytes = sp_core::twox_128(T::PALLET.as_bytes()).to_vec(); - bytes.extend(&sp_core::twox_128(T::STORAGE.as_bytes())[..]); - Self(bytes) - } - - /// Convert the prefix into a [`StorageKey`] - pub fn to_storage_key(self) -> StorageKey { - StorageKey(self.0) - } -} - -/// Storage key. -pub enum StorageEntryKey { - /// Plain key. - Plain, - /// Map key(s). - Map(Vec), -} - -impl StorageEntryKey { - /// Construct the final [`sp_core::storage::StorageKey`] for the storage entry. - pub fn final_key(&self, prefix: StorageKeyPrefix) -> sp_core::storage::StorageKey { - let mut bytes = prefix.0; - if let Self::Map(map_keys) = self { - for map_key in map_keys { - bytes.extend(Self::hash(&map_key.hasher, &map_key.value)) - } - } - sp_core::storage::StorageKey(bytes) - } - - fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { - match hasher { - StorageHasher::Identity => bytes.to_vec(), - StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), - StorageHasher::Blake2_128Concat => { - // copied from substrate Blake2_128Concat::hash since StorageHasher is not public - sp_core::blake2_128(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), - StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), - StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), - StorageHasher::Twox64Concat => { - sp_core::twox_64(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - } - } -} - -/// Storage key for a Map. -pub struct StorageMapKey { - value: Vec, - hasher: StorageHasher, -} - -impl StorageMapKey { - /// Create a new [`StorageMapKey`] with the encoded data and the hasher. - pub fn new(value: &T, hasher: StorageHasher) -> Self { - Self { - value: value.encode(), - hasher, - } - } -} - -/// Client for querying runtime storage. -pub struct StorageClient<'a, T: Config> { - rpc: &'a Rpc, - metadata: Arc>, - iter_page_size: u32, -} - -impl<'a, T: Config> Clone for StorageClient<'a, T> { - fn clone(&self) -> Self { - Self { - rpc: self.rpc, - metadata: Arc::clone(&self.metadata), - iter_page_size: self.iter_page_size, - } - } -} - -impl<'a, T: Config> StorageClient<'a, T> { - /// Create a new [`StorageClient`] - pub fn new( - rpc: &'a Rpc, - metadata: Arc>, - iter_page_size: u32, - ) -> Self { - Self { - rpc, - metadata, - iter_page_size, - } - } - - /// Fetch the value under an unhashed storage key - pub async fn fetch_unhashed( - &self, - key: StorageKey, - hash: Option, - ) -> Result, BasicError> { - if let Some(data) = self.rpc.storage(&key, hash).await? { - Ok(Some(Decode::decode(&mut &data.0[..])?)) - } else { - Ok(None) - } - } - - /// Fetch the raw encoded value under the raw storage key. - pub async fn fetch_raw( - &self, - key: StorageKey, - hash: Option, - ) -> Result, BasicError> { - self.rpc.storage(&key, hash).await - } - - /// Fetch a StorageKey with an optional block hash. - pub async fn fetch( - &self, - store: &F, - hash: Option, - ) -> Result, BasicError> { - let prefix = StorageKeyPrefix::new::(); - let key = store.key().final_key(prefix); - self.fetch_unhashed::(key, hash).await - } - - /// Fetch a StorageKey that has a default value with an optional block hash. - pub async fn fetch_or_default( - &self, - store: &F, - hash: Option, - ) -> Result { - if let Some(data) = self.fetch(store, hash).await? { - Ok(data) - } else { - let metadata = self.metadata.read(); - let pallet_metadata = metadata.pallet(F::PALLET)?; - let storage_metadata = pallet_metadata.storage(F::STORAGE)?; - let default = Decode::decode(&mut &storage_metadata.default[..]) - .map_err(MetadataError::DefaultError)?; - Ok(default) - } - } - - /// Query historical storage entries - pub async fn query_storage( - &self, - keys: Vec, - from: T::Hash, - to: Option, - ) -> Result>, BasicError> { - self.rpc.query_storage(keys, from, to).await - } - - /// Fetch up to `count` keys for a storage map in lexicographic order. - /// - /// Supports pagination by passing a value to `start_key`. - pub async fn fetch_keys( - &self, - count: u32, - start_key: Option, - hash: Option, - ) -> Result, BasicError> { - let key = StorageKeyPrefix::new::().to_storage_key(); - let keys = self - .rpc - .storage_keys_paged(Some(key), count, start_key, hash) - .await?; - Ok(keys) - } - - /// Returns an iterator of key value pairs. - pub async fn iter( - &self, - hash: Option, - ) -> Result, BasicError> { - let hash = if let Some(hash) = hash { - hash - } else { - self.rpc - .block_hash(None) - .await? - .expect("didn't pass a block number; qed") - }; - Ok(KeyIter { - client: self.clone(), - hash, - count: self.iter_page_size, - start_key: None, - buffer: Default::default(), - _marker: PhantomData, - }) - } -} - -/// Iterates over key value pairs in a map. -pub struct KeyIter<'a, T: Config, F: StorageEntry> { - client: StorageClient<'a, T>, - _marker: PhantomData, - count: u32, - hash: T::Hash, - start_key: Option, - buffer: Vec<(StorageKey, StorageData)>, -} - -impl<'a, T: Config, F: StorageEntry> KeyIter<'a, T, F> { - /// Returns the next key value pair from a map. - pub async fn next(&mut self) -> Result, BasicError> { - loop { - if let Some((k, v)) = self.buffer.pop() { - return Ok(Some((k, Decode::decode(&mut &v.0[..])?))) - } else { - let keys = self - .client - .fetch_keys::(self.count, self.start_key.take(), Some(self.hash)) - .await?; - - if keys.is_empty() { - return Ok(None) - } - - self.start_key = keys.last().cloned(); - - let change_sets = self - .client - .rpc - .query_storage_at(&keys, Some(self.hash)) - .await?; - for change_set in change_sets { - for (k, v) in change_set.changes { - if let Some(v) = v { - self.buffer.push((k, v)); - } - } - } - debug_assert_eq!(self.buffer.len(), keys.len()); - } - } - } -} diff --git a/subxt/src/storage/mod.rs b/subxt/src/storage/mod.rs new file mode 100644 index 0000000000..61b400fad7 --- /dev/null +++ b/subxt/src/storage/mod.rs @@ -0,0 +1,48 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! Types associated with accessing and working with storage items. + +mod storage_address; +mod storage_client; +mod storage_map_key; + +pub mod utils; + +pub use storage_client::{ + KeyIter, + StorageClient, +}; + +// Re-export as this is used in the public API: +pub use sp_core::storage::StorageKey; + +/// Types representing an address which describes where a storage +/// entry lives and how to properly decode it. +pub mod address { + pub use super::{ + storage_address::{ + dynamic, + dynamic_root, + DynamicStorageAddress, + StaticStorageAddress, + StorageAddress, + Yes, + }, + storage_map_key::{ + StorageHasher, + StorageMapKey, + }, + }; +} + +// For consistency with other modules, also expose +// the basic address stuff at the root of the module. +pub use storage_address::{ + dynamic, + dynamic_root, + DynamicStorageAddress, + StaticStorageAddress, + StorageAddress, +}; diff --git a/subxt/src/storage/storage_address.rs b/subxt/src/storage/storage_address.rs new file mode 100644 index 0000000000..238b26f6e4 --- /dev/null +++ b/subxt/src/storage/storage_address.rs @@ -0,0 +1,286 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::storage_map_key::StorageMapKey; +use crate::{ + dynamic::{ + DecodedValue, + Value, + }, + error::{ + Error, + StorageAddressError, + }, + metadata::{ + DecodeWithMetadata, + EncodeWithMetadata, + Metadata, + }, +}; +use frame_metadata::StorageEntryType; +use scale_info::TypeDef; +use std::borrow::Cow; + +// We use this type a bunch, so export it from here. +pub use frame_metadata::StorageHasher; + +/// This represents a storage address. Anything implementing this trait +/// can be used to fetch and iterate over storage entries. +pub trait StorageAddress { + /// The target type of the value that lives at this address. + type Target: DecodeWithMetadata; + /// Can an entry be fetched from this address? + /// Set this type to [`Yes`] to enable the corresponding calls to be made. + type IsFetchable; + /// Can a default entry be obtained from this address? + /// Set this type to [`Yes`] to enable the corresponding calls to be made. + type IsDefaultable; + /// Can this address be iterated over? + /// Set this type to [`Yes`] to enable the corresponding calls to be made. + type IsIterable; + + /// The name of the pallet that the entry lives under. + fn pallet_name(&self) -> &str; + + /// The name of the entry in a given pallet that the item is at. + fn entry_name(&self) -> &str; + + /// Output the non-prefix bytes; that is, any additional bytes that need + /// to be appended to the key to dig into maps. + fn append_entry_bytes( + &self, + metadata: &Metadata, + bytes: &mut Vec, + ) -> Result<(), Error>; + + /// An optional hash which, if present, will be checked against + /// the node metadata to confirm that the return type matches what + /// we are expecting. + fn validation_hash(&self) -> Option<[u8; 32]> { + None + } +} + +/// Used to signal whether a [`StorageAddress`] can be iterated, +/// fetched and returned with a default value in the type system. +pub struct Yes; + +/// This represents a statically generated storage lookup address. +pub struct StaticStorageAddress { + pallet_name: &'static str, + entry_name: &'static str, + // How to access the specific value at that storage address. + storage_entry_keys: Vec, + // Hash provided from static code for validation. + validation_hash: Option<[u8; 32]>, + _marker: std::marker::PhantomData<(ReturnTy, Fetchable, Defaultable, Iterable)>, +} + +impl + StaticStorageAddress +where + ReturnTy: DecodeWithMetadata, +{ + /// Create a new [`StaticStorageAddress`] that will be validated + /// against node metadata using the hash given. + pub fn new( + pallet_name: &'static str, + entry_name: &'static str, + storage_entry_keys: Vec, + hash: [u8; 32], + ) -> Self { + Self { + pallet_name, + entry_name, + storage_entry_keys, + validation_hash: Some(hash), + _marker: std::marker::PhantomData, + } + } + + /// Do not validate this storage entry prior to accessing it. + pub fn unvalidated(self) -> Self { + Self { + validation_hash: None, + ..self + } + } + + /// Return bytes representing this storage entry. + pub fn to_bytes(&self) -> Vec { + let mut bytes = Vec::new(); + super::utils::write_storage_address_root_bytes(self, &mut bytes); + for entry in &self.storage_entry_keys { + entry.to_bytes(&mut bytes); + } + bytes + } + + /// Return bytes representing the root of this storage entry (ie a hash of + /// the pallet and entry name). + pub fn to_root_bytes(&self) -> Vec { + super::utils::storage_address_root_bytes(self) + } +} + +impl StorageAddress + for StaticStorageAddress +where + ReturnTy: DecodeWithMetadata, +{ + type Target = ReturnTy; + type IsDefaultable = Defaultable; + type IsIterable = Iterable; + type IsFetchable = Fetchable; + + fn pallet_name(&self) -> &str { + self.pallet_name + } + + fn entry_name(&self) -> &str { + self.entry_name + } + + fn append_entry_bytes( + &self, + _metadata: &Metadata, + bytes: &mut Vec, + ) -> Result<(), Error> { + for entry in &self.storage_entry_keys { + entry.to_bytes(bytes); + } + Ok(()) + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + self.validation_hash + } +} + +/// This represents a dynamically generated storage address. +pub struct DynamicStorageAddress<'a, Encodable> { + pallet_name: Cow<'a, str>, + entry_name: Cow<'a, str>, + storage_entry_keys: Vec, +} + +/// Construct a new dynamic storage lookup to the root of some entry. +pub fn dynamic_root<'a>( + pallet_name: impl Into>, + entry_name: impl Into>, +) -> DynamicStorageAddress<'a, Value> { + DynamicStorageAddress { + pallet_name: pallet_name.into(), + entry_name: entry_name.into(), + storage_entry_keys: vec![], + } +} + +/// Construct a new dynamic storage lookup. +pub fn dynamic<'a, Encodable: EncodeWithMetadata>( + pallet_name: impl Into>, + entry_name: impl Into>, + storage_entry_keys: Vec, +) -> DynamicStorageAddress<'a, Encodable> { + DynamicStorageAddress { + pallet_name: pallet_name.into(), + entry_name: entry_name.into(), + storage_entry_keys, + } +} + +impl<'a, Encodable> StorageAddress for DynamicStorageAddress<'a, Encodable> +where + Encodable: EncodeWithMetadata, +{ + type Target = DecodedValue; + + // For dynamic types, we have no static guarantees about any of + // this stuff, so we just allow it and let it fail at runtime: + type IsFetchable = Yes; + type IsDefaultable = Yes; + type IsIterable = Yes; + + fn pallet_name(&self) -> &str { + &self.pallet_name + } + + fn entry_name(&self) -> &str { + &self.entry_name + } + + fn append_entry_bytes( + &self, + metadata: &Metadata, + bytes: &mut Vec, + ) -> Result<(), Error> { + let pallet = metadata.pallet(&self.pallet_name)?; + let storage = pallet.storage(&self.entry_name)?; + + match &storage.ty { + StorageEntryType::Plain(_) => { + if !self.storage_entry_keys.is_empty() { + Err(StorageAddressError::WrongNumberOfKeys { + expected: 0, + actual: self.storage_entry_keys.len(), + } + .into()) + } else { + Ok(()) + } + } + StorageEntryType::Map { hashers, key, .. } => { + let ty = metadata + .resolve_type(key.id()) + .ok_or_else(|| StorageAddressError::TypeNotFound(key.id()))?; + + // If the key is a tuple, we encode each value to the corresponding tuple type. + // If the key is not a tuple, encode a single value to the key type. + let type_ids = match ty.type_def() { + TypeDef::Tuple(tuple) => { + tuple.fields().iter().map(|f| f.id()).collect() + } + _other => { + vec![key.id()] + } + }; + + if type_ids.len() != self.storage_entry_keys.len() { + return Err(StorageAddressError::WrongNumberOfKeys { + expected: type_ids.len(), + actual: self.storage_entry_keys.len(), + } + .into()) + } + + if hashers.len() == 1 { + // One hasher; hash a tuple of all SCALE encoded bytes with the one hash function. + let mut input = Vec::new(); + for (key, type_id) in self.storage_entry_keys.iter().zip(type_ids) { + key.encode_with_metadata(type_id, metadata, &mut input)?; + } + super::storage_map_key::hash_bytes(&input, &hashers[0], bytes); + Ok(()) + } else if hashers.len() == type_ids.len() { + // A hasher per field; encode and hash each field independently. + for ((key, type_id), hasher) in + self.storage_entry_keys.iter().zip(type_ids).zip(hashers) + { + let mut input = Vec::new(); + key.encode_with_metadata(type_id, metadata, &mut input)?; + super::storage_map_key::hash_bytes(&input, hasher, bytes); + } + Ok(()) + } else { + // Mismatch; wrong number of hashers/fields. + Err(StorageAddressError::WrongNumberOfHashers { + hashers: hashers.len(), + fields: type_ids.len(), + } + .into()) + } + } + } + } +} diff --git a/subxt/src/storage/storage_client.rs b/subxt/src/storage/storage_client.rs new file mode 100644 index 0000000000..262ee6f78c --- /dev/null +++ b/subxt/src/storage/storage_client.rs @@ -0,0 +1,410 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::storage_address::{ + StorageAddress, + Yes, +}; +use crate::{ + client::{ + OfflineClientT, + OnlineClientT, + }, + error::Error, + metadata::{ + DecodeWithMetadata, + Metadata, + }, + Config, +}; +use derivative::Derivative; +use frame_metadata::StorageEntryType; +use scale_info::form::PortableForm; +use sp_core::storage::{ + StorageData, + StorageKey, +}; +use std::{ + future::Future, + marker::PhantomData, +}; + +/// Query the runtime storage. +#[derive(Derivative)] +#[derivative(Clone(bound = "Client: Clone"))] +pub struct StorageClient { + client: Client, + _marker: PhantomData, +} + +impl StorageClient { + /// Create a new [`StorageClient`] + pub fn new(client: Client) -> Self { + Self { + client, + _marker: PhantomData, + } + } +} + +impl StorageClient +where + T: Config, + Client: OfflineClientT, +{ + /// Run the validation logic against some storage address you'd like to access. Returns `Ok(())` + /// if the address is valid (or if it's not possible to check since the address has no validation hash). + /// Return an error if the address was not valid or something went wrong trying to validate it (ie + /// the pallet or storage entry in question do not exist at all). + pub fn validate( + &self, + address: &Address, + ) -> Result<(), Error> { + if let Some(hash) = address.validation_hash() { + validate_storage( + address.pallet_name(), + address.entry_name(), + hash, + &self.client.metadata(), + )?; + } + Ok(()) + } +} + +impl StorageClient +where + T: Config, + Client: OnlineClientT, +{ + /// Fetch the raw encoded value at the address/key given. + pub fn fetch_raw<'a>( + &self, + key: &'a [u8], + hash: Option, + ) -> impl Future>, Error>> + 'a { + let client = self.client.clone(); + // Ensure that the returned future doesn't have a lifetime tied to api.storage(), + // which is a temporary thing we'll be throwing away quickly: + async move { + let data = client.rpc().storage(key, hash).await?; + Ok(data.map(|d| d.0)) + } + } + + /// Fetch a decoded value from storage at a given address and optional block hash. + /// + /// # Example + /// + /// ```no_run + /// use subxt::{ PolkadotConfig, OnlineClient }; + /// + /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] + /// pub mod polkadot {} + /// + /// # #[tokio::main] + /// # async fn main() { + /// let api = OnlineClient::::new().await.unwrap(); + /// + /// // Address to a storage entry we'd like to access. + /// let address = polkadot::storage().xcm_pallet().queries(&12345); + /// + /// // Fetch just the keys, returning up to 10 keys. + /// let value = api + /// .storage() + /// .fetch(&address, None) + /// .await + /// .unwrap(); + /// + /// println!("Value: {:?}", value); + /// # } + /// ``` + pub fn fetch<'a, Address>( + &self, + address: &'a Address, + hash: Option, + ) -> impl Future< + Output = Result::Target>, Error>, + > + 'a + where + Address: StorageAddress + 'a, + { + let client = self.clone(); + async move { + // Metadata validation checks whether the static address given + // is likely to actually correspond to a real storage entry or not. + // if not, it means static codegen doesn't line up with runtime + // metadata. + client.validate(address)?; + + // Look up the return type ID to enable DecodeWithMetadata: + let metadata = client.client.metadata(); + let lookup_bytes = super::utils::storage_address_bytes(address, &metadata)?; + if let Some(data) = client + .client + .storage() + .fetch_raw(&lookup_bytes, hash) + .await? + { + let val = ::decode_storage_with_metadata( + &mut &*data, + address.pallet_name(), + address.entry_name(), + &metadata, + )?; + Ok(Some(val)) + } else { + Ok(None) + } + } + } + + /// Fetch a StorageKey that has a default value with an optional block hash. + pub fn fetch_or_default<'a, Address>( + &self, + address: &'a Address, + hash: Option, + ) -> impl Future::Target, Error>> + + 'a + where + Address: StorageAddress + 'a, + { + let client = self.client.clone(); + async move { + let pallet_name = address.pallet_name(); + let storage_name = address.entry_name(); + // Metadata validation happens via .fetch(): + if let Some(data) = client.storage().fetch(address, hash).await? { + Ok(data) + } else { + let metadata = client.metadata(); + + // We have to dig into metadata already, so no point using the optimised `decode_storage_with_metadata` call. + let pallet_metadata = metadata.pallet(pallet_name)?; + let storage_metadata = pallet_metadata.storage(storage_name)?; + let return_ty_id = + return_type_from_storage_entry_type(&storage_metadata.ty); + let bytes = &mut &storage_metadata.default[..]; + + let val = ::decode_with_metadata( + bytes, + return_ty_id, + &metadata, + )?; + Ok(val) + } + } + } + + /// Fetch up to `count` keys for a storage map in lexicographic order. + /// + /// Supports pagination by passing a value to `start_key`. + pub fn fetch_keys<'a>( + &self, + key: &'a [u8], + count: u32, + start_key: Option<&'a [u8]>, + hash: Option, + ) -> impl Future, Error>> + 'a { + let client = self.client.clone(); + async move { + let keys = client + .rpc() + .storage_keys_paged(key, count, start_key, hash) + .await?; + Ok(keys) + } + } + + /// Returns an iterator of key value pairs. + /// + /// ```no_run + /// use subxt::{ PolkadotConfig, OnlineClient }; + /// + /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] + /// pub mod polkadot {} + /// + /// # #[tokio::main] + /// # async fn main() { + /// let api = OnlineClient::::new().await.unwrap(); + /// + /// // Address to the root of a storage entry that we'd like to iterate over. + /// let address = polkadot::storage().xcm_pallet().version_notifiers_root(); + /// + /// // Iterate over keys and values at that address. + /// let mut iter = api + /// .storage() + /// .iter(address, 10, None) + /// .await + /// .unwrap(); + /// + /// while let Some((key, value)) = iter.next().await.unwrap() { + /// println!("Key: 0x{}", hex::encode(&key)); + /// println!("Value: {}", value); + /// } + /// # } + /// ``` + pub fn iter
( + &self, + address: Address, + page_size: u32, + hash: Option, + ) -> impl Future, Error>> + 'static + where + Address: StorageAddress + 'static, + { + let client = self.clone(); + async move { + // Metadata validation checks whether the static address given + // is likely to actually correspond to a real storage entry or not. + // if not, it means static codegen doesn't line up with runtime + // metadata. + client.validate(&address)?; + + // Fetch a concrete block hash to iterate over. We do this so that if new blocks + // are produced midway through iteration, we continue to iterate at the block + // we started with and not the new block. + let hash = if let Some(hash) = hash { + hash + } else { + client + .client + .rpc() + .block_hash(None) + .await? + .expect("didn't pass a block number; qed") + }; + + let metadata = client.client.metadata(); + + // Look up the return type for flexible decoding. Do this once here to avoid + // potentially doing it every iteration if we used `decode_storage_with_metadata` + // in the iterator. + let return_type_id = lookup_storage_return_type( + &metadata, + address.pallet_name(), + address.entry_name(), + )?; + + // The root pallet/entry bytes for this storage entry: + let address_root_bytes = super::utils::storage_address_root_bytes(&address); + + Ok(KeyIter { + client, + address_root_bytes, + metadata, + return_type_id, + block_hash: hash, + count: page_size, + start_key: None, + buffer: Default::default(), + _marker: std::marker::PhantomData, + }) + } + } +} + +/// Iterates over key value pairs in a map. +pub struct KeyIter { + client: StorageClient, + address_root_bytes: Vec, + return_type_id: u32, + metadata: Metadata, + count: u32, + block_hash: T::Hash, + start_key: Option, + buffer: Vec<(StorageKey, StorageData)>, + _marker: std::marker::PhantomData, +} + +impl<'a, T: Config, Client: OnlineClientT, ReturnTy> KeyIter +where + T: Config, + Client: OnlineClientT, + ReturnTy: DecodeWithMetadata, +{ + /// Returns the next key value pair from a map. + pub async fn next( + &mut self, + ) -> Result, Error> { + loop { + if let Some((k, v)) = self.buffer.pop() { + let val = ReturnTy::decode_with_metadata( + &mut &v.0[..], + self.return_type_id, + &self.metadata, + )?; + return Ok(Some((k, val))) + } else { + let start_key = self.start_key.take(); + let keys = self + .client + .fetch_keys( + &self.address_root_bytes, + self.count, + start_key.as_ref().map(|k| &*k.0), + Some(self.block_hash), + ) + .await?; + + if keys.is_empty() { + return Ok(None) + } + + self.start_key = keys.last().cloned(); + + let change_sets = self + .client + .client + .rpc() + .query_storage_at(keys.iter().map(|k| &*k.0), Some(self.block_hash)) + .await?; + for change_set in change_sets { + for (k, v) in change_set.changes { + if let Some(v) = v { + self.buffer.push((k, v)); + } + } + } + debug_assert_eq!(self.buffer.len(), keys.len()); + } + } + } +} + +/// Validate a storage entry against the metadata. +fn validate_storage( + pallet_name: &str, + storage_name: &str, + hash: [u8; 32], + metadata: &Metadata, +) -> Result<(), Error> { + let expected_hash = match metadata.storage_hash(pallet_name, storage_name) { + Ok(hash) => hash, + Err(e) => return Err(e.into()), + }; + match expected_hash == hash { + true => Ok(()), + false => Err(crate::error::MetadataError::IncompatibleMetadata.into()), + } +} + +/// look up a return type ID for some storage entry. +fn lookup_storage_return_type( + metadata: &Metadata, + pallet: &str, + entry: &str, +) -> Result { + let storage_entry_type = &metadata.pallet(pallet)?.storage(entry)?.ty; + + Ok(return_type_from_storage_entry_type(storage_entry_type)) +} + +/// Fetch the return type out of a [`StorageEntryType`]. +fn return_type_from_storage_entry_type(entry: &StorageEntryType) -> u32 { + match entry { + StorageEntryType::Plain(ty) => ty.id(), + StorageEntryType::Map { value, .. } => value.id(), + } +} diff --git a/subxt/src/storage/storage_map_key.rs b/subxt/src/storage/storage_map_key.rs new file mode 100644 index 0000000000..bd5b96ec1e --- /dev/null +++ b/subxt/src/storage/storage_map_key.rs @@ -0,0 +1,53 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use codec::Encode; +pub use sp_runtime::traits::SignedExtension; + +// We use this type a bunch, so export it from here. +pub use frame_metadata::StorageHasher; + +/// Storage key for a Map. +#[derive(Clone)] +pub struct StorageMapKey { + value: Vec, + hasher: StorageHasher, +} + +impl StorageMapKey { + /// Create a new [`StorageMapKey`] by pre-encoding static data and pairing it with a hasher. + pub fn new( + value: Encodable, + hasher: StorageHasher, + ) -> StorageMapKey { + Self { + value: value.encode(), + hasher, + } + } + + /// Convert this [`StorageMapKey`] into bytes and append them to some existing bytes. + pub fn to_bytes(&self, bytes: &mut Vec) { + hash_bytes(&self.value, &self.hasher, bytes) + } +} + +/// Take some SCALE encoded bytes and a [`StorageHasher`] and hash the bytes accordingly. +pub(super) fn hash_bytes(input: &[u8], hasher: &StorageHasher, bytes: &mut Vec) { + match hasher { + StorageHasher::Identity => bytes.extend(input), + StorageHasher::Blake2_128 => bytes.extend(sp_core::blake2_128(input)), + StorageHasher::Blake2_128Concat => { + bytes.extend(sp_core::blake2_128(input)); + bytes.extend(input); + } + StorageHasher::Blake2_256 => bytes.extend(sp_core::blake2_256(input)), + StorageHasher::Twox128 => bytes.extend(sp_core::twox_128(input)), + StorageHasher::Twox256 => bytes.extend(sp_core::twox_256(input)), + StorageHasher::Twox64Concat => { + bytes.extend(sp_core::twox_64(input)); + bytes.extend(input); + } + } +} diff --git a/subxt/src/storage/utils.rs b/subxt/src/storage/utils.rs new file mode 100644 index 0000000000..ecf6c3a134 --- /dev/null +++ b/subxt/src/storage/utils.rs @@ -0,0 +1,42 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! these utility methods complement the [`StorageAddress`] trait, but +//! aren't things that should ever be overridden, and so don't exist on +//! the trait itself. + +use super::StorageAddress; +use crate::{ + error::Error, + metadata::Metadata, +}; + +/// Return the root of a given [`StorageAddress`]: hash the pallet name and entry name +/// and append those bytes to the output. +pub fn write_storage_address_root_bytes( + addr: &Address, + out: &mut Vec, +) { + out.extend(&sp_core::twox_128(addr.pallet_name().as_bytes())); + out.extend(&sp_core::twox_128(addr.entry_name().as_bytes())); +} + +/// Outputs the [`storage_address_root_bytes`] as well as any additional bytes that represent +/// a lookup in a storage map at that location. +pub fn storage_address_bytes( + addr: &Address, + metadata: &Metadata, +) -> Result, Error> { + let mut bytes = Vec::new(); + write_storage_address_root_bytes(addr, &mut bytes); + addr.append_entry_bytes(metadata, &mut bytes)?; + Ok(bytes) +} + +/// Outputs a vector containing the bytes written by [`write_storage_address_root_bytes`]. +pub fn storage_address_root_bytes(addr: &Address) -> Vec { + let mut bytes = Vec::new(); + write_storage_address_root_bytes(addr, &mut bytes); + bytes +} diff --git a/subxt/src/extrinsic/mod.rs b/subxt/src/tx/mod.rs similarity index 80% rename from subxt/src/extrinsic/mod.rs rename to subxt/src/tx/mod.rs index 6d7b694738..95a60a8f98 100644 --- a/subxt/src/extrinsic/mod.rs +++ b/subxt/src/tx/mod.rs @@ -20,6 +20,9 @@ mod params; mod signer; +mod tx_client; +mod tx_payload; +mod tx_progress; pub use self::{ params::{ @@ -38,4 +41,20 @@ pub use self::{ PairSigner, Signer, }, + tx_client::{ + SignedSubmittableExtrinsic, + TxClient, + }, + tx_payload::{ + dynamic, + DynamicTxPayload, + StaticTxPayload, + TxPayload, + }, + tx_progress::{ + TxEvents, + TxInBlock, + TxProgress, + TxStatus, + }, }; diff --git a/subxt/src/extrinsic/params.rs b/subxt/src/tx/params.rs similarity index 93% rename from subxt/src/extrinsic/params.rs rename to subxt/src/tx/params.rs index 38dedbe1a8..b2bf9cc629 100644 --- a/subxt/src/extrinsic/params.rs +++ b/subxt/src/tx/params.rs @@ -2,16 +2,16 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +use crate::{ + utils::Encoded, + Config, +}; use codec::{ Compact, Encode, }; use core::fmt::Debug; - -use crate::{ - Config, - Encoded, -}; +use derivative::Derivative; // We require Era as a param below, so make it available from here. pub use sp_runtime::generic::Era; @@ -20,7 +20,7 @@ pub use sp_runtime::generic::Era; /// "additional" parameters that are signed and used in transactions. /// see [`BaseExtrinsicParams`] for an implementation that is compatible with /// a Polkadot node. -pub trait ExtrinsicParams: Debug { +pub trait ExtrinsicParams: Debug + 'static { /// These parameters can be provided to the constructor along with /// some default parameters that `subxt` understands, in order to /// help construct your [`ExtrinsicParams`] object. @@ -30,8 +30,8 @@ pub trait ExtrinsicParams: Debug { fn new( spec_version: u32, tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, + nonce: Index, + genesis_hash: Hash, other_params: Self::OtherParams, ) -> Self; @@ -73,7 +73,8 @@ pub type PolkadotExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder { era: Era, nonce: T::Index, @@ -91,6 +92,13 @@ pub struct BaseExtrinsicParams { /// /// Prefer to use [`SubstrateExtrinsicParamsBuilder`] for a version of this tailored towards /// Substrate, or [`PolkadotExtrinsicParamsBuilder`] for a version tailored to Polkadot. +#[derive(Derivative)] +#[derivative( + Debug(bound = "Tip: Debug"), + Clone(bound = "Tip: Clone"), + Copy(bound = "Tip: Copy"), + PartialEq(bound = "Tip: PartialEq") +)] pub struct BaseExtrinsicParamsBuilder { era: Era, mortality_checkpoint: Option, @@ -132,7 +140,9 @@ impl Default for BaseExtrinsicParamsBuilder { } } -impl ExtrinsicParams for BaseExtrinsicParams { +impl ExtrinsicParams + for BaseExtrinsicParams +{ type OtherParams = BaseExtrinsicParamsBuilder; fn new( diff --git a/subxt/src/extrinsic/signer.rs b/subxt/src/tx/signer.rs similarity index 100% rename from subxt/src/extrinsic/signer.rs rename to subxt/src/tx/signer.rs diff --git a/subxt/src/tx/tx_client.rs b/subxt/src/tx/tx_client.rs new file mode 100644 index 0000000000..1c281c39e6 --- /dev/null +++ b/subxt/src/tx/tx_client.rs @@ -0,0 +1,331 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::TxPayload; +use crate::{ + client::{ + OfflineClientT, + OnlineClientT, + }, + error::Error, + tx::{ + ExtrinsicParams, + Signer, + TxProgress, + }, + utils::{ + Encoded, + PhantomDataSendSync, + }, + Config, +}; +use codec::{ + Compact, + Encode, +}; +use derivative::Derivative; +use sp_runtime::{ + traits::Hash, + ApplyExtrinsicResult, +}; + +/// A client for working with transactions. +#[derive(Derivative)] +#[derivative(Clone(bound = "Client: Clone"))] +pub struct TxClient { + client: Client, + _marker: PhantomDataSendSync, +} + +impl TxClient { + /// Create a new [`TxClient`] + pub fn new(client: Client) -> Self { + Self { + client, + _marker: PhantomDataSendSync::new(), + } + } +} + +impl> TxClient { + /// Run the validation logic against some extrinsic you'd like to submit. Returns `Ok(())` + /// if the call is valid (or if it's not possible to check since the call has no validation hash). + /// Return an error if the call was not valid or something went wrong trying to validate it (ie + /// the pallet or call in question do not exist at all). + pub fn validate(&self, call: &Call) -> Result<(), Error> + where + Call: TxPayload, + { + if let Some(actual_hash) = call.validation_hash() { + let metadata = self.client.metadata(); + let expected_hash = + metadata.call_hash(call.pallet_name(), call.call_name())?; + if actual_hash != expected_hash { + return Err(crate::metadata::MetadataError::IncompatibleMetadata.into()) + } + } + Ok(()) + } + + /// Return the SCALE encoded bytes representing the call data of the transaction. + pub fn call_data(&self, call: &Call) -> Result, Error> + where + Call: TxPayload, + { + let metadata = self.client.metadata(); + let mut bytes = Vec::new(); + call.encode_call_data(&metadata, &mut bytes)?; + Ok(bytes) + } + + /// Creates a raw signed extrinsic, without submitting it. + pub async fn create_signed_with_nonce( + &self, + call: &Call, + signer: &(dyn Signer + Send + Sync), + account_nonce: T::Index, + other_params: >::OtherParams, + ) -> Result, Error> + where + Call: TxPayload, + { + // 1. Validate this call against the current node metadata if the call comes + // with a hash allowing us to do so. + self.validate(call)?; + + // 2. SCALE encode call data to bytes (pallet u8, call u8, call params). + let call_data = Encoded(self.call_data(call)?); + + // 3. Construct our custom additional/extra params. + let additional_and_extra_params = { + // Obtain spec version and transaction version from the runtime version of the client. + let runtime = self.client.runtime_version(); + >::new( + runtime.spec_version, + runtime.transaction_version, + account_nonce, + self.client.genesis_hash(), + other_params, + ) + }; + + tracing::debug!( + "tx additional_and_extra_params: {:?}", + additional_and_extra_params + ); + + // 4. Construct signature. This is compatible with the Encode impl + // for SignedPayload (which is this payload of bytes that we'd like) + // to sign. See: + // https://github.com/paritytech/substrate/blob/9a6d706d8db00abb6ba183839ec98ecd9924b1f8/primitives/runtime/src/generic/unchecked_extrinsic.rs#L215) + let signature = { + let mut bytes = Vec::new(); + call_data.encode_to(&mut bytes); + additional_and_extra_params.encode_extra_to(&mut bytes); + additional_and_extra_params.encode_additional_to(&mut bytes); + if bytes.len() > 256 { + signer.sign(&sp_core::blake2_256(&bytes)) + } else { + signer.sign(&bytes) + } + }; + + tracing::debug!("tx signature: {}", hex::encode(signature.encode())); + + // 5. Encode extrinsic, now that we have the parts we need. This is compatible + // with the Encode impl for UncheckedExtrinsic (protocol version 4). + let extrinsic = { + let mut encoded_inner = Vec::new(); + // "is signed" + transaction protocol version (4) + (0b10000000 + 4u8).encode_to(&mut encoded_inner); + // from address for signature + signer.address().encode_to(&mut encoded_inner); + // the signature bytes + signature.encode_to(&mut encoded_inner); + // attach custom extra params + additional_and_extra_params.encode_extra_to(&mut encoded_inner); + // and now, call data + call_data.encode_to(&mut encoded_inner); + // now, prefix byte length: + let len = Compact( + u32::try_from(encoded_inner.len()) + .expect("extrinsic size expected to be <4GB"), + ); + let mut encoded = Vec::new(); + len.encode_to(&mut encoded); + encoded.extend(encoded_inner); + encoded + }; + + // Wrap in Encoded to ensure that any more "encode" calls leave it in the right state. + // maybe we can just return the raw bytes.. + Ok(SignedSubmittableExtrinsic { + client: self.client.clone(), + encoded: Encoded(extrinsic), + marker: std::marker::PhantomData, + }) + } +} + +impl> TxClient { + /// Creates a raw signed extrinsic, without submitting it. + pub async fn create_signed( + &self, + call: &Call, + signer: &(dyn Signer + Send + Sync), + other_params: >::OtherParams, + ) -> Result, Error> + where + Call: TxPayload, + { + // Get nonce from the node. + let account_nonce = if let Some(nonce) = signer.nonce() { + nonce + } else { + self.client + .rpc() + .system_account_next_index(signer.account_id()) + .await? + }; + + self.create_signed_with_nonce(call, signer, account_nonce, other_params) + .await + } + + /// Creates and signs an extrinsic and submits it to the chain. Passes default parameters + /// to construct the "signed extra" and "additional" payloads needed by the extrinsic. + /// + /// Returns a [`TxProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn sign_and_submit_then_watch_default( + &self, + call: &Call, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> + where + Call: TxPayload, + >::OtherParams: Default, + { + self.sign_and_submit_then_watch(call, signer, Default::default()) + .await + } + + /// Creates and signs an extrinsic and submits it to the chain. + /// + /// Returns a [`TxProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn sign_and_submit_then_watch( + &self, + call: &Call, + signer: &(dyn Signer + Send + Sync), + other_params: >::OtherParams, + ) -> Result, Error> + where + Call: TxPayload, + { + self.create_signed(call, signer, other_params) + .await? + .submit_and_watch() + .await + } + + /// Creates and signs an extrinsic and submits to the chain for block inclusion. Passes + /// default parameters to construct the "signed extra" and "additional" payloads needed + /// by the extrinsic. + /// + /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. + /// + /// # Note + /// + /// Success does not mean the extrinsic has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn sign_and_submit_default( + &self, + call: &Call, + signer: &(dyn Signer + Send + Sync), + ) -> Result + where + Call: TxPayload, + >::OtherParams: Default, + { + self.sign_and_submit(call, signer, Default::default()).await + } + + /// Creates and signs an extrinsic and submits to the chain for block inclusion. + /// + /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. + /// + /// # Note + /// + /// Success does not mean the extrinsic has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn sign_and_submit( + &self, + call: &Call, + signer: &(dyn Signer + Send + Sync), + other_params: >::OtherParams, + ) -> Result + where + Call: TxPayload, + { + self.create_signed(call, signer, other_params) + .await? + .submit() + .await + } +} + +/// This represents an extrinsic that has been signed and is ready to submit. +pub struct SignedSubmittableExtrinsic { + client: C, + encoded: Encoded, + marker: std::marker::PhantomData, +} + +impl SignedSubmittableExtrinsic +where + T: Config, + C: OnlineClientT, +{ + /// Submits the extrinsic to the chain. + /// + /// Returns a [`TxProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn submit_and_watch(&self) -> Result, Error> { + // Get a hash of the extrinsic (we'll need this later). + let ext_hash = T::Hashing::hash_of(&self.encoded); + + // Submit and watch for transaction progress. + let sub = self.client.rpc().watch_extrinsic(&self.encoded).await?; + + Ok(TxProgress::new(sub, self.client.clone(), ext_hash)) + } + + /// Submits the extrinsic to the chain for block inclusion. + /// + /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. + /// + /// # Note + /// + /// Success does not mean the extrinsic has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn submit(&self) -> Result { + self.client.rpc().submit_extrinsic(&self.encoded).await + } + + /// Submits the extrinsic to the dry_run RPC, to test if it would succeed. + /// + /// Returns `Ok` with an [`ApplyExtrinsicResult`], which is the result of applying of an extrinsic. + pub async fn dry_run( + &self, + at: Option, + ) -> Result { + self.client.rpc().dry_run(self.encoded(), at).await + } + + /// Returns the SCALE encoded extrinsic bytes. + pub fn encoded(&self) -> &[u8] { + &self.encoded.0 + } +} diff --git a/subxt/src/tx/tx_payload.rs b/subxt/src/tx/tx_payload.rs new file mode 100644 index 0000000000..d1928d0dcc --- /dev/null +++ b/subxt/src/tx/tx_payload.rs @@ -0,0 +1,148 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! This module contains the trait and types used to represent +//! transactions that can be submitted. + +use crate::{ + dynamic::Value, + error::{ + Error, + MetadataError, + }, + metadata::Metadata, +}; +use codec::Encode; +use std::borrow::Cow; + +/// This represents a transaction payload that can be submitted +/// to a node. +pub trait TxPayload { + /// The name of the pallet that the call lives under. + fn pallet_name(&self) -> &str; + + /// The name of the call. + fn call_name(&self) -> &str; + + /// Encode call data to the provided output. + fn encode_call_data( + &self, + metadata: &Metadata, + out: &mut Vec, + ) -> Result<(), Error>; + + /// An optional validation hash that can be provided + /// to verify that the shape of the call on the node + /// aligns with our expectations. + fn validation_hash(&self) -> Option<[u8; 32]> { + None + } +} + +/// This represents a statically generated transaction payload. +pub struct StaticTxPayload { + pallet_name: &'static str, + call_name: &'static str, + call_data: CallData, + validation_hash: Option<[u8; 32]>, +} + +impl StaticTxPayload { + /// Create a new [`StaticTxPayload`] from static data. + pub fn new( + pallet_name: &'static str, + call_name: &'static str, + call_data: CallData, + validation_hash: [u8; 32], + ) -> Self { + StaticTxPayload { + pallet_name, + call_name, + call_data, + validation_hash: Some(validation_hash), + } + } + + /// Do not validate this call prior to submitting it. + pub fn unvalidated(self) -> Self { + Self { + validation_hash: None, + ..self + } + } +} + +impl TxPayload for StaticTxPayload { + fn pallet_name(&self) -> &str { + self.pallet_name + } + + fn call_name(&self) -> &str { + self.call_name + } + + fn encode_call_data( + &self, + metadata: &Metadata, + out: &mut Vec, + ) -> Result<(), Error> { + let pallet = metadata.pallet(self.pallet_name)?; + let pallet_index = pallet.index(); + let call_index = pallet.call_index(self.call_name)?; + + pallet_index.encode_to(out); + call_index.encode_to(out); + self.call_data.encode_to(out); + Ok(()) + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + self.validation_hash + } +} + +/// This represents a dynamically generated transaction payload. +pub struct DynamicTxPayload<'a> { + pallet_name: Cow<'a, str>, + call_name: Cow<'a, str>, + fields: Vec>, +} + +/// Construct a new dynamic transaction payload to submit to a node. +pub fn dynamic<'a>( + pallet_name: impl Into>, + call_name: impl Into>, + fields: Vec>, +) -> DynamicTxPayload<'a> { + DynamicTxPayload { + pallet_name: pallet_name.into(), + call_name: call_name.into(), + fields, + } +} + +impl<'a> TxPayload for DynamicTxPayload<'a> { + fn pallet_name(&self) -> &str { + &self.pallet_name + } + + fn call_name(&self) -> &str { + &self.call_name + } + + fn encode_call_data( + &self, + metadata: &Metadata, + out: &mut Vec, + ) -> Result<(), Error> { + let pallet = metadata.pallet(&self.pallet_name)?; + let call_id = pallet.call_ty_id().ok_or(MetadataError::CallNotFound)?; + let call_value = + Value::unnamed_variant(self.call_name.to_owned(), self.fields.clone()); + + pallet.index().encode_to(out); + scale_value::scale::encode_as_type(&call_value, call_id, metadata.types(), out)?; + Ok(()) + } +} diff --git a/subxt/src/transaction.rs b/subxt/src/tx/tx_progress.rs similarity index 62% rename from subxt/src/transaction.rs rename to subxt/src/tx/tx_progress.rs index f90307e1cb..50b02f4844 100644 --- a/subxt/src/transaction.rs +++ b/subxt/src/tx/tx_progress.rs @@ -2,32 +2,27 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use std::task::Poll; +//! Types representing extrinsics/transactions that have been submitted to a node. -use crate::PhantomDataSendSync; -use codec::Decode; -use sp_runtime::traits::Hash; -pub use sp_runtime::traits::SignedExtension; +use std::task::Poll; use crate::{ - client::Client, + client::OnlineClientT, error::{ - BasicError, + DispatchError, Error, - HasModuleError, - ModuleError, - RuntimeError, TransactionError, }, events::{ self, EventDetails, Events, - RawEventDetails, + EventsClient, + Phase, + StaticEvent, }, - rpc::SubstrateTransactionStatus, + rpc::SubstrateTxStatus, Config, - Phase, }; use derivative::Derivative; use futures::{ @@ -38,71 +33,65 @@ use jsonrpsee::core::{ client::Subscription as RpcSubscription, Error as RpcError, }; +use sp_runtime::traits::Hash; + +pub use sp_runtime::traits::SignedExtension; -/// This struct represents a subscription to the progress of some transaction, and is -/// returned from [`crate::SubmittableExtrinsic::sign_and_submit_then_watch()`]. +/// This struct represents a subscription to the progress of some transaction. #[derive(Derivative)] -#[derivative(Debug(bound = ""))] -pub struct TransactionProgress<'client, T: Config, E, Evs> { - sub: Option>>, +#[derivative(Debug(bound = "C: std::fmt::Debug"))] +pub struct TxProgress { + sub: Option>>, ext_hash: T::Hash, - client: &'client Client, - _error: PhantomDataSendSync<(E, Evs)>, + client: C, } // The above type is not `Unpin` by default unless the generic param `T` is, // so we manually make it clear that Unpin is actually fine regardless of `T` // (we don't care if this moves around in memory while it's "pinned"). -impl<'client, T: Config, E, Evs> Unpin for TransactionProgress<'client, T, E, Evs> {} +impl Unpin for TxProgress {} -impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> - TransactionProgress<'client, T, E, Evs> -{ - /// Instantiate a new [`TransactionProgress`] from a custom subscription. +impl TxProgress { + /// Instantiate a new [`TxProgress`] from a custom subscription. pub fn new( - sub: RpcSubscription>, - client: &'client Client, + sub: RpcSubscription>, + client: C, ext_hash: T::Hash, ) -> Self { Self { sub: Some(sub), client, ext_hash, - _error: PhantomDataSendSync::new(), } } +} +impl> TxProgress { /// Return the next transaction status when it's emitted. This just delegates to the - /// [`futures::Stream`] implementation for [`TransactionProgress`], but allows you to + /// [`futures::Stream`] implementation for [`TxProgress`], but allows you to /// avoid importing that trait if you don't otherwise need it. - pub async fn next_item( - &mut self, - ) -> Option, BasicError>> { + pub async fn next_item(&mut self) -> Option, Error>> { self.next().await } /// Wait for the transaction to be in a block (but not necessarily finalized), and return - /// an [`TransactionInBlock`] instance when this happens, or an error if there was a problem + /// an [`TxInBlock`] instance when this happens, or an error if there was a problem /// waiting for this to happen. /// /// **Note:** consumes `self`. If you'd like to perform multiple actions as the state of the - /// transaction progresses, use [`TransactionProgress::next_item()`] instead. + /// transaction progresses, use [`TxProgress::next_item()`] instead. /// /// **Note:** transaction statuses like `Invalid` and `Usurped` are ignored, because while they /// may well indicate with some probability that the transaction will not make it into a block, /// there is no guarantee that this is true. Thus, we prefer to "play it safe" here. Use the lower - /// level [`TransactionProgress::next_item()`] API if you'd like to handle these statuses yourself. - pub async fn wait_for_in_block( - mut self, - ) -> Result, BasicError> { + /// level [`TxProgress::next_item()`] API if you'd like to handle these statuses yourself. + pub async fn wait_for_in_block(mut self) -> Result, Error> { while let Some(status) = self.next_item().await { match status? { // Finalized or otherwise in a block! Return. - TransactionStatus::InBlock(s) | TransactionStatus::Finalized(s) => { - return Ok(s) - } + TxStatus::InBlock(s) | TxStatus::Finalized(s) => return Ok(s), // Error scenarios; return the error. - TransactionStatus::FinalityTimeout(_) => { + TxStatus::FinalityTimeout(_) => { return Err(TransactionError::FinalitySubscriptionTimeout.into()) } // Ignore anything else and wait for next status event: @@ -112,25 +101,23 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> Err(RpcError::Custom("RPC subscription dropped".into()).into()) } - /// Wait for the transaction to be finalized, and return a [`TransactionInBlock`] + /// Wait for the transaction to be finalized, and return a [`TxInBlock`] /// instance when it is, or an error if there was a problem waiting for finalization. /// /// **Note:** consumes `self`. If you'd like to perform multiple actions as the state of the - /// transaction progresses, use [`TransactionProgress::next_item()`] instead. + /// transaction progresses, use [`TxProgress::next_item()`] instead. /// /// **Note:** transaction statuses like `Invalid` and `Usurped` are ignored, because while they /// may well indicate with some probability that the transaction will not make it into a block, /// there is no guarantee that this is true. Thus, we prefer to "play it safe" here. Use the lower - /// level [`TransactionProgress::next_item()`] API if you'd like to handle these statuses yourself. - pub async fn wait_for_finalized( - mut self, - ) -> Result, BasicError> { + /// level [`TxProgress::next_item()`] API if you'd like to handle these statuses yourself. + pub async fn wait_for_finalized(mut self) -> Result, Error> { while let Some(status) = self.next_item().await { match status? { // Finalized! Return. - TransactionStatus::Finalized(s) => return Ok(s), + TxStatus::Finalized(s) => return Ok(s), // Error scenarios; return the error. - TransactionStatus::FinalityTimeout(_) => { + TxStatus::FinalityTimeout(_) => { return Err(TransactionError::FinalitySubscriptionTimeout.into()) } // Ignore and wait for next status event: @@ -145,24 +132,20 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> /// as well as a couple of other details (block hash and extrinsic hash). /// /// **Note:** consumes self. If you'd like to perform multiple actions as progress is made, - /// use [`TransactionProgress::next_item()`] instead. + /// use [`TxProgress::next_item()`] instead. /// /// **Note:** transaction statuses like `Invalid` and `Usurped` are ignored, because while they /// may well indicate with some probability that the transaction will not make it into a block, /// there is no guarantee that this is true. Thus, we prefer to "play it safe" here. Use the lower - /// level [`TransactionProgress::next_item()`] API if you'd like to handle these statuses yourself. - pub async fn wait_for_finalized_success( - self, - ) -> Result, Error> { + /// level [`TxProgress::next_item()`] API if you'd like to handle these statuses yourself. + pub async fn wait_for_finalized_success(self) -> Result, Error> { let evs = self.wait_for_finalized().await?.wait_for_success().await?; Ok(evs) } } -impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> Stream - for TransactionProgress<'client, T, E, Evs> -{ - type Item = Result, BasicError>; +impl> Stream for TxProgress { + type Item = Result, Error>; fn poll_next( mut self: std::pin::Pin<&mut Self>, @@ -177,28 +160,22 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> Stream .map_err(|e| e.into()) .map_ok(|status| { match status { - SubstrateTransactionStatus::Future => TransactionStatus::Future, - SubstrateTransactionStatus::Ready => TransactionStatus::Ready, - SubstrateTransactionStatus::Broadcast(peers) => { - TransactionStatus::Broadcast(peers) - } - SubstrateTransactionStatus::InBlock(hash) => { - TransactionStatus::InBlock(TransactionInBlock::new( + SubstrateTxStatus::Future => TxStatus::Future, + SubstrateTxStatus::Ready => TxStatus::Ready, + SubstrateTxStatus::Broadcast(peers) => TxStatus::Broadcast(peers), + SubstrateTxStatus::InBlock(hash) => { + TxStatus::InBlock(TxInBlock::new( hash, self.ext_hash, - self.client, + self.client.clone(), )) } - SubstrateTransactionStatus::Retracted(hash) => { - TransactionStatus::Retracted(hash) - } - SubstrateTransactionStatus::Usurped(hash) => { - TransactionStatus::Usurped(hash) - } - SubstrateTransactionStatus::Dropped => TransactionStatus::Dropped, - SubstrateTransactionStatus::Invalid => TransactionStatus::Invalid, + SubstrateTxStatus::Retracted(hash) => TxStatus::Retracted(hash), + SubstrateTxStatus::Usurped(hash) => TxStatus::Usurped(hash), + SubstrateTxStatus::Dropped => TxStatus::Dropped, + SubstrateTxStatus::Invalid => TxStatus::Invalid, // Only the following statuses are actually considered "final" (see the substrate - // docs on `TransactionStatus`). Basically, either the transaction makes it into a + // docs on `TxStatus`). Basically, either the transaction makes it into a // block, or we eventually give up on waiting for it to make it into a block. // Even `Dropped`/`Invalid`/`Usurped` transactions might make it into a block eventually. // @@ -206,16 +183,16 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> Stream // nonce might still be valid on some fork on another node which ends up being finalized. // Equally, a transaction `Dropped` from one node may still be in the transaction pool, // and make it into a block, on another node. Likewise with `Usurped`. - SubstrateTransactionStatus::FinalityTimeout(hash) => { + SubstrateTxStatus::FinalityTimeout(hash) => { self.sub = None; - TransactionStatus::FinalityTimeout(hash) + TxStatus::FinalityTimeout(hash) } - SubstrateTransactionStatus::Finalized(hash) => { + SubstrateTxStatus::Finalized(hash) => { self.sub = None; - TransactionStatus::Finalized(TransactionInBlock::new( + TxStatus::Finalized(TxInBlock::new( hash, self.ext_hash, - self.client, + self.client.clone(), )) } } @@ -223,12 +200,12 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> Stream } } -//* Dev note: The below is adapted from the substrate docs on `TransactionStatus`, which this -//* enum was adapted from (and which is an exact copy of `SubstrateTransactionStatus` in this crate). +//* Dev note: The below is adapted from the substrate docs on `TxStatus`, which this +//* enum was adapted from (and which is an exact copy of `SubstrateTxStatus` in this crate). //* Note that the number of finality watchers is, at the time of writing, found in the constant //* `MAX_FINALITY_WATCHERS` in the `sc_transaction_pool` crate. //* -/// Possible transaction statuses returned from our [`TransactionProgress::next_item()`] call. +/// Possible transaction statuses returned from our [`TxProgress::next_item()`] call. /// /// These status events can be grouped based on their kinds as: /// @@ -270,8 +247,8 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> Stream /// within 512 blocks. This either indicates that finality is not available for your chain, /// or that finality gadget is lagging behind. #[derive(Derivative)] -#[derivative(Debug(bound = ""))] -pub enum TransactionStatus<'client, T: Config, E: Decode, Evs: Decode> { +#[derivative(Debug(bound = "C: std::fmt::Debug"))] +pub enum TxStatus { /// The transaction is part of the "future" queue. Future, /// The transaction is part of the "ready" queue. @@ -279,7 +256,7 @@ pub enum TransactionStatus<'client, T: Config, E: Decode, Evs: Decode> { /// The transaction has been broadcast to the given peers. Broadcast(Vec), /// The transaction has been included in a block with given hash. - InBlock(TransactionInBlock<'client, T, E, Evs>), + InBlock(TxInBlock), /// The block this transaction was included in has been retracted, /// probably because it did not make it onto the blocks which were /// finalized. @@ -288,7 +265,7 @@ pub enum TransactionStatus<'client, T: Config, E: Decode, Evs: Decode> { /// blocks, and so the subscription has ended. FinalityTimeout(T::Hash), /// The transaction has been finalized by a finality-gadget, e.g GRANDPA. - Finalized(TransactionInBlock<'client, T, E, Evs>), + Finalized(TxInBlock), /// The transaction has been replaced in the pool by another transaction /// that provides the same tags. (e.g. same (sender, nonce)). Usurped(T::Hash), @@ -298,10 +275,10 @@ pub enum TransactionStatus<'client, T: Config, E: Decode, Evs: Decode> { Invalid, } -impl<'client, T: Config, E: Decode, Evs: Decode> TransactionStatus<'client, T, E, Evs> { +impl TxStatus { /// A convenience method to return the `Finalized` details. Returns - /// [`None`] if the enum variant is not [`TransactionStatus::Finalized`]. - pub fn as_finalized(&self) -> Option<&TransactionInBlock<'client, T, E, Evs>> { + /// [`None`] if the enum variant is not [`TxStatus::Finalized`]. + pub fn as_finalized(&self) -> Option<&TxInBlock> { match self { Self::Finalized(val) => Some(val), _ => None, @@ -309,8 +286,8 @@ impl<'client, T: Config, E: Decode, Evs: Decode> TransactionStatus<'client, T, E } /// A convenience method to return the `InBlock` details. Returns - /// [`None`] if the enum variant is not [`TransactionStatus::InBlock`]. - pub fn as_in_block(&self) -> Option<&TransactionInBlock<'client, T, E, Evs>> { + /// [`None`] if the enum variant is not [`TxStatus::InBlock`]. + pub fn as_in_block(&self) -> Option<&TxInBlock> { match self { Self::InBlock(val) => Some(val), _ => None, @@ -320,27 +297,19 @@ impl<'client, T: Config, E: Decode, Evs: Decode> TransactionStatus<'client, T, E /// This struct represents a transaction that has made it into a block. #[derive(Derivative)] -#[derivative(Debug(bound = ""))] -pub struct TransactionInBlock<'client, T: Config, E: Decode, Evs: Decode> { +#[derivative(Debug(bound = "C: std::fmt::Debug"))] +pub struct TxInBlock { block_hash: T::Hash, ext_hash: T::Hash, - client: &'client Client, - _error: PhantomDataSendSync<(E, Evs)>, + client: C, } -impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> - TransactionInBlock<'client, T, E, Evs> -{ - pub(crate) fn new( - block_hash: T::Hash, - ext_hash: T::Hash, - client: &'client Client, - ) -> Self { +impl> TxInBlock { + pub(crate) fn new(block_hash: T::Hash, ext_hash: T::Hash, client: C) -> Self { Self { block_hash, ext_hash, client, - _error: PhantomDataSendSync::new(), } } @@ -362,34 +331,21 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> /// **Note:** If multiple `ExtrinsicFailed` errors are returned (for instance /// because a pallet chooses to emit one as an event, which is considered /// abnormal behaviour), it is not specified which of the errors is returned here. - /// You can use [`TransactionInBlock::fetch_events`] instead if you'd like to + /// You can use [`TxInBlock::fetch_events`] instead if you'd like to /// work with multiple "error" events. /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn wait_for_success(&self) -> Result, Error> { + pub async fn wait_for_success(&self) -> Result, Error> { let events = self.fetch_events().await?; // Try to find any errors; return the first one we encounter. - for ev in events.iter_raw() { + for ev in events.iter() { let ev = ev?; - if &ev.pallet == "System" && &ev.variant == "ExtrinsicFailed" { - let dispatch_error = E::decode(&mut &*ev.bytes)?; - if let Some(error_data) = dispatch_error.module_error_data() { - // Error index is utilized as the first byte from the error array. - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - let details = metadata - .error(error_data.pallet_index, error_data.error_index())?; - return Err(Error::Module(ModuleError { - pallet: details.pallet().to_string(), - error: details.error().to_string(), - description: details.description().to_vec(), - error_data, - })) - } else { - return Err(Error::Runtime(RuntimeError(dispatch_error))) - } + if ev.pallet_name() == "System" && ev.variant_name() == "ExtrinsicFailed" { + let dispatch_error = + DispatchError::decode_from(ev.field_bytes(), &self.client.metadata()); + return Err(dispatch_error.into()) } } @@ -402,13 +358,13 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn fetch_events(&self) -> Result, BasicError> { + pub async fn fetch_events(&self) -> Result, Error> { let block = self .client .rpc() .block(Some(self.block_hash)) .await? - .ok_or(BasicError::Transaction(TransactionError::BlockHashNotFound))?; + .ok_or(Error::Transaction(TransactionError::BlockHashNotFound))?; let extrinsic_idx = block.block.extrinsics .iter() @@ -418,11 +374,13 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> }) // If we successfully obtain the block hash we think contains our // extrinsic, the extrinsic should be in there somewhere.. - .ok_or(BasicError::Transaction(TransactionError::BlockHashNotFound))?; + .ok_or(Error::Transaction(TransactionError::BlockHashNotFound))?; - let events = events::at::(self.client, self.block_hash).await?; + let events = EventsClient::new(self.client.clone()) + .at(Some(self.block_hash)) + .await?; - Ok(TransactionEvents { + Ok(TxEvents { ext_hash: self.ext_hash, ext_idx: extrinsic_idx as u32, events, @@ -434,13 +392,13 @@ impl<'client, T: Config, E: Decode + HasModuleError, Evs: Decode> /// We can iterate over the events, or look for a specific one. #[derive(Derivative)] #[derivative(Debug(bound = ""))] -pub struct TransactionEvents { +pub struct TxEvents { ext_hash: T::Hash, ext_idx: u32, - events: Events, + events: Events, } -impl TransactionEvents { +impl TxEvents { /// Return the hash of the block that the transaction has made it into. pub fn block_hash(&self) -> T::Hash { self.events.block_hash() @@ -452,34 +410,18 @@ impl TransactionEvents { } /// Return all of the events in the block that the transaction made it into. - pub fn all_events_in_block(&self) -> &events::Events { + pub fn all_events_in_block(&self) -> &events::Events { &self.events } - /// Iterate over the statically decoded events associated with this transaction. + /// Iterate over all of the raw events associated with this transaction. /// /// This works in the same way that [`events::Events::iter()`] does, with the /// exception that it filters out events not related to the submitted extrinsic. - pub fn iter( - &self, - ) -> impl Iterator, BasicError>> + '_ { + pub fn iter(&self) -> impl Iterator> + '_ { self.events.iter().filter(|ev| { ev.as_ref() - .map(|ev| ev.phase == Phase::ApplyExtrinsic(self.ext_idx)) - .unwrap_or(true) // Keep any errors - }) - } - - /// Iterate over all of the raw events associated with this transaction. - /// - /// This works in the same way that [`events::Events::iter_raw()`] does, with the - /// exception that it filters out events not related to the submitted extrinsic. - pub fn iter_raw( - &self, - ) -> impl Iterator> + '_ { - self.events.iter_raw().filter(|ev| { - ev.as_ref() - .map(|ev| ev.phase == Phase::ApplyExtrinsic(self.ext_idx)) + .map(|ev| ev.phase() == Phase::ApplyExtrinsic(self.ext_idx)) .unwrap_or(true) // Keep any errors. }) } @@ -488,10 +430,8 @@ impl TransactionEvents { /// /// This works in the same way that [`events::Events::find()`] does, with the /// exception that it filters out events not related to the submitted extrinsic. - pub fn find( - &self, - ) -> impl Iterator> + '_ { - self.iter_raw().filter_map(|ev| { + pub fn find(&self) -> impl Iterator> + '_ { + self.iter().filter_map(|ev| { ev.and_then(|ev| ev.as_event::().map_err(Into::into)) .transpose() }) @@ -502,7 +442,7 @@ impl TransactionEvents { /// /// This works in the same way that [`events::Events::find_first()`] does, with the /// exception that it ignores events not related to the submitted extrinsic. - pub fn find_first(&self) -> Result, BasicError> { + pub fn find_first(&self) -> Result, Error> { self.find::().next().transpose() } @@ -510,7 +450,7 @@ impl TransactionEvents { /// /// This works in the same way that [`events::Events::has()`] does, with the /// exception that it ignores events not related to the submitted extrinsic. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some()) } } diff --git a/subxt/src/updates.rs b/subxt/src/updates.rs deleted file mode 100644 index 598d3d4d52..0000000000 --- a/subxt/src/updates.rs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Perform runtime updates in the background using [UpdateClient]. -//! -//! There are cases when the node would perform a runtime update. As a result, the subxt's metadata -//! would be out of sync and the API would not be able to submit valid extrinsics. -//! This API keeps the `RuntimeVersion` and `Metadata` of the client synced with the target node. -//! -//! The runtime update is recommended for long-running clients, or for cases where manually -//! restarting subxt would not be feasible. Even with this, extrinsics submitted during a node -//! runtime update are at risk or failing, as it will take `subxt` a moment to catch up. -//! -//! ## Note -//! -//! Here we use tokio to check for updates in the background, but any runtime can be used. -//! -//! ```no_run -//! # use subxt::{ClientBuilder, DefaultConfig}; -//! # -//! # #[tokio::main] -//! # async fn main() { -//! # let client = ClientBuilder::new() -//! # .set_url("wss://rpc.polkadot.io:443") -//! # .build::() -//! # .await -//! # .unwrap(); -//! # -//! let update_client = client.updates(); -//! // Spawn a new background task to handle runtime updates. -//! tokio::spawn(async move { -//! let result = update_client.perform_runtime_updates().await; -//! println!("Runtime update finished with result={:?}", result); -//! }); -//! # } -//! ``` - -use crate::{ - rpc::{ - Rpc, - RuntimeVersion, - }, - BasicError, - Config, - Metadata, -}; -use parking_lot::RwLock; -use std::sync::Arc; - -/// Client wrapper for performing runtime updates. -pub struct UpdateClient { - rpc: Rpc, - metadata: Arc>, - runtime_version: Arc>, -} - -impl UpdateClient { - /// Create a new [`UpdateClient`]. - pub fn new( - rpc: Rpc, - metadata: Arc>, - runtime_version: Arc>, - ) -> Self { - Self { - rpc, - metadata, - runtime_version, - } - } - - /// Performs runtime updates indefinitely unless encountering an error. - /// - /// *Note:* This should be called from a dedicated background task. - pub async fn perform_runtime_updates(&self) -> Result<(), BasicError> { - // Obtain an update subscription to further detect changes in the runtime version of the node. - let mut update_subscription = self.rpc.subscribe_runtime_version().await?; - - while let Some(update_runtime_version) = update_subscription.next().await { - // The Runtime Version obtained via subscription. - let update_runtime_version = update_runtime_version?; - - // To ensure there are no races between: - // - starting the subxt::Client (fetching runtime version / metadata) - // - subscribing to the runtime updates - // the node provides its runtime version immediately after subscribing. - // - // In those cases, set the Runtime Version on the client if and only if - // the provided runtime version is different than what the client currently - // has stored. - { - // The Runtime Version of the client, as set during building the client - // or during updates. - let runtime_version = self.runtime_version.read(); - if runtime_version.spec_version == update_runtime_version.spec_version { - tracing::debug!( - "Runtime update not performed for spec_version={}, client has spec_version={}", - update_runtime_version.spec_version, runtime_version.spec_version - ); - continue - } - } - - // Update the RuntimeVersion first. - { - let mut runtime_version = self.runtime_version.write(); - // Update both the `RuntimeVersion` and `Metadata` of the client. - tracing::info!( - "Performing runtime update from {} to {}", - runtime_version.spec_version, - update_runtime_version.spec_version, - ); - *runtime_version = update_runtime_version; - } - - // Fetch the new metadata of the runtime node. - let update_metadata = self.rpc.metadata().await?; - tracing::debug!("Performing metadata update"); - let mut metadata = self.metadata.write(); - *metadata = update_metadata; - tracing::debug!("Runtime update completed"); - } - - Ok(()) - } -} diff --git a/subxt/src/utils.rs b/subxt/src/utils.rs new file mode 100644 index 0000000000..d8bff8d7fb --- /dev/null +++ b/subxt/src/utils.rs @@ -0,0 +1,98 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! Miscellaneous utility helpers. + +use codec::{ + Decode, + DecodeAll, + Encode, +}; +use derivative::Derivative; + +/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of +/// the transaction payload +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Encoded(pub Vec); + +impl codec::Encode for Encoded { + fn encode(&self) -> Vec { + self.0.to_owned() + } +} + +/// A wrapper for any type `T` which implement encode/decode in a way compatible with `Vec`. +/// +/// [`WrapperKeepOpaque`] stores the type only in its opaque format, aka as a `Vec`. To +/// access the real type `T` [`Self::try_decode`] needs to be used. +#[derive(Derivative, Encode, Decode)] +#[derivative( + Debug(bound = ""), + Clone(bound = ""), + PartialEq(bound = ""), + Eq(bound = ""), + Default(bound = ""), + Hash(bound = "") +)] +pub struct WrapperKeepOpaque { + data: Vec, + _phantom: PhantomDataSendSync, +} + +impl WrapperKeepOpaque { + /// Try to decode the wrapped type from the inner `data`. + /// + /// Returns `None` if the decoding failed. + pub fn try_decode(&self) -> Option { + T::decode_all(&mut &self.data[..]).ok() + } + + /// Returns the length of the encoded `T`. + pub fn encoded_len(&self) -> usize { + self.data.len() + } + + /// Returns the encoded data. + pub fn encoded(&self) -> &[u8] { + &self.data + } + + /// Create from the given encoded `data`. + pub fn from_encoded(data: Vec) -> Self { + Self { + data, + _phantom: PhantomDataSendSync::new(), + } + } +} + +/// A version of [`std::marker::PhantomData`] that is also Send and Sync (which is fine +/// because regardless of the generic param, it is always possible to Send + Sync this +/// 0 size type). +#[derive(Derivative, Encode, Decode, scale_info::TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = ""), + Default(bound = ""), + Hash(bound = "") +)] +#[scale_info(skip_type_params(T))] +#[doc(hidden)] +pub struct PhantomDataSendSync(core::marker::PhantomData); + +impl PhantomDataSendSync { + pub(crate) fn new() -> Self { + Self(core::marker::PhantomData) + } +} + +unsafe impl Send for PhantomDataSendSync {} +unsafe impl Sync for PhantomDataSendSync {} + +/// This represents a key-value collection and is SCALE compatible +/// with collections like BTreeMap. This has the same type params +/// as `BTreeMap` which allows us to easily swap the two during codegen. +pub type KeyedVec = Vec<(K, V)>; diff --git a/testing/integration-tests/src/client/mod.rs b/testing/integration-tests/src/client/mod.rs index bcfe5ba4ce..9e68c75af2 100644 --- a/testing/integration-tests/src/client/mod.rs +++ b/testing/integration-tests/src/client/mod.rs @@ -3,24 +3,29 @@ // see LICENSE for license details. use crate::{ - test_node_process, - test_node_process_with, - utils::node_runtime::system, + pair_signer, + test_context, + test_context_with, + utils::{ + node_runtime, + wait_for_blocks, + }, }; - -use sp_core::storage::{ - well_known_keys, - StorageKey, +use sp_core::{ + sr25519::Pair as Sr25519Pair, + storage::well_known_keys, + Pair, }; use sp_keyring::AccountKeyring; +use subxt::error::DispatchError; #[tokio::test] async fn insert_key() { - let test_node_process = test_node_process_with(AccountKeyring::Bob).await; - let client = test_node_process.client(); + let ctx = test_context_with(AccountKeyring::Bob).await; + let api = ctx.client(); + let public = AccountKeyring::Alice.public().as_array_ref().to_vec(); - client - .rpc() + api.rpc() .insert_key( "aura".to_string(), "//Alice".to_string(), @@ -28,7 +33,7 @@ async fn insert_key() { ) .await .unwrap(); - assert!(client + assert!(api .rpc() .has_key(public.clone().into(), "aura".to_string()) .await @@ -37,29 +42,30 @@ async fn insert_key() { #[tokio::test] async fn fetch_block_hash() { - let node_process = test_node_process().await; - node_process.client().rpc().block_hash(None).await.unwrap(); + let ctx = test_context().await; + ctx.client().rpc().block_hash(None).await.unwrap(); } #[tokio::test] async fn fetch_block() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client.rpc().block(block_hash).await.unwrap(); + let ctx = test_context().await; + let api = ctx.client(); + + let block_hash = api.rpc().block_hash(None).await.unwrap(); + api.rpc().block(block_hash).await.unwrap(); } #[tokio::test] async fn fetch_read_proof() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client - .rpc() + let ctx = test_context().await; + let api = ctx.client(); + + let block_hash = api.rpc().block_hash(None).await.unwrap(); + api.rpc() .read_proof( vec![ - StorageKey(well_known_keys::HEAP_PAGES.to_vec()), - StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), + well_known_keys::HEAP_PAGES, + well_known_keys::EXTRINSIC_INDEX, ], block_hash, ) @@ -69,27 +75,31 @@ async fn fetch_read_proof() { #[tokio::test] async fn chain_subscribe_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_blocks().await.unwrap(); + let ctx = test_context().await; + let api = ctx.client(); + + let mut blocks = api.rpc().subscribe_blocks().await.unwrap(); blocks.next().await.unwrap().unwrap(); } #[tokio::test] async fn chain_subscribe_finalized_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_finalized_blocks().await.unwrap(); + let ctx = test_context().await; + let api = ctx.client(); + + let mut blocks = api.rpc().subscribe_finalized_blocks().await.unwrap(); blocks.next().await.unwrap().unwrap(); } #[tokio::test] async fn fetch_keys() { - let node_process = test_node_process().await; - let client = node_process.client(); - let keys = client + let ctx = test_context().await; + let api = ctx.client(); + + let addr = node_runtime::storage().system().account_root(); + let keys = api .storage() - .fetch_keys::(4, None, None) + .fetch_keys(&addr.to_root_bytes(), 4, None, None) .await .unwrap(); assert_eq!(keys.len(), 4) @@ -97,13 +107,11 @@ async fn fetch_keys() { #[tokio::test] async fn test_iter() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut iter = client - .storage() - .iter::(None) - .await - .unwrap(); + let ctx = test_context().await; + let api = ctx.client(); + + let addr = node_runtime::storage().system().account_root(); + let mut iter = api.storage().iter(addr, 10, None).await.unwrap(); let mut i = 0; while iter.next().await.unwrap().is_some() { i += 1; @@ -113,9 +121,96 @@ async fn test_iter() { #[tokio::test] async fn fetch_system_info() { - let node_process = test_node_process().await; - let client = node_process.client(); - assert_eq!(client.rpc().system_chain().await.unwrap(), "Development"); - assert_eq!(client.rpc().system_name().await.unwrap(), "Substrate Node"); - assert!(!client.rpc().system_version().await.unwrap().is_empty()); + let ctx = test_context().await; + let api = ctx.client(); + + assert_eq!(api.rpc().system_chain().await.unwrap(), "Development"); + assert_eq!(api.rpc().system_name().await.unwrap(), "Substrate Node"); + assert!(!api.rpc().system_version().await.unwrap().is_empty()); +} + +#[tokio::test] +async fn dry_run_passes() { + let ctx = test_context().await; + let api = ctx.client(); + + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); + + wait_for_blocks(&api).await; + + let tx = node_runtime::tx() + .balances() + .transfer(bob.account_id().clone().into(), 10_000); + + let signed_extrinsic = api + .tx() + .create_signed(&tx, &alice, Default::default()) + .await + .unwrap(); + + api.rpc() + .dry_run(signed_extrinsic.encoded(), None) + .await + .expect("dryrunning failed") + .expect("expected dryrunning to be successful") + .unwrap(); + + signed_extrinsic + .submit_and_watch() + .await + .unwrap() + .wait_for_finalized_success() + .await + .unwrap(); +} + +#[tokio::test] +async fn dry_run_fails() { + let ctx = test_context().await; + let api = ctx.client(); + + wait_for_blocks(&api).await; + + let alice = pair_signer(AccountKeyring::Alice.pair()); + let hans = pair_signer(Sr25519Pair::generate().0); + + let tx = node_runtime::tx().balances().transfer( + hans.account_id().clone().into(), + 100_000_000_000_000_000_000_000_000_000_000_000, + ); + + let signed_extrinsic = api + .tx() + .create_signed(&tx, &alice, Default::default()) + .await + .unwrap(); + + let dry_run_res = api + .rpc() + .dry_run(signed_extrinsic.encoded(), None) + .await + .expect("dryrunning failed") + .expect("expected dryrun transaction to be valid"); + + if let Err(sp_runtime::DispatchError::Module(module_error)) = dry_run_res { + assert_eq!(module_error.index, 6); + assert_eq!(module_error.error, 2); + } else { + panic!("expected a module error when dryrunning"); + } + + let res = signed_extrinsic + .submit_and_watch() + .await + .unwrap() + .wait_for_finalized_success() + .await; + + if let Err(subxt::error::Error::Runtime(DispatchError::Module(err))) = res { + assert_eq!(err.pallet, "Balances"); + assert_eq!(err.error, "InsufficientBalance"); + } else { + panic!("expected a runtime module error"); + } } diff --git a/testing/integration-tests/src/codegen/polkadot.rs b/testing/integration-tests/src/codegen/polkadot.rs index 00214e9661..1e62450680 100644 --- a/testing/integration-tests/src/codegen/polkadot.rs +++ b/testing/integration-tests/src/codegen/polkadot.rs @@ -54,7 +54,9 @@ pub mod api { "Crowdloan", "XcmPallet", ]; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, Debug, + )] pub enum Event { #[codec(index = 0)] System(system::Event), @@ -66,8 +68,6 @@ pub mod api { Indices(indices::Event), #[codec(index = 5)] Balances(balances::Event), - #[codec(index = 32)] - TransactionPayment(transaction_payment::Event), #[codec(index = 7)] Staking(staking::Event), #[codec(index = 8)] @@ -134,146 +134,108 @@ pub mod api { XcmPallet(xcm_pallet::Event), } pub mod system { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct FillBlock { pub ratio: runtime_types::sp_arithmetic::per_things::Perbill, } - impl ::subxt::Call for FillBlock { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "fill_block"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Remark { pub remark: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for Remark { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHeapPages { pub pages: ::core::primitive::u64, } - impl ::subxt::Call for SetHeapPages { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_heap_pages"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetCode { pub code: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for SetCode { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetCodeWithoutChecks { pub code: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for SetCodeWithoutChecks { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code_without_checks"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetStorage { pub items: ::std::vec::Vec<( ::std::vec::Vec<::core::primitive::u8>, ::std::vec::Vec<::core::primitive::u8>, )>, } - impl ::subxt::Call for SetStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_storage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct KillStorage { pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, } - impl ::subxt::Call for KillStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_storage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct KillPrefix { pub prefix: ::std::vec::Vec<::core::primitive::u8>, pub subkeys: ::core::primitive::u32, } - impl ::subxt::Call for KillPrefix { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_prefix"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemarkWithEvent { pub remark: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for RemarkWithEvent { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark_with_event"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "A dispatch that will fill the block weight up to the given ratio."] pub fn fill_block( &self, ratio: runtime_types::sp_arithmetic::per_things::Perbill, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - FillBlock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 228u8, 117u8, 251u8, 95u8, 47u8, 56u8, 32u8, 177u8, 191u8, - 72u8, 75u8, 23u8, 193u8, 175u8, 227u8, 218u8, 127u8, 94u8, - 114u8, 110u8, 215u8, 61u8, 162u8, 102u8, 73u8, 89u8, 218u8, - 148u8, 59u8, 73u8, 59u8, 149u8, - ] - { - let call = FillBlock { ratio }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "fill_block", + FillBlock { ratio }, + [ + 48u8, 18u8, 205u8, 90u8, 222u8, 4u8, 20u8, 251u8, 173u8, + 76u8, 167u8, 4u8, 83u8, 203u8, 160u8, 89u8, 132u8, 218u8, + 191u8, 145u8, 130u8, 245u8, 177u8, 201u8, 169u8, 129u8, + 173u8, 105u8, 88u8, 45u8, 136u8, 191u8, + ], + ) } #[doc = "Make some on-chain remark."] #[doc = ""] @@ -283,69 +245,35 @@ pub mod api { pub fn remark( &self, remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Remark, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 186u8, 79u8, 33u8, 199u8, 216u8, 115u8, 19u8, 146u8, 220u8, - 174u8, 98u8, 61u8, 179u8, 230u8, 40u8, 70u8, 22u8, 251u8, - 77u8, 62u8, 133u8, 80u8, 186u8, 70u8, 135u8, 172u8, 178u8, - 241u8, 69u8, 106u8, 235u8, 140u8, - ] - { - let call = Remark { remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "remark", + Remark { remark }, + [ + 101u8, 80u8, 195u8, 226u8, 224u8, 247u8, 60u8, 128u8, 3u8, + 101u8, 51u8, 147u8, 96u8, 126u8, 76u8, 230u8, 194u8, 227u8, + 191u8, 73u8, 160u8, 146u8, 87u8, 147u8, 243u8, 28u8, 228u8, + 116u8, 224u8, 181u8, 129u8, 160u8, + ], + ) } #[doc = "Set the number of pages in the WebAssembly environment's heap."] pub fn set_heap_pages( &self, pages: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHeapPages, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 77u8, 138u8, 122u8, 55u8, 179u8, 101u8, 60u8, 137u8, 173u8, - 39u8, 28u8, 36u8, 237u8, 243u8, 232u8, 162u8, 76u8, 176u8, - 135u8, 58u8, 60u8, 177u8, 105u8, 136u8, 94u8, 53u8, 26u8, - 31u8, 41u8, 156u8, 228u8, 241u8, - ] - { - let call = SetHeapPages { pages }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_heap_pages", + SetHeapPages { pages }, + [ + 43u8, 103u8, 128u8, 49u8, 156u8, 136u8, 11u8, 204u8, 80u8, + 6u8, 244u8, 86u8, 171u8, 44u8, 140u8, 225u8, 142u8, 198u8, + 43u8, 87u8, 26u8, 45u8, 125u8, 222u8, 165u8, 254u8, 172u8, + 158u8, 39u8, 178u8, 86u8, 87u8, + ], + ) } #[doc = "Set the new runtime code."] #[doc = ""] @@ -362,35 +290,18 @@ pub mod api { pub fn set_code( &self, code: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 35u8, 75u8, 103u8, 203u8, 91u8, 141u8, 77u8, 95u8, 37u8, - 157u8, 107u8, 240u8, 54u8, 242u8, 245u8, 205u8, 104u8, 165u8, - 177u8, 37u8, 86u8, 197u8, 28u8, 202u8, 121u8, 159u8, 18u8, - 204u8, 237u8, 117u8, 141u8, 131u8, - ] - { - let call = SetCode { code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_code", + SetCode { code }, + [ + 27u8, 104u8, 244u8, 205u8, 188u8, 254u8, 121u8, 13u8, 106u8, + 120u8, 244u8, 108u8, 97u8, 84u8, 100u8, 68u8, 26u8, 69u8, + 93u8, 128u8, 107u8, 4u8, 3u8, 142u8, 13u8, 134u8, 196u8, + 62u8, 113u8, 181u8, 14u8, 40u8, + ], + ) } #[doc = "Set the new runtime code without doing any checks of the given `code`."] #[doc = ""] @@ -404,35 +315,18 @@ pub mod api { pub fn set_code_without_checks( &self, code: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCodeWithoutChecks, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 150u8, 148u8, 119u8, 129u8, 77u8, 216u8, 135u8, 187u8, 127u8, - 24u8, 238u8, 15u8, 227u8, 229u8, 191u8, 217u8, 106u8, 129u8, - 149u8, 79u8, 154u8, 78u8, 53u8, 159u8, 89u8, 69u8, 103u8, - 197u8, 93u8, 161u8, 134u8, 17u8, - ] - { - let call = SetCodeWithoutChecks { code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_code_without_checks", + SetCodeWithoutChecks { code }, + [ + 102u8, 160u8, 125u8, 235u8, 30u8, 23u8, 45u8, 239u8, 112u8, + 148u8, 159u8, 158u8, 42u8, 93u8, 206u8, 94u8, 80u8, 250u8, + 66u8, 195u8, 60u8, 40u8, 142u8, 169u8, 183u8, 80u8, 80u8, + 96u8, 3u8, 231u8, 99u8, 216u8, + ], + ) } #[doc = "Set some items of storage."] pub fn set_storage( @@ -441,69 +335,35 @@ pub mod api { ::std::vec::Vec<::core::primitive::u8>, ::std::vec::Vec<::core::primitive::u8>, )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetStorage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 197u8, 12u8, 119u8, 205u8, 152u8, 103u8, 211u8, 170u8, 146u8, - 253u8, 25u8, 56u8, 180u8, 146u8, 74u8, 75u8, 38u8, 108u8, - 212u8, 154u8, 23u8, 22u8, 148u8, 175u8, 107u8, 186u8, 222u8, - 13u8, 149u8, 132u8, 204u8, 217u8, - ] - { - let call = SetStorage { items }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_storage", + SetStorage { items }, + [ + 74u8, 43u8, 106u8, 255u8, 50u8, 151u8, 192u8, 155u8, 14u8, + 90u8, 19u8, 45u8, 165u8, 16u8, 235u8, 242u8, 21u8, 131u8, + 33u8, 172u8, 119u8, 78u8, 140u8, 10u8, 107u8, 202u8, 122u8, + 235u8, 181u8, 191u8, 22u8, 116u8, + ], + ) } #[doc = "Kill some items from storage."] pub fn kill_storage( &self, keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillStorage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 154u8, 115u8, 185u8, 20u8, 126u8, 90u8, 222u8, 131u8, 199u8, - 57u8, 184u8, 226u8, 43u8, 245u8, 161u8, 176u8, 194u8, 123u8, - 139u8, 97u8, 97u8, 94u8, 47u8, 64u8, 204u8, 96u8, 190u8, - 94u8, 216u8, 237u8, 69u8, 51u8, - ] - { - let call = KillStorage { keys }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "kill_storage", + KillStorage { keys }, + [ + 174u8, 174u8, 13u8, 174u8, 75u8, 138u8, 128u8, 235u8, 222u8, + 216u8, 85u8, 18u8, 198u8, 1u8, 138u8, 70u8, 19u8, 108u8, + 209u8, 41u8, 228u8, 67u8, 130u8, 230u8, 160u8, 207u8, 11u8, + 180u8, 139u8, 242u8, 41u8, 15u8, + ], + ) } #[doc = "Kill all storage items with a key that starts with the given prefix."] #[doc = ""] @@ -513,69 +373,35 @@ pub mod api { &self, prefix: ::std::vec::Vec<::core::primitive::u8>, subkeys: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillPrefix, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 214u8, 101u8, 191u8, 241u8, 1u8, 241u8, 144u8, 116u8, 246u8, - 199u8, 159u8, 249u8, 155u8, 164u8, 220u8, 221u8, 75u8, 33u8, - 204u8, 3u8, 255u8, 201u8, 187u8, 238u8, 181u8, 213u8, 41u8, - 105u8, 234u8, 120u8, 202u8, 115u8, - ] - { - let call = KillPrefix { prefix, subkeys }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "kill_prefix", + KillPrefix { prefix, subkeys }, + [ + 203u8, 116u8, 217u8, 42u8, 154u8, 215u8, 77u8, 217u8, 13u8, + 22u8, 193u8, 2u8, 128u8, 115u8, 179u8, 115u8, 187u8, 218u8, + 129u8, 34u8, 80u8, 4u8, 173u8, 120u8, 92u8, 35u8, 237u8, + 112u8, 201u8, 207u8, 200u8, 48u8, + ], + ) } #[doc = "Make some on-chain remark and emit event."] pub fn remark_with_event( &self, remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemarkWithEvent, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 171u8, 82u8, 75u8, 237u8, 69u8, 197u8, 223u8, 125u8, 123u8, - 51u8, 241u8, 35u8, 202u8, 210u8, 227u8, 109u8, 1u8, 241u8, - 255u8, 63u8, 33u8, 115u8, 156u8, 239u8, 97u8, 76u8, 193u8, - 35u8, 74u8, 199u8, 43u8, 255u8, - ] - { - let call = RemarkWithEvent { remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "remark_with_event", + RemarkWithEvent { remark }, + [ + 123u8, 225u8, 180u8, 179u8, 144u8, 74u8, 27u8, 85u8, 101u8, + 75u8, 134u8, 44u8, 181u8, 25u8, 183u8, 158u8, 14u8, 213u8, + 56u8, 225u8, 136u8, 88u8, 26u8, 114u8, 178u8, 43u8, 176u8, + 43u8, 240u8, 84u8, 116u8, 46u8, + ], + ) } } } @@ -583,663 +409,376 @@ pub mod api { pub type Event = runtime_types::frame_system::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An extrinsic completed successfully."] pub struct ExtrinsicSuccess { pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, } - impl ::subxt::Event for ExtrinsicSuccess { + impl ::subxt::events::StaticEvent for ExtrinsicSuccess { const PALLET: &'static str = "System"; const EVENT: &'static str = "ExtrinsicSuccess"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An extrinsic failed."] pub struct ExtrinsicFailed { pub dispatch_error: runtime_types::sp_runtime::DispatchError, pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, } - impl ::subxt::Event for ExtrinsicFailed { + impl ::subxt::events::StaticEvent for ExtrinsicFailed { const PALLET: &'static str = "System"; const EVENT: &'static str = "ExtrinsicFailed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "`:code` was updated."] pub struct CodeUpdated; - impl ::subxt::Event for CodeUpdated { + impl ::subxt::events::StaticEvent for CodeUpdated { const PALLET: &'static str = "System"; const EVENT: &'static str = "CodeUpdated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new account was created."] pub struct NewAccount { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for NewAccount { + impl ::subxt::events::StaticEvent for NewAccount { const PALLET: &'static str = "System"; const EVENT: &'static str = "NewAccount"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account was reaped."] pub struct KilledAccount { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for KilledAccount { + impl ::subxt::events::StaticEvent for KilledAccount { const PALLET: &'static str = "System"; const EVENT: &'static str = "KilledAccount"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "On on-chain remark happened."] pub struct Remarked { - pub sender: ::subxt::sp_core::crypto::AccountId32, - pub hash: ::subxt::sp_core::H256, + pub sender: ::subxt::ext::sp_core::crypto::AccountId32, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Remarked { + impl ::subxt::events::StaticEvent for Remarked { const PALLET: &'static str = "System"; const EVENT: &'static str = "Remarked"; } } pub mod storage { use super::runtime_types; - pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Account"; - type Value = runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ExtrinsicCount; - impl ::subxt::StorageEntry for ExtrinsicCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockWeight; - impl ::subxt::StorageEntry for BlockWeight { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "BlockWeight"; - type Value = runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u64, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AllExtrinsicsLen; - impl ::subxt::StorageEntry for AllExtrinsicsLen { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "AllExtrinsicsLen"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockHash<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for BlockHash<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "BlockHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ExtrinsicData<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ExtrinsicData<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicData"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Number; - impl ::subxt::StorageEntry for Number { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Number"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParentHash; - impl ::subxt::StorageEntry for ParentHash { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ParentHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Digest; - impl ::subxt::StorageEntry for Digest { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Digest"; - type Value = runtime_types::sp_runtime::generic::digest::Digest; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Events; - impl ::subxt::StorageEntry for Events { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Events"; - type Value = ::std::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::polkadot_runtime::Event, - ::subxt::sp_core::H256, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventCount; - impl ::subxt::StorageEntry for EventCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventTopics<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for EventTopics<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventTopics"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct LastRuntimeUpgrade; - impl ::subxt::StorageEntry for LastRuntimeUpgrade { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "LastRuntimeUpgrade"; - type Value = runtime_types::frame_system::LastRuntimeUpgradeInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToU32RefCount; - impl ::subxt::StorageEntry for UpgradedToU32RefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToU32RefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToTripleRefCount; - impl ::subxt::StorageEntry for UpgradedToTripleRefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToTripleRefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ExecutionPhase; - impl ::subxt::StorageEntry for ExecutionPhase { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExecutionPhase"; - type Value = runtime_types::frame_system::Phase; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The full account information for a particular account ID."] pub fn account( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::frame_system::AccountInfo< ::core::primitive::u32, runtime_types::pallet_balances::AccountData< ::core::primitive::u128, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 224u8, 184u8, 2u8, 14u8, 38u8, 177u8, 223u8, 98u8, 223u8, - 15u8, 130u8, 23u8, 212u8, 69u8, 61u8, 165u8, 171u8, 61u8, - 171u8, 57u8, 88u8, 71u8, 168u8, 172u8, 54u8, 91u8, 109u8, - 231u8, 169u8, 167u8, 195u8, 46u8, - ] - { - let entry = Account(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Account", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 176u8, 187u8, 21u8, 220u8, 159u8, 204u8, 127u8, 14u8, 21u8, + 69u8, 77u8, 114u8, 230u8, 141u8, 107u8, 79u8, 23u8, 16u8, + 174u8, 243u8, 252u8, 42u8, 65u8, 120u8, 229u8, 38u8, 210u8, + 255u8, 22u8, 40u8, 109u8, 223u8, + ], + ) } #[doc = " The full account information for a particular account ID."] - pub fn account_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Account<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 224u8, 184u8, 2u8, 14u8, 38u8, 177u8, 223u8, 98u8, 223u8, - 15u8, 130u8, 23u8, 212u8, 69u8, 61u8, 165u8, 171u8, 61u8, - 171u8, 57u8, 88u8, 71u8, 168u8, 172u8, 54u8, 91u8, 109u8, - 231u8, 169u8, 167u8, 195u8, 46u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn account_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::AccountData< + ::core::primitive::u128, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Account", + Vec::new(), + [ + 176u8, 187u8, 21u8, 220u8, 159u8, 204u8, 127u8, 14u8, 21u8, + 69u8, 77u8, 114u8, 230u8, 141u8, 107u8, 79u8, 23u8, 16u8, + 174u8, 243u8, 252u8, 42u8, 65u8, 120u8, 229u8, 38u8, 210u8, + 255u8, 22u8, 40u8, 109u8, 223u8, + ], + ) } #[doc = " Total extrinsics count for the current block."] pub fn extrinsic_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 223u8, 60u8, 201u8, 120u8, 36u8, 44u8, 180u8, 210u8, - 242u8, 53u8, 222u8, 154u8, 123u8, 176u8, 249u8, 8u8, - 225u8, 28u8, 232u8, 4u8, 136u8, 41u8, 151u8, 82u8, 189u8, - 149u8, 49u8, 166u8, 139u8, 9u8, 163u8, 231u8, - ] - { - let entry = ExtrinsicCount; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicCount", + vec![], + [ + 223u8, 60u8, 201u8, 120u8, 36u8, 44u8, 180u8, 210u8, 242u8, + 53u8, 222u8, 154u8, 123u8, 176u8, 249u8, 8u8, 225u8, 28u8, + 232u8, 4u8, 136u8, 41u8, 151u8, 82u8, 189u8, 149u8, 49u8, + 166u8, 139u8, 9u8, 163u8, 231u8, + ], + ) } #[doc = " The current weight for the block."] pub fn block_weight( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::frame_support::weights::PerDispatchClass< ::core::primitive::u64, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 2u8, 236u8, 190u8, 174u8, 244u8, 98u8, 194u8, 168u8, - 89u8, 208u8, 7u8, 45u8, 175u8, 171u8, 177u8, 121u8, - 215u8, 190u8, 184u8, 195u8, 49u8, 133u8, 44u8, 1u8, - 181u8, 215u8, 89u8, 84u8, 255u8, 16u8, 57u8, 152u8, - ] - { - let entry = BlockWeight; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "BlockWeight", + vec![], + [ + 91u8, 211u8, 177u8, 36u8, 147u8, 249u8, 55u8, 164u8, 48u8, + 49u8, 55u8, 11u8, 121u8, 193u8, 103u8, 69u8, 38u8, 142u8, + 148u8, 36u8, 137u8, 41u8, 115u8, 195u8, 31u8, 174u8, 163u8, + 125u8, 69u8, 5u8, 94u8, 79u8, + ], + ) } #[doc = " Total length (in bytes) for all extrinsics put together, for the current block."] pub fn all_extrinsics_len( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 202u8, 145u8, 209u8, 225u8, 40u8, 220u8, 174u8, 74u8, - 93u8, 164u8, 254u8, 248u8, 254u8, 192u8, 32u8, 117u8, - 96u8, 149u8, 53u8, 145u8, 219u8, 64u8, 234u8, 18u8, - 217u8, 200u8, 203u8, 141u8, 145u8, 28u8, 134u8, 60u8, - ] - { - let entry = AllExtrinsicsLen; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "AllExtrinsicsLen", + vec![], + [ + 202u8, 145u8, 209u8, 225u8, 40u8, 220u8, 174u8, 74u8, 93u8, + 164u8, 254u8, 248u8, 254u8, 192u8, 32u8, 117u8, 96u8, 149u8, + 53u8, 145u8, 219u8, 64u8, 234u8, 18u8, 217u8, 200u8, 203u8, + 141u8, 145u8, 28u8, 134u8, 60u8, + ], + ) } #[doc = " Map of block numbers to block hashes."] pub fn block_hash( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::sp_core::H256, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 24u8, 99u8, 146u8, 142u8, 205u8, 166u8, 4u8, 32u8, 218u8, - 213u8, 24u8, 236u8, 45u8, 116u8, 145u8, 204u8, 27u8, - 141u8, 169u8, 249u8, 111u8, 141u8, 37u8, 136u8, 45u8, - 73u8, 167u8, 217u8, 118u8, 206u8, 246u8, 120u8, - ] - { - let entry = BlockHash(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "BlockHash", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 50u8, 112u8, 176u8, 239u8, 175u8, 18u8, 205u8, 20u8, 241u8, + 195u8, 21u8, 228u8, 186u8, 57u8, 200u8, 25u8, 38u8, 44u8, + 106u8, 20u8, 168u8, 80u8, 76u8, 235u8, 12u8, 51u8, 137u8, + 149u8, 200u8, 4u8, 220u8, 237u8, + ], + ) } #[doc = " Map of block numbers to block hashes."] - pub fn block_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, BlockHash<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 24u8, 99u8, 146u8, 142u8, 205u8, 166u8, 4u8, 32u8, 218u8, - 213u8, 24u8, 236u8, 45u8, 116u8, 145u8, 204u8, 27u8, - 141u8, 169u8, 249u8, 111u8, 141u8, 37u8, 136u8, 45u8, - 73u8, 167u8, 217u8, 118u8, 206u8, 246u8, 120u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn block_hash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "BlockHash", + Vec::new(), + [ + 50u8, 112u8, 176u8, 239u8, 175u8, 18u8, 205u8, 20u8, 241u8, + 195u8, 21u8, 228u8, 186u8, 57u8, 200u8, 25u8, 38u8, 44u8, + 106u8, 20u8, 168u8, 80u8, 76u8, 235u8, 12u8, 51u8, 137u8, + 149u8, 200u8, 4u8, 220u8, 237u8, + ], + ) } #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] pub fn extrinsic_data( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, - 238u8, 211u8, 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, - 168u8, 125u8, 98u8, 23u8, 241u8, 59u8, 49u8, 86u8, 126u8, - 9u8, 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, - ] - { - let entry = ExtrinsicData(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicData", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, + 238u8, 211u8, 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, 168u8, + 125u8, 98u8, 23u8, 241u8, 59u8, 49u8, 86u8, 126u8, 9u8, + 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, + ], + ) } #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub fn extrinsic_data_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ExtrinsicData<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, - 238u8, 211u8, 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, - 168u8, 125u8, 98u8, 23u8, 241u8, 59u8, 49u8, 86u8, 126u8, - 9u8, 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn extrinsic_data_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u8>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicData", + Vec::new(), + [ + 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, + 238u8, 211u8, 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, 168u8, + 125u8, 98u8, 23u8, 241u8, 59u8, 49u8, 86u8, 126u8, 9u8, + 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, + ], + ) } #[doc = " The current block number being processed. Set by `execute_block`."] pub fn number( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 228u8, 96u8, 102u8, 190u8, 252u8, 130u8, 239u8, 172u8, - 126u8, 235u8, 246u8, 139u8, 208u8, 15u8, 88u8, 245u8, - 141u8, 232u8, 43u8, 204u8, 36u8, 87u8, 211u8, 141u8, - 187u8, 68u8, 236u8, 70u8, 193u8, 235u8, 164u8, 191u8, - ] - { - let entry = Number; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Number", + vec![], + [ + 228u8, 96u8, 102u8, 190u8, 252u8, 130u8, 239u8, 172u8, 126u8, + 235u8, 246u8, 139u8, 208u8, 15u8, 88u8, 245u8, 141u8, 232u8, + 43u8, 204u8, 36u8, 87u8, 211u8, 141u8, 187u8, 68u8, 236u8, + 70u8, 193u8, 235u8, 164u8, 191u8, + ], + ) } #[doc = " Hash of the previous block."] pub fn parent_hash( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::sp_core::H256, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 194u8, 221u8, 147u8, 22u8, 68u8, 141u8, 32u8, 6u8, 202u8, - 39u8, 164u8, 184u8, 69u8, 126u8, 190u8, 101u8, 215u8, - 27u8, 127u8, 157u8, 200u8, 69u8, 170u8, 139u8, 232u8, - 27u8, 254u8, 181u8, 183u8, 105u8, 111u8, 177u8, - ] - { - let entry = ParentHash; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ParentHash", + vec![], + [ + 232u8, 206u8, 177u8, 119u8, 38u8, 57u8, 233u8, 50u8, 225u8, + 49u8, 169u8, 176u8, 210u8, 51u8, 231u8, 176u8, 234u8, 186u8, + 188u8, 112u8, 15u8, 152u8, 195u8, 232u8, 201u8, 97u8, 208u8, + 249u8, 9u8, 163u8, 69u8, 36u8, + ], + ) } #[doc = " Digest of the current block, also part of the block header."] pub fn digest( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::generic::digest::Digest, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 10u8, 176u8, 13u8, 228u8, 226u8, 42u8, 210u8, 151u8, - 107u8, 212u8, 136u8, 15u8, 38u8, 182u8, 225u8, 12u8, - 250u8, 56u8, 193u8, 243u8, 219u8, 113u8, 95u8, 233u8, - 21u8, 229u8, 125u8, 146u8, 92u8, 250u8, 32u8, 168u8, - ] - { - let entry = Digest; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Digest", + vec![], + [ + 83u8, 141u8, 200u8, 132u8, 182u8, 55u8, 197u8, 122u8, 13u8, + 159u8, 31u8, 42u8, 60u8, 191u8, 89u8, 221u8, 242u8, 47u8, + 199u8, 213u8, 48u8, 216u8, 131u8, 168u8, 245u8, 82u8, 56u8, + 190u8, 62u8, 69u8, 96u8, 37u8, + ], + ) } #[doc = " Events deposited for the current block."] #[doc = ""] @@ -1250,77 +789,51 @@ pub mod api { #[doc = " just in case someone still reads them from within the runtime."] pub fn events( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::frame_system::EventRecord< runtime_types::polkadot_runtime::Event, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 70u8, 6u8, 210u8, 172u8, 48u8, 188u8, 175u8, 84u8, 44u8, - 231u8, 130u8, 201u8, 97u8, 122u8, 141u8, 35u8, 115u8, - 91u8, 218u8, 225u8, 220u8, 39u8, 221u8, 100u8, 65u8, - 38u8, 52u8, 119u8, 209u8, 44u8, 39u8, 175u8, - ] - { - let entry = Events; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Events", + vec![], + [ + 203u8, 182u8, 158u8, 92u8, 173u8, 25u8, 74u8, 25u8, 74u8, + 105u8, 133u8, 201u8, 185u8, 240u8, 214u8, 144u8, 238u8, + 248u8, 15u8, 16u8, 192u8, 84u8, 233u8, 41u8, 169u8, 244u8, + 64u8, 237u8, 36u8, 72u8, 145u8, 95u8, + ], + ) } #[doc = " The number of events in the `Events` list."] pub fn event_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 236u8, 93u8, 90u8, 177u8, 250u8, 211u8, 138u8, 187u8, - 26u8, 208u8, 203u8, 113u8, 221u8, 233u8, 227u8, 9u8, - 249u8, 25u8, 202u8, 185u8, 161u8, 144u8, 167u8, 104u8, - 127u8, 187u8, 38u8, 18u8, 52u8, 61u8, 66u8, 112u8, - ] - { - let entry = EventCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "EventCount", + vec![], + [ + 236u8, 93u8, 90u8, 177u8, 250u8, 211u8, 138u8, 187u8, 26u8, + 208u8, 203u8, 113u8, 221u8, 233u8, 227u8, 9u8, 249u8, 25u8, + 202u8, 185u8, 161u8, 144u8, 167u8, 104u8, 127u8, 187u8, 38u8, + 18u8, 52u8, 61u8, 66u8, 112u8, + ], + ) } #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] #[doc = " of events in the `>` list."] @@ -1334,38 +847,29 @@ pub mod api { #[doc = " no notification will be triggered thus the event might be lost."] pub fn event_topics( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 231u8, 73u8, 172u8, 223u8, 210u8, 145u8, 151u8, 102u8, - 73u8, 23u8, 140u8, 55u8, 97u8, 40u8, 219u8, 239u8, 229u8, - 177u8, 72u8, 41u8, 93u8, 178u8, 7u8, 209u8, 57u8, 86u8, - 153u8, 252u8, 86u8, 152u8, 245u8, 179u8, - ] - { - let entry = EventTopics(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "EventTopics", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 205u8, 90u8, 142u8, 190u8, 176u8, 37u8, 94u8, 82u8, 98u8, + 1u8, 129u8, 63u8, 246u8, 101u8, 130u8, 58u8, 216u8, 16u8, + 139u8, 196u8, 154u8, 111u8, 110u8, 178u8, 24u8, 44u8, 183u8, + 176u8, 232u8, 82u8, 223u8, 38u8, + ], + ) } #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] #[doc = " of events in the `>` list."] @@ -1377,320 +881,215 @@ pub mod api { #[doc = " The value has the type `(T::BlockNumber, EventIndex)` because if we used only just"] #[doc = " the `EventIndex` then in case if the topic has the same contents on the next block"] #[doc = " no notification will be triggered thus the event might be lost."] - pub fn event_topics_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, EventTopics<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 231u8, 73u8, 172u8, 223u8, 210u8, 145u8, 151u8, 102u8, - 73u8, 23u8, 140u8, 55u8, 97u8, 40u8, 219u8, 239u8, 229u8, - 177u8, 72u8, 41u8, 93u8, 178u8, 7u8, 209u8, 57u8, 86u8, - 153u8, 252u8, 86u8, 152u8, 245u8, 179u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn event_topics_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "EventTopics", + Vec::new(), + [ + 205u8, 90u8, 142u8, 190u8, 176u8, 37u8, 94u8, 82u8, 98u8, + 1u8, 129u8, 63u8, 246u8, 101u8, 130u8, 58u8, 216u8, 16u8, + 139u8, 196u8, 154u8, 111u8, 110u8, 178u8, 24u8, 44u8, 183u8, + 176u8, 232u8, 82u8, 223u8, 38u8, + ], + ) } #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] pub fn last_runtime_upgrade( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::frame_system::LastRuntimeUpgradeInfo, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 219u8, 153u8, 158u8, 38u8, 45u8, 65u8, 151u8, 137u8, - 53u8, 76u8, 11u8, 181u8, 218u8, 248u8, 125u8, 190u8, - 100u8, 240u8, 173u8, 75u8, 179u8, 137u8, 198u8, 197u8, - 248u8, 185u8, 118u8, 58u8, 42u8, 165u8, 125u8, 119u8, - ] - { - let entry = LastRuntimeUpgrade; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::LastRuntimeUpgradeInfo, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "LastRuntimeUpgrade", + vec![], + [ + 52u8, 37u8, 117u8, 111u8, 57u8, 130u8, 196u8, 14u8, 99u8, + 77u8, 91u8, 126u8, 178u8, 249u8, 78u8, 34u8, 9u8, 194u8, + 92u8, 105u8, 113u8, 81u8, 185u8, 127u8, 245u8, 184u8, 60u8, + 29u8, 234u8, 182u8, 96u8, 196u8, + ], + ) } #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] pub fn upgraded_to_u32_ref_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 171u8, 88u8, 244u8, 92u8, 122u8, 67u8, 27u8, 18u8, 59u8, - 175u8, 175u8, 178u8, 20u8, 150u8, 213u8, 59u8, 222u8, - 141u8, 32u8, 107u8, 3u8, 114u8, 83u8, 250u8, 180u8, - 233u8, 152u8, 54u8, 187u8, 99u8, 131u8, 204u8, - ] - { - let entry = UpgradedToU32RefCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "UpgradedToU32RefCount", + vec![], + [ + 171u8, 88u8, 244u8, 92u8, 122u8, 67u8, 27u8, 18u8, 59u8, + 175u8, 175u8, 178u8, 20u8, 150u8, 213u8, 59u8, 222u8, 141u8, + 32u8, 107u8, 3u8, 114u8, 83u8, 250u8, 180u8, 233u8, 152u8, + 54u8, 187u8, 99u8, 131u8, 204u8, + ], + ) } #[doc = " True if we have upgraded so that AccountInfo contains three types of `RefCount`. False"] #[doc = " (default) if not."] pub fn upgraded_to_triple_ref_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 90u8, 33u8, 56u8, 86u8, 90u8, 101u8, 89u8, 133u8, 203u8, - 56u8, 201u8, 210u8, 244u8, 232u8, 150u8, 18u8, 51u8, - 105u8, 14u8, 230u8, 103u8, 155u8, 246u8, 99u8, 53u8, - 207u8, 225u8, 128u8, 186u8, 76u8, 40u8, 185u8, - ] - { - let entry = UpgradedToTripleRefCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "UpgradedToTripleRefCount", + vec![], + [ + 90u8, 33u8, 56u8, 86u8, 90u8, 101u8, 89u8, 133u8, 203u8, + 56u8, 201u8, 210u8, 244u8, 232u8, 150u8, 18u8, 51u8, 105u8, + 14u8, 230u8, 103u8, 155u8, 246u8, 99u8, 53u8, 207u8, 225u8, + 128u8, 186u8, 76u8, 40u8, 185u8, + ], + ) } #[doc = " The execution phase of the block."] pub fn execution_phase( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 13u8, 230u8, 220u8, 239u8, 161u8, 172u8, 122u8, - 188u8, 95u8, 141u8, 118u8, 91u8, 158u8, 111u8, 145u8, - 243u8, 173u8, 226u8, 212u8, 187u8, 118u8, 94u8, 132u8, - 221u8, 244u8, 61u8, 148u8, 217u8, 30u8, 238u8, 225u8, - ] - { - let entry = ExecutionPhase; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::Phase, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExecutionPhase", + vec![], + [ + 230u8, 183u8, 221u8, 135u8, 226u8, 223u8, 55u8, 104u8, 138u8, + 224u8, 103u8, 156u8, 222u8, 99u8, 203u8, 199u8, 164u8, 168u8, + 193u8, 133u8, 201u8, 155u8, 63u8, 95u8, 17u8, 206u8, 165u8, + 123u8, 161u8, 33u8, 172u8, 93u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Block & extrinsics weights: base values and limits."] pub fn block_weights( &self, - ) -> ::core::result::Result< - runtime_types::frame_system::limits::BlockWeights, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("System", "BlockWeights")? - == [ - 42u8, 201u8, 244u8, 211u8, 62u8, 161u8, 172u8, 171u8, 167u8, - 103u8, 140u8, 240u8, 106u8, 225u8, 55u8, 34u8, 162u8, 11u8, - 59u8, 8u8, 251u8, 103u8, 50u8, 183u8, 213u8, 64u8, 0u8, 59u8, - 189u8, 112u8, 175u8, 120u8, - ] - { - let pallet = metadata.pallet("System")?; - let constant = pallet.constant("BlockWeights")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::limits::BlockWeights, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "BlockWeights", + [ + 153u8, 164u8, 86u8, 79u8, 97u8, 114u8, 248u8, 181u8, 179u8, + 186u8, 214u8, 124u8, 215u8, 96u8, 116u8, 109u8, 215u8, 182u8, + 61u8, 10u8, 77u8, 74u8, 29u8, 125u8, 131u8, 111u8, 249u8, + 208u8, 233u8, 170u8, 11u8, 14u8, + ], + ) } #[doc = " The maximum length of a block (in bytes)."] pub fn block_length( &self, - ) -> ::core::result::Result< - runtime_types::frame_system::limits::BlockLength, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("System", "BlockLength")? - == [ - 120u8, 249u8, 182u8, 103u8, 246u8, 214u8, 149u8, 44u8, 42u8, - 64u8, 2u8, 56u8, 157u8, 184u8, 43u8, 195u8, 214u8, 251u8, - 207u8, 207u8, 249u8, 105u8, 203u8, 108u8, 179u8, 93u8, 93u8, - 246u8, 40u8, 175u8, 160u8, 114u8, - ] - { - let pallet = metadata.pallet("System")?; - let constant = pallet.constant("BlockLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::limits::BlockLength, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "BlockLength", + [ + 116u8, 184u8, 225u8, 228u8, 207u8, 203u8, 4u8, 220u8, 234u8, + 198u8, 150u8, 108u8, 205u8, 87u8, 194u8, 131u8, 229u8, 51u8, + 140u8, 4u8, 47u8, 12u8, 200u8, 144u8, 153u8, 62u8, 51u8, + 39u8, 138u8, 205u8, 203u8, 236u8, + ], + ) } #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] pub fn block_hash_count( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("System", "BlockHashCount")? - == [ - 123u8, 126u8, 182u8, 103u8, 71u8, 187u8, 233u8, 8u8, 47u8, - 226u8, 159u8, 139u8, 0u8, 59u8, 190u8, 135u8, 189u8, 77u8, - 190u8, 81u8, 39u8, 198u8, 224u8, 219u8, 70u8, 143u8, 6u8, - 132u8, 196u8, 61u8, 117u8, 194u8, - ] - { - let pallet = metadata.pallet("System")?; - let constant = pallet.constant("BlockHashCount")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "BlockHashCount", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The weight of runtime database operations the runtime can invoke."] pub fn db_weight( &self, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::RuntimeDbWeight, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("System", "DbWeight")? - == [ - 159u8, 93u8, 33u8, 204u8, 10u8, 85u8, 53u8, 104u8, 180u8, - 190u8, 30u8, 135u8, 158u8, 108u8, 240u8, 172u8, 234u8, 169u8, - 6u8, 147u8, 95u8, 39u8, 231u8, 137u8, 204u8, 38u8, 100u8, - 46u8, 252u8, 94u8, 119u8, 213u8, - ] - { - let pallet = metadata.pallet("System")?; - let constant = pallet.constant("DbWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::weights::RuntimeDbWeight, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "DbWeight", + [ + 124u8, 162u8, 190u8, 149u8, 49u8, 177u8, 162u8, 231u8, 62u8, + 167u8, 199u8, 181u8, 43u8, 232u8, 185u8, 116u8, 195u8, 51u8, + 233u8, 223u8, 20u8, 129u8, 246u8, 13u8, 65u8, 180u8, 64u8, + 9u8, 157u8, 59u8, 245u8, 118u8, + ], + ) } #[doc = " Get the chain's current version."] pub fn version( &self, - ) -> ::core::result::Result< - runtime_types::sp_version::RuntimeVersion, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("System", "Version")? - == [ - 149u8, 89u8, 207u8, 225u8, 53u8, 68u8, 197u8, 29u8, 227u8, - 30u8, 125u8, 163u8, 182u8, 142u8, 100u8, 218u8, 185u8, 91u8, - 29u8, 108u8, 235u8, 180u8, 21u8, 89u8, 134u8, 222u8, 107u8, - 134u8, 139u8, 79u8, 252u8, 181u8, - ] - { - let pallet = metadata.pallet("System")?; - let constant = pallet.constant("Version")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_version::RuntimeVersion, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "Version", + [ + 93u8, 98u8, 57u8, 243u8, 229u8, 8u8, 234u8, 231u8, 72u8, + 230u8, 139u8, 47u8, 63u8, 181u8, 17u8, 2u8, 220u8, 231u8, + 104u8, 237u8, 185u8, 143u8, 165u8, 253u8, 188u8, 76u8, 147u8, + 12u8, 170u8, 26u8, 74u8, 200u8, + ], + ) } #[doc = " The designated SS85 prefix of this chain."] #[doc = ""] @@ -1699,43 +1098,36 @@ pub mod api { #[doc = " an identifier of the chain."] pub fn ss58_prefix( &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("System", "SS58Prefix")? - == [ - 80u8, 239u8, 133u8, 243u8, 151u8, 113u8, 37u8, 41u8, 100u8, - 145u8, 201u8, 253u8, 29u8, 81u8, 203u8, 97u8, 202u8, 212u8, - 105u8, 25u8, 177u8, 227u8, 114u8, 66u8, 40u8, 194u8, 250u8, - 96u8, 166u8, 87u8, 32u8, 185u8, - ] - { - let pallet = metadata.pallet("System")?; - let constant = pallet.constant("SS58Prefix")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u16>, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "SS58Prefix", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, + 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, + 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, + 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) } } } } pub mod scheduler { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Schedule { pub when: ::core::primitive::u32, pub maybe_periodic: ::core::option::Option<( @@ -1746,24 +1138,24 @@ pub mod api { pub call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, } - impl ::subxt::Call for Schedule { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Cancel { pub when: ::core::primitive::u32, pub index: ::core::primitive::u32, } - impl ::subxt::Call for Cancel { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ScheduleNamed { pub id: ::std::vec::Vec<::core::primitive::u8>, pub when: ::core::primitive::u32, @@ -1775,23 +1167,23 @@ pub mod api { pub call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, } - impl ::subxt::Call for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CancelNamed { pub id: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel_named"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ScheduleAfter { pub after: ::core::primitive::u32, pub maybe_periodic: ::core::option::Option<( @@ -1802,15 +1194,15 @@ pub mod api { pub call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, } - impl ::subxt::Call for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_after"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ScheduleNamedAfter { pub id: ::std::vec::Vec<::core::primitive::u8>, pub after: ::core::primitive::u32, @@ -1822,29 +1214,12 @@ pub mod api { pub call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, } - impl ::subxt::Call for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named_after"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Anonymously schedule a task."] pub fn schedule( &self, @@ -1856,77 +1231,43 @@ pub mod api { priority: ::core::primitive::u8, call: runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Schedule, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 65u8, 105u8, 62u8, 249u8, 104u8, 239u8, 42u8, 123u8, 8u8, - 42u8, 72u8, 186u8, 237u8, 57u8, 116u8, 132u8, 131u8, 41u8, - 47u8, 128u8, 153u8, 21u8, 69u8, 45u8, 250u8, 130u8, 154u8, - 237u8, 172u8, 227u8, 203u8, 95u8, - ] - { - let call = Schedule { + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule", + Schedule { when, maybe_periodic, priority, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 137u8, 178u8, 250u8, 136u8, 93u8, 23u8, 136u8, 247u8, 212u8, + 74u8, 92u8, 177u8, 23u8, 35u8, 116u8, 23u8, 205u8, 118u8, + 171u8, 162u8, 117u8, 107u8, 138u8, 142u8, 129u8, 52u8, 137u8, + 66u8, 69u8, 161u8, 243u8, 112u8, + ], + ) } #[doc = "Cancel an anonymously scheduled task."] pub fn cancel( &self, when: ::core::primitive::u32, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Cancel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 118u8, 0u8, 188u8, 218u8, 148u8, 86u8, 139u8, 15u8, 3u8, - 161u8, 6u8, 150u8, 46u8, 32u8, 85u8, 179u8, 106u8, 113u8, - 240u8, 115u8, 167u8, 114u8, 243u8, 69u8, 103u8, 60u8, 99u8, - 135u8, 21u8, 8u8, 19u8, 225u8, - ] - { - let call = Cancel { when, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "cancel", + Cancel { when, index }, + [ + 81u8, 251u8, 234u8, 17u8, 214u8, 75u8, 19u8, 59u8, 19u8, + 30u8, 89u8, 74u8, 6u8, 216u8, 238u8, 165u8, 7u8, 19u8, 153u8, + 253u8, 161u8, 103u8, 178u8, 227u8, 152u8, 180u8, 80u8, 156u8, + 82u8, 126u8, 132u8, 120u8, + ], + ) } #[doc = "Schedule a named task."] pub fn schedule_named( @@ -1940,77 +1281,43 @@ pub mod api { priority: ::core::primitive::u8, call: runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScheduleNamed, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 39u8, 220u8, 199u8, 201u8, 59u8, 156u8, 51u8, 244u8, 243u8, - 29u8, 6u8, 18u8, 158u8, 9u8, 251u8, 26u8, 207u8, 180u8, - 158u8, 198u8, 116u8, 0u8, 18u8, 186u8, 220u8, 253u8, 45u8, - 158u8, 247u8, 206u8, 234u8, 86u8, - ] - { - let call = ScheduleNamed { + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_named", + ScheduleNamed { id, when, maybe_periodic, priority, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 1u8, 236u8, 205u8, 140u8, 220u8, 43u8, 237u8, 225u8, 189u8, + 7u8, 92u8, 146u8, 170u8, 169u8, 139u8, 201u8, 130u8, 96u8, + 93u8, 5u8, 5u8, 127u8, 23u8, 18u8, 214u8, 2u8, 29u8, 91u8, + 45u8, 122u8, 81u8, 105u8, + ], + ) } #[doc = "Cancel a named scheduled task."] pub fn cancel_named( &self, id: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelNamed, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 118u8, 221u8, 232u8, 126u8, 67u8, 134u8, 33u8, 7u8, 224u8, - 110u8, 181u8, 18u8, 57u8, 39u8, 15u8, 64u8, 90u8, 132u8, 2u8, - 238u8, 19u8, 241u8, 194u8, 120u8, 5u8, 109u8, 74u8, 205u8, - 42u8, 244u8, 99u8, 54u8, - ] - { - let call = CancelNamed { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "cancel_named", + CancelNamed { id }, + [ + 42u8, 232u8, 92u8, 167u8, 113u8, 136u8, 7u8, 215u8, 88u8, + 117u8, 74u8, 26u8, 225u8, 230u8, 244u8, 106u8, 150u8, 112u8, + 46u8, 228u8, 96u8, 252u8, 78u8, 126u8, 39u8, 207u8, 36u8, + 110u8, 83u8, 62u8, 84u8, 241u8, + ], + ) } #[doc = "Anonymously schedule a task after a delay."] #[doc = ""] @@ -2027,42 +1334,25 @@ pub mod api { priority: ::core::primitive::u8, call: runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScheduleAfter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 115u8, 139u8, 93u8, 218u8, 175u8, 210u8, 114u8, 59u8, 180u8, - 36u8, 5u8, 193u8, 86u8, 250u8, 222u8, 35u8, 35u8, 94u8, 25u8, - 130u8, 192u8, 166u8, 0u8, 31u8, 127u8, 114u8, 95u8, 24u8, - 64u8, 91u8, 135u8, 114u8, - ] - { - let call = ScheduleAfter { + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_after", + ScheduleAfter { after, maybe_periodic, priority, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 128u8, 226u8, 249u8, 226u8, 27u8, 178u8, 222u8, 22u8, 126u8, + 156u8, 70u8, 146u8, 195u8, 112u8, 15u8, 110u8, 222u8, 2u8, + 89u8, 85u8, 144u8, 133u8, 163u8, 177u8, 62u8, 73u8, 55u8, + 47u8, 172u8, 52u8, 116u8, 5u8, + ], + ) } #[doc = "Schedule a named task after a delay."] #[doc = ""] @@ -2080,43 +1370,26 @@ pub mod api { priority: ::core::primitive::u8, call: runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScheduleNamedAfter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 245u8, 76u8, 86u8, 31u8, 17u8, 228u8, 176u8, 203u8, 22u8, - 130u8, 202u8, 237u8, 206u8, 248u8, 58u8, 252u8, 164u8, 72u8, - 116u8, 93u8, 183u8, 28u8, 244u8, 16u8, 32u8, 131u8, 58u8, - 95u8, 195u8, 88u8, 243u8, 183u8, - ] - { - let call = ScheduleNamedAfter { + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_named_after", + ScheduleNamedAfter { id, after, maybe_periodic, priority, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 13u8, 12u8, 26u8, 103u8, 66u8, 180u8, 139u8, 149u8, 147u8, + 0u8, 51u8, 26u8, 195u8, 42u8, 139u8, 29u8, 29u8, 188u8, + 218u8, 188u8, 114u8, 253u8, 33u8, 47u8, 90u8, 241u8, 128u8, + 12u8, 242u8, 169u8, 82u8, 235u8, + ], + ) } } } @@ -2124,27 +1397,39 @@ pub mod api { pub type Event = runtime_types::pallet_scheduler::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Scheduled some task."] pub struct Scheduled { pub when: ::core::primitive::u32, pub index: ::core::primitive::u32, } - impl ::subxt::Event for Scheduled { + impl ::subxt::events::StaticEvent for Scheduled { const PALLET: &'static str = "Scheduler"; const EVENT: &'static str = "Scheduled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Canceled some task."] pub struct Canceled { pub when: ::core::primitive::u32, pub index: ::core::primitive::u32, } - impl ::subxt::Event for Canceled { + impl ::subxt::events::StaticEvent for Canceled { const PALLET: &'static str = "Scheduler"; const EVENT: &'static str = "Canceled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Dispatched some task."] pub struct Dispatched { pub task: (::core::primitive::u32, ::core::primitive::u32), @@ -2152,323 +1437,198 @@ pub mod api { pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for Dispatched { + impl ::subxt::events::StaticEvent for Dispatched { const PALLET: &'static str = "Scheduler"; const EVENT: &'static str = "Dispatched"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The call for the provided hash was not found so the task has been aborted."] pub struct CallLookupFailed { pub task: (::core::primitive::u32, ::core::primitive::u32), pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, pub error: runtime_types::frame_support::traits::schedule::LookupError, } - impl ::subxt::Event for CallLookupFailed { + impl ::subxt::events::StaticEvent for CallLookupFailed { const PALLET: &'static str = "Scheduler"; const EVENT: &'static str = "CallLookupFailed"; } } pub mod storage { use super::runtime_types; - pub struct Agenda<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Agenda<'_> { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Agenda"; - type Value = ::std::vec::Vec< - ::core::option::Option< - runtime_types::pallet_scheduler::ScheduledV3< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ::core::primitive::u32, - runtime_types::polkadot_runtime::OriginCaller, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Lookup<'a>(pub &'a [::core::primitive::u8]); - impl ::subxt::StorageEntry for Lookup<'_> { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Lookup"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda (& self , _0 : & 'a :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: ScheduledV3 < runtime_types :: frame_support :: traits :: schedule :: MaybeHashed < runtime_types :: polkadot_runtime :: Call , :: subxt :: sp_core :: H256 > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: sp_core :: crypto :: AccountId32 > > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 75u8, 4u8, 32u8, 14u8, 49u8, 69u8, 183u8, 81u8, 195u8, - 51u8, 83u8, 183u8, 41u8, 69u8, 255u8, 112u8, 131u8, - 132u8, 72u8, 115u8, 249u8, 142u8, 23u8, 219u8, 172u8, - 84u8, 11u8, 245u8, 139u8, 70u8, 181u8, 86u8, - ] - { - let entry = Agenda(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] - pub fn agenda_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Agenda<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 75u8, 4u8, 32u8, 14u8, 49u8, 69u8, 183u8, 81u8, 195u8, - 51u8, 83u8, 183u8, 41u8, 69u8, 255u8, 112u8, 131u8, - 132u8, 72u8, 115u8, 249u8, 142u8, 23u8, 219u8, 172u8, - 84u8, 11u8, 245u8, 139u8, 70u8, 181u8, 86u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub struct StorageApi; + impl StorageApi { + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda (& self , _0 : impl :: std :: borrow :: Borrow < :: core :: primitive :: u32 > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: ScheduledV3 < runtime_types :: frame_support :: traits :: schedule :: MaybeHashed < runtime_types :: polkadot_runtime :: Call , :: subxt :: ext :: sp_core :: H256 > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Agenda", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 126u8, 252u8, 83u8, 155u8, 229u8, 159u8, 72u8, 83u8, 118u8, + 67u8, 86u8, 164u8, 64u8, 243u8, 165u8, 120u8, 161u8, 78u8, + 165u8, 42u8, 87u8, 247u8, 87u8, 55u8, 107u8, 164u8, 109u8, + 97u8, 57u8, 92u8, 57u8, 10u8, + ], + ) + } + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: ScheduledV3 < runtime_types :: frame_support :: traits :: schedule :: MaybeHashed < runtime_types :: polkadot_runtime :: Call , :: subxt :: ext :: sp_core :: H256 > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Agenda", + Vec::new(), + [ + 126u8, 252u8, 83u8, 155u8, 229u8, 159u8, 72u8, 83u8, 118u8, + 67u8, 86u8, 164u8, 64u8, 243u8, 165u8, 120u8, 161u8, 78u8, + 165u8, 42u8, 87u8, 247u8, 87u8, 55u8, 107u8, 164u8, 109u8, + 97u8, 57u8, 92u8, 57u8, 10u8, + ], + ) } #[doc = " Lookup from identity to the block number and index of the task."] pub fn lookup( &self, - _0: &'a [::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, - 131u8, 57u8, 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, - 169u8, 182u8, 168u8, 43u8, 36u8, 202u8, 222u8, 182u8, - 41u8, 216u8, 222u8, 1u8, 72u8, 165u8, 62u8, 166u8, - ] - { - let entry = Lookup(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Lookup", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, 131u8, + 57u8, 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, 169u8, 182u8, + 168u8, 43u8, 36u8, 202u8, 222u8, 182u8, 41u8, 216u8, 222u8, + 1u8, 72u8, 165u8, 62u8, 166u8, + ], + ) } #[doc = " Lookup from identity to the block number and index of the task."] - pub fn lookup_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Lookup<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, - 131u8, 57u8, 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, - 169u8, 182u8, 168u8, 43u8, 36u8, 202u8, 222u8, 182u8, - 41u8, 216u8, 222u8, 1u8, 72u8, 165u8, 62u8, 166u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn lookup_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Lookup", + Vec::new(), + [ + 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, 131u8, + 57u8, 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, 169u8, 182u8, + 168u8, 43u8, 36u8, 202u8, 222u8, 182u8, 41u8, 216u8, 222u8, + 1u8, 72u8, 165u8, 62u8, 166u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The maximum weight that may be scheduled per block for any dispatchables of less"] #[doc = " priority than `schedule::HARD_DEADLINE`."] pub fn maximum_weight( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Scheduler", "MaximumWeight")? - == [ - 235u8, 167u8, 74u8, 91u8, 5u8, 188u8, 76u8, 138u8, 208u8, - 10u8, 100u8, 241u8, 65u8, 185u8, 195u8, 212u8, 38u8, 161u8, - 27u8, 113u8, 220u8, 214u8, 28u8, 214u8, 67u8, 169u8, 21u8, - 10u8, 230u8, 130u8, 251u8, 175u8, - ] - { - let pallet = metadata.pallet("Scheduler")?; - let constant = pallet.constant("MaximumWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Scheduler", + "MaximumWeight", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } #[doc = " The maximum number of scheduled calls in the queue for a single block."] #[doc = " Not strictly enforced, but used for weight estimation."] pub fn max_scheduled_per_block( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Scheduler", "MaxScheduledPerBlock")? - == [ - 64u8, 25u8, 128u8, 202u8, 165u8, 97u8, 30u8, 196u8, 174u8, - 132u8, 139u8, 223u8, 88u8, 20u8, 228u8, 203u8, 253u8, 201u8, - 83u8, 157u8, 161u8, 120u8, 187u8, 165u8, 4u8, 64u8, 184u8, - 34u8, 28u8, 129u8, 136u8, 13u8, - ] - { - let pallet = metadata.pallet("Scheduler")?; - let constant = pallet.constant("MaxScheduledPerBlock")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Scheduler", + "MaxScheduledPerBlock", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod preimage { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NotePreimage { pub bytes: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for NotePreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "note_preimage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct UnnotePreimage { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for UnnotePreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "unnote_preimage"; + pub hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RequestPreimage { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "request_preimage"; + pub hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct UnrequestPreimage { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for UnrequestPreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "unrequest_preimage"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Register a preimage on-chain."] #[doc = ""] #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] @@ -2476,69 +1636,35 @@ pub mod api { pub fn note_preimage( &self, bytes: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NotePreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 116u8, 66u8, 88u8, 251u8, 187u8, 86u8, 82u8, 136u8, 215u8, - 82u8, 240u8, 255u8, 70u8, 190u8, 116u8, 187u8, 232u8, 168u8, - 125u8, 234u8, 8u8, 21u8, 247u8, 195u8, 167u8, 237u8, 27u8, - 202u8, 123u8, 25u8, 225u8, 131u8, - ] - { - let call = NotePreimage { bytes }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Preimage", + "note_preimage", + NotePreimage { bytes }, + [ + 77u8, 48u8, 104u8, 3u8, 254u8, 65u8, 106u8, 95u8, 204u8, + 89u8, 149u8, 29u8, 144u8, 188u8, 99u8, 23u8, 146u8, 142u8, + 35u8, 17u8, 125u8, 130u8, 31u8, 206u8, 106u8, 83u8, 163u8, + 192u8, 81u8, 23u8, 232u8, 230u8, + ], + ) } #[doc = "Clear an unrequested preimage from the runtime storage."] pub fn unnote_preimage( &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnnotePreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 162u8, 195u8, 220u8, 134u8, 147u8, 150u8, 145u8, 130u8, - 231u8, 104u8, 83u8, 70u8, 42u8, 90u8, 248u8, 61u8, 223u8, - 63u8, 162u8, 219u8, 92u8, 248u8, 179u8, 99u8, 158u8, 252u8, - 89u8, 59u8, 115u8, 130u8, 73u8, 21u8, - ] - { - let call = UnnotePreimage { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Preimage", + "unnote_preimage", + UnnotePreimage { hash }, + [ + 211u8, 204u8, 205u8, 58u8, 33u8, 179u8, 68u8, 74u8, 149u8, + 138u8, 213u8, 45u8, 140u8, 27u8, 106u8, 81u8, 68u8, 212u8, + 147u8, 116u8, 27u8, 130u8, 84u8, 34u8, 231u8, 197u8, 135u8, + 8u8, 19u8, 242u8, 207u8, 17u8, + ], + ) } #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] @@ -2546,72 +1672,38 @@ pub mod api { #[doc = "a user may have paid, and take the control of the preimage out of their hands."] pub fn request_preimage( &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RequestPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 186u8, 108u8, 235u8, 145u8, 104u8, 29u8, 22u8, 33u8, 21u8, - 121u8, 32u8, 75u8, 141u8, 125u8, 205u8, 186u8, 210u8, 184u8, - 134u8, 248u8, 74u8, 175u8, 104u8, 91u8, 247u8, 151u8, 70u8, - 192u8, 183u8, 163u8, 245u8, 180u8, - ] - { - let call = RequestPreimage { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Preimage", + "request_preimage", + RequestPreimage { hash }, + [ + 195u8, 26u8, 146u8, 255u8, 79u8, 43u8, 73u8, 60u8, 115u8, + 78u8, 99u8, 197u8, 137u8, 95u8, 139u8, 141u8, 79u8, 213u8, + 170u8, 169u8, 127u8, 30u8, 236u8, 65u8, 38u8, 16u8, 118u8, + 228u8, 141u8, 83u8, 162u8, 233u8, + ], + ) } #[doc = "Clear a previously made request for a preimage."] #[doc = ""] #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] pub fn unrequest_preimage( &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnrequestPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 160u8, 6u8, 6u8, 198u8, 77u8, 37u8, 28u8, 86u8, 240u8, 160u8, - 128u8, 123u8, 144u8, 150u8, 150u8, 60u8, 107u8, 148u8, 189u8, - 192u8, 125u8, 25u8, 55u8, 212u8, 193u8, 212u8, 198u8, 131u8, - 113u8, 37u8, 213u8, 152u8, - ] - { - let call = UnrequestPreimage { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Preimage", + "unrequest_preimage", + UnrequestPreimage { hash }, + [ + 143u8, 225u8, 239u8, 44u8, 237u8, 83u8, 18u8, 105u8, 101u8, + 68u8, 111u8, 116u8, 66u8, 212u8, 63u8, 190u8, 38u8, 32u8, + 105u8, 152u8, 69u8, 177u8, 193u8, 15u8, 60u8, 26u8, 95u8, + 130u8, 11u8, 113u8, 187u8, 108u8, + ], + ) } } } @@ -2619,237 +1711,176 @@ pub mod api { pub type Event = runtime_types::pallet_preimage::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A preimage has been noted."] pub struct Noted { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Noted { + impl ::subxt::events::StaticEvent for Noted { const PALLET: &'static str = "Preimage"; const EVENT: &'static str = "Noted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A preimage has been requested."] pub struct Requested { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Requested { + impl ::subxt::events::StaticEvent for Requested { const PALLET: &'static str = "Preimage"; const EVENT: &'static str = "Requested"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A preimage has ben cleared."] pub struct Cleared { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Cleared { + impl ::subxt::events::StaticEvent for Cleared { const PALLET: &'static str = "Preimage"; const EVENT: &'static str = "Cleared"; } } pub mod storage { use super::runtime_types; - pub struct StatusFor<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for StatusFor<'_> { - const PALLET: &'static str = "Preimage"; - const STORAGE: &'static str = "StatusFor"; - type Value = runtime_types::pallet_preimage::RequestStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct PreimageFor<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for PreimageFor<'_> { - const PALLET: &'static str = "Preimage"; - const STORAGE: &'static str = "PreimageFor"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The request status of a given hash."] pub fn status_for( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_preimage::RequestStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_preimage::RequestStatus< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 239u8, 53u8, 52u8, 248u8, 196u8, 74u8, 99u8, 113u8, - 135u8, 186u8, 100u8, 46u8, 246u8, 245u8, 160u8, 102u8, - 81u8, 96u8, 85u8, 11u8, 27u8, 53u8, 139u8, 8u8, 18u8, - 208u8, 241u8, 139u8, 162u8, 239u8, 113u8, 28u8, - ] - { - let entry = StatusFor(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Preimage", + "StatusFor", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 244u8, 6u8, 120u8, 75u8, 164u8, 32u8, 39u8, 15u8, 107u8, + 127u8, 19u8, 242u8, 80u8, 121u8, 18u8, 219u8, 253u8, 174u8, + 138u8, 9u8, 76u8, 219u8, 156u8, 229u8, 78u8, 155u8, 233u8, + 162u8, 215u8, 237u8, 23u8, 123u8, + ], + ) } #[doc = " The request status of a given hash."] - pub fn status_for_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, StatusFor<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 239u8, 53u8, 52u8, 248u8, 196u8, 74u8, 99u8, 113u8, - 135u8, 186u8, 100u8, 46u8, 246u8, 245u8, 160u8, 102u8, - 81u8, 96u8, 85u8, 11u8, 27u8, 53u8, 139u8, 8u8, 18u8, - 208u8, 241u8, 139u8, 162u8, 239u8, 113u8, 28u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn status_for_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_preimage::RequestStatus< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Preimage", + "StatusFor", + Vec::new(), + [ + 244u8, 6u8, 120u8, 75u8, 164u8, 32u8, 39u8, 15u8, 107u8, + 127u8, 19u8, 242u8, 80u8, 121u8, 18u8, 219u8, 253u8, 174u8, + 138u8, 9u8, 76u8, 219u8, 156u8, 229u8, 78u8, 155u8, 233u8, + 162u8, 215u8, 237u8, 23u8, 123u8, + ], + ) } #[doc = " The preimages stored by this pallet."] pub fn preimage_for( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 153u8, 48u8, 185u8, 144u8, 57u8, 68u8, 133u8, 92u8, - 225u8, 172u8, 36u8, 62u8, 152u8, 162u8, 15u8, 139u8, - 140u8, 82u8, 118u8, 63u8, 31u8, 158u8, 197u8, 26u8, - 141u8, 210u8, 150u8, 82u8, 109u8, 100u8, 144u8, 56u8, - ] - { - let entry = PreimageFor(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Preimage", + "PreimageFor", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 82u8, 216u8, 233u8, 5u8, 102u8, 206u8, 96u8, 64u8, 133u8, + 179u8, 63u8, 45u8, 53u8, 42u8, 190u8, 95u8, 77u8, 197u8, + 60u8, 11u8, 59u8, 231u8, 190u8, 219u8, 87u8, 149u8, 112u8, + 196u8, 33u8, 238u8, 247u8, 117u8, + ], + ) } #[doc = " The preimages stored by this pallet."] - pub fn preimage_for_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PreimageFor<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 153u8, 48u8, 185u8, 144u8, 57u8, 68u8, 133u8, 92u8, - 225u8, 172u8, 36u8, 62u8, 152u8, 162u8, 15u8, 139u8, - 140u8, 82u8, 118u8, 63u8, 31u8, 158u8, 197u8, 26u8, - 141u8, 210u8, 150u8, 82u8, 109u8, 100u8, 144u8, 56u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn preimage_for_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Preimage", + "PreimageFor", + Vec::new(), + [ + 82u8, 216u8, 233u8, 5u8, 102u8, 206u8, 96u8, 64u8, 133u8, + 179u8, 63u8, 45u8, 53u8, 42u8, 190u8, 95u8, 77u8, 197u8, + 60u8, 11u8, 59u8, 231u8, 190u8, 219u8, 87u8, 149u8, 112u8, + 196u8, 33u8, 238u8, 247u8, 117u8, + ], + ) } } } } pub mod babe { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReportEquivocation { pub equivocation_proof: ::std::boxed::Box< runtime_types::sp_consensus_slots::EquivocationProof< @@ -2862,11 +1893,11 @@ pub mod api { >, pub key_owner_proof: runtime_types::sp_session::MembershipProof, } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "report_equivocation"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReportEquivocationUnsigned { pub equivocation_proof: ::std::boxed::Box< runtime_types::sp_consensus_slots::EquivocationProof< @@ -2879,34 +1910,17 @@ pub mod api { >, pub key_owner_proof: runtime_types::sp_session::MembershipProof, } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct PlanConfigChange { pub config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, } - impl ::subxt::Call for PlanConfigChange { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "plan_config_change"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Report authority equivocation/misbehavior. This method will verify"] #[doc = "the equivocation proof and validate the given key ownership proof"] #[doc = "against the extracted offender. If both are valid, the offence will"] @@ -2915,40 +1929,23 @@ pub mod api { &self, equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocation, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 123u8, 212u8, 216u8, 77u8, 79u8, 132u8, 201u8, 155u8, 166u8, - 230u8, 50u8, 89u8, 98u8, 68u8, 56u8, 213u8, 206u8, 245u8, - 91u8, 104u8, 89u8, 189u8, 57u8, 38u8, 127u8, 22u8, 47u8, - 206u8, 142u8, 202u8, 106u8, 154u8, - ] - { - let call = ReportEquivocation { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Babe", + "report_equivocation", + ReportEquivocation { equivocation_proof: ::std::boxed::Box::new( equivocation_proof, ), key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 177u8, 237u8, 107u8, 138u8, 237u8, 233u8, 30u8, 195u8, 112u8, + 176u8, 185u8, 113u8, 157u8, 221u8, 134u8, 151u8, 62u8, 151u8, + 64u8, 164u8, 254u8, 112u8, 2u8, 94u8, 175u8, 79u8, 160u8, + 3u8, 72u8, 145u8, 244u8, 137u8, + ], + ) } #[doc = "Report authority equivocation/misbehavior. This method will verify"] #[doc = "the equivocation proof and validate the given key ownership proof"] @@ -2962,40 +1959,24 @@ pub mod api { &self, equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocationUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 32u8, 163u8, 168u8, 251u8, 251u8, 9u8, 1u8, 195u8, 173u8, - 32u8, 235u8, 125u8, 141u8, 201u8, 130u8, 207u8, 239u8, 76u8, - 150u8, 99u8, 74u8, 193u8, 60u8, 165u8, 93u8, 49u8, 95u8, - 224u8, 217u8, 243u8, 117u8, 173u8, - ] - { - let call = ReportEquivocationUnsigned { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Babe", + "report_equivocation_unsigned", + ReportEquivocationUnsigned { equivocation_proof: ::std::boxed::Box::new( equivocation_proof, ), key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 56u8, 103u8, 238u8, 118u8, 61u8, 192u8, 222u8, 87u8, 254u8, + 24u8, 138u8, 219u8, 210u8, 85u8, 201u8, 147u8, 128u8, 49u8, + 199u8, 144u8, 46u8, 158u8, 163u8, 31u8, 101u8, 224u8, 72u8, + 98u8, 68u8, 120u8, 215u8, 19u8, + ], + ) } #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] @@ -3004,342 +1985,105 @@ pub mod api { pub fn plan_config_change( &self, config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PlanConfigChange, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 215u8, 121u8, 90u8, 87u8, 178u8, 247u8, 114u8, 53u8, 174u8, - 28u8, 20u8, 33u8, 139u8, 216u8, 13u8, 187u8, 74u8, 198u8, - 38u8, 28u8, 175u8, 13u8, 73u8, 132u8, 103u8, 78u8, 217u8, - 207u8, 113u8, 169u8, 42u8, 103u8, - ] - { - let call = PlanConfigChange { config }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Babe", + "plan_config_change", + PlanConfigChange { config }, + [ + 229u8, 157u8, 41u8, 58u8, 56u8, 4u8, 52u8, 107u8, 104u8, + 20u8, 42u8, 110u8, 1u8, 17u8, 45u8, 196u8, 30u8, 135u8, 63u8, + 46u8, 40u8, 137u8, 209u8, 37u8, 24u8, 108u8, 251u8, 189u8, + 77u8, 208u8, 74u8, 32u8, + ], + ) } } } pub mod storage { use super::runtime_types; - pub struct EpochIndex; - impl ::subxt::StorageEntry for EpochIndex { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochIndex"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Authorities; - impl ::subxt::StorageEntry for Authorities { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Authorities"; - type Value = - runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< - ( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - ), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct GenesisSlot; - impl ::subxt::StorageEntry for GenesisSlot { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "GenesisSlot"; - type Value = runtime_types::sp_consensus_slots::Slot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentSlot; - impl ::subxt::StorageEntry for CurrentSlot { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "CurrentSlot"; - type Value = runtime_types::sp_consensus_slots::Slot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Randomness; - impl ::subxt::StorageEntry for Randomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Randomness"; - type Value = [::core::primitive::u8; 32usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingEpochConfigChange; - impl ::subxt::StorageEntry for PendingEpochConfigChange { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "PendingEpochConfigChange"; - type Value = - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextRandomness; - impl ::subxt::StorageEntry for NextRandomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextRandomness"; - type Value = [::core::primitive::u8; 32usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextAuthorities; - impl ::subxt::StorageEntry for NextAuthorities { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextAuthorities"; - type Value = - runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< - ( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - ), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SegmentIndex; - impl ::subxt::StorageEntry for SegmentIndex { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "SegmentIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnderConstruction<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for UnderConstruction<'_> { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "UnderConstruction"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Initialized; - impl ::subxt::StorageEntry for Initialized { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Initialized"; - type Value = ::core::option::Option< - runtime_types::sp_consensus_babe::digests::PreDigest, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AuthorVrfRandomness; - impl ::subxt::StorageEntry for AuthorVrfRandomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "AuthorVrfRandomness"; - type Value = ::core::option::Option<[::core::primitive::u8; 32usize]>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochStart; - impl ::subxt::StorageEntry for EpochStart { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochStart"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Lateness; - impl ::subxt::StorageEntry for Lateness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Lateness"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochConfig; - impl ::subxt::StorageEntry for EpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextEpochConfig; - impl ::subxt::StorageEntry for NextEpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextEpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Current epoch index."] pub fn epoch_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u64, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 51u8, 27u8, 91u8, 156u8, 118u8, 99u8, 46u8, 219u8, 190u8, - 147u8, 205u8, 23u8, 106u8, 169u8, 121u8, 218u8, 208u8, - 235u8, 135u8, 127u8, 243u8, 41u8, 55u8, 243u8, 235u8, - 122u8, 57u8, 86u8, 37u8, 90u8, 208u8, 71u8, - ] - { - let entry = EpochIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Current epoch authorities."] pub fn authorities (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 39u8, 102u8, 251u8, 125u8, 230u8, 247u8, 174u8, 255u8, - 2u8, 81u8, 86u8, 69u8, 182u8, 92u8, 191u8, 163u8, 66u8, - 181u8, 247u8, 9u8, 57u8, 154u8, 239u8, 34u8, 25u8, 139u8, - 119u8, 4u8, 131u8, 124u8, 135u8, 240u8, - ] - { - let entry = Authorities; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "EpochIndex", + vec![], + [ + 51u8, 27u8, 91u8, 156u8, 118u8, 99u8, 46u8, 219u8, 190u8, + 147u8, 205u8, 23u8, 106u8, 169u8, 121u8, 218u8, 208u8, 235u8, + 135u8, 127u8, 243u8, 41u8, 55u8, 243u8, 235u8, 122u8, 57u8, + 86u8, 37u8, 90u8, 208u8, 71u8, + ], + ) + } + #[doc = " Current epoch authorities."] pub fn authorities (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Authorities", + vec![], + [ + 61u8, 8u8, 133u8, 111u8, 169u8, 120u8, 0u8, 213u8, 31u8, + 159u8, 204u8, 212u8, 18u8, 205u8, 93u8, 84u8, 140u8, 108u8, + 136u8, 209u8, 234u8, 107u8, 145u8, 9u8, 204u8, 224u8, 105u8, + 9u8, 238u8, 241u8, 65u8, 30u8, + ], + ) } #[doc = " The slot at which the first epoch actually started. This is 0"] #[doc = " until the first block of the chain."] pub fn genesis_slot( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_consensus_slots::Slot, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 136u8, 244u8, 7u8, 142u8, 224u8, 33u8, 144u8, 186u8, - 155u8, 144u8, 68u8, 81u8, 241u8, 57u8, 40u8, 207u8, 35u8, - 39u8, 28u8, 41u8, 210u8, 213u8, 53u8, 195u8, 175u8, - 119u8, 6u8, 175u8, 100u8, 192u8, 180u8, 73u8, - ] - { - let entry = GenesisSlot; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "GenesisSlot", + vec![], + [ + 234u8, 127u8, 243u8, 100u8, 124u8, 160u8, 66u8, 248u8, 48u8, + 218u8, 61u8, 52u8, 54u8, 142u8, 158u8, 77u8, 32u8, 63u8, + 156u8, 39u8, 94u8, 255u8, 192u8, 238u8, 170u8, 118u8, 58u8, + 42u8, 199u8, 61u8, 199u8, 77u8, + ], + ) } #[doc = " Current slot number."] pub fn current_slot( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_consensus_slots::Slot, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 233u8, 102u8, 77u8, 99u8, 103u8, 50u8, 151u8, 229u8, - 46u8, 226u8, 181u8, 37u8, 117u8, 204u8, 234u8, 120u8, - 116u8, 166u8, 80u8, 188u8, 92u8, 154u8, 137u8, 150u8, - 79u8, 164u8, 29u8, 203u8, 2u8, 51u8, 123u8, 104u8, - ] - { - let entry = CurrentSlot; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "CurrentSlot", + vec![], + [ + 139u8, 237u8, 185u8, 137u8, 251u8, 179u8, 69u8, 167u8, 133u8, + 168u8, 204u8, 64u8, 178u8, 123u8, 92u8, 250u8, 119u8, 190u8, + 208u8, 178u8, 208u8, 176u8, 124u8, 187u8, 74u8, 165u8, 33u8, + 78u8, 161u8, 206u8, 8u8, 108u8, + ], + ) } #[doc = " The epoch randomness for the *current* epoch."] #[doc = ""] @@ -3353,124 +2097,80 @@ pub mod api { #[doc = " adversary, for purposes such as public-coin zero-knowledge proofs."] pub fn randomness( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 191u8, 197u8, 25u8, 164u8, 104u8, 248u8, 247u8, 193u8, - 244u8, 60u8, 181u8, 195u8, 248u8, 90u8, 41u8, 199u8, - 82u8, 123u8, 72u8, 126u8, 18u8, 17u8, 128u8, 215u8, 34u8, - 251u8, 227u8, 70u8, 166u8, 10u8, 104u8, 140u8, - ] - { - let entry = Randomness; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Pending epoch configuration change that will be applied when the next epoch is enacted."] pub fn pending_epoch_config_change (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 98u8, 52u8, 22u8, 32u8, 76u8, 196u8, 89u8, 78u8, 119u8, - 181u8, 17u8, 49u8, 220u8, 159u8, 195u8, 74u8, 33u8, 59u8, - 15u8, 104u8, 26u8, 111u8, 165u8, 68u8, 147u8, 14u8, 86u8, - 94u8, 250u8, 167u8, 146u8, 82u8, - ] - { - let entry = PendingEpochConfigChange; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u8; 32usize]>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Randomness", + vec![], + [ + 191u8, 197u8, 25u8, 164u8, 104u8, 248u8, 247u8, 193u8, 244u8, + 60u8, 181u8, 195u8, 248u8, 90u8, 41u8, 199u8, 82u8, 123u8, + 72u8, 126u8, 18u8, 17u8, 128u8, 215u8, 34u8, 251u8, 227u8, + 70u8, 166u8, 10u8, 104u8, 140u8, + ], + ) + } + #[doc = " Pending epoch configuration change that will be applied when the next epoch is enacted."] + pub fn pending_epoch_config_change( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "PendingEpochConfigChange", + vec![], + [ + 4u8, 201u8, 0u8, 204u8, 47u8, 246u8, 4u8, 185u8, 163u8, + 242u8, 242u8, 152u8, 29u8, 222u8, 71u8, 127u8, 49u8, 203u8, + 206u8, 180u8, 244u8, 50u8, 80u8, 49u8, 199u8, 97u8, 3u8, + 170u8, 156u8, 139u8, 106u8, 113u8, + ], + ) } #[doc = " Next epoch randomness."] pub fn next_randomness( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 185u8, 98u8, 45u8, 109u8, 253u8, 38u8, 238u8, 221u8, - 240u8, 29u8, 38u8, 107u8, 118u8, 117u8, 131u8, 115u8, - 21u8, 255u8, 203u8, 81u8, 243u8, 251u8, 91u8, 60u8, - 163u8, 202u8, 125u8, 193u8, 173u8, 234u8, 166u8, 92u8, - ] - { - let entry = NextRandomness; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Next epoch authorities."] pub fn next_authorities (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 211u8, 175u8, 218u8, 0u8, 212u8, 114u8, 210u8, 137u8, - 146u8, 135u8, 78u8, 133u8, 85u8, 253u8, 140u8, 242u8, - 101u8, 155u8, 159u8, 8u8, 217u8, 176u8, 234u8, 143u8, - 212u8, 103u8, 198u8, 94u8, 121u8, 111u8, 56u8, 89u8, - ] - { - let entry = NextAuthorities; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u8; 32usize]>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "NextRandomness", + vec![], + [ + 185u8, 98u8, 45u8, 109u8, 253u8, 38u8, 238u8, 221u8, 240u8, + 29u8, 38u8, 107u8, 118u8, 117u8, 131u8, 115u8, 21u8, 255u8, + 203u8, 81u8, 243u8, 251u8, 91u8, 60u8, 163u8, 202u8, 125u8, + 193u8, 173u8, 234u8, 166u8, 92u8, + ], + ) + } + #[doc = " Next epoch authorities."] pub fn next_authorities (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "NextAuthorities", + vec![], + [ + 201u8, 193u8, 164u8, 18u8, 155u8, 253u8, 124u8, 163u8, 143u8, + 73u8, 212u8, 20u8, 241u8, 108u8, 110u8, 5u8, 171u8, 66u8, + 224u8, 208u8, 10u8, 65u8, 148u8, 164u8, 1u8, 12u8, 216u8, + 83u8, 20u8, 226u8, 254u8, 183u8, + ], + ) } #[doc = " Randomness under construction."] #[doc = ""] @@ -3483,149 +2183,103 @@ pub mod api { #[doc = " epoch."] pub fn segment_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 128u8, 45u8, 87u8, 58u8, 174u8, 152u8, 241u8, 156u8, - 56u8, 192u8, 19u8, 45u8, 75u8, 160u8, 35u8, 253u8, 145u8, - 11u8, 178u8, 81u8, 114u8, 117u8, 112u8, 107u8, 163u8, - 208u8, 240u8, 151u8, 102u8, 176u8, 246u8, 5u8, - ] - { - let entry = SegmentIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "SegmentIndex", + vec![], + [ + 128u8, 45u8, 87u8, 58u8, 174u8, 152u8, 241u8, 156u8, 56u8, + 192u8, 19u8, 45u8, 75u8, 160u8, 35u8, 253u8, 145u8, 11u8, + 178u8, 81u8, 114u8, 117u8, 112u8, 107u8, 163u8, 208u8, 240u8, + 151u8, 102u8, 176u8, 246u8, 5u8, + ], + ) } #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] pub fn under_construction( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< [::core::primitive::u8; 32usize], >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 12u8, 167u8, 30u8, 96u8, 161u8, 63u8, 210u8, 63u8, 91u8, - 199u8, 188u8, 78u8, 254u8, 255u8, 253u8, 202u8, 203u8, - 26u8, 4u8, 105u8, 76u8, 125u8, 191u8, 245u8, 32u8, 97u8, - 127u8, 129u8, 167u8, 80u8, 210u8, 123u8, - ] - { - let entry = UnderConstruction(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "UnderConstruction", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 180u8, 4u8, 149u8, 245u8, 231u8, 92u8, 99u8, 170u8, 254u8, + 172u8, 182u8, 3u8, 152u8, 156u8, 132u8, 196u8, 140u8, 97u8, + 7u8, 84u8, 220u8, 89u8, 195u8, 177u8, 235u8, 51u8, 98u8, + 144u8, 73u8, 238u8, 59u8, 164u8, + ], + ) } #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub fn under_construction_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, UnderConstruction<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 12u8, 167u8, 30u8, 96u8, 161u8, 63u8, 210u8, 63u8, 91u8, - 199u8, 188u8, 78u8, 254u8, 255u8, 253u8, 202u8, 203u8, - 26u8, 4u8, 105u8, 76u8, 125u8, 191u8, 245u8, 32u8, 97u8, - 127u8, 129u8, 167u8, 80u8, 210u8, 123u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn under_construction_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "UnderConstruction", + Vec::new(), + [ + 180u8, 4u8, 149u8, 245u8, 231u8, 92u8, 99u8, 170u8, 254u8, + 172u8, 182u8, 3u8, 152u8, 156u8, 132u8, 196u8, 140u8, 97u8, + 7u8, 84u8, 220u8, 89u8, 195u8, 177u8, 235u8, 51u8, 98u8, + 144u8, 73u8, 238u8, 59u8, 164u8, + ], + ) } #[doc = " Temporary value (cleared at block finalization) which is `Some`"] #[doc = " if per-block initialization has already been called for current block."] pub fn initialized( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::core::option::Option< - ::core::option::Option< - runtime_types::sp_consensus_babe::digests::PreDigest, - >, + runtime_types::sp_consensus_babe::digests::PreDigest, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 23u8, 254u8, 52u8, 114u8, 235u8, 65u8, 46u8, 39u8, - 97u8, 238u8, 243u8, 237u8, 138u8, 142u8, 85u8, 114u8, - 69u8, 58u8, 172u8, 7u8, 238u8, 110u8, 153u8, 22u8, 122u8, - 117u8, 149u8, 113u8, 221u8, 127u8, 225u8, - ] - { - let entry = Initialized; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Initialized", + vec![], + [ + 142u8, 101u8, 250u8, 113u8, 93u8, 201u8, 157u8, 18u8, 166u8, + 153u8, 59u8, 197u8, 107u8, 247u8, 124u8, 110u8, 202u8, 67u8, + 62u8, 57u8, 186u8, 134u8, 49u8, 182u8, 149u8, 44u8, 255u8, + 85u8, 87u8, 177u8, 149u8, 121u8, + ], + ) } #[doc = " This field should always be populated during block processing unless"] #[doc = " secondary plain slots are enabled (which don't contain a VRF output)."] @@ -3633,37 +2287,25 @@ pub mod api { #[doc = " It is set in `on_finalize`, before it will contain the value from the last block."] pub fn author_vrf_randomness( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::core::option::Option<[::core::primitive::u8; 32usize]>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 66u8, 235u8, 74u8, 252u8, 222u8, 135u8, 19u8, 28u8, 74u8, - 191u8, 170u8, 197u8, 207u8, 127u8, 77u8, 121u8, 138u8, - 138u8, 110u8, 187u8, 34u8, 14u8, 230u8, 43u8, 241u8, - 241u8, 63u8, 163u8, 53u8, 179u8, 250u8, 247u8, - ] - { - let entry = AuthorVrfRandomness; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "AuthorVrfRandomness", + vec![], + [ + 66u8, 235u8, 74u8, 252u8, 222u8, 135u8, 19u8, 28u8, 74u8, + 191u8, 170u8, 197u8, 207u8, 127u8, 77u8, 121u8, 138u8, 138u8, + 110u8, 187u8, 34u8, 14u8, 230u8, 43u8, 241u8, 241u8, 63u8, + 163u8, 53u8, 179u8, 250u8, 247u8, + ], + ) } #[doc = " The block numbers when the last and current epoch have started, respectively `N-1` and"] #[doc = " `N`."] @@ -3672,37 +2314,26 @@ pub mod api { #[doc = " slots, which may be skipped, the block numbers may not line up with the slot numbers."] pub fn epoch_start( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 196u8, 39u8, 241u8, 20u8, 150u8, 180u8, 136u8, 4u8, - 195u8, 205u8, 218u8, 10u8, 130u8, 131u8, 168u8, 243u8, - 207u8, 249u8, 58u8, 195u8, 177u8, 119u8, 110u8, 243u8, - 241u8, 3u8, 245u8, 56u8, 157u8, 5u8, 68u8, 60u8, - ] - { - let entry = EpochStart; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "EpochStart", + vec![], + [ + 196u8, 39u8, 241u8, 20u8, 150u8, 180u8, 136u8, 4u8, 195u8, + 205u8, 218u8, 10u8, 130u8, 131u8, 168u8, 243u8, 207u8, 249u8, + 58u8, 195u8, 177u8, 119u8, 110u8, 243u8, 241u8, 3u8, 245u8, + 56u8, 157u8, 5u8, 68u8, 60u8, + ], + ) } #[doc = " How late the current block is compared to its parent."] #[doc = ""] @@ -3711,150 +2342,96 @@ pub mod api { #[doc = " execution context should always yield zero."] pub fn lateness( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 229u8, 230u8, 224u8, 89u8, 49u8, 213u8, 198u8, 236u8, - 144u8, 56u8, 193u8, 234u8, 62u8, 242u8, 191u8, 199u8, - 105u8, 131u8, 74u8, 63u8, 75u8, 1u8, 210u8, 49u8, 3u8, - 128u8, 18u8, 77u8, 219u8, 146u8, 60u8, 88u8, - ] - { - let entry = Lateness; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Lateness", + vec![], + [ + 229u8, 230u8, 224u8, 89u8, 49u8, 213u8, 198u8, 236u8, 144u8, + 56u8, 193u8, 234u8, 62u8, 242u8, 191u8, 199u8, 105u8, 131u8, + 74u8, 63u8, 75u8, 1u8, 210u8, 49u8, 3u8, 128u8, 18u8, 77u8, + 219u8, 146u8, 60u8, 88u8, + ], + ) } #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] #[doc = " genesis."] pub fn epoch_config( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 169u8, 189u8, 214u8, 159u8, 181u8, 232u8, 243u8, 4u8, - 113u8, 24u8, 221u8, 229u8, 27u8, 35u8, 3u8, 121u8, 136u8, - 88u8, 187u8, 193u8, 207u8, 153u8, 223u8, 225u8, 166u8, - 183u8, 53u8, 3u8, 162u8, 207u8, 88u8, 133u8, - ] - { - let entry = EpochConfig; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "EpochConfig", + vec![], + [ + 41u8, 118u8, 141u8, 244u8, 72u8, 17u8, 125u8, 203u8, 43u8, + 153u8, 203u8, 119u8, 117u8, 223u8, 123u8, 133u8, 73u8, 235u8, + 130u8, 21u8, 160u8, 167u8, 16u8, 173u8, 177u8, 35u8, 117u8, + 97u8, 149u8, 49u8, 220u8, 24u8, + ], + ) } #[doc = " The configuration for the next epoch, `None` if the config will not change"] #[doc = " (you can fallback to `EpochConfig` instead in that case)."] pub fn next_epoch_config( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 239u8, 125u8, 203u8, 223u8, 161u8, 107u8, 232u8, 54u8, - 158u8, 100u8, 244u8, 140u8, 119u8, 58u8, 253u8, 245u8, - 73u8, 236u8, 50u8, 67u8, 228u8, 162u8, 166u8, 168u8, - 162u8, 152u8, 239u8, 246u8, 153u8, 223u8, 109u8, 121u8, - ] - { - let entry = NextEpochConfig; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "NextEpochConfig", + vec![], + [ + 111u8, 182u8, 144u8, 180u8, 92u8, 146u8, 102u8, 249u8, 196u8, + 229u8, 226u8, 30u8, 25u8, 198u8, 133u8, 9u8, 136u8, 95u8, + 11u8, 151u8, 139u8, 156u8, 105u8, 228u8, 181u8, 12u8, 175u8, + 148u8, 174u8, 33u8, 233u8, 228u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The amount of time, in slots, that each epoch should last."] #[doc = " NOTE: Currently it is not possible to change the epoch duration after"] #[doc = " the chain has started. Attempting to do so will brick block production."] pub fn epoch_duration( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Babe", "EpochDuration")? - == [ - 40u8, 54u8, 255u8, 20u8, 89u8, 2u8, 38u8, 235u8, 70u8, 145u8, - 128u8, 227u8, 177u8, 3u8, 153u8, 91u8, 102u8, 159u8, 160u8, - 139u8, 88u8, 111u8, 116u8, 90u8, 139u8, 12u8, 31u8, 236u8, - 11u8, 113u8, 213u8, 254u8, - ] - { - let pallet = metadata.pallet("Babe")?; - let constant = pallet.constant("EpochDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Babe", + "EpochDuration", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } #[doc = " The expected average block time at which BABE should be creating"] #[doc = " blocks. Since BABE is probabilistic it is not trivial to figure out"] @@ -3863,90 +2440,59 @@ pub mod api { #[doc = " the probability of a slot being empty)."] pub fn expected_block_time( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Babe", "ExpectedBlockTime")? - == [ - 249u8, 170u8, 37u8, 7u8, 132u8, 115u8, 106u8, 71u8, 116u8, - 166u8, 78u8, 251u8, 242u8, 146u8, 99u8, 207u8, 204u8, 225u8, - 157u8, 57u8, 19u8, 17u8, 202u8, 231u8, 50u8, 67u8, 17u8, - 205u8, 238u8, 80u8, 154u8, 125u8, - ] - { - let pallet = metadata.pallet("Babe")?; - let constant = pallet.constant("ExpectedBlockTime")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Babe", + "ExpectedBlockTime", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } #[doc = " Max number of authorities allowed"] pub fn max_authorities( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Babe", "MaxAuthorities")? - == [ - 248u8, 195u8, 131u8, 166u8, 10u8, 50u8, 71u8, 223u8, 41u8, - 49u8, 43u8, 99u8, 251u8, 113u8, 75u8, 193u8, 159u8, 15u8, - 77u8, 217u8, 147u8, 205u8, 165u8, 50u8, 6u8, 166u8, 77u8, - 189u8, 102u8, 22u8, 201u8, 19u8, - ] - { - let pallet = metadata.pallet("Babe")?; - let constant = pallet.constant("MaxAuthorities")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Babe", + "MaxAuthorities", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod timestamp { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Set { #[codec(compact)] pub now: ::core::primitive::u64, } - impl ::subxt::Call for Set { - const PALLET: &'static str = "Timestamp"; - const FUNCTION: &'static str = "set"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Set the current time."] #[doc = ""] #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] @@ -3966,261 +2512,152 @@ pub mod api { pub fn set( &self, now: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Set, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 191u8, 73u8, 102u8, 150u8, 65u8, 157u8, 172u8, 194u8, 7u8, - 72u8, 1u8, 35u8, 54u8, 99u8, 245u8, 139u8, 40u8, 136u8, - 245u8, 53u8, 167u8, 100u8, 143u8, 244u8, 160u8, 5u8, 18u8, - 130u8, 77u8, 160u8, 227u8, 51u8, - ] - { - let call = Set { now }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Timestamp", + "set", + Set { now }, + [ + 6u8, 97u8, 172u8, 236u8, 118u8, 238u8, 228u8, 114u8, 15u8, + 115u8, 102u8, 85u8, 66u8, 151u8, 16u8, 33u8, 187u8, 17u8, + 166u8, 88u8, 127u8, 214u8, 182u8, 51u8, 168u8, 88u8, 43u8, + 101u8, 185u8, 8u8, 1u8, 28u8, + ], + ) } } } pub mod storage { use super::runtime_types; - pub struct Now; - impl ::subxt::StorageEntry for Now { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "Now"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidUpdate; - impl ::subxt::StorageEntry for DidUpdate { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "DidUpdate"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Current time for the current block."] pub fn now( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u64, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 148u8, 53u8, 50u8, 54u8, 13u8, 161u8, 57u8, 150u8, 16u8, - 83u8, 144u8, 221u8, 59u8, 75u8, 158u8, 130u8, 39u8, - 123u8, 106u8, 134u8, 202u8, 185u8, 83u8, 85u8, 60u8, - 41u8, 120u8, 96u8, 210u8, 34u8, 2u8, 250u8, - ] - { - let entry = Now; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Timestamp", + "Now", + vec![], + [ + 148u8, 53u8, 50u8, 54u8, 13u8, 161u8, 57u8, 150u8, 16u8, + 83u8, 144u8, 221u8, 59u8, 75u8, 158u8, 130u8, 39u8, 123u8, + 106u8, 134u8, 202u8, 185u8, 83u8, 85u8, 60u8, 41u8, 120u8, + 96u8, 210u8, 34u8, 2u8, 250u8, + ], + ) } #[doc = " Did the timestamp get updated in this block?"] pub fn did_update( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 70u8, 13u8, 92u8, 186u8, 80u8, 151u8, 167u8, 90u8, 158u8, - 232u8, 175u8, 13u8, 103u8, 135u8, 2u8, 78u8, 16u8, 6u8, - 39u8, 158u8, 167u8, 85u8, 27u8, 47u8, 122u8, 73u8, 127u8, - 26u8, 35u8, 168u8, 72u8, 204u8, - ] - { - let entry = DidUpdate; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Timestamp", + "DidUpdate", + vec![], + [ + 70u8, 13u8, 92u8, 186u8, 80u8, 151u8, 167u8, 90u8, 158u8, + 232u8, 175u8, 13u8, 103u8, 135u8, 2u8, 78u8, 16u8, 6u8, 39u8, + 158u8, 167u8, 85u8, 27u8, 47u8, 122u8, 73u8, 127u8, 26u8, + 35u8, 168u8, 72u8, 204u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The minimum period between blocks. Beware that this is different to the *expected*"] #[doc = " period that the block production apparatus provides. Your chosen consensus system will"] #[doc = " generally work with this to determine a sensible block time. e.g. For Aura, it will be"] #[doc = " double this period on default settings."] pub fn minimum_period( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Timestamp", "MinimumPeriod")? - == [ - 141u8, 242u8, 40u8, 24u8, 83u8, 43u8, 33u8, 194u8, 156u8, - 149u8, 219u8, 61u8, 10u8, 123u8, 120u8, 247u8, 228u8, 22u8, - 25u8, 24u8, 214u8, 188u8, 54u8, 135u8, 240u8, 162u8, 41u8, - 216u8, 3u8, 58u8, 238u8, 39u8, - ] - { - let pallet = metadata.pallet("Timestamp")?; - let constant = pallet.constant("MinimumPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Timestamp", + "MinimumPeriod", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } } } } pub mod indices { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Claim { pub index: ::core::primitive::u32, } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "claim"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Transfer { - pub new: ::subxt::sp_core::crypto::AccountId32, + pub new: ::subxt::ext::sp_core::crypto::AccountId32, pub index: ::core::primitive::u32, } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "transfer"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Free { pub index: ::core::primitive::u32, } - impl ::subxt::Call for Free { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "free"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceTransfer { - pub new: ::subxt::sp_core::crypto::AccountId32, + pub new: ::subxt::ext::sp_core::crypto::AccountId32, pub index: ::core::primitive::u32, pub freeze: ::core::primitive::bool, } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "force_transfer"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Freeze { pub index: ::core::primitive::u32, } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "freeze"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Assign an previously unassigned index."] #[doc = ""] #[doc = "Payment: `Deposit` is reserved from the sender account."] @@ -4242,35 +2679,18 @@ pub mod api { pub fn claim( &self, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Claim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 27u8, 4u8, 108u8, 55u8, 23u8, 109u8, 175u8, 25u8, 201u8, - 230u8, 228u8, 51u8, 164u8, 15u8, 79u8, 10u8, 219u8, 182u8, - 242u8, 102u8, 164u8, 148u8, 39u8, 91u8, 106u8, 197u8, 29u8, - 190u8, 178u8, 221u8, 16u8, 87u8, - ] - { - let call = Claim { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "claim", + Claim { index }, + [ + 5u8, 24u8, 11u8, 173u8, 226u8, 170u8, 0u8, 30u8, 193u8, + 102u8, 214u8, 59u8, 252u8, 32u8, 221u8, 88u8, 196u8, 189u8, + 244u8, 18u8, 233u8, 37u8, 228u8, 248u8, 76u8, 175u8, 212u8, + 233u8, 238u8, 203u8, 162u8, 68u8, + ], + ) } #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] #[doc = "is effectively transferred to the new account."] @@ -4294,37 +2714,20 @@ pub mod api { #[doc = "# "] pub fn transfer( &self, - new: ::subxt::sp_core::crypto::AccountId32, + new: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Transfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 124u8, 83u8, 33u8, 230u8, 23u8, 70u8, 83u8, 59u8, 76u8, - 100u8, 219u8, 100u8, 165u8, 163u8, 102u8, 193u8, 11u8, 22u8, - 30u8, 125u8, 114u8, 28u8, 61u8, 156u8, 38u8, 170u8, 129u8, - 74u8, 187u8, 28u8, 33u8, 65u8, - ] - { - let call = Transfer { new, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "transfer", + Transfer { new, index }, + [ + 229u8, 48u8, 45u8, 2u8, 206u8, 24u8, 60u8, 43u8, 202u8, 99u8, + 80u8, 172u8, 62u8, 134u8, 224u8, 128u8, 107u8, 219u8, 57u8, + 87u8, 144u8, 220u8, 207u8, 79u8, 7u8, 89u8, 208u8, 75u8, + 158u8, 75u8, 10u8, 113u8, + ], + ) } #[doc = "Free up an index owned by the sender."] #[doc = ""] @@ -4347,35 +2750,18 @@ pub mod api { pub fn free( &self, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Free, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 143u8, 162u8, 33u8, 229u8, 3u8, 159u8, 153u8, 111u8, - 100u8, 160u8, 250u8, 227u8, 24u8, 157u8, 226u8, 173u8, 39u8, - 25u8, 200u8, 137u8, 147u8, 232u8, 213u8, 182u8, 49u8, 142u8, - 250u8, 139u8, 155u8, 84u8, 214u8, - ] - { - let call = Free { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "free", + Free { index }, + [ + 133u8, 202u8, 225u8, 127u8, 69u8, 145u8, 43u8, 13u8, 160u8, + 248u8, 215u8, 243u8, 232u8, 166u8, 74u8, 203u8, 235u8, 138u8, + 255u8, 27u8, 163u8, 71u8, 254u8, 217u8, 6u8, 208u8, 202u8, + 204u8, 238u8, 70u8, 126u8, 252u8, + ], + ) } #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] #[doc = "held, then any deposit is reimbursed to its current owner."] @@ -4400,38 +2786,21 @@ pub mod api { #[doc = "# "] pub fn force_transfer( &self, - new: ::subxt::sp_core::crypto::AccountId32, + new: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, freeze: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 181u8, 143u8, 90u8, 135u8, 132u8, 11u8, 145u8, 85u8, 4u8, - 211u8, 56u8, 110u8, 213u8, 153u8, 224u8, 106u8, 198u8, 250u8, - 130u8, 253u8, 72u8, 58u8, 133u8, 150u8, 102u8, 119u8, 177u8, - 175u8, 77u8, 106u8, 253u8, 99u8, - ] - { - let call = ForceTransfer { new, index, freeze }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "force_transfer", + ForceTransfer { new, index, freeze }, + [ + 2u8, 134u8, 200u8, 233u8, 224u8, 80u8, 237u8, 130u8, 28u8, + 159u8, 130u8, 223u8, 124u8, 205u8, 248u8, 70u8, 246u8, 77u8, + 73u8, 193u8, 78u8, 85u8, 58u8, 29u8, 191u8, 217u8, 252u8, + 178u8, 113u8, 255u8, 151u8, 49u8, + ], + ) } #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] #[doc = "deposit."] @@ -4454,35 +2823,18 @@ pub mod api { pub fn freeze( &self, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Freeze, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 204u8, 127u8, 214u8, 137u8, 138u8, 28u8, 171u8, 169u8, 184u8, - 164u8, 235u8, 114u8, 132u8, 176u8, 14u8, 207u8, 72u8, 39u8, - 179u8, 231u8, 137u8, 243u8, 242u8, 57u8, 89u8, 57u8, 213u8, - 210u8, 87u8, 12u8, 253u8, 159u8, - ] - { - let call = Freeze { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "freeze", + Freeze { index }, + [ + 121u8, 45u8, 118u8, 2u8, 72u8, 48u8, 38u8, 7u8, 234u8, 204u8, + 68u8, 20u8, 76u8, 251u8, 205u8, 246u8, 149u8, 31u8, 168u8, + 186u8, 208u8, 90u8, 40u8, 47u8, 100u8, 228u8, 188u8, 33u8, + 79u8, 220u8, 105u8, 209u8, + ], + ) } } } @@ -4490,207 +2842,162 @@ pub mod api { pub type Event = runtime_types::pallet_indices::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A account index was assigned."] pub struct IndexAssigned { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub index: ::core::primitive::u32, } - impl ::subxt::Event for IndexAssigned { + impl ::subxt::events::StaticEvent for IndexAssigned { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexAssigned"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A account index has been freed up (unassigned)."] pub struct IndexFreed { pub index: ::core::primitive::u32, } - impl ::subxt::Event for IndexFreed { + impl ::subxt::events::StaticEvent for IndexFreed { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexFreed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A account index has been frozen to its current account ID."] pub struct IndexFrozen { pub index: ::core::primitive::u32, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for IndexFrozen { + impl ::subxt::events::StaticEvent for IndexFrozen { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexFrozen"; } } pub mod storage { use super::runtime_types; - pub struct Accounts<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Accounts<'_> { - const PALLET: &'static str = "Indices"; - const STORAGE: &'static str = "Accounts"; - type Value = ( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The lookup from index to account."] pub fn accounts( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 105u8, 208u8, 81u8, 30u8, 157u8, 108u8, 22u8, 122u8, - 152u8, 220u8, 40u8, 97u8, 255u8, 166u8, 222u8, 11u8, - 81u8, 245u8, 143u8, 79u8, 57u8, 19u8, 174u8, 164u8, - 220u8, 59u8, 77u8, 117u8, 39u8, 72u8, 251u8, 234u8, - ] - { - let entry = Accounts(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Indices", + "Accounts", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 211u8, 169u8, 54u8, 254u8, 88u8, 57u8, 22u8, 223u8, 108u8, + 27u8, 38u8, 9u8, 202u8, 209u8, 111u8, 209u8, 144u8, 13u8, + 211u8, 114u8, 239u8, 127u8, 75u8, 166u8, 234u8, 222u8, 225u8, + 35u8, 160u8, 163u8, 112u8, 242u8, + ], + ) } #[doc = " The lookup from index to account."] - pub fn accounts_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Accounts<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 105u8, 208u8, 81u8, 30u8, 157u8, 108u8, 22u8, 122u8, - 152u8, 220u8, 40u8, 97u8, 255u8, 166u8, 222u8, 11u8, - 81u8, 245u8, 143u8, 79u8, 57u8, 19u8, 174u8, 164u8, - 220u8, 59u8, 77u8, 117u8, 39u8, 72u8, 251u8, 234u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn accounts_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Indices", + "Accounts", + Vec::new(), + [ + 211u8, 169u8, 54u8, 254u8, 88u8, 57u8, 22u8, 223u8, 108u8, + 27u8, 38u8, 9u8, 202u8, 209u8, 111u8, 209u8, 144u8, 13u8, + 211u8, 114u8, 239u8, 127u8, 75u8, 166u8, 234u8, 222u8, 225u8, + 35u8, 160u8, 163u8, 112u8, 242u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The deposit needed for reserving an index."] pub fn deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Indices", "Deposit")? - == [ - 249u8, 18u8, 129u8, 140u8, 50u8, 11u8, 128u8, 63u8, 198u8, - 178u8, 202u8, 62u8, 51u8, 99u8, 138u8, 112u8, 96u8, 138u8, - 30u8, 159u8, 53u8, 65u8, 250u8, 156u8, 199u8, 99u8, 129u8, - 80u8, 116u8, 156u8, 82u8, 42u8, - ] - { - let pallet = metadata.pallet("Indices")?; - let constant = pallet.constant("Deposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Indices", + "Deposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } } pub mod balances { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Transfer { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetBalance { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -4698,79 +3005,62 @@ pub mod api { #[codec(compact)] pub new_reserved: ::core::primitive::u128, } - impl ::subxt::Call for SetBalance { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "set_balance"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct TransferKeepAlive { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for TransferKeepAlive { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_keep_alive"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct TransferAll { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub keep_alive: ::core::primitive::bool, } - impl ::subxt::Call for TransferAll { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_all"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceUnreserve { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub amount: ::core::primitive::u128, } - impl ::subxt::Call for ForceUnreserve { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_unreserve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Transfer some liquid free balance to another account."] #[doc = ""] #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] @@ -4798,40 +3088,23 @@ pub mod api { #[doc = "# "] pub fn transfer( &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Transfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 250u8, 8u8, 164u8, 186u8, 80u8, 220u8, 134u8, 247u8, 142u8, - 121u8, 34u8, 22u8, 169u8, 39u8, 6u8, 93u8, 72u8, 47u8, 44u8, - 107u8, 9u8, 98u8, 203u8, 190u8, 136u8, 55u8, 251u8, 78u8, - 216u8, 150u8, 98u8, 118u8, - ] - { - let call = Transfer { dest, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer", + Transfer { dest, value }, + [ + 111u8, 222u8, 32u8, 56u8, 171u8, 77u8, 252u8, 29u8, 194u8, + 155u8, 200u8, 192u8, 198u8, 81u8, 23u8, 115u8, 236u8, 91u8, + 218u8, 114u8, 107u8, 141u8, 138u8, 100u8, 237u8, 21u8, 58u8, + 172u8, 3u8, 20u8, 216u8, 38u8, + ], + ) } #[doc = "Set the balances of a given account."] #[doc = ""] @@ -4843,45 +3116,28 @@ pub mod api { #[doc = "The dispatch origin for this call is `root`."] pub fn set_balance( &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, new_free: ::core::primitive::u128, new_reserved: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetBalance, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 232u8, 6u8, 27u8, 131u8, 163u8, 72u8, 148u8, 197u8, 14u8, - 239u8, 94u8, 1u8, 32u8, 94u8, 17u8, 14u8, 123u8, 82u8, 39u8, - 233u8, 77u8, 20u8, 40u8, 139u8, 222u8, 137u8, 103u8, 18u8, - 126u8, 63u8, 200u8, 149u8, - ] - { - let call = SetBalance { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "set_balance", + SetBalance { who, new_free, new_reserved, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 234u8, 215u8, 97u8, 98u8, 243u8, 199u8, 57u8, 76u8, 59u8, + 161u8, 118u8, 207u8, 34u8, 197u8, 198u8, 61u8, 231u8, 210u8, + 169u8, 235u8, 150u8, 137u8, 173u8, 49u8, 28u8, 77u8, 84u8, + 149u8, 143u8, 210u8, 139u8, 193u8, + ], + ) } #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] #[doc = "specified."] @@ -4891,48 +3147,31 @@ pub mod api { #[doc = "# "] pub fn force_transfer( &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 120u8, 66u8, 111u8, 84u8, 176u8, 241u8, 214u8, 118u8, 219u8, - 75u8, 127u8, 222u8, 45u8, 33u8, 204u8, 147u8, 126u8, 214u8, - 101u8, 190u8, 37u8, 37u8, 159u8, 166u8, 61u8, 143u8, 22u8, - 32u8, 15u8, 83u8, 221u8, 230u8, - ] - { - let call = ForceTransfer { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "force_transfer", + ForceTransfer { source, dest, value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 79u8, 174u8, 212u8, 108u8, 184u8, 33u8, 170u8, 29u8, 232u8, + 254u8, 195u8, 218u8, 221u8, 134u8, 57u8, 99u8, 6u8, 70u8, + 181u8, 227u8, 56u8, 239u8, 243u8, 158u8, 157u8, 245u8, 36u8, + 162u8, 11u8, 237u8, 147u8, 15u8, + ], + ) } #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] #[doc = "origin account."] @@ -4942,40 +3181,23 @@ pub mod api { #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] pub fn transfer_keep_alive( &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TransferKeepAlive, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 111u8, 233u8, 125u8, 71u8, 223u8, 141u8, 112u8, 94u8, 157u8, - 11u8, 88u8, 7u8, 239u8, 145u8, 247u8, 183u8, 245u8, 87u8, - 157u8, 35u8, 49u8, 91u8, 54u8, 103u8, 101u8, 76u8, 110u8, - 94u8, 81u8, 170u8, 153u8, 209u8, - ] - { - let call = TransferKeepAlive { dest, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer_keep_alive", + TransferKeepAlive { dest, value }, + [ + 112u8, 179u8, 75u8, 168u8, 193u8, 221u8, 9u8, 82u8, 190u8, + 113u8, 253u8, 13u8, 130u8, 134u8, 170u8, 216u8, 136u8, 111u8, + 242u8, 220u8, 202u8, 112u8, 47u8, 79u8, 73u8, 244u8, 226u8, + 59u8, 240u8, 188u8, 210u8, 208u8, + ], + ) } #[doc = "Transfer the entire transferable balance from the caller account."] #[doc = ""] @@ -4996,80 +3218,46 @@ pub mod api { #[doc = " #"] pub fn transfer_all( &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, keep_alive: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TransferAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 240u8, 165u8, 185u8, 144u8, 24u8, 149u8, 15u8, 46u8, 60u8, - 147u8, 19u8, 187u8, 96u8, 24u8, 150u8, 53u8, 151u8, 232u8, - 200u8, 164u8, 176u8, 167u8, 8u8, 23u8, 63u8, 135u8, 68u8, - 110u8, 5u8, 21u8, 35u8, 78u8, - ] - { - let call = TransferAll { dest, keep_alive }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer_all", + TransferAll { dest, keep_alive }, + [ + 46u8, 129u8, 29u8, 177u8, 221u8, 107u8, 245u8, 69u8, 238u8, + 126u8, 145u8, 26u8, 219u8, 208u8, 14u8, 80u8, 149u8, 1u8, + 214u8, 63u8, 67u8, 201u8, 144u8, 45u8, 129u8, 145u8, 174u8, + 71u8, 238u8, 113u8, 208u8, 34u8, + ], + ) } #[doc = "Unreserve some balance from a user by force."] #[doc = ""] #[doc = "Can only be called by ROOT."] pub fn force_unreserve( &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, amount: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnreserve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 106u8, 42u8, 48u8, 136u8, 41u8, 155u8, 214u8, 112u8, 99u8, - 122u8, 202u8, 250u8, 95u8, 60u8, 182u8, 13u8, 25u8, 149u8, - 212u8, 212u8, 247u8, 191u8, 130u8, 95u8, 84u8, 252u8, 252u8, - 197u8, 244u8, 149u8, 103u8, 67u8, - ] - { - let call = ForceUnreserve { who, amount }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "force_unreserve", + ForceUnreserve { who, amount }, + [ + 160u8, 146u8, 137u8, 76u8, 157u8, 187u8, 66u8, 148u8, 207u8, + 76u8, 32u8, 254u8, 82u8, 215u8, 35u8, 161u8, 213u8, 52u8, + 32u8, 98u8, 102u8, 106u8, 234u8, 123u8, 6u8, 175u8, 184u8, + 188u8, 174u8, 106u8, 176u8, 78u8, + ], + ) } } } @@ -5077,222 +3265,178 @@ pub mod api { pub type Event = runtime_types::pallet_balances::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account was created with some free balance."] pub struct Endowed { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub free_balance: ::core::primitive::u128, } - impl ::subxt::Event for Endowed { + impl ::subxt::events::StaticEvent for Endowed { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Endowed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] #[doc = "resulting in an outright loss."] pub struct DustLost { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for DustLost { + impl ::subxt::events::StaticEvent for DustLost { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "DustLost"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Transfer succeeded."] pub struct Transfer { - pub from: ::subxt::sp_core::crypto::AccountId32, - pub to: ::subxt::sp_core::crypto::AccountId32, + pub from: ::subxt::ext::sp_core::crypto::AccountId32, + pub to: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Transfer { + impl ::subxt::events::StaticEvent for Transfer { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Transfer"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A balance was set by root."] pub struct BalanceSet { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub free: ::core::primitive::u128, pub reserved: ::core::primitive::u128, } - impl ::subxt::Event for BalanceSet { + impl ::subxt::events::StaticEvent for BalanceSet { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "BalanceSet"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some balance was reserved (moved from free to reserved)."] pub struct Reserved { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Reserved { + impl ::subxt::events::StaticEvent for Reserved { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Reserved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some balance was unreserved (moved from reserved to free)."] pub struct Unreserved { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Unreserved { + impl ::subxt::events::StaticEvent for Unreserved { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Unreserved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some balance was moved from the reserve of the first account to the second account."] #[doc = "Final argument indicates the destination balance type."] pub struct ReserveRepatriated { - pub from: ::subxt::sp_core::crypto::AccountId32, - pub to: ::subxt::sp_core::crypto::AccountId32, + pub from: ::subxt::ext::sp_core::crypto::AccountId32, + pub to: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, pub destination_status: runtime_types::frame_support::traits::tokens::misc::BalanceStatus, } - impl ::subxt::Event for ReserveRepatriated { + impl ::subxt::events::StaticEvent for ReserveRepatriated { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "ReserveRepatriated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some amount was deposited (e.g. for transaction fees)."] pub struct Deposit { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Deposit { + impl ::subxt::events::StaticEvent for Deposit { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Deposit"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Withdraw { + impl ::subxt::events::StaticEvent for Withdraw { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Withdraw"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] pub struct Slashed { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Slashed { + impl ::subxt::events::StaticEvent for Slashed { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Slashed"; } } pub mod storage { use super::runtime_types; - pub struct TotalIssuance; - impl ::subxt::StorageEntry for TotalIssuance { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "TotalIssuance"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Account"; - type Value = - runtime_types::pallet_balances::AccountData<::core::primitive::u128>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Locks<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Locks"; - type Value = - runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::BalanceLock< - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Reserves<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Reserves<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Reserves"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_balances::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The total units issued in the system."] pub fn total_issuance( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 1u8, 206u8, 252u8, 237u8, 6u8, 30u8, 20u8, 232u8, 164u8, - 115u8, 51u8, 156u8, 156u8, 206u8, 241u8, 187u8, 44u8, - 84u8, 25u8, 164u8, 235u8, 20u8, 86u8, 242u8, 124u8, 23u8, - 28u8, 140u8, 26u8, 73u8, 231u8, 51u8, - ] - { - let entry = TotalIssuance; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "TotalIssuance", + vec![], + [ + 1u8, 206u8, 252u8, 237u8, 6u8, 30u8, 20u8, 232u8, 164u8, + 115u8, 51u8, 156u8, 156u8, 206u8, 241u8, 187u8, 44u8, 84u8, + 25u8, 164u8, 235u8, 20u8, 86u8, 242u8, 124u8, 23u8, 28u8, + 140u8, 26u8, 73u8, 231u8, 51u8, + ], + ) } #[doc = " The Balances pallet example of storing the balance of an account."] #[doc = ""] @@ -5320,40 +3464,31 @@ pub mod api { #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] pub fn account( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_balances::AccountData< ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 129u8, 169u8, 171u8, 206u8, 229u8, 178u8, 69u8, 118u8, - 199u8, 64u8, 254u8, 67u8, 16u8, 154u8, 160u8, 197u8, - 177u8, 161u8, 148u8, 199u8, 78u8, 219u8, 187u8, 83u8, - 99u8, 110u8, 207u8, 252u8, 243u8, 39u8, 46u8, 106u8, - ] - { - let entry = Account(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Account", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 246u8, 154u8, 253u8, 71u8, 192u8, 192u8, 192u8, 236u8, 128u8, + 80u8, 40u8, 252u8, 201u8, 43u8, 3u8, 131u8, 19u8, 49u8, + 141u8, 240u8, 172u8, 217u8, 215u8, 109u8, 87u8, 135u8, 248u8, + 57u8, 98u8, 185u8, 22u8, 4u8, + ], + ) } #[doc = " The Balances pallet example of storing the balance of an account."] #[doc = ""] @@ -5379,428 +3514,264 @@ pub mod api { #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] - pub fn account_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Account<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 129u8, 169u8, 171u8, 206u8, 229u8, 178u8, 69u8, 118u8, - 199u8, 64u8, 254u8, 67u8, 16u8, 154u8, 160u8, 197u8, - 177u8, 161u8, 148u8, 199u8, 78u8, 219u8, 187u8, 83u8, - 99u8, 110u8, 207u8, 252u8, 243u8, 39u8, 46u8, 106u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn account_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_balances::AccountData< + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Account", + Vec::new(), + [ + 246u8, 154u8, 253u8, 71u8, 192u8, 192u8, 192u8, 236u8, 128u8, + 80u8, 40u8, 252u8, 201u8, 43u8, 3u8, 131u8, 19u8, 49u8, + 141u8, 240u8, 172u8, 217u8, 215u8, 109u8, 87u8, 135u8, 248u8, + 57u8, 98u8, 185u8, 22u8, 4u8, + ], + ) } #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] pub fn locks (& self , _0 : & 'a :: subxt :: sp_core :: crypto :: AccountId32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 31u8, 76u8, 213u8, 60u8, 86u8, 11u8, 155u8, 151u8, 33u8, - 212u8, 74u8, 89u8, 174u8, 74u8, 195u8, 107u8, 29u8, - 163u8, 178u8, 34u8, 209u8, 8u8, 201u8, 237u8, 77u8, 99u8, - 205u8, 212u8, 236u8, 132u8, 2u8, 252u8, - ] - { - let entry = Locks(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] pub fn locks (& self , _0 : impl :: std :: borrow :: Borrow < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Locks", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 216u8, 253u8, 87u8, 73u8, 24u8, 218u8, 35u8, 0u8, 244u8, + 134u8, 195u8, 58u8, 255u8, 64u8, 153u8, 212u8, 210u8, 232u8, + 4u8, 122u8, 90u8, 212u8, 136u8, 14u8, 127u8, 232u8, 8u8, + 192u8, 40u8, 233u8, 18u8, 250u8, + ], + ) } #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - pub fn locks_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Locks<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 31u8, 76u8, 213u8, 60u8, 86u8, 11u8, 155u8, 151u8, 33u8, - 212u8, 74u8, 89u8, 174u8, 74u8, 195u8, 107u8, 29u8, - 163u8, 178u8, 34u8, 209u8, 8u8, 201u8, 237u8, 77u8, 99u8, - 205u8, 212u8, 236u8, 132u8, 2u8, 252u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] pub fn locks_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Locks", + Vec::new(), + [ + 216u8, 253u8, 87u8, 73u8, 24u8, 218u8, 35u8, 0u8, 244u8, + 134u8, 195u8, 58u8, 255u8, 64u8, 153u8, 212u8, 210u8, 232u8, + 4u8, 122u8, 90u8, 212u8, 136u8, 14u8, 127u8, 232u8, 8u8, + 192u8, 40u8, 233u8, 18u8, 250u8, + ], + ) } #[doc = " Named reserves on some account balances."] pub fn reserves( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< runtime_types::pallet_balances::ReserveData< [::core::primitive::u8; 8usize], ::core::primitive::u128, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 6u8, 69u8, 151u8, 81u8, 40u8, 146u8, 113u8, 56u8, - 239u8, 104u8, 31u8, 168u8, 242u8, 141u8, 121u8, 213u8, - 213u8, 114u8, 63u8, 62u8, 47u8, 91u8, 119u8, 57u8, 91u8, - 95u8, 81u8, 19u8, 208u8, 59u8, 146u8, - ] - { - let entry = Reserves(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Reserves", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 17u8, 32u8, 191u8, 46u8, 76u8, 220u8, 101u8, 100u8, 42u8, + 250u8, 128u8, 167u8, 117u8, 44u8, 85u8, 96u8, 105u8, 216u8, + 16u8, 147u8, 74u8, 55u8, 183u8, 94u8, 160u8, 177u8, 26u8, + 187u8, 71u8, 197u8, 187u8, 163u8, + ], + ) } #[doc = " Named reserves on some account balances."] - pub fn reserves_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Reserves<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 6u8, 69u8, 151u8, 81u8, 40u8, 146u8, 113u8, 56u8, - 239u8, 104u8, 31u8, 168u8, 242u8, 141u8, 121u8, 213u8, - 213u8, 114u8, 63u8, 62u8, 47u8, 91u8, 119u8, 57u8, 91u8, - 95u8, 81u8, 19u8, 208u8, 59u8, 146u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Storage version of the pallet."] + pub fn reserves_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Reserves", + Vec::new(), + [ + 17u8, 32u8, 191u8, 46u8, 76u8, 220u8, 101u8, 100u8, 42u8, + 250u8, 128u8, 167u8, 117u8, 44u8, 85u8, 96u8, 105u8, 216u8, + 16u8, 147u8, 74u8, 55u8, 183u8, 94u8, 160u8, 177u8, 26u8, + 187u8, 71u8, 197u8, 187u8, 163u8, + ], + ) + } + #[doc = " Storage version of the pallet."] #[doc = ""] #[doc = " This is set to v2.0.0 for new networks."] pub fn storage_version( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_balances::Releases, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 135u8, 96u8, 28u8, 234u8, 124u8, 212u8, 56u8, 140u8, - 40u8, 101u8, 235u8, 128u8, 136u8, 221u8, 182u8, 81u8, - 17u8, 9u8, 184u8, 228u8, 174u8, 165u8, 200u8, 162u8, - 214u8, 178u8, 227u8, 72u8, 34u8, 5u8, 173u8, 96u8, - ] - { - let entry = StorageVersion; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "StorageVersion", + vec![], + [ + 135u8, 96u8, 28u8, 234u8, 124u8, 212u8, 56u8, 140u8, 40u8, + 101u8, 235u8, 128u8, 136u8, 221u8, 182u8, 81u8, 17u8, 9u8, + 184u8, 228u8, 174u8, 165u8, 200u8, 162u8, 214u8, 178u8, + 227u8, 72u8, 34u8, 5u8, 173u8, 96u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The minimum amount required to keep an account open."] pub fn existential_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Balances", "ExistentialDeposit")? - == [ - 100u8, 197u8, 144u8, 241u8, 166u8, 142u8, 204u8, 246u8, - 114u8, 229u8, 145u8, 5u8, 133u8, 180u8, 23u8, 117u8, 117u8, - 204u8, 228u8, 32u8, 70u8, 243u8, 110u8, 36u8, 218u8, 106u8, - 47u8, 136u8, 193u8, 46u8, 121u8, 242u8, - ] - { - let pallet = metadata.pallet("Balances")?; - let constant = pallet.constant("ExistentialDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Balances", + "ExistentialDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum number of locks that should exist on an account."] #[doc = " Not strictly enforced, but used for weight estimation."] pub fn max_locks( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Balances", "MaxLocks")? - == [ - 250u8, 58u8, 19u8, 15u8, 35u8, 113u8, 227u8, 89u8, 39u8, - 75u8, 21u8, 108u8, 202u8, 32u8, 163u8, 167u8, 207u8, 233u8, - 69u8, 151u8, 53u8, 164u8, 230u8, 16u8, 14u8, 22u8, 172u8, - 46u8, 36u8, 216u8, 29u8, 1u8, - ] - { - let pallet = metadata.pallet("Balances")?; - let constant = pallet.constant("MaxLocks")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Balances", + "MaxLocks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The maximum number of named reserves that can exist on an account."] pub fn max_reserves( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Balances", "MaxReserves")? - == [ - 24u8, 30u8, 77u8, 89u8, 216u8, 114u8, 140u8, 11u8, 127u8, - 252u8, 130u8, 203u8, 4u8, 55u8, 62u8, 240u8, 65u8, 182u8, - 187u8, 189u8, 140u8, 6u8, 177u8, 216u8, 159u8, 108u8, 18u8, - 73u8, 95u8, 67u8, 62u8, 50u8, - ] - { - let pallet = metadata.pallet("Balances")?; - let constant = pallet.constant("MaxReserves")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Balances", + "MaxReserves", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod transaction_payment { - use super::{ - root_mod, - runtime_types, - }; - #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] - pub type Event = runtime_types::pallet_transaction_payment::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] - #[doc = "has been paid by `who`."] - pub struct TransactionFeePaid { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub actual_fee: ::core::primitive::u128, - pub tip: ::core::primitive::u128, - } - impl ::subxt::Event for TransactionFeePaid { - const PALLET: &'static str = "TransactionPayment"; - const EVENT: &'static str = "TransactionFeePaid"; - } - } + use super::root_mod; + use super::runtime_types; pub mod storage { use super::runtime_types; - pub struct NextFeeMultiplier; - impl ::subxt::StorageEntry for NextFeeMultiplier { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "NextFeeMultiplier"; - type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_transaction_payment::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { pub fn next_fee_multiplier( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 232u8, 48u8, 68u8, 202u8, 209u8, 29u8, 249u8, 71u8, 0u8, - 84u8, 229u8, 250u8, 176u8, 203u8, 27u8, 26u8, 34u8, 55u8, - 83u8, 183u8, 224u8, 40u8, 62u8, 127u8, 131u8, 88u8, - 128u8, 9u8, 56u8, 178u8, 31u8, 183u8, - ] - { - let entry = NextFeeMultiplier; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TransactionPayment", + "NextFeeMultiplier", + vec![], + [ + 210u8, 0u8, 206u8, 165u8, 183u8, 10u8, 206u8, 52u8, 14u8, + 90u8, 218u8, 197u8, 189u8, 125u8, 113u8, 216u8, 52u8, 161u8, + 45u8, 24u8, 245u8, 237u8, 121u8, 41u8, 106u8, 29u8, 45u8, + 129u8, 250u8, 203u8, 206u8, 180u8, + ], + ) } pub fn storage_version( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_transaction_payment::Releases, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 219u8, 243u8, 82u8, 176u8, 65u8, 5u8, 132u8, 114u8, 8u8, - 82u8, 176u8, 200u8, 97u8, 150u8, 177u8, 164u8, 166u8, - 11u8, 34u8, 12u8, 12u8, 198u8, 58u8, 191u8, 186u8, 221u8, - 221u8, 119u8, 181u8, 253u8, 154u8, 228u8, - ] - { - let entry = StorageVersion; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TransactionPayment", + "StorageVersion", + vec![], + [ + 219u8, 243u8, 82u8, 176u8, 65u8, 5u8, 132u8, 114u8, 8u8, + 82u8, 176u8, 200u8, 97u8, 150u8, 177u8, 164u8, 166u8, 11u8, + 34u8, 12u8, 12u8, 198u8, 58u8, 191u8, 186u8, 221u8, 221u8, + 119u8, 181u8, 253u8, 154u8, 228u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " A fee mulitplier for `Operational` extrinsics to compute \"virtual tip\" to boost their"] #[doc = " `priority`"] #[doc = ""] @@ -5824,44 +3795,36 @@ pub mod api { #[doc = " transactions."] pub fn operational_fee_multiplier( &self, - ) -> ::core::result::Result<::core::primitive::u8, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("TransactionPayment", "OperationalFeeMultiplier")? - == [ - 161u8, 232u8, 150u8, 43u8, 106u8, 83u8, 56u8, 248u8, 54u8, - 123u8, 244u8, 73u8, 5u8, 49u8, 245u8, 150u8, 70u8, 92u8, - 158u8, 207u8, 127u8, 115u8, 211u8, 21u8, 24u8, 136u8, 89u8, - 44u8, 151u8, 211u8, 235u8, 196u8, - ] - { - let pallet = metadata.pallet("TransactionPayment")?; - let constant = pallet.constant("OperationalFeeMultiplier")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u8>, + > { + ::subxt::constants::StaticConstantAddress::new( + "TransactionPayment", + "OperationalFeeMultiplier", + [ + 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, + 110u8, 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, + 185u8, 66u8, 226u8, 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, + 114u8, 237u8, 228u8, 183u8, 165u8, + ], + ) } } } } pub mod authorship { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetUncles { pub new_uncles: ::std::vec::Vec< runtime_types::sp_runtime::generic::header::Header< @@ -5870,25 +3833,8 @@ pub mod api { >, >, } - impl ::subxt::Call for SetUncles { - const PALLET: &'static str = "Authorship"; - const FUNCTION: &'static str = "set_uncles"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Provide a set of uncles."] pub fn set_uncles( &self, @@ -5898,460 +3844,352 @@ pub mod api { runtime_types::sp_runtime::traits::BlakeTwo256, >, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUncles, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 56u8, 71u8, 152u8, 103u8, 232u8, 101u8, 171u8, 200u8, - 2u8, 177u8, 102u8, 0u8, 93u8, 210u8, 90u8, 56u8, 151u8, 5u8, - 235u8, 227u8, 197u8, 189u8, 248u8, 2u8, 71u8, 49u8, 220u8, - 212u8, 253u8, 235u8, 67u8, - ] - { - let call = SetUncles { new_uncles }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Authorship", + "set_uncles", + SetUncles { new_uncles }, + [ + 181u8, 70u8, 222u8, 83u8, 154u8, 215u8, 200u8, 64u8, 154u8, + 228u8, 115u8, 247u8, 117u8, 89u8, 229u8, 102u8, 128u8, 189u8, + 90u8, 60u8, 223u8, 19u8, 111u8, 172u8, 5u8, 223u8, 132u8, + 37u8, 235u8, 119u8, 42u8, 64u8, + ], + ) } } } pub mod storage { use super::runtime_types; - pub struct Uncles; - impl ::subxt::StorageEntry for Uncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Uncles"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_authorship::UncleEntryItem< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Author; - impl ::subxt::StorageEntry for Author { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Author"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidSetUncles; - impl ::subxt::StorageEntry for DidSetUncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "DidSetUncles"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Uncles"] pub fn uncles( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< runtime_types::pallet_authorship::UncleEntryItem< ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::H256, + ::subxt::ext::sp_core::crypto::AccountId32, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 104u8, 166u8, 142u8, 139u8, 46u8, 63u8, 163u8, 183u8, - 45u8, 77u8, 156u8, 44u8, 228u8, 57u8, 253u8, 230u8, - 103u8, 119u8, 145u8, 135u8, 251u8, 182u8, 144u8, 165u8, - 127u8, 150u8, 127u8, 185u8, 146u8, 228u8, 91u8, 163u8, - ] - { - let entry = Uncles; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Authorship", + "Uncles", + vec![], + [ + 43u8, 181u8, 75u8, 158u8, 153u8, 32u8, 210u8, 36u8, 194u8, + 34u8, 146u8, 179u8, 154u8, 141u8, 75u8, 29u8, 51u8, 116u8, + 94u8, 82u8, 90u8, 74u8, 103u8, 216u8, 86u8, 27u8, 30u8, + 213u8, 174u8, 80u8, 193u8, 51u8, + ], + ) } #[doc = " Author of current block."] pub fn author( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 191u8, 57u8, 3u8, 242u8, 220u8, 123u8, 103u8, 215u8, - 149u8, 120u8, 20u8, 139u8, 146u8, 234u8, 180u8, 105u8, - 129u8, 128u8, 114u8, 147u8, 114u8, 236u8, 23u8, 21u8, - 15u8, 250u8, 180u8, 19u8, 177u8, 145u8, 77u8, 228u8, - ] - { - let entry = Author; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Authorship", + "Author", + vec![], + [ + 149u8, 42u8, 33u8, 147u8, 190u8, 207u8, 174u8, 227u8, 190u8, + 110u8, 25u8, 131u8, 5u8, 167u8, 237u8, 188u8, 188u8, 33u8, + 177u8, 126u8, 181u8, 49u8, 126u8, 118u8, 46u8, 128u8, 154u8, + 95u8, 15u8, 91u8, 103u8, 113u8, + ], + ) } #[doc = " Whether uncles were already set in this block."] pub fn did_set_uncles( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 64u8, 3u8, 208u8, 187u8, 50u8, 45u8, 37u8, 88u8, 163u8, - 226u8, 37u8, 126u8, 232u8, 107u8, 156u8, 187u8, 29u8, - 15u8, 53u8, 46u8, 28u8, 73u8, 83u8, 123u8, 14u8, 244u8, - 243u8, 43u8, 245u8, 143u8, 15u8, 115u8, - ] - { - let entry = DidSetUncles; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Authorship", + "DidSetUncles", + vec![], + [ + 64u8, 3u8, 208u8, 187u8, 50u8, 45u8, 37u8, 88u8, 163u8, + 226u8, 37u8, 126u8, 232u8, 107u8, 156u8, 187u8, 29u8, 15u8, + 53u8, 46u8, 28u8, 73u8, 83u8, 123u8, 14u8, 244u8, 243u8, + 43u8, 245u8, 143u8, 15u8, 115u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The number of blocks back we should accept uncles."] #[doc = " This means that we will deal with uncle-parents that are"] #[doc = " `UncleGenerations + 1` before `now`."] pub fn uncle_generations( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Authorship", "UncleGenerations")? - == [ - 0u8, 72u8, 57u8, 175u8, 222u8, 143u8, 191u8, 33u8, 163u8, - 157u8, 202u8, 83u8, 186u8, 103u8, 162u8, 103u8, 227u8, 158u8, - 239u8, 212u8, 205u8, 193u8, 226u8, 138u8, 5u8, 220u8, 221u8, - 42u8, 7u8, 146u8, 173u8, 205u8, - ] - { - let pallet = metadata.pallet("Authorship")?; - let constant = pallet.constant("UncleGenerations")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Authorship", + "UncleGenerations", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod staking { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Bond { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] pub value: ::core::primitive::u128, pub payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, } - impl ::subxt::Call for Bond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "bond"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct BondExtra { #[codec(compact)] pub max_additional: ::core::primitive::u128, } - impl ::subxt::Call for BondExtra { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "bond_extra"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Unbond { #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for Unbond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "unbond"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct WithdrawUnbonded { pub num_slashing_spans: ::core::primitive::u32, } - impl ::subxt::Call for WithdrawUnbonded { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "withdraw_unbonded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Validate { pub prefs: runtime_types::pallet_staking::ValidatorPrefs, } - impl ::subxt::Call for Validate { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "validate"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Nominate { pub targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, >, } - impl ::subxt::Call for Nominate { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "nominate"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Chill; - impl ::subxt::Call for Chill { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "chill"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetPayee { pub payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, } - impl ::subxt::Call for SetPayee { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_payee"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetController { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for SetController { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_controller"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetValidatorCount { #[codec(compact)] pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetValidatorCount { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_validator_count"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct IncreaseValidatorCount { #[codec(compact)] pub additional: ::core::primitive::u32, } - impl ::subxt::Call for IncreaseValidatorCount { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "increase_validator_count"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ScaleValidatorCount { pub factor: runtime_types::sp_arithmetic::per_things::Percent, } - impl ::subxt::Call for ScaleValidatorCount { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "scale_validator_count"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceNoEras; - impl ::subxt::Call for ForceNoEras { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_no_eras"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceNewEra; - impl ::subxt::Call for ForceNewEra { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_new_era"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetInvulnerables { - pub invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub invulnerables: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, } - impl ::subxt::Call for SetInvulnerables { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_invulnerables"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceUnstake { - pub stash: ::subxt::sp_core::crypto::AccountId32, + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, pub num_slashing_spans: ::core::primitive::u32, } - impl ::subxt::Call for ForceUnstake { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_unstake"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceNewEraAlways; - impl ::subxt::Call for ForceNewEraAlways { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_new_era_always"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CancelDeferredSlash { pub era: ::core::primitive::u32, pub slash_indices: ::std::vec::Vec<::core::primitive::u32>, } - impl ::subxt::Call for CancelDeferredSlash { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "cancel_deferred_slash"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct PayoutStakers { - pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + pub validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, pub era: ::core::primitive::u32, } - impl ::subxt::Call for PayoutStakers { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "payout_stakers"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Rebond { #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for Rebond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "rebond"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetHistoryDepth { #[codec(compact)] pub new_history_depth: ::core::primitive::u32, #[codec(compact)] pub era_items_deleted: ::core::primitive::u32, } - impl ::subxt::Call for SetHistoryDepth { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_history_depth"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReapStash { - pub stash: ::subxt::sp_core::crypto::AccountId32, + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, pub num_slashing_spans: ::core::primitive::u32, } - impl ::subxt::Call for ReapStash { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "reap_stash"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Kick { pub who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, >, } - impl ::subxt::Call for Kick { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "kick"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetStakingConfigs { pub min_nominator_bond: runtime_types::pallet_staking::pallet::pallet::ConfigOp< @@ -6378,41 +4216,24 @@ pub mod api { runtime_types::sp_arithmetic::per_things::Perbill, >, } - impl ::subxt::Call for SetStakingConfigs { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_staking_configs"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ChillOther { - pub controller: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChillOther { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "chill_other"; + pub controller: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceApplyMinCommission { - pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + pub validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Call for ForceApplyMinCommission { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_apply_min_commission"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] #[doc = "be the account that controls it."] #[doc = ""] @@ -6432,47 +4253,30 @@ pub mod api { #[doc = "# "] pub fn bond( &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, value: ::core::primitive::u128, payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Bond, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 41u8, 8u8, 237u8, 132u8, 236u8, 61u8, 222u8, 146u8, 255u8, - 136u8, 174u8, 104u8, 120u8, 64u8, 198u8, 147u8, 80u8, 237u8, - 65u8, 255u8, 187u8, 55u8, 252u8, 34u8, 252u8, 88u8, 35u8, - 236u8, 249u8, 170u8, 116u8, 208u8, - ] - { - let call = Bond { + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "bond", + Bond { controller, value, payee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 215u8, 211u8, 69u8, 215u8, 33u8, 158u8, 62u8, 3u8, 31u8, + 216u8, 213u8, 188u8, 151u8, 43u8, 165u8, 154u8, 117u8, 163u8, + 190u8, 227u8, 116u8, 70u8, 155u8, 178u8, 64u8, 174u8, 203u8, + 179u8, 214u8, 187u8, 176u8, 10u8, + ], + ) } #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] #[doc = "for staking."] @@ -6492,35 +4296,18 @@ pub mod api { pub fn bond_extra( &self, max_additional: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - BondExtra, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 170u8, 38u8, 37u8, 71u8, 243u8, 41u8, 24u8, 59u8, 17u8, - 229u8, 61u8, 20u8, 130u8, 167u8, 1u8, 1u8, 158u8, 180u8, - 234u8, 65u8, 196u8, 181u8, 232u8, 146u8, 62u8, 90u8, 194u8, - 183u8, 253u8, 142u8, 251u8, 200u8, - ] - { - let call = BondExtra { max_additional }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "bond_extra", + BondExtra { max_additional }, + [ + 60u8, 45u8, 82u8, 223u8, 113u8, 95u8, 0u8, 71u8, 59u8, 108u8, + 228u8, 9u8, 95u8, 210u8, 113u8, 106u8, 252u8, 15u8, 19u8, + 128u8, 11u8, 187u8, 4u8, 151u8, 103u8, 143u8, 24u8, 33u8, + 149u8, 82u8, 35u8, 192u8, + ], + ) } #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] #[doc = "period ends. If this leaves an amount actively bonded less than"] @@ -6544,35 +4331,18 @@ pub mod api { pub fn unbond( &self, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Unbond, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 85u8, 188u8, 141u8, 62u8, 242u8, 15u8, 6u8, 20u8, 96u8, - 220u8, 201u8, 163u8, 29u8, 136u8, 24u8, 4u8, 143u8, 13u8, - 22u8, 118u8, 22u8, 212u8, 164u8, 125u8, 200u8, 219u8, 6u8, - 25u8, 174u8, 92u8, 108u8, 89u8, - ] - { - let call = Unbond { value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "unbond", + Unbond { value }, + [ + 85u8, 62u8, 34u8, 127u8, 60u8, 241u8, 134u8, 60u8, 125u8, + 91u8, 31u8, 193u8, 50u8, 230u8, 237u8, 42u8, 114u8, 230u8, + 240u8, 146u8, 14u8, 109u8, 185u8, 151u8, 148u8, 44u8, 147u8, + 182u8, 192u8, 253u8, 51u8, 87u8, + ], + ) } #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] #[doc = ""] @@ -6592,35 +4362,18 @@ pub mod api { pub fn withdraw_unbonded( &self, num_slashing_spans: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - WithdrawUnbonded, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 252u8, 47u8, 185u8, 86u8, 179u8, 203u8, 20u8, 5u8, 88u8, - 252u8, 212u8, 173u8, 20u8, 202u8, 206u8, 56u8, 10u8, 186u8, - 124u8, 221u8, 42u8, 61u8, 202u8, 110u8, 233u8, 40u8, 210u8, - 135u8, 204u8, 110u8, 133u8, 123u8, - ] - { - let call = WithdrawUnbonded { num_slashing_spans }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "withdraw_unbonded", + WithdrawUnbonded { num_slashing_spans }, + [ + 95u8, 223u8, 122u8, 217u8, 76u8, 208u8, 86u8, 129u8, 31u8, + 104u8, 70u8, 154u8, 23u8, 250u8, 165u8, 192u8, 149u8, 249u8, + 158u8, 159u8, 194u8, 224u8, 118u8, 134u8, 204u8, 157u8, 72u8, + 136u8, 19u8, 193u8, 183u8, 84u8, + ], + ) } #[doc = "Declare the desire to validate for the origin controller."] #[doc = ""] @@ -6630,35 +4383,18 @@ pub mod api { pub fn validate( &self, prefs: runtime_types::pallet_staking::ValidatorPrefs, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Validate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 138u8, 13u8, 146u8, 216u8, 4u8, 27u8, 20u8, 159u8, 148u8, - 25u8, 169u8, 229u8, 145u8, 2u8, 251u8, 58u8, 13u8, 128u8, - 20u8, 22u8, 194u8, 11u8, 13u8, 65u8, 50u8, 51u8, 158u8, - 239u8, 45u8, 90u8, 6u8, 37u8, - ] - { - let call = Validate { prefs }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "validate", + Validate { prefs }, + [ + 191u8, 116u8, 139u8, 35u8, 250u8, 211u8, 86u8, 240u8, 35u8, + 9u8, 19u8, 44u8, 148u8, 35u8, 91u8, 106u8, 200u8, 172u8, + 108u8, 145u8, 194u8, 146u8, 61u8, 145u8, 233u8, 168u8, 2u8, + 26u8, 145u8, 101u8, 114u8, 157u8, + ], + ) } #[doc = "Declare the desire to nominate `targets` for the origin controller."] #[doc = ""] @@ -6674,40 +4410,23 @@ pub mod api { pub fn nominate( &self, targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Nominate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 199u8, 181u8, 123u8, 171u8, 186u8, 9u8, 23u8, 220u8, 147u8, - 7u8, 252u8, 26u8, 25u8, 195u8, 126u8, 175u8, 181u8, 118u8, - 162u8, 37u8, 99u8, 31u8, 100u8, 249u8, 245u8, 122u8, 235u8, - 11u8, 43u8, 39u8, 198u8, 145u8, - ] - { - let call = Nominate { targets }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "nominate", + Nominate { targets }, + [ + 112u8, 162u8, 70u8, 26u8, 74u8, 7u8, 188u8, 193u8, 210u8, + 247u8, 27u8, 189u8, 133u8, 137u8, 33u8, 155u8, 255u8, 171u8, + 122u8, 68u8, 175u8, 247u8, 139u8, 253u8, 97u8, 187u8, 254u8, + 201u8, 66u8, 166u8, 226u8, 90u8, + ], + ) } #[doc = "Declare no desire to either validate or nominate."] #[doc = ""] @@ -6720,37 +4439,18 @@ pub mod api { #[doc = "- Contains one read."] #[doc = "- Writes are limited to the `origin` account key."] #[doc = "# "] - pub fn chill( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Chill, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn chill(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "chill", + Chill {}, + [ 94u8, 20u8, 196u8, 31u8, 220u8, 125u8, 115u8, 167u8, 140u8, 3u8, 20u8, 132u8, 81u8, 120u8, 215u8, 166u8, 230u8, 56u8, 16u8, 222u8, 31u8, 153u8, 120u8, 62u8, 153u8, 67u8, 220u8, 239u8, 11u8, 234u8, 127u8, 122u8, - ] - { - let call = Chill {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "(Re-)set the payment target for a controller."] #[doc = ""] @@ -6771,37 +4471,20 @@ pub mod api { pub fn set_payee( &self, payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPayee, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 185u8, 62u8, 154u8, 65u8, 135u8, 104u8, 38u8, 171u8, 237u8, - 16u8, 169u8, 38u8, 53u8, 161u8, 170u8, 232u8, 249u8, 185u8, - 24u8, 155u8, 54u8, 88u8, 96u8, 147u8, 171u8, 85u8, 216u8, - 240u8, 52u8, 158u8, 134u8, 72u8, - ] - { - let call = SetPayee { payee }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_payee", + SetPayee { payee }, + [ + 96u8, 8u8, 254u8, 164u8, 87u8, 46u8, 120u8, 11u8, 197u8, + 63u8, 20u8, 178u8, 167u8, 236u8, 149u8, 245u8, 14u8, 171u8, + 108u8, 195u8, 250u8, 133u8, 0u8, 75u8, 192u8, 159u8, 84u8, + 220u8, 242u8, 133u8, 60u8, 62u8, + ], + ) } #[doc = "(Re-)set the controller of a stash."] #[doc = ""] @@ -6821,39 +4504,22 @@ pub mod api { #[doc = "# "] pub fn set_controller( &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetController, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 239u8, 105u8, 43u8, 234u8, 201u8, 103u8, 93u8, 252u8, 26u8, - 52u8, 27u8, 23u8, 219u8, 153u8, 195u8, 150u8, 244u8, 13u8, - 24u8, 241u8, 199u8, 160u8, 119u8, 37u8, 55u8, 239u8, 142u8, - 16u8, 80u8, 45u8, 20u8, 233u8, - ] - { - let call = SetController { controller }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_controller", + SetController { controller }, + [ + 165u8, 250u8, 213u8, 32u8, 179u8, 163u8, 15u8, 35u8, 14u8, + 152u8, 56u8, 171u8, 43u8, 101u8, 7u8, 167u8, 178u8, 60u8, + 89u8, 186u8, 59u8, 28u8, 82u8, 159u8, 13u8, 96u8, 168u8, + 123u8, 194u8, 212u8, 205u8, 184u8, + ], + ) } #[doc = "Sets the ideal number of validators."] #[doc = ""] @@ -6866,35 +4532,18 @@ pub mod api { pub fn set_validator_count( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidatorCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 181u8, 82u8, 21u8, 239u8, 81u8, 194u8, 166u8, 66u8, 55u8, - 156u8, 68u8, 22u8, 76u8, 251u8, 241u8, 113u8, 168u8, 8u8, - 193u8, 125u8, 112u8, 82u8, 200u8, 139u8, 55u8, 139u8, 22u8, - 35u8, 171u8, 124u8, 112u8, 52u8, - ] - { - let call = SetValidatorCount { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_validator_count", + SetValidatorCount { new }, + [ + 55u8, 232u8, 95u8, 66u8, 228u8, 217u8, 11u8, 27u8, 3u8, + 202u8, 199u8, 242u8, 70u8, 160u8, 250u8, 187u8, 194u8, 91u8, + 15u8, 36u8, 215u8, 36u8, 160u8, 108u8, 251u8, 60u8, 240u8, + 202u8, 249u8, 235u8, 28u8, 94u8, + ], + ) } #[doc = "Increments the ideal number of validators."] #[doc = ""] @@ -6906,35 +4555,19 @@ pub mod api { pub fn increase_validator_count( &self, additional: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncreaseValidatorCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 219u8, 143u8, 69u8, 205u8, 182u8, 155u8, 101u8, 39u8, 59u8, - 214u8, 81u8, 47u8, 247u8, 54u8, 106u8, 92u8, 183u8, 42u8, - 30u8, 57u8, 28u8, 136u8, 13u8, 13u8, 170u8, 101u8, 216u8, - 234u8, 194u8, 90u8, 248u8, 234u8, - ] - { - let call = IncreaseValidatorCount { additional }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "increase_validator_count", + IncreaseValidatorCount { additional }, + [ + 239u8, 184u8, 155u8, 213u8, 25u8, 22u8, 193u8, 13u8, 102u8, + 192u8, 82u8, 153u8, 249u8, 192u8, 60u8, 158u8, 8u8, 78u8, + 175u8, 219u8, 46u8, 51u8, 222u8, 193u8, 193u8, 201u8, 78u8, + 90u8, 58u8, 86u8, 196u8, 17u8, + ], + ) } #[doc = "Scale up the ideal number of validators by a factor."] #[doc = ""] @@ -6946,35 +4579,18 @@ pub mod api { pub fn scale_validator_count( &self, factor: runtime_types::sp_arithmetic::per_things::Percent, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScaleValidatorCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 170u8, 156u8, 101u8, 109u8, 117u8, 199u8, 38u8, 157u8, 132u8, - 210u8, 54u8, 66u8, 251u8, 10u8, 123u8, 120u8, 237u8, 31u8, - 206u8, 176u8, 224u8, 112u8, 82u8, 70u8, 152u8, 6u8, 166u8, - 118u8, 10u8, 172u8, 254u8, 148u8, - ] - { - let call = ScaleValidatorCount { factor }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "scale_validator_count", + ScaleValidatorCount { factor }, + [ + 198u8, 68u8, 227u8, 94u8, 110u8, 157u8, 209u8, 217u8, 112u8, + 37u8, 78u8, 142u8, 12u8, 193u8, 219u8, 167u8, 149u8, 112u8, + 49u8, 139u8, 74u8, 81u8, 172u8, 72u8, 253u8, 224u8, 56u8, + 194u8, 185u8, 90u8, 87u8, 125u8, + ], + ) } #[doc = "Force there to be no new eras indefinitely."] #[doc = ""] @@ -6991,37 +4607,18 @@ pub mod api { #[doc = "- Weight: O(1)"] #[doc = "- Write: ForceEra"] #[doc = "# "] - pub fn force_no_eras( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNoEras, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn force_no_eras(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_no_eras", + ForceNoEras {}, + [ 16u8, 81u8, 207u8, 168u8, 23u8, 236u8, 11u8, 75u8, 141u8, 107u8, 92u8, 2u8, 53u8, 111u8, 252u8, 116u8, 91u8, 120u8, 75u8, 24u8, 125u8, 53u8, 9u8, 28u8, 242u8, 87u8, 245u8, 55u8, 40u8, 103u8, 151u8, 178u8, - ] - { - let call = ForceNoEras {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] #[doc = "reset to normal (non-forced) behaviour."] @@ -7039,113 +4636,62 @@ pub mod api { #[doc = "- Weight: O(1)"] #[doc = "- Write ForceEra"] #[doc = "# "] - pub fn force_new_era( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNewEra, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn force_new_era(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_new_era", + ForceNewEra {}, + [ 230u8, 242u8, 169u8, 196u8, 78u8, 145u8, 24u8, 191u8, 113u8, 68u8, 5u8, 138u8, 48u8, 51u8, 109u8, 126u8, 73u8, 136u8, 162u8, 158u8, 174u8, 201u8, 213u8, 230u8, 215u8, 44u8, 200u8, 32u8, 75u8, 27u8, 23u8, 254u8, - ] - { - let call = ForceNewEra {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Set the validators who cannot be slashed (if any)."] #[doc = ""] #[doc = "The dispatch origin must be Root."] pub fn set_invulnerables( &self, - invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetInvulnerables, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 0u8, 119u8, 27u8, 243u8, 238u8, 65u8, 133u8, 89u8, 210u8, - 202u8, 154u8, 243u8, 168u8, 158u8, 9u8, 147u8, 146u8, 215u8, - 172u8, 28u8, 171u8, 183u8, 112u8, 42u8, 245u8, 232u8, 238u8, - 94u8, 205u8, 46u8, 0u8, 20u8, - ] - { - let call = SetInvulnerables { invulnerables }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + invulnerables: ::std::vec::Vec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_invulnerables", + SetInvulnerables { invulnerables }, + [ + 2u8, 148u8, 221u8, 111u8, 153u8, 48u8, 222u8, 36u8, 228u8, + 84u8, 18u8, 35u8, 168u8, 239u8, 53u8, 245u8, 27u8, 76u8, + 18u8, 203u8, 206u8, 9u8, 8u8, 81u8, 35u8, 224u8, 22u8, 133u8, + 58u8, 99u8, 103u8, 39u8, + ], + ) } #[doc = "Force a current staker to become completely unstaked, immediately."] #[doc = ""] #[doc = "The dispatch origin must be Root."] pub fn force_unstake( &self, - stash: ::subxt::sp_core::crypto::AccountId32, + stash: ::subxt::ext::sp_core::crypto::AccountId32, num_slashing_spans: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnstake, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 254u8, 115u8, 250u8, 15u8, 235u8, 119u8, 2u8, 131u8, 237u8, - 144u8, 247u8, 66u8, 150u8, 92u8, 12u8, 112u8, 137u8, 195u8, - 246u8, 178u8, 129u8, 64u8, 214u8, 4u8, 183u8, 18u8, 94u8, - 104u8, 157u8, 174u8, 231u8, 1u8, - ] - { - let call = ForceUnstake { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_unstake", + ForceUnstake { stash, num_slashing_spans, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 94u8, 247u8, 238u8, 47u8, 250u8, 6u8, 96u8, 175u8, 173u8, + 123u8, 161u8, 187u8, 162u8, 214u8, 176u8, 233u8, 33u8, 33u8, + 167u8, 239u8, 40u8, 223u8, 19u8, 131u8, 230u8, 39u8, 175u8, + 200u8, 36u8, 182u8, 76u8, 207u8, + ], + ) } #[doc = "Force there to be a new era at the end of sessions indefinitely."] #[doc = ""] @@ -7158,35 +4704,18 @@ pub mod api { #[doc = "have enough blocks to get a result."] pub fn force_new_era_always( &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNewEraAlways, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_new_era_always", + ForceNewEraAlways {}, + [ 179u8, 118u8, 189u8, 54u8, 248u8, 141u8, 207u8, 142u8, 80u8, 37u8, 241u8, 185u8, 138u8, 254u8, 117u8, 147u8, 225u8, 118u8, 34u8, 177u8, 197u8, 158u8, 8u8, 82u8, 202u8, 108u8, 208u8, 26u8, 64u8, 33u8, 74u8, 43u8, - ] - { - let call = ForceNewEraAlways {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Cancel enactment of a deferred slash."] #[doc = ""] @@ -7197,35 +4726,18 @@ pub mod api { &self, era: ::core::primitive::u32, slash_indices: ::std::vec::Vec<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelDeferredSlash, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 217u8, 175u8, 246u8, 108u8, 78u8, 134u8, 98u8, 49u8, 178u8, - 209u8, 98u8, 178u8, 52u8, 242u8, 173u8, 135u8, 171u8, 70u8, - 129u8, 239u8, 62u8, 150u8, 84u8, 142u8, 243u8, 193u8, 179u8, - 249u8, 114u8, 231u8, 8u8, 252u8, - ] - { - let call = CancelDeferredSlash { era, slash_indices }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "cancel_deferred_slash", + CancelDeferredSlash { era, slash_indices }, + [ + 120u8, 57u8, 162u8, 105u8, 91u8, 250u8, 129u8, 240u8, 110u8, + 234u8, 170u8, 98u8, 164u8, 65u8, 106u8, 101u8, 19u8, 88u8, + 146u8, 210u8, 171u8, 44u8, 37u8, 50u8, 65u8, 178u8, 37u8, + 223u8, 239u8, 197u8, 116u8, 168u8, + ], + ) } #[doc = "Pay out all the stakers behind a single validator for a single era."] #[doc = ""] @@ -7250,40 +4762,23 @@ pub mod api { #[doc = "# "] pub fn payout_stakers( &self, - validator_stash: ::subxt::sp_core::crypto::AccountId32, + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, era: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PayoutStakers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 65u8, 65u8, 249u8, 162u8, 235u8, 127u8, 48u8, 216u8, - 51u8, 252u8, 111u8, 186u8, 191u8, 174u8, 245u8, 144u8, 77u8, - 135u8, 124u8, 205u8, 160u8, 148u8, 130u8, 81u8, 213u8, 195u8, - 105u8, 21u8, 65u8, 186u8, 157u8, - ] - { - let call = PayoutStakers { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "payout_stakers", + PayoutStakers { validator_stash, era, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 184u8, 194u8, 33u8, 118u8, 7u8, 203u8, 89u8, 119u8, 214u8, + 76u8, 178u8, 20u8, 82u8, 111u8, 57u8, 132u8, 212u8, 43u8, + 232u8, 91u8, 252u8, 49u8, 42u8, 115u8, 1u8, 181u8, 154u8, + 207u8, 144u8, 206u8, 205u8, 33u8, + ], + ) } #[doc = "Rebond a portion of the stash scheduled to be unlocked."] #[doc = ""] @@ -7297,35 +4792,18 @@ pub mod api { pub fn rebond( &self, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Rebond, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 138u8, 156u8, 164u8, 170u8, 178u8, 236u8, 221u8, 242u8, - 157u8, 176u8, 173u8, 145u8, 254u8, 94u8, 158u8, 27u8, 138u8, - 103u8, 116u8, 31u8, 41u8, 106u8, 199u8, 180u8, 233u8, 172u8, - 38u8, 7u8, 76u8, 29u8, 5u8, 225u8, - ] - { - let call = Rebond { value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "rebond", + Rebond { value }, + [ + 25u8, 22u8, 191u8, 172u8, 133u8, 101u8, 139u8, 102u8, 134u8, + 16u8, 136u8, 56u8, 137u8, 162u8, 4u8, 253u8, 196u8, 30u8, + 234u8, 49u8, 102u8, 68u8, 145u8, 96u8, 148u8, 219u8, 162u8, + 17u8, 177u8, 184u8, 34u8, 113u8, + ], + ) } #[doc = "Set `HistoryDepth` value. This function will delete any history information"] #[doc = "when `HistoryDepth` is reduced."] @@ -7353,38 +4831,21 @@ pub mod api { &self, new_history_depth: ::core::primitive::u32, era_items_deleted: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHistoryDepth, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 128u8, 149u8, 139u8, 192u8, 213u8, 239u8, 248u8, 215u8, 57u8, - 145u8, 177u8, 225u8, 43u8, 214u8, 228u8, 14u8, 213u8, 181u8, - 18u8, 40u8, 242u8, 1u8, 210u8, 87u8, 143u8, 78u8, 0u8, 23u8, - 145u8, 46u8, 210u8, 168u8, - ] - { - let call = SetHistoryDepth { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_history_depth", + SetHistoryDepth { new_history_depth, era_items_deleted, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 174u8, 55u8, 231u8, 132u8, 219u8, 215u8, 118u8, 202u8, 13u8, + 151u8, 193u8, 248u8, 141u8, 180u8, 56u8, 103u8, 90u8, 182u8, + 194u8, 198u8, 120u8, 251u8, 143u8, 218u8, 81u8, 59u8, 13u8, + 161u8, 247u8, 57u8, 178u8, 122u8, + ], + ) } #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] #[doc = "be considered `dust` in the staking system. The requirements are:"] @@ -7400,40 +4861,23 @@ pub mod api { #[doc = "Refunds the transaction fees upon successful execution."] pub fn reap_stash( &self, - stash: ::subxt::sp_core::crypto::AccountId32, + stash: ::subxt::ext::sp_core::crypto::AccountId32, num_slashing_spans: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReapStash, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 84u8, 192u8, 207u8, 193u8, 133u8, 53u8, 93u8, 148u8, 153u8, - 112u8, 54u8, 145u8, 68u8, 195u8, 42u8, 158u8, 17u8, 230u8, - 197u8, 218u8, 179u8, 101u8, 237u8, 105u8, 17u8, 232u8, 125u8, - 163u8, 209u8, 134u8, 3u8, 248u8, - ] - { - let call = ReapStash { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "reap_stash", + ReapStash { stash, num_slashing_spans, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 34u8, 168u8, 120u8, 161u8, 95u8, 199u8, 106u8, 233u8, 61u8, + 240u8, 166u8, 31u8, 183u8, 165u8, 158u8, 179u8, 32u8, 130u8, + 27u8, 164u8, 112u8, 44u8, 14u8, 125u8, 227u8, 87u8, 70u8, + 203u8, 194u8, 24u8, 212u8, 177u8, + ], + ) } #[doc = "Remove the given nominations from the calling validator."] #[doc = ""] @@ -7449,40 +4893,23 @@ pub mod api { pub fn kick( &self, who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Kick, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 145u8, 201u8, 168u8, 147u8, 25u8, 39u8, 62u8, 48u8, 236u8, - 44u8, 45u8, 233u8, 178u8, 196u8, 117u8, 117u8, 74u8, 193u8, - 131u8, 101u8, 210u8, 40u8, 18u8, 207u8, 99u8, 160u8, 103u8, - 89u8, 69u8, 72u8, 155u8, 89u8, - ] - { - let call = Kick { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "kick", + Kick { who }, + [ + 32u8, 26u8, 202u8, 6u8, 186u8, 180u8, 58u8, 121u8, 185u8, + 208u8, 123u8, 10u8, 53u8, 179u8, 167u8, 203u8, 96u8, 229u8, + 7u8, 144u8, 231u8, 172u8, 145u8, 141u8, 162u8, 180u8, 212u8, + 42u8, 34u8, 5u8, 199u8, 82u8, + ], + ) } #[doc = "Update the various staking configurations ."] #[doc = ""] @@ -7509,42 +4936,25 @@ pub mod api { max_validator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, chill_threshold : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Percent >, min_commission : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Perbill >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetStakingConfigs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 249u8, 192u8, 107u8, 126u8, 200u8, 50u8, 63u8, 120u8, 116u8, - 53u8, 183u8, 80u8, 134u8, 135u8, 49u8, 112u8, 232u8, 140u8, - 177u8, 175u8, 136u8, 220u8, 209u8, 179u8, 219u8, 110u8, 19u8, - 165u8, 191u8, 173u8, 65u8, 13u8, - ] - { - let call = SetStakingConfigs { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_staking_configs", + SetStakingConfigs { min_nominator_bond, min_validator_bond, max_nominator_count, max_validator_count, chill_threshold, min_commission, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 176u8, 168u8, 155u8, 176u8, 27u8, 79u8, 223u8, 92u8, 88u8, + 93u8, 223u8, 69u8, 179u8, 250u8, 138u8, 138u8, 87u8, 220u8, + 36u8, 3u8, 126u8, 213u8, 16u8, 68u8, 3u8, 16u8, 218u8, 151u8, + 98u8, 169u8, 217u8, 75u8, + ], + ) } #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] #[doc = ""] @@ -7574,72 +4984,39 @@ pub mod api { #[doc = "who do not satisfy these requirements."] pub fn chill_other( &self, - controller: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ChillOther, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 219u8, 114u8, 146u8, 43u8, 175u8, 216u8, 70u8, 148u8, 137u8, - 192u8, 77u8, 247u8, 134u8, 80u8, 188u8, 100u8, 79u8, 141u8, - 32u8, 94u8, 15u8, 178u8, 159u8, 233u8, 235u8, 6u8, 243u8, - 253u8, 22u8, 145u8, 146u8, 219u8, - ] - { - let call = ChillOther { controller }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + controller: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "chill_other", + ChillOther { controller }, + [ + 140u8, 98u8, 4u8, 203u8, 91u8, 131u8, 123u8, 119u8, 169u8, + 47u8, 188u8, 23u8, 205u8, 170u8, 82u8, 220u8, 166u8, 170u8, + 135u8, 176u8, 68u8, 228u8, 14u8, 67u8, 42u8, 52u8, 140u8, + 231u8, 62u8, 167u8, 80u8, 173u8, + ], + ) } #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] #[doc = "can call this."] pub fn force_apply_min_commission( &self, - validator_stash: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceApplyMinCommission, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 8u8, 57u8, 61u8, 141u8, 175u8, 100u8, 174u8, 161u8, 236u8, - 2u8, 133u8, 169u8, 249u8, 168u8, 236u8, 188u8, 168u8, 221u8, - 88u8, 148u8, 95u8, 24u8, 214u8, 206u8, 165u8, 170u8, 200u8, - 134u8, 38u8, 174u8, 187u8, 119u8, - ] - { - let call = ForceApplyMinCommission { validator_stash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_apply_min_commission", + ForceApplyMinCommission { validator_stash }, + [ + 136u8, 163u8, 85u8, 134u8, 240u8, 247u8, 183u8, 227u8, 226u8, + 202u8, 102u8, 186u8, 138u8, 119u8, 78u8, 123u8, 229u8, 135u8, + 129u8, 241u8, 119u8, 106u8, 41u8, 182u8, 121u8, 181u8, 242u8, + 175u8, 74u8, 207u8, 64u8, 106u8, + ], + ) } } } @@ -7647,7 +5024,11 @@ pub mod api { pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] #[doc = "the remainder from the maximum amount of reward."] #[doc = "\\[era_index, validator_payout, remainder\\]"] @@ -7656,612 +5037,179 @@ pub mod api { pub ::core::primitive::u128, pub ::core::primitive::u128, ); - impl ::subxt::Event for EraPaid { + impl ::subxt::events::StaticEvent for EraPaid { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "EraPaid"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] pub struct Rewarded( - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, pub ::core::primitive::u128, ); - impl ::subxt::Event for Rewarded { + impl ::subxt::events::StaticEvent for Rewarded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Rewarded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "One validator (and its nominators) has been slashed by the given amount."] #[doc = "\\[validator, amount\\]"] pub struct Slashed( - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, pub ::core::primitive::u128, ); - impl ::subxt::Event for Slashed { + impl ::subxt::events::StaticEvent for Slashed { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Slashed"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "An old slashing report from a prior era was discarded because it could"] #[doc = "not be processed. \\[session_index\\]"] pub struct OldSlashingReportDiscarded(pub ::core::primitive::u32); - impl ::subxt::Event for OldSlashingReportDiscarded { + impl ::subxt::events::StaticEvent for OldSlashingReportDiscarded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "OldSlashingReportDiscarded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new set of stakers was elected."] pub struct StakersElected; - impl ::subxt::Event for StakersElected { + impl ::subxt::events::StaticEvent for StakersElected { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "StakersElected"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has bonded this amount. \\[stash, amount\\]"] #[doc = ""] #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] #[doc = "it will not be emitted for staking rewards when they are added to stake."] pub struct Bonded( - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, pub ::core::primitive::u128, ); - impl ::subxt::Event for Bonded { + impl ::subxt::events::StaticEvent for Bonded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Bonded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] pub struct Unbonded( - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, pub ::core::primitive::u128, ); - impl ::subxt::Event for Unbonded { + impl ::subxt::events::StaticEvent for Unbonded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Unbonded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] #[doc = "from the unlocking queue. \\[stash, amount\\]"] pub struct Withdrawn( - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, pub ::core::primitive::u128, ); - impl ::subxt::Event for Withdrawn { + impl ::subxt::events::StaticEvent for Withdrawn { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Withdrawn"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] pub struct Kicked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, ); - impl ::subxt::Event for Kicked { + impl ::subxt::events::StaticEvent for Kicked { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Kicked"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The election failed. No new era is planned."] pub struct StakingElectionFailed; - impl ::subxt::Event for StakingElectionFailed { + impl ::subxt::events::StaticEvent for StakingElectionFailed { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "StakingElectionFailed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has stopped participating as either a validator or nominator."] #[doc = "\\[stash\\]"] - pub struct Chilled(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Chilled { + pub struct Chilled(pub ::subxt::ext::sp_core::crypto::AccountId32); + impl ::subxt::events::StaticEvent for Chilled { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Chilled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] pub struct PayoutStarted( pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, ); - impl ::subxt::Event for PayoutStarted { + impl ::subxt::events::StaticEvent for PayoutStarted { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "PayoutStarted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A validator has set their preferences."] pub struct ValidatorPrefsSet( - pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, pub runtime_types::pallet_staking::ValidatorPrefs, ); - impl ::subxt::Event for ValidatorPrefsSet { + impl ::subxt::events::StaticEvent for ValidatorPrefsSet { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "ValidatorPrefsSet"; } } pub mod storage { use super::runtime_types; - pub struct HistoryDepth; - impl ::subxt::StorageEntry for HistoryDepth { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "HistoryDepth"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorCount; - impl ::subxt::StorageEntry for ValidatorCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ValidatorCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MinimumValidatorCount; - impl ::subxt::StorageEntry for MinimumValidatorCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinimumValidatorCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Invulnerables; - impl ::subxt::StorageEntry for Invulnerables { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Invulnerables"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bonded<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Bonded<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Bonded"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MinNominatorBond; - impl ::subxt::StorageEntry for MinNominatorBond { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinNominatorBond"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MinValidatorBond; - impl ::subxt::StorageEntry for MinValidatorBond { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinValidatorBond"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MinCommission; - impl ::subxt::StorageEntry for MinCommission { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinCommission"; - type Value = runtime_types::sp_arithmetic::per_things::Perbill; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Ledger<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Ledger<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Ledger"; - type Value = runtime_types::pallet_staking::StakingLedger; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Payee<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Payee<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Payee"; - type Value = runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Validators<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Validators<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Validators"; - type Value = runtime_types::pallet_staking::ValidatorPrefs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CounterForValidators; - impl ::subxt::StorageEntry for CounterForValidators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CounterForValidators"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxValidatorsCount; - impl ::subxt::StorageEntry for MaxValidatorsCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MaxValidatorsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Nominators<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Nominators<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Nominators"; - type Value = runtime_types::pallet_staking::Nominations; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CounterForNominators; - impl ::subxt::StorageEntry for CounterForNominators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CounterForNominators"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxNominatorsCount; - impl ::subxt::StorageEntry for MaxNominatorsCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MaxNominatorsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentEra; - impl ::subxt::StorageEntry for CurrentEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CurrentEra"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveEra; - impl ::subxt::StorageEntry for ActiveEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ActiveEra"; - type Value = runtime_types::pallet_staking::ActiveEraInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ErasStartSessionIndex<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasStartSessionIndex<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStartSessionIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasStakers<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ErasStakers<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStakers"; - type Value = runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ErasStakersClipped<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ErasStakersClipped<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStakersClipped"; - type Value = runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ErasValidatorPrefs<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ErasValidatorPrefs<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasValidatorPrefs"; - type Value = runtime_types::pallet_staking::ValidatorPrefs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ErasValidatorReward<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasValidatorReward<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasValidatorReward"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasRewardPoints<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasRewardPoints<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasRewardPoints"; - type Value = runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasTotalStake<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasTotalStake<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasTotalStake"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ForceEra; - impl ::subxt::StorageEntry for ForceEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ForceEra"; - type Value = runtime_types::pallet_staking::Forcing; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SlashRewardFraction; - impl ::subxt::StorageEntry for SlashRewardFraction { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SlashRewardFraction"; - type Value = runtime_types::sp_arithmetic::per_things::Perbill; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CanceledSlashPayout; - impl ::subxt::StorageEntry for CanceledSlashPayout { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CanceledSlashPayout"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnappliedSlashes<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for UnappliedSlashes<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "UnappliedSlashes"; - type Value = ::std::vec::Vec< - runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BondedEras; - impl ::subxt::StorageEntry for BondedEras { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "BondedEras"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorSlashInEra<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ValidatorSlashInEra<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ValidatorSlashInEra"; - type Value = ( - runtime_types::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct NominatorSlashInEra<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for NominatorSlashInEra<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "NominatorSlashInEra"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct SlashingSpans<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SlashingSpans<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SlashingSpans"; - type Value = runtime_types::pallet_staking::slashing::SlashingSpans; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct SpanSlash<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for SpanSlash<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SpanSlash"; - type Value = runtime_types::pallet_staking::slashing::SpanRecord< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct EarliestUnappliedSlash; - impl ::subxt::StorageEntry for EarliestUnappliedSlash { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "EarliestUnappliedSlash"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentPlannedSession; - impl ::subxt::StorageEntry for CurrentPlannedSession { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CurrentPlannedSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct OffendingValidators; - impl ::subxt::StorageEntry for OffendingValidators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "OffendingValidators"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_staking::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ChillThreshold; - impl ::subxt::StorageEntry for ChillThreshold { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ChillThreshold"; - type Value = runtime_types::sp_arithmetic::per_things::Percent; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Number of eras to keep in history."] #[doc = ""] #[doc = " Information is kept for eras in `[current_era - history_depth; current_era]`."] @@ -8271,607 +5219,405 @@ pub mod api { #[doc = " guaranteed."] pub fn history_depth( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 41u8, 54u8, 118u8, 245u8, 75u8, 136u8, 220u8, 25u8, 55u8, - 255u8, 149u8, 177u8, 49u8, 155u8, 167u8, 188u8, 170u8, - 29u8, 251u8, 44u8, 240u8, 250u8, 225u8, 205u8, 102u8, - 74u8, 25u8, 47u8, 52u8, 235u8, 204u8, 167u8, - ] - { - let entry = HistoryDepth; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "HistoryDepth", + vec![], + [ + 41u8, 54u8, 118u8, 245u8, 75u8, 136u8, 220u8, 25u8, 55u8, + 255u8, 149u8, 177u8, 49u8, 155u8, 167u8, 188u8, 170u8, 29u8, + 251u8, 44u8, 240u8, 250u8, 225u8, 205u8, 102u8, 74u8, 25u8, + 47u8, 52u8, 235u8, 204u8, 167u8, + ], + ) } #[doc = " The ideal number of staking participants."] pub fn validator_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 245u8, 75u8, 214u8, 110u8, 66u8, 164u8, 86u8, 206u8, - 69u8, 89u8, 12u8, 111u8, 117u8, 16u8, 228u8, 184u8, - 207u8, 6u8, 0u8, 126u8, 221u8, 67u8, 125u8, 218u8, 188u8, - 245u8, 156u8, 188u8, 34u8, 85u8, 208u8, 197u8, - ] - { - let entry = ValidatorCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ValidatorCount", + vec![], + [ + 245u8, 75u8, 214u8, 110u8, 66u8, 164u8, 86u8, 206u8, 69u8, + 89u8, 12u8, 111u8, 117u8, 16u8, 228u8, 184u8, 207u8, 6u8, + 0u8, 126u8, 221u8, 67u8, 125u8, 218u8, 188u8, 245u8, 156u8, + 188u8, 34u8, 85u8, 208u8, 197u8, + ], + ) } #[doc = " Minimum number of staking participants before emergency conditions are imposed."] pub fn minimum_validator_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 82u8, 95u8, 128u8, 55u8, 136u8, 134u8, 71u8, 117u8, - 135u8, 76u8, 44u8, 46u8, 174u8, 34u8, 170u8, 228u8, - 175u8, 1u8, 234u8, 162u8, 91u8, 252u8, 127u8, 68u8, - 243u8, 241u8, 13u8, 107u8, 214u8, 70u8, 87u8, 249u8, - ] - { - let entry = MinimumValidatorCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinimumValidatorCount", + vec![], + [ + 82u8, 95u8, 128u8, 55u8, 136u8, 134u8, 71u8, 117u8, 135u8, + 76u8, 44u8, 46u8, 174u8, 34u8, 170u8, 228u8, 175u8, 1u8, + 234u8, 162u8, 91u8, 252u8, 127u8, 68u8, 243u8, 241u8, 13u8, + 107u8, 214u8, 70u8, 87u8, 249u8, + ], + ) } #[doc = " Any validators that may never be slashed or forcibly kicked. It's a Vec since they're"] #[doc = " easy to initialize and the performance hit is minimal (we expect no more than four"] #[doc = " invulnerables) and restricted to testnets."] pub fn invulnerables( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 93u8, 29u8, 166u8, 244u8, 19u8, 78u8, 182u8, - 235u8, 37u8, 199u8, 127u8, 211u8, 124u8, 168u8, 145u8, - 111u8, 251u8, 33u8, 36u8, 167u8, 119u8, 124u8, 206u8, - 205u8, 14u8, 186u8, 68u8, 16u8, 150u8, 45u8, 158u8, - ] - { - let entry = Invulnerables; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Invulnerables", + vec![], + [ + 77u8, 78u8, 63u8, 199u8, 150u8, 167u8, 135u8, 130u8, 192u8, + 51u8, 202u8, 119u8, 68u8, 49u8, 241u8, 68u8, 82u8, 90u8, + 226u8, 201u8, 96u8, 170u8, 21u8, 173u8, 236u8, 116u8, 148u8, + 8u8, 174u8, 92u8, 7u8, 11u8, + ], + ) } #[doc = " Map from all locked \"stash\" accounts to the controller account."] pub fn bonded( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 9u8, 214u8, 190u8, 93u8, 116u8, 143u8, 174u8, 103u8, - 102u8, 25u8, 123u8, 201u8, 12u8, 44u8, 188u8, 241u8, - 74u8, 33u8, 35u8, 79u8, 210u8, 243u8, 174u8, 190u8, 46u8, - 48u8, 21u8, 10u8, 243u8, 16u8, 99u8, 48u8, - ] - { - let entry = Bonded(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Bonded", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 35u8, 197u8, 156u8, 60u8, 22u8, 59u8, 103u8, 83u8, 77u8, + 15u8, 118u8, 193u8, 155u8, 97u8, 229u8, 36u8, 119u8, 128u8, + 224u8, 162u8, 21u8, 46u8, 199u8, 221u8, 15u8, 74u8, 59u8, + 70u8, 77u8, 218u8, 73u8, 165u8, + ], + ) } #[doc = " Map from all locked \"stash\" accounts to the controller account."] - pub fn bonded_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Bonded<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 9u8, 214u8, 190u8, 93u8, 116u8, 143u8, 174u8, 103u8, - 102u8, 25u8, 123u8, 201u8, 12u8, 44u8, 188u8, 241u8, - 74u8, 33u8, 35u8, 79u8, 210u8, 243u8, 174u8, 190u8, 46u8, - 48u8, 21u8, 10u8, 243u8, 16u8, 99u8, 48u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn bonded_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Bonded", + Vec::new(), + [ + 35u8, 197u8, 156u8, 60u8, 22u8, 59u8, 103u8, 83u8, 77u8, + 15u8, 118u8, 193u8, 155u8, 97u8, 229u8, 36u8, 119u8, 128u8, + 224u8, 162u8, 21u8, 46u8, 199u8, 221u8, 15u8, 74u8, 59u8, + 70u8, 77u8, 218u8, 73u8, 165u8, + ], + ) } #[doc = " The minimum active bond to become and maintain the role of a nominator."] pub fn min_nominator_bond( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 187u8, 66u8, 149u8, 226u8, 72u8, 219u8, 57u8, 246u8, - 102u8, 47u8, 71u8, 12u8, 219u8, 204u8, 127u8, 223u8, - 58u8, 134u8, 81u8, 165u8, 200u8, 142u8, 196u8, 158u8, - 26u8, 38u8, 165u8, 19u8, 91u8, 251u8, 119u8, 84u8, - ] - { - let entry = MinNominatorBond; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinNominatorBond", + vec![], + [ + 187u8, 66u8, 149u8, 226u8, 72u8, 219u8, 57u8, 246u8, 102u8, + 47u8, 71u8, 12u8, 219u8, 204u8, 127u8, 223u8, 58u8, 134u8, + 81u8, 165u8, 200u8, 142u8, 196u8, 158u8, 26u8, 38u8, 165u8, + 19u8, 91u8, 251u8, 119u8, 84u8, + ], + ) } #[doc = " The minimum active bond to become and maintain the role of a validator."] pub fn min_validator_bond( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 48u8, 105u8, 85u8, 178u8, 142u8, 208u8, 208u8, 19u8, - 236u8, 130u8, 129u8, 169u8, 35u8, 245u8, 66u8, 182u8, - 92u8, 20u8, 22u8, 109u8, 155u8, 174u8, 87u8, 118u8, - 242u8, 216u8, 193u8, 154u8, 4u8, 5u8, 66u8, 56u8, - ] - { - let entry = MinValidatorBond; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinValidatorBond", + vec![], + [ + 48u8, 105u8, 85u8, 178u8, 142u8, 208u8, 208u8, 19u8, 236u8, + 130u8, 129u8, 169u8, 35u8, 245u8, 66u8, 182u8, 92u8, 20u8, + 22u8, 109u8, 155u8, 174u8, 87u8, 118u8, 242u8, 216u8, 193u8, + 154u8, 4u8, 5u8, 66u8, 56u8, + ], + ) } #[doc = " The minimum amount of commission that validators can set."] #[doc = ""] #[doc = " If set to `0`, no limit exists."] pub fn min_commission( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 198u8, 29u8, 53u8, 56u8, 181u8, 170u8, 164u8, 240u8, - 27u8, 171u8, 69u8, 57u8, 151u8, 40u8, 23u8, 166u8, 157u8, - 68u8, 208u8, 20u8, 2u8, 78u8, 63u8, 235u8, 166u8, 50u8, - 3u8, 246u8, 237u8, 146u8, 170u8, 91u8, - ] - { - let entry = MinCommission; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinCommission", + vec![], + [ + 61u8, 101u8, 69u8, 27u8, 220u8, 179u8, 5u8, 71u8, 66u8, + 227u8, 84u8, 98u8, 18u8, 141u8, 183u8, 49u8, 98u8, 46u8, + 123u8, 114u8, 198u8, 85u8, 15u8, 175u8, 243u8, 239u8, 133u8, + 129u8, 146u8, 174u8, 254u8, 158u8, + ], + ) } #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] pub fn ledger( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::StakingLedger, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 54u8, 158u8, 148u8, 211u8, 91u8, 48u8, 159u8, 56u8, - 149u8, 116u8, 43u8, 31u8, 45u8, 102u8, 252u8, 12u8, 1u8, - 176u8, 189u8, 68u8, 97u8, 88u8, 13u8, 204u8, 148u8, 12u8, - 34u8, 0u8, 180u8, 162u8, 202u8, 8u8, - ] - { - let entry = Ledger(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::StakingLedger, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Ledger", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 117u8, 177u8, 209u8, 237u8, 0u8, 30u8, 228u8, 128u8, 150u8, + 69u8, 138u8, 21u8, 9u8, 74u8, 178u8, 113u8, 238u8, 111u8, + 57u8, 222u8, 242u8, 241u8, 191u8, 50u8, 225u8, 51u8, 99u8, + 211u8, 210u8, 163u8, 60u8, 205u8, + ], + ) } #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] - pub fn ledger_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Ledger<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 54u8, 158u8, 148u8, 211u8, 91u8, 48u8, 159u8, 56u8, - 149u8, 116u8, 43u8, 31u8, 45u8, 102u8, 252u8, 12u8, 1u8, - 176u8, 189u8, 68u8, 97u8, 88u8, 13u8, 204u8, 148u8, 12u8, - 34u8, 0u8, 180u8, 162u8, 202u8, 8u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn ledger_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::StakingLedger, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Ledger", + Vec::new(), + [ + 117u8, 177u8, 209u8, 237u8, 0u8, 30u8, 228u8, 128u8, 150u8, + 69u8, 138u8, 21u8, 9u8, 74u8, 178u8, 113u8, 238u8, 111u8, + 57u8, 222u8, 242u8, 241u8, 191u8, 50u8, 225u8, 51u8, 99u8, + 211u8, 210u8, 163u8, 60u8, 205u8, + ], + ) } #[doc = " Where the reward payment should be made. Keyed by stash."] pub fn payee( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 108u8, 35u8, 28u8, 189u8, 146u8, 103u8, 200u8, 73u8, - 220u8, 230u8, 193u8, 7u8, 66u8, 147u8, 55u8, 34u8, 1u8, - 21u8, 255u8, 100u8, 64u8, 175u8, 16u8, 106u8, 130u8, - 202u8, 103u8, 62u8, 79u8, 143u8, 115u8, 222u8, - ] - { - let entry = Payee(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Payee", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 195u8, 125u8, 82u8, 213u8, 216u8, 64u8, 76u8, 63u8, 187u8, + 163u8, 20u8, 230u8, 153u8, 13u8, 189u8, 232u8, 119u8, 118u8, + 107u8, 17u8, 102u8, 245u8, 36u8, 42u8, 232u8, 137u8, 177u8, + 165u8, 169u8, 246u8, 199u8, 57u8, + ], + ) } #[doc = " Where the reward payment should be made. Keyed by stash."] - pub fn payee_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Payee<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 108u8, 35u8, 28u8, 189u8, 146u8, 103u8, 200u8, 73u8, - 220u8, 230u8, 193u8, 7u8, 66u8, 147u8, 55u8, 34u8, 1u8, - 21u8, 255u8, 100u8, 64u8, 175u8, 16u8, 106u8, 130u8, - 202u8, 103u8, 62u8, 79u8, 143u8, 115u8, 222u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn payee_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Payee", + Vec::new(), + [ + 195u8, 125u8, 82u8, 213u8, 216u8, 64u8, 76u8, 63u8, 187u8, + 163u8, 20u8, 230u8, 153u8, 13u8, 189u8, 232u8, 119u8, 118u8, + 107u8, 17u8, 102u8, 245u8, 36u8, 42u8, 232u8, 137u8, 177u8, + 165u8, 169u8, 246u8, 199u8, 57u8, + ], + ) } #[doc = " The map from (wannabe) validator stash key to the preferences of that validator."] pub fn validators( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 45u8, 57u8, 106u8, 30u8, 123u8, 251u8, 148u8, 37u8, 52u8, - 129u8, 103u8, 88u8, 54u8, 216u8, 174u8, 181u8, 51u8, - 181u8, 70u8, 6u8, 136u8, 7u8, 239u8, 44u8, 83u8, 153u8, - 124u8, 187u8, 225u8, 112u8, 23u8, 76u8, - ] - { - let entry = Validators(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Validators", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 80u8, 77u8, 66u8, 18u8, 197u8, 250u8, 41u8, 185u8, 43u8, + 24u8, 149u8, 164u8, 208u8, 60u8, 144u8, 29u8, 251u8, 195u8, + 236u8, 196u8, 108u8, 58u8, 80u8, 115u8, 246u8, 66u8, 226u8, + 241u8, 201u8, 172u8, 229u8, 152u8, + ], + ) } #[doc = " The map from (wannabe) validator stash key to the preferences of that validator."] - pub fn validators_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Validators<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 45u8, 57u8, 106u8, 30u8, 123u8, 251u8, 148u8, 37u8, 52u8, - 129u8, 103u8, 88u8, 54u8, 216u8, 174u8, 181u8, 51u8, - 181u8, 70u8, 6u8, 136u8, 7u8, 239u8, 44u8, 83u8, 153u8, - 124u8, 187u8, 225u8, 112u8, 23u8, 76u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn validators_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ValidatorPrefs, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Validators", + Vec::new(), + [ + 80u8, 77u8, 66u8, 18u8, 197u8, 250u8, 41u8, 185u8, 43u8, + 24u8, 149u8, 164u8, 208u8, 60u8, 144u8, 29u8, 251u8, 195u8, + 236u8, 196u8, 108u8, 58u8, 80u8, 115u8, 246u8, 66u8, 226u8, + 241u8, 201u8, 172u8, 229u8, 152u8, + ], + ) } #[doc = "Counter for the related counted storage map"] pub fn counter_for_validators( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 139u8, 25u8, 223u8, 6u8, 160u8, 239u8, 212u8, 85u8, 36u8, - 185u8, 69u8, 63u8, 21u8, 156u8, 144u8, 241u8, 112u8, - 85u8, 49u8, 78u8, 88u8, 11u8, 8u8, 48u8, 118u8, 34u8, - 62u8, 159u8, 239u8, 122u8, 90u8, 45u8, - ] - { - let entry = CounterForValidators; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CounterForValidators", + vec![], + [ + 139u8, 25u8, 223u8, 6u8, 160u8, 239u8, 212u8, 85u8, 36u8, + 185u8, 69u8, 63u8, 21u8, 156u8, 144u8, 241u8, 112u8, 85u8, + 49u8, 78u8, 88u8, 11u8, 8u8, 48u8, 118u8, 34u8, 62u8, 159u8, + 239u8, 122u8, 90u8, 45u8, + ], + ) } #[doc = " The maximum validator count before we stop allowing new validators to join."] #[doc = ""] #[doc = " When this value is not set, no limits are enforced."] pub fn max_validators_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 250u8, 62u8, 16u8, 68u8, 192u8, 216u8, 236u8, 211u8, - 217u8, 9u8, 213u8, 49u8, 41u8, 37u8, 58u8, 62u8, 131u8, - 112u8, 64u8, 26u8, 133u8, 7u8, 130u8, 1u8, 71u8, 158u8, - 14u8, 55u8, 169u8, 239u8, 223u8, 245u8, - ] - { - let entry = MaxValidatorsCount; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MaxValidatorsCount", + vec![], + [ + 250u8, 62u8, 16u8, 68u8, 192u8, 216u8, 236u8, 211u8, 217u8, + 9u8, 213u8, 49u8, 41u8, 37u8, 58u8, 62u8, 131u8, 112u8, 64u8, + 26u8, 133u8, 7u8, 130u8, 1u8, 71u8, 158u8, 14u8, 55u8, 169u8, + 239u8, 223u8, 245u8, + ], + ) } #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] #[doc = " they wish to support."] @@ -8891,40 +5637,29 @@ pub mod api { #[doc = " [`Call::chill_other`] dispatchable by anyone."] pub fn nominators( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::Nominations, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 26u8, 169u8, 68u8, 99u8, 216u8, 95u8, 198u8, 5u8, - 123u8, 21u8, 83u8, 220u8, 140u8, 122u8, 111u8, 22u8, - 133u8, 9u8, 155u8, 35u8, 58u8, 232u8, 143u8, 62u8, 229u8, - 228u8, 98u8, 175u8, 114u8, 152u8, 253u8, - ] - { - let entry = Nominators(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Nominations, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Nominators", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 1u8, 154u8, 55u8, 170u8, 215u8, 64u8, 56u8, 83u8, 254u8, + 19u8, 152u8, 85u8, 164u8, 171u8, 206u8, 129u8, 184u8, 45u8, + 221u8, 181u8, 229u8, 133u8, 200u8, 231u8, 16u8, 146u8, 247u8, + 21u8, 77u8, 122u8, 165u8, 134u8, + ], + ) } #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] #[doc = " they wish to support."] @@ -8942,110 +5677,71 @@ pub mod api { #[doc = ""] #[doc = " Lastly, if any of the nominators become non-decodable, they can be chilled immediately via"] #[doc = " [`Call::chill_other`] dispatchable by anyone."] - pub fn nominators_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Nominators<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 26u8, 169u8, 68u8, 99u8, 216u8, 95u8, 198u8, 5u8, - 123u8, 21u8, 83u8, 220u8, 140u8, 122u8, 111u8, 22u8, - 133u8, 9u8, 155u8, 35u8, 58u8, 232u8, 143u8, 62u8, 229u8, - 228u8, 98u8, 175u8, 114u8, 152u8, 253u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn nominators_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Nominations, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Nominators", + Vec::new(), + [ + 1u8, 154u8, 55u8, 170u8, 215u8, 64u8, 56u8, 83u8, 254u8, + 19u8, 152u8, 85u8, 164u8, 171u8, 206u8, 129u8, 184u8, 45u8, + 221u8, 181u8, 229u8, 133u8, 200u8, 231u8, 16u8, 146u8, 247u8, + 21u8, 77u8, 122u8, 165u8, 134u8, + ], + ) } #[doc = "Counter for the related counted storage map"] pub fn counter_for_nominators( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 31u8, 94u8, 130u8, 138u8, 75u8, 8u8, 38u8, 162u8, 181u8, - 5u8, 125u8, 116u8, 9u8, 51u8, 22u8, 234u8, 40u8, 117u8, - 215u8, 46u8, 82u8, 117u8, 225u8, 1u8, 9u8, 208u8, 83u8, - 63u8, 39u8, 187u8, 207u8, 191u8, - ] - { - let entry = CounterForNominators; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CounterForNominators", + vec![], + [ + 31u8, 94u8, 130u8, 138u8, 75u8, 8u8, 38u8, 162u8, 181u8, 5u8, + 125u8, 116u8, 9u8, 51u8, 22u8, 234u8, 40u8, 117u8, 215u8, + 46u8, 82u8, 117u8, 225u8, 1u8, 9u8, 208u8, 83u8, 63u8, 39u8, + 187u8, 207u8, 191u8, + ], + ) } #[doc = " The maximum nominator count before we stop allowing new validators to join."] #[doc = ""] #[doc = " When this value is not set, no limits are enforced."] pub fn max_nominators_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 180u8, 190u8, 180u8, 66u8, 235u8, 173u8, 76u8, 160u8, - 197u8, 92u8, 96u8, 165u8, 220u8, 188u8, 32u8, 119u8, 3u8, - 73u8, 86u8, 49u8, 104u8, 17u8, 186u8, 98u8, 221u8, 175u8, - 109u8, 254u8, 207u8, 245u8, 125u8, 179u8, - ] - { - let entry = MaxNominatorsCount; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MaxNominatorsCount", + vec![], + [ + 180u8, 190u8, 180u8, 66u8, 235u8, 173u8, 76u8, 160u8, 197u8, + 92u8, 96u8, 165u8, 220u8, 188u8, 32u8, 119u8, 3u8, 73u8, + 86u8, 49u8, 104u8, 17u8, 186u8, 98u8, 221u8, 175u8, 109u8, + 254u8, 207u8, 245u8, 125u8, 179u8, + ], + ) } #[doc = " The current era index."] #[doc = ""] @@ -9053,37 +5749,23 @@ pub mod api { #[doc = " set, it might be active or not."] pub fn current_era( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 105u8, 150u8, 49u8, 122u8, 4u8, 78u8, 8u8, 121u8, 34u8, - 136u8, 157u8, 227u8, 59u8, 139u8, 7u8, 253u8, 7u8, 10u8, - 117u8, 71u8, 240u8, 74u8, 86u8, 36u8, 198u8, 37u8, 153u8, - 93u8, 196u8, 22u8, 192u8, 243u8, - ] - { - let entry = CurrentEra; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CurrentEra", + vec![], + [ + 105u8, 150u8, 49u8, 122u8, 4u8, 78u8, 8u8, 121u8, 34u8, + 136u8, 157u8, 227u8, 59u8, 139u8, 7u8, 253u8, 7u8, 10u8, + 117u8, 71u8, 240u8, 74u8, 86u8, 36u8, 198u8, 37u8, 153u8, + 93u8, 196u8, 22u8, 192u8, 243u8, + ], + ) } #[doc = " The active era information, it holds index and start."] #[doc = ""] @@ -9091,39 +5773,25 @@ pub mod api { #[doc = " equal to [`SessionInterface::validators`]."] pub fn active_era( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::ActiveEraInfo, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 230u8, 144u8, 49u8, 201u8, 36u8, 253u8, 97u8, 135u8, - 57u8, 169u8, 157u8, 138u8, 21u8, 35u8, 14u8, 2u8, 151u8, - 214u8, 176u8, 211u8, 48u8, 105u8, 38u8, 123u8, 98u8, - 255u8, 14u8, 35u8, 177u8, 247u8, 31u8, 28u8, - ] - { - let entry = ActiveEra; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ActiveEraInfo, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ActiveEra", + vec![], + [ + 15u8, 112u8, 251u8, 183u8, 108u8, 61u8, 28u8, 71u8, 44u8, + 150u8, 162u8, 4u8, 143u8, 121u8, 11u8, 37u8, 83u8, 29u8, + 193u8, 21u8, 210u8, 116u8, 190u8, 236u8, 213u8, 235u8, 49u8, + 97u8, 189u8, 142u8, 251u8, 124u8, + ], + ) } #[doc = " The session index at which the era start for the last `HISTORY_DEPTH` eras."] #[doc = ""] @@ -9131,75 +5799,51 @@ pub mod api { #[doc = " for the eras in `[CurrentEra - HISTORY_DEPTH, CurrentEra]`."] pub fn eras_start_session_index( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 92u8, 157u8, 168u8, 144u8, 132u8, 3u8, 212u8, 80u8, - 230u8, 229u8, 251u8, 218u8, 97u8, 55u8, 79u8, 100u8, - 163u8, 91u8, 32u8, 246u8, 122u8, 78u8, 149u8, 214u8, - 103u8, 249u8, 119u8, 20u8, 101u8, 116u8, 110u8, 185u8, - ] - { - let entry = ErasStartSessionIndex(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStartSessionIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 92u8, 157u8, 168u8, 144u8, 132u8, 3u8, 212u8, 80u8, 230u8, + 229u8, 251u8, 218u8, 97u8, 55u8, 79u8, 100u8, 163u8, 91u8, + 32u8, 246u8, 122u8, 78u8, 149u8, 214u8, 103u8, 249u8, 119u8, + 20u8, 101u8, 116u8, 110u8, 185u8, + ], + ) } #[doc = " The session index at which the era start for the last `HISTORY_DEPTH` eras."] #[doc = ""] #[doc = " Note: This tracks the starting session (i.e. session index when era start being active)"] #[doc = " for the eras in `[CurrentEra - HISTORY_DEPTH, CurrentEra]`."] - pub fn eras_start_session_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStartSessionIndex<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 92u8, 157u8, 168u8, 144u8, 132u8, 3u8, 212u8, 80u8, - 230u8, 229u8, 251u8, 218u8, 97u8, 55u8, 79u8, 100u8, - 163u8, 91u8, 32u8, 246u8, 122u8, 78u8, 149u8, 214u8, - 103u8, 249u8, 119u8, 20u8, 101u8, 116u8, 110u8, 185u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_start_session_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStartSessionIndex", + Vec::new(), + [ + 92u8, 157u8, 168u8, 144u8, 132u8, 3u8, 212u8, 80u8, 230u8, + 229u8, 251u8, 218u8, 97u8, 55u8, 79u8, 100u8, 163u8, 91u8, + 32u8, 246u8, 122u8, 78u8, 149u8, 214u8, 103u8, 249u8, 119u8, + 20u8, 101u8, 116u8, 110u8, 185u8, + ], + ) } #[doc = " Exposure of validator at era."] #[doc = ""] @@ -9209,42 +5853,39 @@ pub mod api { #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] pub fn eras_stakers( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 250u8, 76u8, 183u8, 219u8, 180u8, 156u8, 138u8, - 111u8, 153u8, 154u8, 90u8, 14u8, 194u8, 56u8, 133u8, - 197u8, 199u8, 35u8, 20u8, 188u8, 129u8, 169u8, 38u8, - 10u8, 219u8, 186u8, 107u8, 179u8, 160u8, 244u8, 210u8, - ] - { - let entry = ErasStakers(_0, _1); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakers", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 192u8, 50u8, 152u8, 151u8, 92u8, 180u8, 206u8, 15u8, 139u8, + 210u8, 128u8, 65u8, 92u8, 253u8, 43u8, 35u8, 139u8, 171u8, + 73u8, 185u8, 32u8, 78u8, 20u8, 197u8, 154u8, 90u8, 233u8, + 231u8, 23u8, 22u8, 187u8, 156u8, + ], + ) } #[doc = " Exposure of validator at era."] #[doc = ""] @@ -9252,38 +5893,30 @@ pub mod api { #[doc = ""] #[doc = " Is it removed after `HISTORY_DEPTH` eras."] #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] - pub fn eras_stakers_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakers<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 250u8, 76u8, 183u8, 219u8, 180u8, 156u8, 138u8, - 111u8, 153u8, 154u8, 90u8, 14u8, 194u8, 56u8, 133u8, - 197u8, 199u8, 35u8, 20u8, 188u8, 129u8, 169u8, 38u8, - 10u8, 219u8, 186u8, 107u8, 179u8, 160u8, 244u8, 210u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_stakers_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakers", + Vec::new(), + [ + 192u8, 50u8, 152u8, 151u8, 92u8, 180u8, 206u8, 15u8, 139u8, + 210u8, 128u8, 65u8, 92u8, 253u8, 43u8, 35u8, 139u8, 171u8, + 73u8, 185u8, 32u8, 78u8, 20u8, 197u8, 154u8, 90u8, 233u8, + 231u8, 23u8, 22u8, 187u8, 156u8, + ], + ) } #[doc = " Clipped Exposure of validator at era."] #[doc = ""] @@ -9298,42 +5931,39 @@ pub mod api { #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] pub fn eras_stakers_clipped( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 91u8, 87u8, 165u8, 255u8, 253u8, 169u8, 48u8, 28u8, - 254u8, 124u8, 93u8, 108u8, 252u8, 15u8, 141u8, 139u8, - 152u8, 118u8, 226u8, 122u8, 178u8, 110u8, 4u8, 242u8, - 62u8, 77u8, 157u8, 122u8, 149u8, 225u8, 201u8, 231u8, - ] - { - let entry = ErasStakersClipped(_0, _1); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakersClipped", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 43u8, 159u8, 113u8, 223u8, 122u8, 169u8, 98u8, 153u8, 26u8, + 55u8, 71u8, 119u8, 174u8, 48u8, 158u8, 45u8, 214u8, 26u8, + 136u8, 215u8, 46u8, 161u8, 185u8, 17u8, 174u8, 204u8, 206u8, + 246u8, 49u8, 87u8, 134u8, 169u8, + ], + ) } #[doc = " Clipped Exposure of validator at era."] #[doc = ""] @@ -9346,38 +5976,30 @@ pub mod api { #[doc = ""] #[doc = " Is it removed after `HISTORY_DEPTH` eras."] #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] - pub fn eras_stakers_clipped_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakersClipped<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 91u8, 87u8, 165u8, 255u8, 253u8, 169u8, 48u8, 28u8, - 254u8, 124u8, 93u8, 108u8, 252u8, 15u8, 141u8, 139u8, - 152u8, 118u8, 226u8, 122u8, 178u8, 110u8, 4u8, 242u8, - 62u8, 77u8, 157u8, 122u8, 149u8, 225u8, 201u8, 231u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_stakers_clipped_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakersClipped", + Vec::new(), + [ + 43u8, 159u8, 113u8, 223u8, 122u8, 169u8, 98u8, 153u8, 26u8, + 55u8, 71u8, 119u8, 174u8, 48u8, 158u8, 45u8, 214u8, 26u8, + 136u8, 215u8, 46u8, 161u8, 185u8, 17u8, 174u8, 204u8, 206u8, + 246u8, 49u8, 87u8, 134u8, 169u8, + ], + ) } #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] #[doc = ""] @@ -9386,480 +6008,347 @@ pub mod api { #[doc = " Is it removed after `HISTORY_DEPTH` eras."] pub fn eras_validator_prefs( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 8u8, 55u8, 222u8, 216u8, 126u8, 126u8, 131u8, 18u8, - 145u8, 58u8, 91u8, 123u8, 92u8, 19u8, 178u8, 200u8, - 133u8, 140u8, 3u8, 207u8, 101u8, 70u8, 204u8, 172u8, - 98u8, 137u8, 149u8, 74u8, 99u8, 141u8, 150u8, 228u8, - ] - { - let entry = ErasValidatorPrefs(_0, _1); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorPrefs", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 6u8, 196u8, 209u8, 138u8, 252u8, 18u8, 203u8, 86u8, 129u8, + 62u8, 4u8, 56u8, 234u8, 114u8, 141u8, 136u8, 127u8, 224u8, + 142u8, 89u8, 150u8, 33u8, 31u8, 50u8, 140u8, 108u8, 124u8, + 77u8, 188u8, 102u8, 230u8, 174u8, + ], + ) } #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] #[doc = ""] #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] #[doc = ""] #[doc = " Is it removed after `HISTORY_DEPTH` eras."] - pub fn eras_validator_prefs_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorPrefs<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 8u8, 55u8, 222u8, 216u8, 126u8, 126u8, 131u8, 18u8, - 145u8, 58u8, 91u8, 123u8, 92u8, 19u8, 178u8, 200u8, - 133u8, 140u8, 3u8, 207u8, 101u8, 70u8, 204u8, 172u8, - 98u8, 137u8, 149u8, 74u8, 99u8, 141u8, 150u8, 228u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_validator_prefs_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ValidatorPrefs, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorPrefs", + Vec::new(), + [ + 6u8, 196u8, 209u8, 138u8, 252u8, 18u8, 203u8, 86u8, 129u8, + 62u8, 4u8, 56u8, 234u8, 114u8, 141u8, 136u8, 127u8, 224u8, + 142u8, 89u8, 150u8, 33u8, 31u8, 50u8, 140u8, 108u8, 124u8, + 77u8, 188u8, 102u8, 230u8, 174u8, + ], + ) } #[doc = " The total validator era payout for the last `HISTORY_DEPTH` eras."] #[doc = ""] #[doc = " Eras that haven't finished yet or has been removed doesn't have reward."] pub fn eras_validator_reward( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 87u8, 80u8, 156u8, 123u8, 107u8, 77u8, 203u8, 37u8, - 231u8, 84u8, 124u8, 155u8, 227u8, 212u8, 212u8, 179u8, - 84u8, 161u8, 223u8, 255u8, 254u8, 107u8, 52u8, 89u8, - 98u8, 169u8, 136u8, 241u8, 104u8, 3u8, 244u8, 161u8, - ] - { - let entry = ErasValidatorReward(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorReward", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 87u8, 80u8, 156u8, 123u8, 107u8, 77u8, 203u8, 37u8, 231u8, + 84u8, 124u8, 155u8, 227u8, 212u8, 212u8, 179u8, 84u8, 161u8, + 223u8, 255u8, 254u8, 107u8, 52u8, 89u8, 98u8, 169u8, 136u8, + 241u8, 104u8, 3u8, 244u8, 161u8, + ], + ) } #[doc = " The total validator era payout for the last `HISTORY_DEPTH` eras."] #[doc = ""] #[doc = " Eras that haven't finished yet or has been removed doesn't have reward."] - pub fn eras_validator_reward_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorReward<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 87u8, 80u8, 156u8, 123u8, 107u8, 77u8, 203u8, 37u8, - 231u8, 84u8, 124u8, 155u8, 227u8, 212u8, 212u8, 179u8, - 84u8, 161u8, 223u8, 255u8, 254u8, 107u8, 52u8, 89u8, - 98u8, 169u8, 136u8, 241u8, 104u8, 3u8, 244u8, 161u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_validator_reward_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorReward", + Vec::new(), + [ + 87u8, 80u8, 156u8, 123u8, 107u8, 77u8, 203u8, 37u8, 231u8, + 84u8, 124u8, 155u8, 227u8, 212u8, 212u8, 179u8, 84u8, 161u8, + 223u8, 255u8, 254u8, 107u8, 52u8, 89u8, 98u8, 169u8, 136u8, + 241u8, 104u8, 3u8, 244u8, 161u8, + ], + ) } #[doc = " Rewards for the last `HISTORY_DEPTH` eras."] #[doc = " If reward hasn't been set or has been removed then 0 reward is returned."] pub fn eras_reward_points( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 76u8, 221u8, 158u8, 62u8, 3u8, 254u8, 139u8, 170u8, - 103u8, 218u8, 191u8, 103u8, 57u8, 212u8, 208u8, 7u8, - 105u8, 52u8, 117u8, 173u8, 8u8, 34u8, 82u8, 141u8, 51u8, - 72u8, 243u8, 56u8, 206u8, 206u8, 48u8, 140u8, - ] - { - let entry = ErasRewardPoints(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasRewardPoints", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 194u8, 29u8, 20u8, 83u8, 200u8, 47u8, 158u8, 102u8, 88u8, + 65u8, 24u8, 255u8, 120u8, 178u8, 23u8, 232u8, 15u8, 64u8, + 206u8, 0u8, 170u8, 40u8, 18u8, 149u8, 45u8, 90u8, 179u8, + 127u8, 52u8, 59u8, 37u8, 192u8, + ], + ) } #[doc = " Rewards for the last `HISTORY_DEPTH` eras."] #[doc = " If reward hasn't been set or has been removed then 0 reward is returned."] - pub fn eras_reward_points_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasRewardPoints<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 76u8, 221u8, 158u8, 62u8, 3u8, 254u8, 139u8, 170u8, - 103u8, 218u8, 191u8, 103u8, 57u8, 212u8, 208u8, 7u8, - 105u8, 52u8, 117u8, 173u8, 8u8, 34u8, 82u8, 141u8, 51u8, - 72u8, 243u8, 56u8, 206u8, 206u8, 48u8, 140u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_reward_points_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasRewardPoints", + Vec::new(), + [ + 194u8, 29u8, 20u8, 83u8, 200u8, 47u8, 158u8, 102u8, 88u8, + 65u8, 24u8, 255u8, 120u8, 178u8, 23u8, 232u8, 15u8, 64u8, + 206u8, 0u8, 170u8, 40u8, 18u8, 149u8, 45u8, 90u8, 179u8, + 127u8, 52u8, 59u8, 37u8, 192u8, + ], + ) } #[doc = " The total amount staked for the last `HISTORY_DEPTH` eras."] #[doc = " If total hasn't been set or has been removed then 0 stake is returned."] pub fn eras_total_stake( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 224u8, 240u8, 168u8, 69u8, 148u8, 140u8, 249u8, 240u8, - 4u8, 46u8, 77u8, 11u8, 224u8, 65u8, 26u8, 239u8, 1u8, - 110u8, 53u8, 11u8, 247u8, 235u8, 142u8, 234u8, 22u8, - 43u8, 24u8, 36u8, 37u8, 43u8, 170u8, 40u8, - ] - { - let entry = ErasTotalStake(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasTotalStake", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 224u8, 240u8, 168u8, 69u8, 148u8, 140u8, 249u8, 240u8, 4u8, + 46u8, 77u8, 11u8, 224u8, 65u8, 26u8, 239u8, 1u8, 110u8, 53u8, + 11u8, 247u8, 235u8, 142u8, 234u8, 22u8, 43u8, 24u8, 36u8, + 37u8, 43u8, 170u8, 40u8, + ], + ) } #[doc = " The total amount staked for the last `HISTORY_DEPTH` eras."] #[doc = " If total hasn't been set or has been removed then 0 stake is returned."] - pub fn eras_total_stake_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasTotalStake<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 224u8, 240u8, 168u8, 69u8, 148u8, 140u8, 249u8, 240u8, - 4u8, 46u8, 77u8, 11u8, 224u8, 65u8, 26u8, 239u8, 1u8, - 110u8, 53u8, 11u8, 247u8, 235u8, 142u8, 234u8, 22u8, - 43u8, 24u8, 36u8, 37u8, 43u8, 170u8, 40u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn eras_total_stake_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasTotalStake", + Vec::new(), + [ + 224u8, 240u8, 168u8, 69u8, 148u8, 140u8, 249u8, 240u8, 4u8, + 46u8, 77u8, 11u8, 224u8, 65u8, 26u8, 239u8, 1u8, 110u8, 53u8, + 11u8, 247u8, 235u8, 142u8, 234u8, 22u8, 43u8, 24u8, 36u8, + 37u8, 43u8, 170u8, 40u8, + ], + ) } #[doc = " Mode of era forcing."] pub fn force_era( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::Forcing, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 221u8, 41u8, 71u8, 21u8, 28u8, 193u8, 65u8, 97u8, 103u8, - 37u8, 145u8, 146u8, 183u8, 194u8, 57u8, 131u8, 214u8, - 136u8, 68u8, 156u8, 140u8, 194u8, 69u8, 151u8, 115u8, - 177u8, 92u8, 147u8, 29u8, 40u8, 41u8, 31u8, - ] - { - let entry = ForceEra; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ForceEra", + vec![], + [ + 221u8, 41u8, 71u8, 21u8, 28u8, 193u8, 65u8, 97u8, 103u8, + 37u8, 145u8, 146u8, 183u8, 194u8, 57u8, 131u8, 214u8, 136u8, + 68u8, 156u8, 140u8, 194u8, 69u8, 151u8, 115u8, 177u8, 92u8, + 147u8, 29u8, 40u8, 41u8, 31u8, + ], + ) } #[doc = " The percentage of the slash that is distributed to reporters."] #[doc = ""] #[doc = " The rest of the slashed value is handled by the `Slash`."] pub fn slash_reward_fraction( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 92u8, 55u8, 255u8, 233u8, 174u8, 125u8, 32u8, 21u8, 78u8, - 237u8, 123u8, 241u8, 113u8, 243u8, 48u8, 101u8, 190u8, - 165u8, 216u8, 134u8, 35u8, 128u8, 7u8, 207u8, 48u8, 92u8, - 116u8, 179u8, 253u8, 14u8, 87u8, 176u8, - ] - { - let entry = SlashRewardFraction; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SlashRewardFraction", + vec![], + [ + 167u8, 79u8, 143u8, 202u8, 199u8, 100u8, 129u8, 162u8, 23u8, + 165u8, 106u8, 170u8, 244u8, 86u8, 144u8, 242u8, 65u8, 207u8, + 115u8, 224u8, 231u8, 155u8, 55u8, 139u8, 101u8, 129u8, 242u8, + 196u8, 130u8, 50u8, 3u8, 117u8, + ], + ) } #[doc = " The amount of currency given to reporters of a slash event which was"] #[doc = " canceled by extraordinary circumstances (e.g. governance)."] pub fn canceled_slash_payout( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 126u8, 218u8, 66u8, 92u8, 82u8, 124u8, 145u8, 161u8, - 40u8, 176u8, 14u8, 211u8, 178u8, 216u8, 8u8, 156u8, 83u8, - 14u8, 91u8, 15u8, 200u8, 170u8, 3u8, 127u8, 141u8, 139u8, - 151u8, 98u8, 74u8, 96u8, 238u8, 29u8, - ] - { - let entry = CanceledSlashPayout; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CanceledSlashPayout", + vec![], + [ + 126u8, 218u8, 66u8, 92u8, 82u8, 124u8, 145u8, 161u8, 40u8, + 176u8, 14u8, 211u8, 178u8, 216u8, 8u8, 156u8, 83u8, 14u8, + 91u8, 15u8, 200u8, 170u8, 3u8, 127u8, 141u8, 139u8, 151u8, + 98u8, 74u8, 96u8, 238u8, 29u8, + ], + ) } #[doc = " All unapplied slashes that are queued for later."] pub fn unapplied_slashes( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 213u8, 28u8, 144u8, 139u8, 187u8, 184u8, 7u8, 192u8, - 114u8, 57u8, 238u8, 66u8, 7u8, 254u8, 41u8, 230u8, 189u8, - 188u8, 127u8, 49u8, 201u8, 179u8, 21u8, 157u8, 177u8, - 130u8, 137u8, 151u8, 51u8, 213u8, 242u8, 236u8, - ] - { - let entry = UnappliedSlashes(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "UnappliedSlashes", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 130u8, 4u8, 163u8, 163u8, 28u8, 85u8, 34u8, 156u8, 47u8, + 125u8, 57u8, 0u8, 133u8, 176u8, 130u8, 2u8, 175u8, 180u8, + 167u8, 203u8, 230u8, 82u8, 198u8, 183u8, 55u8, 82u8, 221u8, + 248u8, 100u8, 173u8, 206u8, 151u8, + ], + ) } #[doc = " All unapplied slashes that are queued for later."] - pub fn unapplied_slashes_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, UnappliedSlashes<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 213u8, 28u8, 144u8, 139u8, 187u8, 184u8, 7u8, 192u8, - 114u8, 57u8, 238u8, 66u8, 7u8, 254u8, 41u8, 230u8, 189u8, - 188u8, 127u8, 49u8, 201u8, 179u8, 21u8, 157u8, 177u8, - 130u8, 137u8, 151u8, 51u8, 213u8, 242u8, 236u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn unapplied_slashes_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "UnappliedSlashes", + Vec::new(), + [ + 130u8, 4u8, 163u8, 163u8, 28u8, 85u8, 34u8, 156u8, 47u8, + 125u8, 57u8, 0u8, 133u8, 176u8, 130u8, 2u8, 175u8, 180u8, + 167u8, 203u8, 230u8, 82u8, 198u8, 183u8, 55u8, 82u8, 221u8, + 248u8, 100u8, 173u8, 206u8, 151u8, + ], + ) } #[doc = " A mapping from still-bonded eras to the first session index of that era."] #[doc = ""] @@ -9867,403 +6356,290 @@ pub mod api { #[doc = " `[active_era - bounding_duration; active_era]`"] pub fn bonded_eras( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 243u8, 162u8, 236u8, 198u8, 122u8, 182u8, 37u8, 55u8, - 171u8, 156u8, 235u8, 223u8, 226u8, 129u8, 89u8, 206u8, - 2u8, 155u8, 222u8, 154u8, 116u8, 124u8, 4u8, 119u8, - 155u8, 94u8, 248u8, 30u8, 171u8, 51u8, 78u8, 106u8, - ] - { - let entry = BondedEras; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "BondedEras", + vec![], + [ + 243u8, 162u8, 236u8, 198u8, 122u8, 182u8, 37u8, 55u8, 171u8, + 156u8, 235u8, 223u8, 226u8, 129u8, 89u8, 206u8, 2u8, 155u8, + 222u8, 154u8, 116u8, 124u8, 4u8, 119u8, 155u8, 94u8, 248u8, + 30u8, 171u8, 51u8, 78u8, 106u8, + ], + ) } #[doc = " All slashing events on validators, mapped by era to the highest slash proportion"] #[doc = " and slash value of the era."] pub fn validator_slash_in_era( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - runtime_types::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 241u8, 177u8, 227u8, 239u8, 150u8, 186u8, 50u8, 97u8, - 144u8, 224u8, 24u8, 149u8, 189u8, 166u8, 71u8, 232u8, - 221u8, 129u8, 122u8, 248u8, 235u8, 100u8, 130u8, 230u8, - 11u8, 96u8, 214u8, 59u8, 79u8, 40u8, 236u8, 136u8, - ] - { - let entry = ValidatorSlashInEra(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ValidatorSlashInEra", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 237u8, 80u8, 3u8, 237u8, 9u8, 40u8, 212u8, 15u8, 251u8, + 196u8, 85u8, 29u8, 27u8, 151u8, 98u8, 122u8, 189u8, 147u8, + 205u8, 40u8, 202u8, 194u8, 158u8, 96u8, 138u8, 16u8, 116u8, + 71u8, 140u8, 163u8, 121u8, 197u8, + ], + ) } #[doc = " All slashing events on validators, mapped by era to the highest slash proportion"] #[doc = " and slash value of the era."] - pub fn validator_slash_in_era_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ValidatorSlashInEra<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 241u8, 177u8, 227u8, 239u8, 150u8, 186u8, 50u8, 97u8, - 144u8, 224u8, 24u8, 149u8, 189u8, 166u8, 71u8, 232u8, - 221u8, 129u8, 122u8, 248u8, 235u8, 100u8, 130u8, 230u8, - 11u8, 96u8, 214u8, 59u8, 79u8, 40u8, 236u8, 136u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn validator_slash_in_era_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ValidatorSlashInEra", + Vec::new(), + [ + 237u8, 80u8, 3u8, 237u8, 9u8, 40u8, 212u8, 15u8, 251u8, + 196u8, 85u8, 29u8, 27u8, 151u8, 98u8, 122u8, 189u8, 147u8, + 205u8, 40u8, 202u8, 194u8, 158u8, 96u8, 138u8, 16u8, 116u8, + 71u8, 140u8, 163u8, 121u8, 197u8, + ], + ) } #[doc = " All slashing events on nominators, mapped by era to the highest slash value of the era."] pub fn nominator_slash_in_era( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 149u8, 144u8, 51u8, 167u8, 71u8, 119u8, 218u8, 110u8, - 25u8, 45u8, 168u8, 149u8, 62u8, 195u8, 248u8, 50u8, - 215u8, 216u8, 228u8, 4u8, 238u8, 4u8, 52u8, 211u8, 65u8, - 223u8, 84u8, 105u8, 186u8, 200u8, 73u8, 133u8, - ] - { - let entry = NominatorSlashInEra(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "NominatorSlashInEra", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 249u8, 85u8, 170u8, 41u8, 179u8, 194u8, 180u8, 12u8, 53u8, + 101u8, 80u8, 96u8, 166u8, 71u8, 239u8, 23u8, 153u8, 19u8, + 152u8, 38u8, 138u8, 136u8, 221u8, 200u8, 18u8, 165u8, 26u8, + 228u8, 195u8, 199u8, 62u8, 4u8, + ], + ) } #[doc = " All slashing events on nominators, mapped by era to the highest slash value of the era."] - pub fn nominator_slash_in_era_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, NominatorSlashInEra<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 149u8, 144u8, 51u8, 167u8, 71u8, 119u8, 218u8, 110u8, - 25u8, 45u8, 168u8, 149u8, 62u8, 195u8, 248u8, 50u8, - 215u8, 216u8, 228u8, 4u8, 238u8, 4u8, 52u8, 211u8, 65u8, - 223u8, 84u8, 105u8, 186u8, 200u8, 73u8, 133u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn nominator_slash_in_era_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "NominatorSlashInEra", + Vec::new(), + [ + 249u8, 85u8, 170u8, 41u8, 179u8, 194u8, 180u8, 12u8, 53u8, + 101u8, 80u8, 96u8, 166u8, 71u8, 239u8, 23u8, 153u8, 19u8, + 152u8, 38u8, 138u8, 136u8, 221u8, 200u8, 18u8, 165u8, 26u8, + 228u8, 195u8, 199u8, 62u8, 4u8, + ], + ) } #[doc = " Slashing spans for stash accounts."] pub fn slashing_spans( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::slashing::SlashingSpans, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 73u8, 200u8, 194u8, 106u8, 157u8, 84u8, 5u8, 119u8, - 5u8, 73u8, 247u8, 125u8, 213u8, 80u8, 37u8, 154u8, 192u8, - 16u8, 2u8, 135u8, 124u8, 139u8, 26u8, 84u8, 223u8, 254u8, - 229u8, 148u8, 45u8, 194u8, 183u8, - ] - { - let entry = SlashingSpans(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SlashingSpans", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 106u8, 115u8, 118u8, 52u8, 89u8, 77u8, 246u8, 5u8, 255u8, + 204u8, 44u8, 5u8, 66u8, 36u8, 227u8, 252u8, 86u8, 159u8, + 186u8, 152u8, 196u8, 21u8, 74u8, 201u8, 133u8, 93u8, 142u8, + 191u8, 20u8, 27u8, 218u8, 157u8, + ], + ) } #[doc = " Slashing spans for stash accounts."] - pub fn slashing_spans_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SlashingSpans<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 73u8, 200u8, 194u8, 106u8, 157u8, 84u8, 5u8, 119u8, - 5u8, 73u8, 247u8, 125u8, 213u8, 80u8, 37u8, 154u8, 192u8, - 16u8, 2u8, 135u8, 124u8, 139u8, 26u8, 84u8, 223u8, 254u8, - 229u8, 148u8, 45u8, 194u8, 183u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn slashing_spans_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SlashingSpans", + Vec::new(), + [ + 106u8, 115u8, 118u8, 52u8, 89u8, 77u8, 246u8, 5u8, 255u8, + 204u8, 44u8, 5u8, 66u8, 36u8, 227u8, 252u8, 86u8, 159u8, + 186u8, 152u8, 196u8, 21u8, 74u8, 201u8, 133u8, 93u8, 142u8, + 191u8, 20u8, 27u8, 218u8, 157u8, + ], + ) } #[doc = " Records information about the maximum slash of a stash within a slashing span,"] #[doc = " as well as how much reward has been paid out."] pub fn span_slash( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - _1: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::slashing::SpanRecord< ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 95u8, 42u8, 40u8, 167u8, 201u8, 140u8, 142u8, 55u8, 69u8, - 238u8, 248u8, 118u8, 209u8, 11u8, 117u8, 132u8, 179u8, - 33u8, 17u8, 156u8, 137u8, 220u8, 170u8, 144u8, 235u8, - 99u8, 248u8, 47u8, 99u8, 42u8, 247u8, 189u8, - ] - { - let entry = SpanSlash(_0, _1); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SpanSlash", + vec![::subxt::storage::address::StorageMapKey::new( + &(_0.borrow(), _1.borrow()), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 160u8, 63u8, 115u8, 190u8, 233u8, 148u8, 75u8, 3u8, 11u8, + 59u8, 184u8, 220u8, 205u8, 64u8, 28u8, 190u8, 116u8, 210u8, + 225u8, 230u8, 224u8, 163u8, 103u8, 157u8, 100u8, 29u8, 86u8, + 167u8, 84u8, 217u8, 109u8, 200u8, + ], + ) } #[doc = " Records information about the maximum slash of a stash within a slashing span,"] #[doc = " as well as how much reward has been paid out."] - pub fn span_slash_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SpanSlash<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 95u8, 42u8, 40u8, 167u8, 201u8, 140u8, 142u8, 55u8, 69u8, - 238u8, 248u8, 118u8, 209u8, 11u8, 117u8, 132u8, 179u8, - 33u8, 17u8, 156u8, 137u8, 220u8, 170u8, 144u8, 235u8, - 99u8, 248u8, 47u8, 99u8, 42u8, 247u8, 189u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn span_slash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SpanSlash", + Vec::new(), + [ + 160u8, 63u8, 115u8, 190u8, 233u8, 148u8, 75u8, 3u8, 11u8, + 59u8, 184u8, 220u8, 205u8, 64u8, 28u8, 190u8, 116u8, 210u8, + 225u8, 230u8, 224u8, 163u8, 103u8, 157u8, 100u8, 29u8, 86u8, + 167u8, 84u8, 217u8, 109u8, 200u8, + ], + ) } #[doc = " The earliest era for which we have a pending, unapplied slash."] pub fn earliest_unapplied_slash( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 2u8, 167u8, 88u8, 76u8, 113u8, 225u8, 232u8, 80u8, 183u8, - 162u8, 104u8, 28u8, 162u8, 13u8, 120u8, 45u8, 200u8, - 130u8, 147u8, 124u8, 210u8, 111u8, 30u8, 222u8, 70u8, - 79u8, 125u8, 157u8, 56u8, 252u8, 237u8, 216u8, - ] - { - let entry = EarliestUnappliedSlash; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "EarliestUnappliedSlash", + vec![], + [ + 2u8, 167u8, 88u8, 76u8, 113u8, 225u8, 232u8, 80u8, 183u8, + 162u8, 104u8, 28u8, 162u8, 13u8, 120u8, 45u8, 200u8, 130u8, + 147u8, 124u8, 210u8, 111u8, 30u8, 222u8, 70u8, 79u8, 125u8, + 157u8, 56u8, 252u8, 237u8, 216u8, + ], + ) } #[doc = " The last planned session scheduled by the session pallet."] #[doc = ""] #[doc = " This is basically in sync with the call to [`pallet_session::SessionManager::new_session`]."] pub fn current_planned_session( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 38u8, 22u8, 56u8, 250u8, 17u8, 154u8, 99u8, 37u8, 155u8, - 253u8, 100u8, 117u8, 5u8, 239u8, 31u8, 190u8, 53u8, - 241u8, 11u8, 185u8, 163u8, 227u8, 10u8, 77u8, 210u8, - 64u8, 156u8, 218u8, 105u8, 16u8, 1u8, 57u8, - ] - { - let entry = CurrentPlannedSession; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CurrentPlannedSession", + vec![], + [ + 38u8, 22u8, 56u8, 250u8, 17u8, 154u8, 99u8, 37u8, 155u8, + 253u8, 100u8, 117u8, 5u8, 239u8, 31u8, 190u8, 53u8, 241u8, + 11u8, 185u8, 163u8, 227u8, 10u8, 77u8, 210u8, 64u8, 156u8, + 218u8, 105u8, 16u8, 1u8, 57u8, + ], + ) } #[doc = " Indices of validators that have offended in the active era and whether they are currently"] #[doc = " disabled."] @@ -10276,40 +6652,28 @@ pub mod api { #[doc = " the era ends."] pub fn offending_validators( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( ::core::primitive::u32, ::core::primitive::bool, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 94u8, 254u8, 0u8, 50u8, 76u8, 232u8, 51u8, 153u8, 118u8, - 14u8, 70u8, 101u8, 112u8, 215u8, 173u8, 82u8, 182u8, - 104u8, 167u8, 103u8, 187u8, 168u8, 86u8, 16u8, 51u8, - 235u8, 51u8, 119u8, 38u8, 154u8, 42u8, 113u8, - ] - { - let entry = OffendingValidators; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "OffendingValidators", + vec![], + [ + 94u8, 254u8, 0u8, 50u8, 76u8, 232u8, 51u8, 153u8, 118u8, + 14u8, 70u8, 101u8, 112u8, 215u8, 173u8, 82u8, 182u8, 104u8, + 167u8, 103u8, 187u8, 168u8, 86u8, 16u8, 51u8, 235u8, 51u8, + 119u8, 38u8, 154u8, 42u8, 113u8, + ], + ) } #[doc = " True if network has been upgraded to this version."] #[doc = " Storage version of the pallet."] @@ -10317,159 +6681,107 @@ pub mod api { #[doc = " This is set to v7.0.0 for new networks."] pub fn storage_version( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_staking::Releases, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 156u8, 107u8, 113u8, 89u8, 107u8, 89u8, 171u8, 229u8, - 13u8, 96u8, 203u8, 67u8, 119u8, 153u8, 199u8, 158u8, - 63u8, 114u8, 229u8, 113u8, 81u8, 70u8, 200u8, 9u8, 147u8, - 233u8, 6u8, 7u8, 210u8, 109u8, 149u8, 14u8, - ] - { - let entry = StorageVersion; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "StorageVersion", + vec![], + [ + 156u8, 107u8, 113u8, 89u8, 107u8, 89u8, 171u8, 229u8, 13u8, + 96u8, 203u8, 67u8, 119u8, 153u8, 199u8, 158u8, 63u8, 114u8, + 229u8, 113u8, 81u8, 70u8, 200u8, 9u8, 147u8, 233u8, 6u8, 7u8, + 210u8, 109u8, 149u8, 14u8, + ], + ) } #[doc = " The threshold for when users can start calling `chill_other` for other validators /"] #[doc = " nominators. The threshold is compared to the actual number of validators / nominators"] #[doc = " (`CountFor*`) in the system compared to the configured max (`Max*Count`)."] pub fn chill_threshold( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 254u8, 131u8, 112u8, 90u8, 234u8, 72u8, 26u8, 240u8, - 38u8, 14u8, 128u8, 234u8, 133u8, 169u8, 66u8, 48u8, - 234u8, 170u8, 159u8, 145u8, 75u8, 135u8, 79u8, 189u8, - 54u8, 89u8, 113u8, 144u8, 16u8, 70u8, 184u8, 43u8, - ] - { - let entry = ChillThreshold; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ChillThreshold", + vec![], + [ + 174u8, 165u8, 249u8, 105u8, 24u8, 151u8, 115u8, 166u8, 199u8, + 251u8, 28u8, 5u8, 50u8, 95u8, 144u8, 110u8, 220u8, 76u8, + 14u8, 23u8, 179u8, 41u8, 11u8, 248u8, 28u8, 154u8, 159u8, + 255u8, 156u8, 109u8, 98u8, 92u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Maximum number of nominations per nominator."] pub fn max_nominations( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Staking", "MaxNominations")? - == [ - 155u8, 58u8, 120u8, 225u8, 19u8, 30u8, 64u8, 6u8, 16u8, 72u8, - 160u8, 120u8, 99u8, 8u8, 170u8, 47u8, 217u8, 196u8, 184u8, - 183u8, 199u8, 156u8, 76u8, 154u8, 143u8, 172u8, 67u8, 133u8, - 95u8, 36u8, 60u8, 50u8, - ] - { - let pallet = metadata.pallet("Staking")?; - let constant = pallet.constant("MaxNominations")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "MaxNominations", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Number of sessions per era."] pub fn sessions_per_era( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Staking", "SessionsPerEra")? - == [ - 73u8, 207u8, 178u8, 212u8, 159u8, 9u8, 41u8, 31u8, 205u8, - 221u8, 166u8, 159u8, 104u8, 218u8, 113u8, 160u8, 174u8, 66u8, - 95u8, 0u8, 237u8, 42u8, 120u8, 171u8, 68u8, 78u8, 136u8, - 162u8, 163u8, 225u8, 199u8, 138u8, - ] - { - let pallet = metadata.pallet("Staking")?; - let constant = pallet.constant("SessionsPerEra")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "SessionsPerEra", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Number of eras that staked funds must remain bonded for."] pub fn bonding_duration( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Staking", "BondingDuration")? - == [ - 205u8, 83u8, 35u8, 244u8, 140u8, 127u8, 183u8, 152u8, 242u8, - 60u8, 44u8, 77u8, 252u8, 245u8, 35u8, 157u8, 71u8, 124u8, - 99u8, 243u8, 122u8, 252u8, 104u8, 33u8, 28u8, 86u8, 63u8, - 26u8, 3u8, 22u8, 193u8, 237u8, - ] - { - let pallet = metadata.pallet("Staking")?; - let constant = pallet.constant("BondingDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "BondingDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Number of eras that slashes are deferred by, after computation."] #[doc = ""] @@ -10477,26 +6789,19 @@ pub mod api { #[doc = " should be applied immediately, without opportunity for intervention."] pub fn slash_defer_duration( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Staking", "SlashDeferDuration")? - == [ - 119u8, 238u8, 165u8, 29u8, 118u8, 219u8, 225u8, 241u8, 249u8, - 202u8, 99u8, 86u8, 123u8, 152u8, 33u8, 200u8, 166u8, 24u8, - 240u8, 111u8, 6u8, 56u8, 94u8, 70u8, 198u8, 4u8, 223u8, 19u8, - 39u8, 246u8, 190u8, 167u8, - ] - { - let pallet = metadata.pallet("Staking")?; - let constant = pallet.constant("SlashDeferDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "SlashDeferDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The maximum number of nominators rewarded for each validator."] #[doc = ""] @@ -10504,67 +6809,53 @@ pub mod api { #[doc = " claim their reward. This used to limit the i/o cost for the nominator payout."] pub fn max_nominator_rewarded_per_validator( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("Staking", "MaxNominatorRewardedPerValidator")? - == [ - 203u8, 67u8, 240u8, 15u8, 205u8, 129u8, 216u8, 42u8, 197u8, - 166u8, 179u8, 175u8, 9u8, 179u8, 182u8, 19u8, 57u8, 206u8, - 237u8, 79u8, 204u8, 135u8, 76u8, 243u8, 108u8, 191u8, 151u8, - 127u8, 38u8, 154u8, 193u8, 142u8, - ] - { - let pallet = metadata.pallet("Staking")?; - let constant = - pallet.constant("MaxNominatorRewardedPerValidator")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "MaxNominatorRewardedPerValidator", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively"] #[doc = " determines how many unique eras a staker may be unbonding in."] pub fn max_unlocking_chunks( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Staking", "MaxUnlockingChunks")? - == [ - 60u8, 255u8, 33u8, 12u8, 50u8, 253u8, 93u8, 203u8, 3u8, - 245u8, 156u8, 201u8, 121u8, 119u8, 72u8, 58u8, 38u8, 133u8, - 127u8, 51u8, 21u8, 223u8, 40u8, 23u8, 116u8, 158u8, 77u8, - 24u8, 139u8, 219u8, 197u8, 150u8, - ] - { - let pallet = metadata.pallet("Staking")?; - let constant = pallet.constant("MaxUnlockingChunks")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "MaxUnlockingChunks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod offences { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Events type."] pub type Event = runtime_types::pallet_offences::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] #[doc = "\\[kind, timeslot\\]."] @@ -10572,225 +6863,139 @@ pub mod api { pub kind: [::core::primitive::u8; 16usize], pub timeslot: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Event for Offence { + impl ::subxt::events::StaticEvent for Offence { const PALLET: &'static str = "Offences"; const EVENT: &'static str = "Offence"; } } pub mod storage { use super::runtime_types; - pub struct Reports<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reports<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "Reports"; - type Value = runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::sp_core::crypto::AccountId32, - ( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ConcurrentReportsIndex<'a>( - pub &'a [::core::primitive::u8; 16usize], - pub &'a [::core::primitive::u8], - ); - impl ::subxt::StorageEntry for ConcurrentReportsIndex<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ConcurrentReportsIndex"; - type Value = ::std::vec::Vec<::subxt::sp_core::H256>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ReportsByKindIndex<'a>(pub &'a [::core::primitive::u8; 16usize]); - impl ::subxt::StorageEntry for ReportsByKindIndex<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The primary structure that holds all offence records keyed by report identifiers."] pub fn reports( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::sp_core::crypto::AccountId32, - ( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ), - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::ext::sp_core::crypto::AccountId32, + ( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 82u8, 209u8, 30u8, 189u8, 152u8, 16u8, 7u8, 24u8, 178u8, - 140u8, 17u8, 226u8, 97u8, 37u8, 80u8, 211u8, 252u8, 36u8, - 196u8, 121u8, 113u8, 79u8, 209u8, 113u8, 236u8, 148u8, - 243u8, 100u8, 46u8, 193u8, 180u8, 83u8, - ] - { - let entry = Reports(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "Reports", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 144u8, 30u8, 66u8, 199u8, 102u8, 236u8, 175u8, 201u8, 206u8, + 170u8, 55u8, 162u8, 137u8, 120u8, 220u8, 213u8, 57u8, 252u8, + 0u8, 88u8, 210u8, 68u8, 5u8, 25u8, 77u8, 114u8, 204u8, 23u8, + 190u8, 32u8, 211u8, 30u8, + ], + ) } #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub fn reports_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Reports<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 82u8, 209u8, 30u8, 189u8, 152u8, 16u8, 7u8, 24u8, 178u8, - 140u8, 17u8, 226u8, 97u8, 37u8, 80u8, 211u8, 252u8, 36u8, - 196u8, 121u8, 113u8, 79u8, 209u8, 113u8, 236u8, 148u8, - 243u8, 100u8, 46u8, 193u8, 180u8, 83u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn reports_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::ext::sp_core::crypto::AccountId32, + ( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "Reports", + Vec::new(), + [ + 144u8, 30u8, 66u8, 199u8, 102u8, 236u8, 175u8, 201u8, 206u8, + 170u8, 55u8, 162u8, 137u8, 120u8, 220u8, 213u8, 57u8, 252u8, + 0u8, 88u8, 210u8, 68u8, 5u8, 25u8, 77u8, 114u8, 204u8, 23u8, + 190u8, 32u8, 211u8, 30u8, + ], + ) } #[doc = " A vector of reports of the same kind that happened at the same time slot."] pub fn concurrent_reports_index( &self, - _0: &'a [::core::primitive::u8; 16usize], - _1: &'a [::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::H256>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 110u8, 42u8, 178u8, 19u8, 180u8, 109u8, 26u8, 134u8, - 74u8, 223u8, 19u8, 172u8, 149u8, 194u8, 228u8, 11u8, - 205u8, 189u8, 157u8, 52u8, 179u8, 177u8, 19u8, 65u8, - 35u8, 176u8, 62u8, 98u8, 108u8, 236u8, 242u8, 240u8, - ] - { - let entry = ConcurrentReportsIndex(_0, _1); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 16usize]>, + _1: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::H256>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "ConcurrentReportsIndex", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 106u8, 21u8, 104u8, 5u8, 4u8, 66u8, 28u8, 70u8, 161u8, 195u8, + 238u8, 28u8, 69u8, 241u8, 221u8, 113u8, 140u8, 103u8, 181u8, + 143u8, 60u8, 177u8, 13u8, 129u8, 224u8, 149u8, 77u8, 32u8, + 75u8, 74u8, 101u8, 65u8, + ], + ) } #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub fn concurrent_reports_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ConcurrentReportsIndex<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 110u8, 42u8, 178u8, 19u8, 180u8, 109u8, 26u8, 134u8, - 74u8, 223u8, 19u8, 172u8, 149u8, 194u8, 228u8, 11u8, - 205u8, 189u8, 157u8, 52u8, 179u8, 177u8, 19u8, 65u8, - 35u8, 176u8, 62u8, 98u8, 108u8, 236u8, 242u8, 240u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn concurrent_reports_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::H256>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "ConcurrentReportsIndex", + Vec::new(), + [ + 106u8, 21u8, 104u8, 5u8, 4u8, 66u8, 28u8, 70u8, 161u8, 195u8, + 238u8, 28u8, 69u8, 241u8, 221u8, 113u8, 140u8, 103u8, 181u8, + 143u8, 60u8, 177u8, 13u8, 129u8, 224u8, 149u8, 77u8, 32u8, + 75u8, 74u8, 101u8, 65u8, + ], + ) } #[doc = " Enumerates all reports of a kind along with the time they happened."] #[doc = ""] @@ -10800,38 +7005,29 @@ pub mod api { #[doc = " different types are not supported at the moment so we are doing the manual serialization."] pub fn reports_by_kind_index( &self, - _0: &'a [::core::primitive::u8; 16usize], - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 16usize]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, - 36u8, 137u8, 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, - 164u8, 50u8, 91u8, 164u8, 20u8, 96u8, 189u8, 100u8, - 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, 145u8, - ] - { - let entry = ReportsByKindIndex(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "ReportsByKindIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, + 137u8, 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, + 91u8, 164u8, 20u8, 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, + 136u8, 98u8, 215u8, 180u8, 145u8, + ], + ) } #[doc = " Enumerates all reports of a kind along with the time they happened."] #[doc = ""] @@ -10839,90 +7035,60 @@ pub mod api { #[doc = ""] #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] #[doc = " different types are not supported at the moment so we are doing the manual serialization."] - pub fn reports_by_kind_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ReportsByKindIndex<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, - 36u8, 137u8, 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, - 164u8, 50u8, 91u8, 164u8, 20u8, 96u8, 189u8, 100u8, - 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, 145u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn reports_by_kind_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u8>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "ReportsByKindIndex", + Vec::new(), + [ + 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, + 137u8, 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, + 91u8, 164u8, 20u8, 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, + 136u8, 98u8, 215u8, 180u8, 145u8, + ], + ) } } } } pub mod historical { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; } pub mod session { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetKeys { pub keys: runtime_types::polkadot_runtime::SessionKeys, pub proof: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for SetKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "set_keys"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct PurgeKeys; - impl ::subxt::Call for PurgeKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "purge_keys"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Sets the session key(s) of the function caller to `keys`."] #[doc = "Allows an account to set its session key prior to becoming a validator."] #[doc = "This doesn't take effect until the next session."] @@ -10941,35 +7107,18 @@ pub mod api { &self, keys: runtime_types::polkadot_runtime::SessionKeys, proof: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetKeys, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 194u8, 88u8, 145u8, 74u8, 215u8, 181u8, 126u8, 21u8, 193u8, - 174u8, 42u8, 142u8, 229u8, 213u8, 104u8, 36u8, 134u8, 83u8, - 245u8, 106u8, 9u8, 42u8, 75u8, 206u8, 161u8, 248u8, 232u8, - 31u8, 160u8, 213u8, 70u8, 228u8, - ] - { - let call = SetKeys { keys, proof }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Session", + "set_keys", + SetKeys { keys, proof }, + [ + 17u8, 127u8, 23u8, 71u8, 118u8, 133u8, 89u8, 105u8, 93u8, + 52u8, 46u8, 201u8, 151u8, 19u8, 124u8, 195u8, 228u8, 229u8, + 22u8, 216u8, 32u8, 54u8, 67u8, 222u8, 91u8, 175u8, 206u8, + 7u8, 238u8, 118u8, 81u8, 112u8, + ], + ) } #[doc = "Removes any session key(s) of the function caller."] #[doc = ""] @@ -10987,37 +7136,18 @@ pub mod api { #[doc = "- DbWrites: `NextKeys`, `origin account`"] #[doc = "- DbWrites per key id: `KeyOwner`"] #[doc = "# "] - pub fn purge_keys( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PurgeKeys, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn purge_keys(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Session", + "purge_keys", + PurgeKeys {}, + [ 200u8, 255u8, 4u8, 213u8, 188u8, 92u8, 99u8, 116u8, 163u8, 152u8, 29u8, 35u8, 133u8, 119u8, 246u8, 44u8, 91u8, 31u8, 145u8, 23u8, 213u8, 64u8, 71u8, 242u8, 207u8, 239u8, 231u8, 37u8, 61u8, 63u8, 190u8, 35u8, - ] - { - let call = PurgeKeys {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } } } @@ -11026,9 +7156,9 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "New session has happened. Note that the argument is the session index, not the"] @@ -11036,239 +7166,107 @@ pub mod api { pub struct NewSession { pub session_index: ::core::primitive::u32, } - impl ::subxt::Event for NewSession { + impl ::subxt::events::StaticEvent for NewSession { const PALLET: &'static str = "Session"; const EVENT: &'static str = "NewSession"; } } pub mod storage { use super::runtime_types; - pub struct Validators; - impl ::subxt::StorageEntry for Validators { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "Validators"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentIndex; - impl ::subxt::StorageEntry for CurrentIndex { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "CurrentIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedChanged; - impl ::subxt::StorageEntry for QueuedChanged { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "QueuedChanged"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedKeys; - impl ::subxt::StorageEntry for QueuedKeys { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "QueuedKeys"; - type Value = ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::SessionKeys, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DisabledValidators; - impl ::subxt::StorageEntry for DisabledValidators { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "DisabledValidators"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextKeys<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for NextKeys<'_> { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::polkadot_runtime::SessionKeys; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct KeyOwner<'a>( - pub &'a runtime_types::sp_core::crypto::KeyTypeId, - pub &'a [::core::primitive::u8], - ); - impl ::subxt::StorageEntry for KeyOwner<'_> { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "KeyOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The current set of validators."] pub fn validators( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 186u8, 248u8, 234u8, 74u8, 245u8, 141u8, 90u8, 152u8, - 226u8, 220u8, 255u8, 104u8, 174u8, 1u8, 37u8, 152u8, - 23u8, 208u8, 25u8, 49u8, 33u8, 253u8, 254u8, 251u8, - 141u8, 16u8, 18u8, 175u8, 196u8, 188u8, 163u8, 209u8, - ] - { - let entry = Validators; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "Validators", + vec![], + [ + 144u8, 235u8, 200u8, 43u8, 151u8, 57u8, 147u8, 172u8, 201u8, + 202u8, 242u8, 96u8, 57u8, 76u8, 124u8, 77u8, 42u8, 113u8, + 218u8, 220u8, 230u8, 32u8, 151u8, 152u8, 172u8, 106u8, 60u8, + 227u8, 122u8, 118u8, 137u8, 68u8, + ], + ) } #[doc = " Current index of the session."] pub fn current_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 148u8, 179u8, 159u8, 15u8, 197u8, 95u8, 214u8, 30u8, - 209u8, 251u8, 183u8, 231u8, 91u8, 25u8, 181u8, 191u8, - 143u8, 252u8, 227u8, 80u8, 159u8, 66u8, 194u8, 67u8, - 113u8, 74u8, 111u8, 91u8, 218u8, 187u8, 130u8, 40u8, - ] - { - let entry = CurrentIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "CurrentIndex", + vec![], + [ + 148u8, 179u8, 159u8, 15u8, 197u8, 95u8, 214u8, 30u8, 209u8, + 251u8, 183u8, 231u8, 91u8, 25u8, 181u8, 191u8, 143u8, 252u8, + 227u8, 80u8, 159u8, 66u8, 194u8, 67u8, 113u8, 74u8, 111u8, + 91u8, 218u8, 187u8, 130u8, 40u8, + ], + ) } #[doc = " True if the underlying economic identities or weighting behind the validators"] #[doc = " has changed in the queued validator set."] pub fn queued_changed( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 105u8, 140u8, 235u8, 218u8, 96u8, 100u8, 252u8, 10u8, - 58u8, 221u8, 244u8, 251u8, 67u8, 91u8, 80u8, 202u8, - 152u8, 42u8, 50u8, 113u8, 200u8, 247u8, 59u8, 213u8, - 77u8, 195u8, 1u8, 150u8, 220u8, 18u8, 245u8, 46u8, - ] - { - let entry = QueuedChanged; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "QueuedChanged", + vec![], + [ + 105u8, 140u8, 235u8, 218u8, 96u8, 100u8, 252u8, 10u8, 58u8, + 221u8, 244u8, 251u8, 67u8, 91u8, 80u8, 202u8, 152u8, 42u8, + 50u8, 113u8, 200u8, 247u8, 59u8, 213u8, 77u8, 195u8, 1u8, + 150u8, 220u8, 18u8, 245u8, 46u8, + ], + ) } #[doc = " The queued keys for the next session. When the next session begins, these keys"] #[doc = " will be used to determine the validator's session keys."] pub fn queued_keys( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::polkadot_runtime::SessionKeys, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 94u8, 85u8, 104u8, 215u8, 108u8, 102u8, 70u8, 179u8, - 201u8, 132u8, 63u8, 148u8, 29u8, 97u8, 185u8, 117u8, - 153u8, 236u8, 106u8, 21u8, 156u8, 60u8, 178u8, 93u8, - 240u8, 144u8, 101u8, 78u8, 63u8, 247u8, 128u8, 13u8, - ] - { - let entry = QueuedKeys; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "QueuedKeys", + vec![], + [ + 197u8, 174u8, 245u8, 219u8, 36u8, 118u8, 73u8, 184u8, 156u8, + 93u8, 167u8, 107u8, 142u8, 7u8, 41u8, 51u8, 77u8, 191u8, + 68u8, 95u8, 71u8, 76u8, 253u8, 137u8, 73u8, 194u8, 169u8, + 234u8, 217u8, 76u8, 157u8, 223u8, + ], + ) } #[doc = " Indices of disabled validators."] #[doc = ""] @@ -11277,290 +7275,202 @@ pub mod api { #[doc = " a new set of identities."] pub fn disabled_validators( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 135u8, 22u8, 22u8, 97u8, 82u8, 217u8, 144u8, 141u8, - 121u8, 240u8, 189u8, 16u8, 176u8, 88u8, 177u8, 31u8, - 20u8, 242u8, 73u8, 104u8, 11u8, 110u8, 214u8, 34u8, 52u8, - 217u8, 106u8, 33u8, 174u8, 174u8, 198u8, 84u8, - ] - { - let entry = DisabledValidators; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "DisabledValidators", + vec![], + [ + 135u8, 22u8, 22u8, 97u8, 82u8, 217u8, 144u8, 141u8, 121u8, + 240u8, 189u8, 16u8, 176u8, 88u8, 177u8, 31u8, 20u8, 242u8, + 73u8, 104u8, 11u8, 110u8, 214u8, 34u8, 52u8, 217u8, 106u8, + 33u8, 174u8, 174u8, 198u8, 84u8, + ], + ) } #[doc = " The next session keys for a validator."] pub fn next_keys( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime::SessionKeys, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 18u8, 229u8, 236u8, 115u8, 189u8, 239u8, 3u8, 100u8, 6u8, - 254u8, 237u8, 61u8, 223u8, 21u8, 226u8, 203u8, 214u8, - 213u8, 58u8, 252u8, 168u8, 7u8, 92u8, 5u8, 176u8, 37u8, - 43u8, 104u8, 175u8, 75u8, 42u8, 221u8, - ] - { - let entry = NextKeys(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime::SessionKeys, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "NextKeys", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 94u8, 197u8, 147u8, 245u8, 165u8, 97u8, 186u8, 57u8, 142u8, + 66u8, 132u8, 213u8, 126u8, 3u8, 77u8, 88u8, 191u8, 33u8, + 82u8, 153u8, 11u8, 109u8, 96u8, 252u8, 193u8, 171u8, 158u8, + 131u8, 29u8, 192u8, 248u8, 166u8, + ], + ) } #[doc = " The next session keys for a validator."] - pub fn next_keys_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, NextKeys<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 18u8, 229u8, 236u8, 115u8, 189u8, 239u8, 3u8, 100u8, 6u8, - 254u8, 237u8, 61u8, 223u8, 21u8, 226u8, 203u8, 214u8, - 213u8, 58u8, 252u8, 168u8, 7u8, 92u8, 5u8, 176u8, 37u8, - 43u8, 104u8, 175u8, 75u8, 42u8, 221u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn next_keys_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime::SessionKeys, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "NextKeys", + Vec::new(), + [ + 94u8, 197u8, 147u8, 245u8, 165u8, 97u8, 186u8, 57u8, 142u8, + 66u8, 132u8, 213u8, 126u8, 3u8, 77u8, 88u8, 191u8, 33u8, + 82u8, 153u8, 11u8, 109u8, 96u8, 252u8, 193u8, 171u8, 158u8, + 131u8, 29u8, 192u8, 248u8, 166u8, + ], + ) } #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] pub fn key_owner( &self, - _0: &'a runtime_types::sp_core::crypto::KeyTypeId, - _1: &'a [::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 49u8, 245u8, 212u8, 141u8, 211u8, 208u8, 109u8, 102u8, - 249u8, 161u8, 41u8, 93u8, 220u8, 230u8, 14u8, 59u8, - 251u8, 176u8, 33u8, 127u8, 93u8, 149u8, 205u8, 229u8, - 113u8, 129u8, 162u8, 177u8, 155u8, 216u8, 151u8, 57u8, - ] - { - let entry = KeyOwner(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow, + _1: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "KeyOwner", + vec![::subxt::storage::address::StorageMapKey::new( + &(_0.borrow(), _1.borrow()), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 4u8, 91u8, 25u8, 84u8, 250u8, 201u8, 174u8, 129u8, 201u8, + 58u8, 197u8, 199u8, 137u8, 240u8, 118u8, 33u8, 99u8, 2u8, + 195u8, 57u8, 53u8, 172u8, 0u8, 148u8, 203u8, 144u8, 149u8, + 64u8, 135u8, 254u8, 242u8, 215u8, + ], + ) } #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub fn key_owner_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, KeyOwner<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 49u8, 245u8, 212u8, 141u8, 211u8, 208u8, 109u8, 102u8, - 249u8, 161u8, 41u8, 93u8, 220u8, 230u8, 14u8, 59u8, - 251u8, 176u8, 33u8, 127u8, 93u8, 149u8, 205u8, 229u8, - 113u8, 129u8, 162u8, 177u8, 155u8, 216u8, 151u8, 57u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn key_owner_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "KeyOwner", + Vec::new(), + [ + 4u8, 91u8, 25u8, 84u8, 250u8, 201u8, 174u8, 129u8, 201u8, + 58u8, 197u8, 199u8, 137u8, 240u8, 118u8, 33u8, 99u8, 2u8, + 195u8, 57u8, 53u8, 172u8, 0u8, 148u8, 203u8, 144u8, 149u8, + 64u8, 135u8, 254u8, 242u8, 215u8, + ], + ) } } } } pub mod grandpa { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReportEquivocation { pub equivocation_proof: ::std::boxed::Box< runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, ::core::primitive::u32, >, >, pub key_owner_proof: runtime_types::sp_session::MembershipProof, } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReportEquivocationUnsigned { pub equivocation_proof: ::std::boxed::Box< runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, ::core::primitive::u32, >, >, pub key_owner_proof: runtime_types::sp_session::MembershipProof, } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NoteStalled { pub delay: ::core::primitive::u32, pub best_finalized_block_number: ::core::primitive::u32, } - impl ::subxt::Call for NoteStalled { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "note_stalled"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Report voter equivocation/misbehavior. This method will verify the"] #[doc = "equivocation proof and validate the given key ownership proof"] #[doc = "against the extracted offender. If both are valid, the offence"] #[doc = "will be reported."] pub fn report_equivocation( &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: ext :: sp_core :: H256 , :: core :: primitive :: u32 >, key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocation, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 230u8, 252u8, 24u8, 207u8, 164u8, 127u8, 177u8, 30u8, 113u8, - 175u8, 207u8, 252u8, 230u8, 225u8, 181u8, 190u8, 236u8, - 110u8, 145u8, 168u8, 200u8, 134u8, 88u8, 234u8, 231u8, 45u8, - 149u8, 169u8, 155u8, 114u8, 62u8, 65u8, - ] - { - let call = ReportEquivocation { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Grandpa", + "report_equivocation", + ReportEquivocation { equivocation_proof: ::std::boxed::Box::new( equivocation_proof, ), key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 156u8, 162u8, 189u8, 89u8, 60u8, 156u8, 129u8, 176u8, 62u8, + 35u8, 214u8, 7u8, 68u8, 245u8, 130u8, 117u8, 30u8, 3u8, 73u8, + 218u8, 142u8, 82u8, 13u8, 141u8, 124u8, 19u8, 53u8, 138u8, + 70u8, 4u8, 40u8, 32u8, + ], + ) } #[doc = "Report voter equivocation/misbehavior. This method will verify the"] #[doc = "equivocation proof and validate the given key ownership proof"] @@ -11573,42 +7483,26 @@ pub mod api { #[doc = "reporter."] pub fn report_equivocation_unsigned( &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: ext :: sp_core :: H256 , :: core :: primitive :: u32 >, key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocationUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 141u8, 235u8, 27u8, 135u8, 124u8, 124u8, 234u8, 51u8, 100u8, - 105u8, 188u8, 248u8, 133u8, 10u8, 84u8, 14u8, 40u8, 235u8, - 14u8, 107u8, 63u8, 148u8, 107u8, 172u8, 136u8, 159u8, 86u8, - 23u8, 145u8, 221u8, 93u8, 206u8, - ] - { - let call = ReportEquivocationUnsigned { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Grandpa", + "report_equivocation_unsigned", + ReportEquivocationUnsigned { equivocation_proof: ::std::boxed::Box::new( equivocation_proof, ), key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 166u8, 26u8, 217u8, 185u8, 215u8, 37u8, 174u8, 170u8, 137u8, + 160u8, 151u8, 43u8, 246u8, 86u8, 58u8, 18u8, 248u8, 73u8, + 99u8, 161u8, 158u8, 93u8, 212u8, 186u8, 224u8, 253u8, 234u8, + 18u8, 151u8, 111u8, 227u8, 249u8, + ], + ) } #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] #[doc = ""] @@ -11626,38 +7520,21 @@ pub mod api { &self, delay: ::core::primitive::u32, best_finalized_block_number: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteStalled, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 227u8, 98u8, 249u8, 158u8, 96u8, 124u8, 72u8, 188u8, 27u8, - 215u8, 73u8, 62u8, 103u8, 79u8, 38u8, 48u8, 212u8, 88u8, - 233u8, 187u8, 11u8, 95u8, 39u8, 247u8, 55u8, 184u8, 228u8, - 102u8, 13u8, 251u8, 52u8, 206u8, - ] - { - let call = NoteStalled { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Grandpa", + "note_stalled", + NoteStalled { delay, best_finalized_block_number, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 197u8, 236u8, 137u8, 32u8, 46u8, 200u8, 144u8, 13u8, 89u8, + 181u8, 235u8, 73u8, 167u8, 131u8, 174u8, 93u8, 42u8, 136u8, + 238u8, 59u8, 129u8, 60u8, 83u8, 100u8, 5u8, 182u8, 99u8, + 250u8, 145u8, 180u8, 1u8, 199u8, + ], + ) } } } @@ -11665,7 +7542,11 @@ pub mod api { pub type Event = runtime_types::pallet_grandpa::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "New authority set has been applied."] pub struct NewAuthorities { pub authority_set: ::std::vec::Vec<( @@ -11673,431 +7554,253 @@ pub mod api { ::core::primitive::u64, )>, } - impl ::subxt::Event for NewAuthorities { + impl ::subxt::events::StaticEvent for NewAuthorities { const PALLET: &'static str = "Grandpa"; const EVENT: &'static str = "NewAuthorities"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Current authority set has been paused."] pub struct Paused; - impl ::subxt::Event for Paused { + impl ::subxt::events::StaticEvent for Paused { const PALLET: &'static str = "Grandpa"; const EVENT: &'static str = "Paused"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Current authority set has been resumed."] pub struct Resumed; - impl ::subxt::Event for Resumed { + impl ::subxt::events::StaticEvent for Resumed { const PALLET: &'static str = "Grandpa"; const EVENT: &'static str = "Resumed"; } } pub mod storage { use super::runtime_types; - pub struct State; - impl ::subxt::StorageEntry for State { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "State"; - type Value = - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingChange; - impl ::subxt::StorageEntry for PendingChange { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "PendingChange"; - type Value = runtime_types::pallet_grandpa::StoredPendingChange< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextForced; - impl ::subxt::StorageEntry for NextForced { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "NextForced"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Stalled; - impl ::subxt::StorageEntry for Stalled { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "Stalled"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentSetId; - impl ::subxt::StorageEntry for CurrentSetId { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "CurrentSetId"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SetIdSession<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for SetIdSession<'_> { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "SetIdSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " State of the current authority set."] pub fn state( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_grandpa::StoredState< ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 159u8, 75u8, 78u8, 23u8, 98u8, 89u8, 239u8, 230u8, 192u8, - 67u8, 139u8, 222u8, 151u8, 237u8, 216u8, 20u8, 235u8, - 247u8, 180u8, 24u8, 64u8, 160u8, 58u8, 15u8, 205u8, - 191u8, 120u8, 68u8, 32u8, 5u8, 161u8, 106u8, - ] - { - let entry = State; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "State", + vec![], + [ + 211u8, 149u8, 114u8, 217u8, 206u8, 194u8, 115u8, 67u8, 12u8, + 218u8, 246u8, 213u8, 208u8, 29u8, 216u8, 104u8, 2u8, 39u8, + 123u8, 172u8, 252u8, 210u8, 52u8, 129u8, 147u8, 237u8, 244u8, + 68u8, 252u8, 169u8, 97u8, 148u8, + ], + ) } #[doc = " Pending change: (signaled at, scheduled change)."] pub fn pending_change( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange< - ::core::primitive::u32, - >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_grandpa::StoredPendingChange< + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 128u8, 176u8, 209u8, 41u8, 231u8, 111u8, 205u8, 198u8, - 154u8, 44u8, 228u8, 231u8, 44u8, 110u8, 74u8, 9u8, 31u8, - 86u8, 128u8, 244u8, 112u8, 21u8, 120u8, 176u8, 50u8, - 213u8, 122u8, 46u8, 85u8, 255u8, 40u8, 173u8, - ] - { - let entry = PendingChange; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "PendingChange", + vec![], + [ + 178u8, 24u8, 140u8, 7u8, 8u8, 196u8, 18u8, 58u8, 3u8, 226u8, + 181u8, 47u8, 155u8, 160u8, 70u8, 12u8, 75u8, 189u8, 38u8, + 255u8, 104u8, 141u8, 64u8, 34u8, 134u8, 201u8, 102u8, 21u8, + 75u8, 81u8, 218u8, 60u8, + ], + ) } #[doc = " next block number where we can force a change."] pub fn next_forced( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 99u8, 43u8, 245u8, 201u8, 60u8, 9u8, 122u8, 99u8, 188u8, - 29u8, 67u8, 6u8, 193u8, 133u8, 179u8, 67u8, 202u8, 208u8, - 62u8, 179u8, 19u8, 169u8, 196u8, 119u8, 107u8, 75u8, - 100u8, 3u8, 121u8, 18u8, 80u8, 156u8, - ] - { - let entry = NextForced; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "NextForced", + vec![], + [ + 99u8, 43u8, 245u8, 201u8, 60u8, 9u8, 122u8, 99u8, 188u8, + 29u8, 67u8, 6u8, 193u8, 133u8, 179u8, 67u8, 202u8, 208u8, + 62u8, 179u8, 19u8, 169u8, 196u8, 119u8, 107u8, 75u8, 100u8, + 3u8, 121u8, 18u8, 80u8, 156u8, + ], + ) } #[doc = " `true` if we are currently stalled."] pub fn stalled( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 219u8, 8u8, 37u8, 78u8, 150u8, 55u8, 0u8, 57u8, 201u8, - 170u8, 186u8, 189u8, 56u8, 161u8, 44u8, 15u8, 53u8, - 178u8, 224u8, 208u8, 231u8, 109u8, 14u8, 209u8, 57u8, - 205u8, 237u8, 153u8, 231u8, 156u8, 24u8, 185u8, - ] - { - let entry = Stalled; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "Stalled", + vec![], + [ + 219u8, 8u8, 37u8, 78u8, 150u8, 55u8, 0u8, 57u8, 201u8, 170u8, + 186u8, 189u8, 56u8, 161u8, 44u8, 15u8, 53u8, 178u8, 224u8, + 208u8, 231u8, 109u8, 14u8, 209u8, 57u8, 205u8, 237u8, 153u8, + 231u8, 156u8, 24u8, 185u8, + ], + ) } #[doc = " The number of changes (both in terms of keys and underlying economic responsibilities)"] #[doc = " in the \"set\" of Grandpa validators from genesis."] pub fn current_set_id( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u64, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 129u8, 7u8, 62u8, 101u8, 199u8, 60u8, 56u8, 33u8, 54u8, - 158u8, 20u8, 178u8, 244u8, 145u8, 189u8, 197u8, 157u8, - 163u8, 116u8, 36u8, 105u8, 52u8, 149u8, 244u8, 108u8, - 94u8, 109u8, 111u8, 244u8, 137u8, 7u8, 108u8, - ] - { - let entry = CurrentSetId; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "CurrentSetId", + vec![], + [ + 129u8, 7u8, 62u8, 101u8, 199u8, 60u8, 56u8, 33u8, 54u8, + 158u8, 20u8, 178u8, 244u8, 145u8, 189u8, 197u8, 157u8, 163u8, + 116u8, 36u8, 105u8, 52u8, 149u8, 244u8, 108u8, 94u8, 109u8, + 111u8, 244u8, 137u8, 7u8, 108u8, + ], + ) } #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] #[doc = " members were responsible."] #[doc = ""] #[doc = " TWOX-NOTE: `SetId` is not under user control."] pub fn set_id_session( - &self, - _0: &'a ::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, - 110u8, 11u8, 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, - 157u8, 15u8, 33u8, 234u8, 108u8, 13u8, 88u8, 115u8, - 254u8, 9u8, 145u8, 199u8, 102u8, 47u8, 53u8, 134u8, - ] - { - let entry = SetIdSession(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "SetIdSession", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, 110u8, + 11u8, 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, 157u8, 15u8, + 33u8, 234u8, 108u8, 13u8, 88u8, 115u8, 254u8, 9u8, 145u8, + 199u8, 102u8, 47u8, 53u8, 134u8, + ], + ) } #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] #[doc = " members were responsible."] #[doc = ""] #[doc = " TWOX-NOTE: `SetId` is not under user control."] - pub fn set_id_session_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SetIdSession<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, - 110u8, 11u8, 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, - 157u8, 15u8, 33u8, 234u8, 108u8, 13u8, 88u8, 115u8, - 254u8, 9u8, 145u8, 199u8, 102u8, 47u8, 53u8, 134u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn set_id_session_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "SetIdSession", + Vec::new(), + [ + 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, 110u8, + 11u8, 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, 157u8, 15u8, + 33u8, 234u8, 108u8, 13u8, 88u8, 115u8, 254u8, 9u8, 145u8, + 199u8, 102u8, 47u8, 53u8, 134u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Max Authorities in use"] pub fn max_authorities( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Grandpa", "MaxAuthorities")? - == [ - 248u8, 195u8, 131u8, 166u8, 10u8, 50u8, 71u8, 223u8, 41u8, - 49u8, 43u8, 99u8, 251u8, 113u8, 75u8, 193u8, 159u8, 15u8, - 77u8, 217u8, 147u8, 205u8, 165u8, 50u8, 6u8, 166u8, 77u8, - 189u8, 102u8, 22u8, 201u8, 19u8, - ] - { - let pallet = metadata.pallet("Grandpa")?; - let constant = pallet.constant("MaxAuthorities")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Grandpa", + "MaxAuthorities", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod im_online { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Heartbeat { pub heartbeat: runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, pub signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, } - impl ::subxt::Call for Heartbeat { - const PALLET: &'static str = "ImOnline"; - const FUNCTION: &'static str = "heartbeat"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "# "] #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] #[doc = " length of `heartbeat.network_state.external_address`"] @@ -12113,38 +7816,21 @@ pub mod api { ::core::primitive::u32, >, signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Heartbeat, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 246u8, 83u8, 28u8, 233u8, 69u8, 55u8, 28u8, 178u8, 82u8, - 159u8, 56u8, 241u8, 111u8, 78u8, 194u8, 15u8, 14u8, 250u8, - 172u8, 148u8, 208u8, 52u8, 33u8, 106u8, 159u8, 210u8, 196u8, - 79u8, 138u8, 194u8, 150u8, 201u8, - ] - { - let call = Heartbeat { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ImOnline", + "heartbeat", + Heartbeat { heartbeat, signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 212u8, 23u8, 174u8, 246u8, 60u8, 220u8, 178u8, 137u8, 53u8, + 146u8, 165u8, 225u8, 179u8, 209u8, 233u8, 152u8, 129u8, + 210u8, 126u8, 32u8, 216u8, 22u8, 76u8, 196u8, 255u8, 128u8, + 246u8, 161u8, 30u8, 186u8, 249u8, 34u8, + ], + ) } } } @@ -12152,113 +7838,55 @@ pub mod api { pub type Event = runtime_types::pallet_im_online::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new heartbeat was received from `AuthorityId`."] pub struct HeartbeatReceived { pub authority_id: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, } - impl ::subxt::Event for HeartbeatReceived { + impl ::subxt::events::StaticEvent for HeartbeatReceived { const PALLET: &'static str = "ImOnline"; const EVENT: &'static str = "HeartbeatReceived"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "At the end of the session, no offence was committed."] pub struct AllGood; - impl ::subxt::Event for AllGood { + impl ::subxt::events::StaticEvent for AllGood { const PALLET: &'static str = "ImOnline"; const EVENT: &'static str = "AllGood"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "At the end of the session, at least one validator was found to be offline."] pub struct SomeOffline { pub offline: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, )>, } - impl ::subxt::Event for SomeOffline { + impl ::subxt::events::StaticEvent for SomeOffline { const PALLET: &'static str = "ImOnline"; const EVENT: &'static str = "SomeOffline"; } } pub mod storage { use super::runtime_types; - pub struct HeartbeatAfter; - impl ::subxt::StorageEntry for HeartbeatAfter { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "HeartbeatAfter"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Keys; - impl ::subxt::StorageEntry for Keys { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "Keys"; - type Value = - runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReceivedHeartbeats<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for ReceivedHeartbeats<'_> { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "ReceivedHeartbeats"; - type Value = runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct AuthoredBlocks<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for AuthoredBlocks<'_> { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "AuthoredBlocks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The block number after which it's ok to send heartbeats in the current"] #[doc = " session."] #[doc = ""] @@ -12272,280 +7900,222 @@ pub mod api { #[doc = " more accurate then the value we calculate for `HeartbeatAfter`."] pub fn heartbeat_after( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 108u8, 100u8, 85u8, 198u8, 226u8, 122u8, 94u8, 225u8, - 97u8, 154u8, 135u8, 95u8, 106u8, 28u8, 185u8, 78u8, - 192u8, 196u8, 35u8, 191u8, 12u8, 19u8, 163u8, 46u8, - 232u8, 235u8, 193u8, 81u8, 126u8, 204u8, 25u8, 228u8, - ] - { - let entry = HeartbeatAfter; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " The current set of keys that may issue a heartbeat."] pub fn keys (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 105u8, 250u8, 99u8, 106u8, 9u8, 29u8, 73u8, 176u8, 158u8, - 247u8, 28u8, 171u8, 95u8, 1u8, 109u8, 11u8, 231u8, 52u8, - 54u8, 102u8, 142u8, 105u8, 209u8, 31u8, 132u8, 60u8, - 89u8, 181u8, 89u8, 193u8, 241u8, 130u8, - ] - { - let entry = Keys; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "HeartbeatAfter", + vec![], + [ + 108u8, 100u8, 85u8, 198u8, 226u8, 122u8, 94u8, 225u8, 97u8, + 154u8, 135u8, 95u8, 106u8, 28u8, 185u8, 78u8, 192u8, 196u8, + 35u8, 191u8, 12u8, 19u8, 163u8, 46u8, 232u8, 235u8, 193u8, + 81u8, 126u8, 204u8, 25u8, 228u8, + ], + ) + } + #[doc = " The current set of keys that may issue a heartbeat."] pub fn keys (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "Keys", + vec![], + [ + 6u8, 198u8, 221u8, 58u8, 14u8, 166u8, 245u8, 103u8, 191u8, + 20u8, 69u8, 233u8, 147u8, 245u8, 24u8, 64u8, 207u8, 180u8, + 39u8, 208u8, 252u8, 236u8, 247u8, 112u8, 187u8, 97u8, 70u8, + 11u8, 248u8, 148u8, 208u8, 106u8, + ], + ) } #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] - #[doc = " `WrapperOpaque`."] pub fn received_heartbeats (& self , _0 : & 'a :: core :: primitive :: u32 , _1 : & 'a :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: frame_support :: traits :: misc :: WrapperOpaque < runtime_types :: pallet_im_online :: BoundedOpaqueNetworkState > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 29u8, 40u8, 67u8, 222u8, 59u8, 104u8, 24u8, 193u8, 249u8, - 200u8, 152u8, 225u8, 72u8, 243u8, 140u8, 114u8, 121u8, - 216u8, 54u8, 145u8, 205u8, 82u8, 133u8, 128u8, 109u8, - 54u8, 153u8, 118u8, 66u8, 147u8, 251u8, 148u8, - ] - { - let entry = ReceivedHeartbeats(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " `WrapperOpaque`."] + pub fn received_heartbeats( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "ReceivedHeartbeats", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 233u8, 128u8, 140u8, 233u8, 55u8, 146u8, 172u8, 54u8, 54u8, + 57u8, 141u8, 106u8, 168u8, 59u8, 147u8, 253u8, 119u8, 48u8, + 50u8, 251u8, 242u8, 109u8, 251u8, 2u8, 136u8, 80u8, 146u8, + 121u8, 180u8, 219u8, 245u8, 37u8, + ], + ) } #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] #[doc = " `WrapperOpaque`."] - pub fn received_heartbeats_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ReceivedHeartbeats<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 29u8, 40u8, 67u8, 222u8, 59u8, 104u8, 24u8, 193u8, 249u8, - 200u8, 152u8, 225u8, 72u8, 243u8, 140u8, 114u8, 121u8, - 216u8, 54u8, 145u8, 205u8, 82u8, 133u8, 128u8, 109u8, - 54u8, 153u8, 118u8, 66u8, 147u8, 251u8, 148u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn received_heartbeats_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "ReceivedHeartbeats", + Vec::new(), + [ + 233u8, 128u8, 140u8, 233u8, 55u8, 146u8, 172u8, 54u8, 54u8, + 57u8, 141u8, 106u8, 168u8, 59u8, 147u8, 253u8, 119u8, 48u8, + 50u8, 251u8, 242u8, 109u8, 251u8, 2u8, 136u8, 80u8, 146u8, + 121u8, 180u8, 219u8, 245u8, 37u8, + ], + ) } #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] #[doc = " number of blocks authored by the given authority."] pub fn authored_blocks( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 94u8, 193u8, 107u8, 126u8, 3u8, 13u8, 28u8, 151u8, 197u8, - 226u8, 224u8, 48u8, 138u8, 113u8, 31u8, 57u8, 111u8, - 184u8, 218u8, 215u8, 185u8, 83u8, 209u8, 139u8, 114u8, - 241u8, 68u8, 110u8, 157u8, 208u8, 16u8, 22u8, - ] - { - let entry = AuthoredBlocks(_0, _1); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "AuthoredBlocks", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 50u8, 4u8, 242u8, 240u8, 247u8, 184u8, 114u8, 245u8, 233u8, + 170u8, 24u8, 197u8, 18u8, 245u8, 8u8, 28u8, 33u8, 115u8, + 166u8, 245u8, 221u8, 223u8, 56u8, 144u8, 33u8, 139u8, 10u8, + 227u8, 228u8, 223u8, 103u8, 151u8, + ], + ) } #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] #[doc = " number of blocks authored by the given authority."] - pub fn authored_blocks_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, AuthoredBlocks<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 94u8, 193u8, 107u8, 126u8, 3u8, 13u8, 28u8, 151u8, 197u8, - 226u8, 224u8, 48u8, 138u8, 113u8, 31u8, 57u8, 111u8, - 184u8, 218u8, 215u8, 185u8, 83u8, 209u8, 139u8, 114u8, - 241u8, 68u8, 110u8, 157u8, 208u8, 16u8, 22u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn authored_blocks_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "AuthoredBlocks", + Vec::new(), + [ + 50u8, 4u8, 242u8, 240u8, 247u8, 184u8, 114u8, 245u8, 233u8, + 170u8, 24u8, 197u8, 18u8, 245u8, 8u8, 28u8, 33u8, 115u8, + 166u8, 245u8, 221u8, 223u8, 56u8, 144u8, 33u8, 139u8, 10u8, + 227u8, 228u8, 223u8, 103u8, 151u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " A configuration for base priority of unsigned transactions."] #[doc = ""] #[doc = " This is exposed so that it can be tuned for particular runtime, when"] #[doc = " multiple pallets send unsigned transactions."] pub fn unsigned_priority( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("ImOnline", "UnsignedPriority")? - == [ - 78u8, 226u8, 84u8, 70u8, 162u8, 23u8, 167u8, 100u8, 156u8, - 228u8, 119u8, 16u8, 28u8, 202u8, 21u8, 71u8, 72u8, 244u8, - 3u8, 255u8, 243u8, 55u8, 109u8, 238u8, 26u8, 180u8, 207u8, - 175u8, 221u8, 27u8, 213u8, 217u8, - ] - { - let pallet = metadata.pallet("ImOnline")?; - let constant = pallet.constant("UnsignedPriority")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ImOnline", + "UnsignedPriority", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } } } } pub mod authority_discovery { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; } pub mod democracy { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Propose { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Second { #[codec(compact)] pub proposal: ::core::primitive::u32, #[codec(compact)] pub seconds_upper_bound: ::core::primitive::u32, } - impl ::subxt::Call for Second { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "second"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Vote { #[codec(compact)] pub ref_index: ::core::primitive::u32, @@ -12553,223 +8123,194 @@ pub mod api { ::core::primitive::u128, >, } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "vote"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct EmergencyCancel { pub ref_index: ::core::primitive::u32, } - impl ::subxt::Call for EmergencyCancel { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "emergency_cancel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ExternalPropose { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for ExternalPropose { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "external_propose"; + pub proposal_hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ExternalProposeMajority { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for ExternalProposeMajority { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "external_propose_majority"; + pub proposal_hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ExternalProposeDefault { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for ExternalProposeDefault { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "external_propose_default"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct FastTrack { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub voting_period: ::core::primitive::u32, pub delay: ::core::primitive::u32, } - impl ::subxt::Call for FastTrack { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "fast_track"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct VetoExternal { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for VetoExternal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "veto_external"; + pub proposal_hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CancelReferendum { #[codec(compact)] pub ref_index: ::core::primitive::u32, } - impl ::subxt::Call for CancelReferendum { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_referendum"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct CancelQueued { pub which: ::core::primitive::u32, } - impl ::subxt::Call for CancelQueued { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_queued"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Delegate { - pub to: ::subxt::sp_core::crypto::AccountId32, + pub to: ::subxt::ext::sp_core::crypto::AccountId32, pub conviction: runtime_types::pallet_democracy::conviction::Conviction, pub balance: ::core::primitive::u128, } - impl ::subxt::Call for Delegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "delegate"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Undelegate; - impl ::subxt::Call for Undelegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "undelegate"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClearPublicProposals; - impl ::subxt::Call for ClearPublicProposals { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "clear_public_proposals"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NotePreimage { pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for NotePreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NotePreimageOperational { pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for NotePreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage_operational"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NoteImminentPreimage { pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for NoteImminentPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NoteImminentPreimageOperational { pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for NoteImminentPreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage_operational"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReapPreimage { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub proposal_len_upper_bound: ::core::primitive::u32, } - impl ::subxt::Call for ReapPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "reap_preimage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Unlock { - pub target: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for Unlock { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "unlock"; + pub target: ::subxt::ext::sp_core::crypto::AccountId32, } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct RemoveVote { pub index: ::core::primitive::u32, } - impl ::subxt::Call for RemoveVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_vote"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveOtherVote { - pub target: ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_core::crypto::AccountId32, pub index: ::core::primitive::u32, } - impl ::subxt::Call for RemoveOtherVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_other_vote"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct EnactProposal { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub index: ::core::primitive::u32, } - impl ::subxt::Call for EnactProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "enact_proposal"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Blacklist { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub maybe_ref_index: ::core::option::Option<::core::primitive::u32>, } - impl ::subxt::Call for Blacklist { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "blacklist"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CancelProposal { #[codec(compact)] pub prop_index: ::core::primitive::u32, } - impl ::subxt::Call for CancelProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Propose a sensitive action to be taken."] #[doc = ""] #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] @@ -12783,40 +8324,23 @@ pub mod api { #[doc = "Weight: `O(p)`"] pub fn propose( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 149u8, 60u8, 16u8, 143u8, 114u8, 16u8, 124u8, 96u8, 97u8, - 5u8, 176u8, 137u8, 188u8, 164u8, 65u8, 145u8, 142u8, 104u8, - 74u8, 120u8, 248u8, 90u8, 109u8, 112u8, 29u8, 226u8, 208u8, - 230u8, 101u8, 8u8, 79u8, 12u8, - ] - { - let call = Propose { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "propose", + Propose { proposal_hash, value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 151u8, 2u8, 117u8, 57u8, 201u8, 246u8, 181u8, 198u8, 83u8, + 74u8, 99u8, 211u8, 237u8, 53u8, 90u8, 173u8, 161u8, 250u8, + 139u8, 253u8, 223u8, 251u8, 39u8, 108u8, 254u8, 192u8, 233u8, + 23u8, 9u8, 99u8, 169u8, 195u8, + ], + ) } #[doc = "Signals agreement with a particular proposal."] #[doc = ""] @@ -12832,38 +8356,21 @@ pub mod api { &self, proposal: ::core::primitive::u32, seconds_upper_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Second, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 37u8, 226u8, 138u8, 26u8, 138u8, 46u8, 39u8, 147u8, 22u8, - 32u8, 245u8, 40u8, 49u8, 228u8, 218u8, 225u8, 72u8, 89u8, - 37u8, 90u8, 132u8, 31u8, 52u8, 22u8, 234u8, 124u8, 254u8, - 223u8, 56u8, 215u8, 255u8, 79u8, - ] - { - let call = Second { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "second", + Second { proposal, seconds_upper_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 152u8, 56u8, 134u8, 181u8, 88u8, 224u8, 68u8, 238u8, 231u8, + 78u8, 237u8, 142u8, 133u8, 16u8, 93u8, 63u8, 253u8, 81u8, + 96u8, 200u8, 43u8, 21u8, 249u8, 92u8, 78u8, 24u8, 101u8, + 217u8, 143u8, 16u8, 213u8, 244u8, + ], + ) } #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] #[doc = "otherwise it is a vote to keep the status quo."] @@ -12880,35 +8387,18 @@ pub mod api { vote: runtime_types::pallet_democracy::vote::AccountVote< ::core::primitive::u128, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 1u8, 235u8, 77u8, 58u8, 54u8, 224u8, 30u8, 168u8, 150u8, - 169u8, 20u8, 172u8, 137u8, 191u8, 189u8, 184u8, 28u8, 118u8, - 204u8, 233u8, 146u8, 212u8, 45u8, 139u8, 58u8, 175u8, 231u8, - 169u8, 43u8, 164u8, 149u8, 16u8, - ] - { - let call = Vote { ref_index, vote }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "vote", + Vote { ref_index, vote }, + [ + 138u8, 213u8, 229u8, 111u8, 1u8, 191u8, 73u8, 3u8, 145u8, + 28u8, 44u8, 88u8, 163u8, 188u8, 129u8, 188u8, 64u8, 15u8, + 64u8, 103u8, 250u8, 97u8, 234u8, 188u8, 29u8, 205u8, 51u8, + 6u8, 116u8, 58u8, 156u8, 201u8, + ], + ) } #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] #[doc = "referendum."] @@ -12921,35 +8411,18 @@ pub mod api { pub fn emergency_cancel( &self, ref_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - EmergencyCancel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 4u8, 129u8, 205u8, 102u8, 202u8, 197u8, 75u8, 155u8, 24u8, - 125u8, 157u8, 73u8, 50u8, 243u8, 173u8, 103u8, 49u8, 60u8, - 50u8, 63u8, 54u8, 40u8, 34u8, 227u8, 29u8, 247u8, 179u8, - 102u8, 107u8, 177u8, 117u8, 161u8, - ] - { - let call = EmergencyCancel { ref_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "emergency_cancel", + EmergencyCancel { ref_index }, + [ + 139u8, 213u8, 133u8, 75u8, 34u8, 206u8, 124u8, 245u8, 35u8, + 237u8, 132u8, 92u8, 49u8, 167u8, 117u8, 80u8, 188u8, 93u8, + 198u8, 237u8, 132u8, 77u8, 195u8, 65u8, 29u8, 37u8, 86u8, + 74u8, 214u8, 119u8, 71u8, 204u8, + ], + ) } #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] #[doc = "referendum."] @@ -12962,36 +8435,19 @@ pub mod api { #[doc = " Decoding vec of length V. Charged as maximum"] pub fn external_propose( &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExternalPropose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 50u8, 82u8, 155u8, 206u8, 57u8, 61u8, 64u8, 43u8, 30u8, 71u8, - 89u8, 91u8, 221u8, 46u8, 15u8, 222u8, 15u8, 211u8, 56u8, - 176u8, 84u8, 225u8, 192u8, 92u8, 253u8, 56u8, 207u8, 29u8, - 252u8, 77u8, 245u8, 113u8, - ] - { - let call = ExternalPropose { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "external_propose", + ExternalPropose { proposal_hash }, + [ + 8u8, 206u8, 229u8, 218u8, 203u8, 208u8, 253u8, 113u8, 43u8, + 62u8, 110u8, 155u8, 123u8, 35u8, 187u8, 211u8, 180u8, 225u8, + 41u8, 30u8, 204u8, 110u8, 202u8, 210u8, 143u8, 84u8, 117u8, + 20u8, 215u8, 110u8, 211u8, 89u8, + ], + ) } #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] #[doc = "an external referendum."] @@ -13006,36 +8462,20 @@ pub mod api { #[doc = "Weight: `O(1)`"] pub fn external_propose_majority( &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExternalProposeMajority, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 18u8, 92u8, 204u8, 120u8, 189u8, 60u8, 223u8, 166u8, 213u8, - 49u8, 20u8, 131u8, 202u8, 1u8, 87u8, 226u8, 168u8, 156u8, - 144u8, 110u8, 118u8, 125u8, 81u8, 111u8, 229u8, 244u8, 89u8, - 93u8, 202u8, 140u8, 16u8, 220u8, - ] - { - let call = ExternalProposeMajority { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "external_propose_majority", + ExternalProposeMajority { proposal_hash }, + [ + 36u8, 47u8, 192u8, 177u8, 164u8, 82u8, 109u8, 215u8, 98u8, + 28u8, 47u8, 237u8, 159u8, 233u8, 53u8, 9u8, 158u8, 134u8, + 232u8, 249u8, 55u8, 189u8, 48u8, 133u8, 201u8, 46u8, 237u8, + 158u8, 181u8, 163u8, 166u8, 213u8, + ], + ) } #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] #[doc = "schedule an external referendum."] @@ -13050,36 +8490,20 @@ pub mod api { #[doc = "Weight: `O(1)`"] pub fn external_propose_default( &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExternalProposeDefault, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 51u8, 75u8, 236u8, 51u8, 53u8, 39u8, 26u8, 231u8, 212u8, - 191u8, 175u8, 233u8, 181u8, 156u8, 210u8, 221u8, 181u8, - 182u8, 113u8, 69u8, 171u8, 70u8, 219u8, 133u8, 88u8, 78u8, - 87u8, 228u8, 177u8, 53u8, 111u8, 115u8, - ] - { - let call = ExternalProposeDefault { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "external_propose_default", + ExternalProposeDefault { proposal_hash }, + [ + 32u8, 100u8, 249u8, 175u8, 187u8, 77u8, 30u8, 65u8, 90u8, + 103u8, 251u8, 21u8, 21u8, 220u8, 8u8, 118u8, 97u8, 160u8, + 152u8, 122u8, 71u8, 140u8, 96u8, 8u8, 245u8, 74u8, 112u8, + 164u8, 55u8, 130u8, 38u8, 14u8, + ], + ) } #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] @@ -13098,42 +8522,25 @@ pub mod api { #[doc = "Weight: `O(1)`"] pub fn fast_track( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, voting_period: ::core::primitive::u32, delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - FastTrack, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 232u8, 255u8, 150u8, 13u8, 151u8, 28u8, 253u8, 37u8, 183u8, - 127u8, 53u8, 228u8, 160u8, 11u8, 223u8, 48u8, 74u8, 5u8, - 37u8, 3u8, 84u8, 224u8, 79u8, 172u8, 120u8, 220u8, 158u8, - 191u8, 127u8, 55u8, 126u8, 135u8, - ] - { - let call = FastTrack { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "fast_track", + FastTrack { proposal_hash, voting_period, delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 125u8, 209u8, 107u8, 120u8, 93u8, 205u8, 129u8, 147u8, 254u8, + 126u8, 45u8, 126u8, 39u8, 0u8, 56u8, 14u8, 233u8, 49u8, + 245u8, 220u8, 156u8, 10u8, 252u8, 31u8, 102u8, 90u8, 163u8, + 236u8, 178u8, 85u8, 13u8, 24u8, + ], + ) } #[doc = "Veto and blacklist the external proposal hash."] #[doc = ""] @@ -13146,36 +8553,19 @@ pub mod api { #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] pub fn veto_external( &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - VetoExternal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 230u8, 207u8, 43u8, 137u8, 173u8, 97u8, 143u8, 183u8, 193u8, - 78u8, 252u8, 104u8, 237u8, 32u8, 151u8, 164u8, 91u8, 247u8, - 233u8, 36u8, 198u8, 88u8, 63u8, 176u8, 77u8, 87u8, 26u8, - 242u8, 211u8, 47u8, 193u8, 180u8, - ] - { - let call = VetoExternal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "veto_external", + VetoExternal { proposal_hash }, + [ + 209u8, 18u8, 18u8, 103u8, 186u8, 160u8, 214u8, 124u8, 150u8, + 207u8, 112u8, 90u8, 84u8, 197u8, 95u8, 157u8, 165u8, 65u8, + 109u8, 101u8, 75u8, 201u8, 41u8, 149u8, 75u8, 154u8, 37u8, + 178u8, 239u8, 121u8, 124u8, 23u8, + ], + ) } #[doc = "Remove a referendum."] #[doc = ""] @@ -13187,35 +8577,18 @@ pub mod api { pub fn cancel_referendum( &self, ref_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelReferendum, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 107u8, 144u8, 114u8, 224u8, 39u8, 217u8, 156u8, 202u8, 62u8, - 4u8, 196u8, 63u8, 145u8, 196u8, 107u8, 241u8, 3u8, 61u8, - 202u8, 20u8, 123u8, 158u8, 153u8, 45u8, 192u8, 192u8, 244u8, - 42u8, 224u8, 23u8, 243u8, 225u8, - ] - { - let call = CancelReferendum { ref_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "cancel_referendum", + CancelReferendum { ref_index }, + [ + 51u8, 25u8, 25u8, 251u8, 236u8, 115u8, 130u8, 230u8, 72u8, + 186u8, 119u8, 71u8, 165u8, 137u8, 55u8, 167u8, 187u8, 128u8, + 55u8, 8u8, 212u8, 139u8, 245u8, 232u8, 103u8, 136u8, 229u8, + 113u8, 125u8, 36u8, 1u8, 149u8, + ], + ) } #[doc = "Cancel a proposal queued for enactment."] #[doc = ""] @@ -13227,35 +8600,18 @@ pub mod api { pub fn cancel_queued( &self, which: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelQueued, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 130u8, 218u8, 212u8, 143u8, 89u8, 134u8, 207u8, 161u8, 165u8, - 202u8, 237u8, 237u8, 81u8, 125u8, 165u8, 147u8, 222u8, 198u8, - 236u8, 1u8, 223u8, 74u8, 200u8, 6u8, 208u8, 128u8, 215u8, - 50u8, 46u8, 117u8, 16u8, 143u8, - ] - { - let call = CancelQueued { which }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "cancel_queued", + CancelQueued { which }, + [ + 6u8, 97u8, 182u8, 142u8, 165u8, 206u8, 218u8, 245u8, 206u8, + 224u8, 143u8, 164u8, 232u8, 129u8, 202u8, 141u8, 78u8, 65u8, + 79u8, 206u8, 3u8, 195u8, 151u8, 36u8, 8u8, 220u8, 184u8, + 239u8, 28u8, 187u8, 208u8, 174u8, + ], + ) } #[doc = "Delegate the voting power (with some given conviction) of the sending account."] #[doc = ""] @@ -13279,42 +8635,25 @@ pub mod api { #[doc = " voted on. Weight is charged as if maximum votes."] pub fn delegate( &self, - to: ::subxt::sp_core::crypto::AccountId32, + to: ::subxt::ext::sp_core::crypto::AccountId32, conviction: runtime_types::pallet_democracy::conviction::Conviction, balance: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Delegate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 33u8, 155u8, 180u8, 53u8, 39u8, 251u8, 59u8, 100u8, 16u8, - 124u8, 209u8, 40u8, 42u8, 152u8, 3u8, 109u8, 97u8, 211u8, - 129u8, 151u8, 82u8, 45u8, 16u8, 98u8, 114u8, 250u8, 145u8, - 176u8, 244u8, 39u8, 64u8, 11u8, - ] - { - let call = Delegate { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "delegate", + Delegate { to, conviction, balance, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 190u8, 241u8, 243u8, 105u8, 114u8, 112u8, 169u8, 52u8, 119u8, + 174u8, 61u8, 72u8, 165u8, 161u8, 192u8, 234u8, 32u8, 144u8, + 89u8, 214u8, 178u8, 227u8, 251u8, 198u8, 129u8, 21u8, 244u8, + 183u8, 135u8, 33u8, 1u8, 224u8, + ], + ) } #[doc = "Undelegate the voting power of the sending account."] #[doc = ""] @@ -13328,37 +8667,18 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] #[doc = " voted on. Weight is charged as if maximum votes."] - pub fn undelegate( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Undelegate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn undelegate(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "undelegate", + Undelegate {}, + [ 165u8, 40u8, 183u8, 209u8, 57u8, 153u8, 111u8, 29u8, 114u8, 109u8, 107u8, 235u8, 97u8, 61u8, 53u8, 155u8, 44u8, 245u8, 28u8, 220u8, 56u8, 134u8, 43u8, 122u8, 248u8, 156u8, 191u8, 154u8, 4u8, 121u8, 152u8, 153u8, - ] - { - let call = Undelegate {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Clears all public proposals."] #[doc = ""] @@ -13367,35 +8687,18 @@ pub mod api { #[doc = "Weight: `O(1)`."] pub fn clear_public_proposals( &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearPublicProposals, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "clear_public_proposals", + ClearPublicProposals {}, + [ 59u8, 126u8, 254u8, 223u8, 252u8, 225u8, 75u8, 185u8, 188u8, 181u8, 42u8, 179u8, 211u8, 73u8, 12u8, 141u8, 243u8, 197u8, 46u8, 130u8, 215u8, 196u8, 225u8, 88u8, 48u8, 199u8, 231u8, 249u8, 195u8, 53u8, 184u8, 204u8, - ] - { - let call = ClearPublicProposals {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] @@ -13410,69 +8713,36 @@ pub mod api { pub fn note_preimage( &self, encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NotePreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 121u8, 179u8, 204u8, 32u8, 104u8, 133u8, 99u8, 153u8, 226u8, - 190u8, 89u8, 121u8, 232u8, 154u8, 89u8, 133u8, 124u8, 222u8, - 237u8, 39u8, 50u8, 128u8, 80u8, 115u8, 186u8, 180u8, 151u8, - 139u8, 73u8, 112u8, 148u8, 232u8, - ] - { - let call = NotePreimage { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_preimage", + NotePreimage { encoded_proposal }, + [ + 31u8, 252u8, 248u8, 238u8, 103u8, 1u8, 82u8, 84u8, 135u8, + 152u8, 246u8, 234u8, 251u8, 124u8, 193u8, 73u8, 52u8, 255u8, + 88u8, 31u8, 112u8, 99u8, 191u8, 245u8, 251u8, 202u8, 51u8, + 130u8, 136u8, 114u8, 177u8, 241u8, + ], + ) } #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] pub fn note_preimage_operational( &self, encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NotePreimageOperational, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 102u8, 20u8, 213u8, 32u8, 64u8, 28u8, 150u8, 241u8, 173u8, - 182u8, 201u8, 70u8, 52u8, 211u8, 95u8, 211u8, 127u8, 12u8, - 249u8, 57u8, 128u8, 64u8, 185u8, 239u8, 255u8, 191u8, 203u8, - 222u8, 123u8, 187u8, 106u8, 12u8, - ] - { - let call = NotePreimageOperational { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_preimage_operational", + NotePreimageOperational { encoded_proposal }, + [ + 184u8, 81u8, 31u8, 172u8, 81u8, 113u8, 84u8, 246u8, 189u8, + 219u8, 167u8, 32u8, 191u8, 126u8, 165u8, 250u8, 147u8, 199u8, + 241u8, 196u8, 253u8, 34u8, 51u8, 158u8, 2u8, 157u8, 16u8, + 122u8, 210u8, 66u8, 110u8, 234u8, + ], + ) } #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] @@ -13489,69 +8759,36 @@ pub mod api { pub fn note_imminent_preimage( &self, encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteImminentPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 240u8, 77u8, 42u8, 178u8, 110u8, 117u8, 152u8, 158u8, 64u8, - 26u8, 49u8, 37u8, 177u8, 178u8, 203u8, 227u8, 23u8, 251u8, - 242u8, 112u8, 184u8, 234u8, 95u8, 73u8, 86u8, 37u8, 148u8, - 150u8, 6u8, 50u8, 239u8, 64u8, - ] - { - let call = NoteImminentPreimage { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_imminent_preimage", + NoteImminentPreimage { encoded_proposal }, + [ + 32u8, 188u8, 10u8, 215u8, 245u8, 132u8, 234u8, 124u8, 19u8, + 90u8, 225u8, 216u8, 169u8, 105u8, 95u8, 231u8, 12u8, 109u8, + 16u8, 91u8, 153u8, 134u8, 240u8, 82u8, 80u8, 254u8, 117u8, + 230u8, 88u8, 203u8, 68u8, 42u8, + ], + ) } #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] pub fn note_imminent_preimage_operational( &self, encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteImminentPreimageOperational, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 119u8, 17u8, 140u8, 81u8, 7u8, 103u8, 162u8, 112u8, 160u8, - 179u8, 116u8, 34u8, 126u8, 150u8, 64u8, 117u8, 93u8, 225u8, - 197u8, 40u8, 62u8, 238u8, 174u8, 63u8, 148u8, 248u8, 214u8, - 212u8, 228u8, 86u8, 87u8, 195u8, - ] - { - let call = NoteImminentPreimageOperational { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_imminent_preimage_operational", + NoteImminentPreimageOperational { encoded_proposal }, + [ + 7u8, 31u8, 49u8, 238u8, 155u8, 234u8, 187u8, 147u8, 123u8, + 84u8, 50u8, 98u8, 221u8, 39u8, 218u8, 204u8, 175u8, 136u8, + 44u8, 93u8, 140u8, 172u8, 73u8, 98u8, 168u8, 110u8, 31u8, + 82u8, 22u8, 1u8, 205u8, 84u8, + ], + ) } #[doc = "Remove an expired proposal preimage and collect the deposit."] #[doc = ""] @@ -13570,40 +8807,23 @@ pub mod api { #[doc = "Weight: `O(D)` where D is length of proposal."] pub fn reap_preimage( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, proposal_len_upper_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReapPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 45u8, 191u8, 46u8, 19u8, 87u8, 216u8, 48u8, 29u8, 124u8, - 205u8, 39u8, 178u8, 158u8, 95u8, 163u8, 116u8, 232u8, 58u8, - 6u8, 242u8, 52u8, 215u8, 251u8, 49u8, 1u8, 234u8, 99u8, - 142u8, 76u8, 182u8, 134u8, 173u8, - ] - { - let call = ReapPreimage { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "reap_preimage", + ReapPreimage { proposal_hash, proposal_len_upper_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 135u8, 43u8, 115u8, 154u8, 93u8, 121u8, 112u8, 65u8, 145u8, + 141u8, 236u8, 252u8, 203u8, 155u8, 63u8, 130u8, 120u8, 221u8, + 13u8, 105u8, 81u8, 179u8, 167u8, 254u8, 213u8, 117u8, 146u8, + 232u8, 18u8, 104u8, 196u8, 112u8, + ], + ) } #[doc = "Unlock tokens that have an expired lock."] #[doc = ""] @@ -13614,36 +8834,19 @@ pub mod api { #[doc = "Weight: `O(R)` with R number of vote of target."] pub fn unlock( &self, - target: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Unlock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 106u8, 17u8, 189u8, 71u8, 208u8, 26u8, 49u8, 71u8, 162u8, - 196u8, 126u8, 192u8, 242u8, 239u8, 77u8, 196u8, 62u8, 171u8, - 58u8, 176u8, 157u8, 81u8, 65u8, 246u8, 210u8, 43u8, 1u8, - 226u8, 143u8, 149u8, 210u8, 192u8, - ] - { - let call = Unlock { target }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + target: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "unlock", + Unlock { target }, + [ + 137u8, 93u8, 240u8, 75u8, 142u8, 148u8, 51u8, 55u8, 88u8, + 159u8, 2u8, 57u8, 24u8, 169u8, 120u8, 121u8, 115u8, 53u8, + 225u8, 176u8, 67u8, 156u8, 20u8, 132u8, 39u8, 54u8, 125u8, + 203u8, 199u8, 85u8, 60u8, 211u8, + ], + ) } #[doc = "Remove a vote for a referendum."] #[doc = ""] @@ -13675,35 +8878,18 @@ pub mod api { pub fn remove_vote( &self, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveVote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 33u8, 72u8, 14u8, 166u8, 152u8, 18u8, 232u8, 153u8, 163u8, - 96u8, 146u8, 180u8, 98u8, 155u8, 119u8, 75u8, 247u8, 175u8, - 246u8, 183u8, 182u8, 108u8, 250u8, 80u8, 148u8, 86u8, 255u8, - 59u8, 93u8, 197u8, 209u8, 226u8, - ] - { - let call = RemoveVote { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "remove_vote", + RemoveVote { index }, + [ + 148u8, 120u8, 14u8, 172u8, 81u8, 152u8, 159u8, 178u8, 106u8, + 244u8, 36u8, 98u8, 120u8, 189u8, 213u8, 93u8, 119u8, 156u8, + 112u8, 34u8, 241u8, 72u8, 206u8, 113u8, 212u8, 161u8, 164u8, + 126u8, 122u8, 82u8, 160u8, 74u8, + ], + ) } #[doc = "Remove a vote for a referendum."] #[doc = ""] @@ -13722,75 +8908,41 @@ pub mod api { #[doc = " Weight is calculated for the maximum number of vote."] pub fn remove_other_vote( &self, - target: ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveOtherVote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 43u8, 194u8, 32u8, 219u8, 87u8, 143u8, 240u8, 34u8, 236u8, - 232u8, 128u8, 7u8, 99u8, 113u8, 106u8, 124u8, 92u8, 115u8, - 75u8, 228u8, 39u8, 234u8, 192u8, 134u8, 69u8, 109u8, 119u8, - 133u8, 194u8, 110u8, 167u8, 244u8, - ] - { - let call = RemoveOtherVote { target, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "remove_other_vote", + RemoveOtherVote { target, index }, + [ + 137u8, 59u8, 51u8, 72u8, 97u8, 181u8, 74u8, 123u8, 65u8, + 147u8, 63u8, 23u8, 14u8, 6u8, 66u8, 186u8, 105u8, 72u8, + 112u8, 120u8, 51u8, 229u8, 247u8, 96u8, 218u8, 137u8, 220u8, + 65u8, 95u8, 109u8, 253u8, 45u8, + ], + ) } #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] pub fn enact_proposal( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - EnactProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 246u8, 188u8, 9u8, 244u8, 56u8, 81u8, 201u8, 59u8, 212u8, - 11u8, 204u8, 7u8, 173u8, 7u8, 212u8, 34u8, 173u8, 248u8, - 83u8, 225u8, 209u8, 105u8, 249u8, 167u8, 243u8, 49u8, 119u8, - 167u8, 28u8, 31u8, 60u8, 75u8, - ] - { - let call = EnactProposal { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "enact_proposal", + EnactProposal { proposal_hash, index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 191u8, 244u8, 244u8, 174u8, 95u8, 86u8, 132u8, 63u8, 2u8, + 94u8, 3u8, 117u8, 96u8, 54u8, 100u8, 89u8, 124u8, 117u8, + 205u8, 142u8, 214u8, 192u8, 137u8, 141u8, 178u8, 145u8, + 241u8, 167u8, 163u8, 76u8, 61u8, 31u8, + ], + ) } #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] #[doc = "proposed again."] @@ -13809,40 +8961,23 @@ pub mod api { #[doc = " reasonable value)."] pub fn blacklist( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, maybe_ref_index: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Blacklist, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 105u8, 99u8, 153u8, 150u8, 122u8, 234u8, 105u8, 238u8, 152u8, - 152u8, 121u8, 181u8, 133u8, 246u8, 159u8, 35u8, 8u8, 65u8, - 15u8, 203u8, 206u8, 75u8, 28u8, 214u8, 111u8, 26u8, 40u8, - 141u8, 68u8, 57u8, 217u8, 244u8, - ] - { - let call = Blacklist { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "blacklist", + Blacklist { proposal_hash, maybe_ref_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 48u8, 144u8, 81u8, 164u8, 54u8, 111u8, 197u8, 134u8, 6u8, + 98u8, 121u8, 179u8, 254u8, 191u8, 204u8, 212u8, 84u8, 255u8, + 86u8, 110u8, 225u8, 130u8, 26u8, 65u8, 133u8, 56u8, 231u8, + 15u8, 245u8, 137u8, 146u8, 242u8, + ], + ) } #[doc = "Remove a proposal."] #[doc = ""] @@ -13854,35 +8989,18 @@ pub mod api { pub fn cancel_proposal( &self, prop_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 26u8, 117u8, 180u8, 24u8, 12u8, 177u8, 77u8, 254u8, 113u8, - 53u8, 146u8, 48u8, 164u8, 255u8, 45u8, 205u8, 207u8, 46u8, - 74u8, 184u8, 73u8, 95u8, 216u8, 190u8, 240u8, 64u8, 121u8, - 104u8, 147u8, 141u8, 128u8, 82u8, - ] - { - let call = CancelProposal { prop_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "cancel_proposal", + CancelProposal { prop_index }, + [ + 179u8, 3u8, 198u8, 244u8, 241u8, 124u8, 205u8, 58u8, 100u8, + 80u8, 177u8, 254u8, 98u8, 220u8, 189u8, 63u8, 229u8, 60u8, + 157u8, 83u8, 142u8, 6u8, 236u8, 183u8, 193u8, 235u8, 253u8, + 126u8, 153u8, 185u8, 74u8, 117u8, + ], + ) } } } @@ -13890,777 +9008,566 @@ pub mod api { pub type Event = runtime_types::pallet_democracy::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion has been proposed by a public account."] pub struct Proposed { pub proposal_index: ::core::primitive::u32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for Proposed { + impl ::subxt::events::StaticEvent for Proposed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Proposed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A public proposal has been tabled for referendum vote."] pub struct Tabled { pub proposal_index: ::core::primitive::u32, pub deposit: ::core::primitive::u128, - pub depositors: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub depositors: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, } - impl ::subxt::Event for Tabled { + impl ::subxt::events::StaticEvent for Tabled { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Tabled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An external proposal has been tabled."] pub struct ExternalTabled; - impl ::subxt::Event for ExternalTabled { + impl ::subxt::events::StaticEvent for ExternalTabled { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "ExternalTabled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A referendum has begun."] pub struct Started { pub ref_index: ::core::primitive::u32, pub threshold: runtime_types::pallet_democracy::vote_threshold::VoteThreshold, } - impl ::subxt::Event for Started { + impl ::subxt::events::StaticEvent for Started { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Started"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A proposal has been approved by referendum."] pub struct Passed { pub ref_index: ::core::primitive::u32, } - impl ::subxt::Event for Passed { + impl ::subxt::events::StaticEvent for Passed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Passed"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A proposal has been rejected by referendum."] pub struct NotPassed { pub ref_index: ::core::primitive::u32, } - impl ::subxt::Event for NotPassed { + impl ::subxt::events::StaticEvent for NotPassed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "NotPassed"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A referendum has been cancelled."] pub struct Cancelled { pub ref_index: ::core::primitive::u32, } - impl ::subxt::Event for Cancelled { + impl ::subxt::events::StaticEvent for Cancelled { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Cancelled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal has been enacted."] pub struct Executed { pub ref_index: ::core::primitive::u32, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for Executed { + impl ::subxt::events::StaticEvent for Executed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Executed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has delegated their vote to another account."] pub struct Delegated { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub target: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Delegated { + impl ::subxt::events::StaticEvent for Delegated { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Delegated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has cancelled a previous delegation operation."] pub struct Undelegated { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Undelegated { + impl ::subxt::events::StaticEvent for Undelegated { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Undelegated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An external proposal has been vetoed."] pub struct Vetoed { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub until: ::core::primitive::u32, } - impl ::subxt::Event for Vetoed { + impl ::subxt::events::StaticEvent for Vetoed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Vetoed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal's preimage was noted, and the deposit taken."] pub struct PreimageNoted { - pub proposal_hash: ::subxt::sp_core::H256, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for PreimageNoted { + impl ::subxt::events::StaticEvent for PreimageNoted { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageNoted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal preimage was removed and used (the deposit was returned)."] pub struct PreimageUsed { - pub proposal_hash: ::subxt::sp_core::H256, - pub provider: ::subxt::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub provider: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for PreimageUsed { + impl ::subxt::events::StaticEvent for PreimageUsed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageUsed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal could not be executed because its preimage was invalid."] pub struct PreimageInvalid { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub ref_index: ::core::primitive::u32, } - impl ::subxt::Event for PreimageInvalid { + impl ::subxt::events::StaticEvent for PreimageInvalid { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageInvalid"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal could not be executed because its preimage was missing."] pub struct PreimageMissing { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub ref_index: ::core::primitive::u32, } - impl ::subxt::Event for PreimageMissing { + impl ::subxt::events::StaticEvent for PreimageMissing { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageMissing"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A registered preimage was removed and the deposit collected by the reaper."] pub struct PreimageReaped { - pub proposal_hash: ::subxt::sp_core::H256, - pub provider: ::subxt::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub provider: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, - pub reaper: ::subxt::sp_core::crypto::AccountId32, + pub reaper: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for PreimageReaped { + impl ::subxt::events::StaticEvent for PreimageReaped { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageReaped"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal_hash has been blacklisted permanently."] pub struct Blacklisted { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Blacklisted { + impl ::subxt::events::StaticEvent for Blacklisted { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Blacklisted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has voted in a referendum"] pub struct Voted { - pub voter: ::subxt::sp_core::crypto::AccountId32, + pub voter: ::subxt::ext::sp_core::crypto::AccountId32, pub ref_index: ::core::primitive::u32, pub vote: runtime_types::pallet_democracy::vote::AccountVote< ::core::primitive::u128, >, } - impl ::subxt::Event for Voted { + impl ::subxt::events::StaticEvent for Voted { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Voted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has secconded a proposal"] pub struct Seconded { - pub seconder: ::subxt::sp_core::crypto::AccountId32, + pub seconder: ::subxt::ext::sp_core::crypto::AccountId32, pub prop_index: ::core::primitive::u32, } - impl ::subxt::Event for Seconded { + impl ::subxt::events::StaticEvent for Seconded { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Seconded"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A proposal got canceled."] pub struct ProposalCanceled { pub prop_index: ::core::primitive::u32, } - impl ::subxt::Event for ProposalCanceled { + impl ::subxt::events::StaticEvent for ProposalCanceled { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "ProposalCanceled"; } } pub mod storage { use super::runtime_types; - pub struct PublicPropCount; - impl ::subxt::StorageEntry for PublicPropCount { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "PublicPropCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PublicProps; - impl ::subxt::StorageEntry for PublicProps { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "PublicProps"; - type Value = ::std::vec::Vec<( - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DepositOf<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for DepositOf<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "DepositOf"; - type Value = ( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Preimages<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Preimages<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Preimages"; - type Value = runtime_types::pallet_democracy::PreimageStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ReferendumCount; - impl ::subxt::StorageEntry for ReferendumCount { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "ReferendumCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct LowestUnbaked; - impl ::subxt::StorageEntry for LowestUnbaked { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "LowestUnbaked"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReferendumInfoOf<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ReferendumInfoOf<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "ReferendumInfoOf"; - type Value = runtime_types::pallet_democracy::types::ReferendumInfo< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct VotingOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for VotingOf<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "VotingOf"; - type Value = runtime_types::pallet_democracy::vote::Voting< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct LastTabledWasExternal; - impl ::subxt::StorageEntry for LastTabledWasExternal { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "LastTabledWasExternal"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextExternal; - impl ::subxt::StorageEntry for NextExternal { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "NextExternal"; - type Value = ( - ::subxt::sp_core::H256, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Blacklist<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Blacklist<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Blacklist"; - type Value = ( - ::core::primitive::u32, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Cancellations<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Cancellations<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Cancellations"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_democracy::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The number of (public) proposals that have been made so far."] pub fn public_prop_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 91u8, 14u8, 171u8, 94u8, 37u8, 157u8, 46u8, 157u8, 254u8, - 13u8, 68u8, 144u8, 23u8, 146u8, 128u8, 159u8, 9u8, 174u8, - 74u8, 174u8, 218u8, 197u8, 23u8, 235u8, 152u8, 226u8, - 216u8, 4u8, 120u8, 121u8, 27u8, 138u8, - ] - { - let entry = PublicPropCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "PublicPropCount", + vec![], + [ + 91u8, 14u8, 171u8, 94u8, 37u8, 157u8, 46u8, 157u8, 254u8, + 13u8, 68u8, 144u8, 23u8, 146u8, 128u8, 159u8, 9u8, 174u8, + 74u8, 174u8, 218u8, 197u8, 23u8, 235u8, 152u8, 226u8, 216u8, + 4u8, 120u8, 121u8, 27u8, 138u8, + ], + ) } #[doc = " The public proposals. Unsorted. The second item is the proposal's hash."] pub fn public_props( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::H256, + ::subxt::ext::sp_core::crypto::AccountId32, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 78u8, 208u8, 211u8, 20u8, 85u8, 237u8, 161u8, 149u8, - 99u8, 158u8, 6u8, 54u8, 204u8, 228u8, 132u8, 10u8, 75u8, - 247u8, 148u8, 155u8, 101u8, 183u8, 58u8, 169u8, 21u8, - 172u8, 10u8, 110u8, 130u8, 74u8, 88u8, 52u8, - ] - { - let entry = PublicProps; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "PublicProps", + vec![], + [ + 151u8, 247u8, 196u8, 97u8, 171u8, 230u8, 55u8, 45u8, 220u8, + 16u8, 12u8, 28u8, 22u8, 58u8, 127u8, 179u8, 130u8, 192u8, + 115u8, 165u8, 5u8, 173u8, 87u8, 104u8, 7u8, 186u8, 114u8, + 47u8, 162u8, 182u8, 252u8, 154u8, + ], + ) } #[doc = " Those who have locked a deposit."] #[doc = ""] #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] pub fn deposit_of( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 116u8, 57u8, 200u8, 96u8, 150u8, 62u8, 162u8, 169u8, - 28u8, 18u8, 134u8, 161u8, 210u8, 217u8, 80u8, 225u8, - 22u8, 185u8, 177u8, 166u8, 243u8, 232u8, 193u8, 64u8, - 170u8, 89u8, 216u8, 198u8, 43u8, 102u8, 178u8, 55u8, - ] - { - let entry = DepositOf(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "DepositOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 153u8, 236u8, 152u8, 224u8, 221u8, 90u8, 204u8, 183u8, 222u8, + 160u8, 227u8, 26u8, 8u8, 110u8, 230u8, 102u8, 133u8, 186u8, + 66u8, 2u8, 84u8, 31u8, 236u8, 228u8, 202u8, 75u8, 17u8, 97u8, + 133u8, 232u8, 64u8, 7u8, + ], + ) } #[doc = " Those who have locked a deposit."] #[doc = ""] #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] - pub fn deposit_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, DepositOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 116u8, 57u8, 200u8, 96u8, 150u8, 62u8, 162u8, 169u8, - 28u8, 18u8, 134u8, 161u8, 210u8, 217u8, 80u8, 225u8, - 22u8, 185u8, 177u8, 166u8, 243u8, 232u8, 193u8, 64u8, - 170u8, 89u8, 216u8, 198u8, 43u8, 102u8, 178u8, 55u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn deposit_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "DepositOf", + Vec::new(), + [ + 153u8, 236u8, 152u8, 224u8, 221u8, 90u8, 204u8, 183u8, 222u8, + 160u8, 227u8, 26u8, 8u8, 110u8, 230u8, 102u8, 133u8, 186u8, + 66u8, 2u8, 84u8, 31u8, 236u8, 228u8, 202u8, 75u8, 17u8, 97u8, + 133u8, 232u8, 64u8, 7u8, + ], + ) } #[doc = " Map of hashes to the proposal preimage, along with who registered it and their deposit."] #[doc = " The block number is the block at which it was deposited."] pub fn preimages( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_democracy::PreimageStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::PreimageStatus< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 20u8, 82u8, 223u8, 51u8, 178u8, 115u8, 71u8, 83u8, 23u8, - 15u8, 85u8, 66u8, 0u8, 69u8, 68u8, 20u8, 28u8, 159u8, - 74u8, 41u8, 225u8, 145u8, 247u8, 23u8, 36u8, 155u8, - 101u8, 229u8, 27u8, 24u8, 93u8, 215u8, - ] - { - let entry = Preimages(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Preimages", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 206u8, 131u8, 7u8, 129u8, 172u8, 231u8, 164u8, 220u8, 129u8, + 0u8, 204u8, 227u8, 231u8, 244u8, 61u8, 145u8, 144u8, 146u8, + 173u8, 215u8, 174u8, 218u8, 192u8, 83u8, 174u8, 99u8, 87u8, + 102u8, 98u8, 235u8, 138u8, 127u8, + ], + ) } #[doc = " Map of hashes to the proposal preimage, along with who registered it and their deposit."] #[doc = " The block number is the block at which it was deposited."] - pub fn preimages_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Preimages<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 20u8, 82u8, 223u8, 51u8, 178u8, 115u8, 71u8, 83u8, 23u8, - 15u8, 85u8, 66u8, 0u8, 69u8, 68u8, 20u8, 28u8, 159u8, - 74u8, 41u8, 225u8, 145u8, 247u8, 23u8, 36u8, 155u8, - 101u8, 229u8, 27u8, 24u8, 93u8, 215u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn preimages_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::PreimageStatus< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Preimages", + Vec::new(), + [ + 206u8, 131u8, 7u8, 129u8, 172u8, 231u8, 164u8, 220u8, 129u8, + 0u8, 204u8, 227u8, 231u8, 244u8, 61u8, 145u8, 144u8, 146u8, + 173u8, 215u8, 174u8, 218u8, 192u8, 83u8, 174u8, 99u8, 87u8, + 102u8, 98u8, 235u8, 138u8, 127u8, + ], + ) } #[doc = " The next free referendum index, aka the number of referenda started so far."] pub fn referendum_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 153u8, 210u8, 106u8, 244u8, 156u8, 70u8, 124u8, 251u8, - 123u8, 75u8, 7u8, 189u8, 199u8, 145u8, 95u8, 119u8, - 137u8, 11u8, 240u8, 160u8, 151u8, 248u8, 229u8, 231u8, - 89u8, 222u8, 18u8, 237u8, 144u8, 78u8, 99u8, 58u8, - ] - { - let entry = ReferendumCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "ReferendumCount", + vec![], + [ + 153u8, 210u8, 106u8, 244u8, 156u8, 70u8, 124u8, 251u8, 123u8, + 75u8, 7u8, 189u8, 199u8, 145u8, 95u8, 119u8, 137u8, 11u8, + 240u8, 160u8, 151u8, 248u8, 229u8, 231u8, 89u8, 222u8, 18u8, + 237u8, 144u8, 78u8, 99u8, 58u8, + ], + ) } #[doc = " The lowest referendum index representing an unbaked referendum. Equal to"] #[doc = " `ReferendumCount` if there isn't a unbaked referendum."] pub fn lowest_unbaked( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 4u8, 51u8, 108u8, 11u8, 48u8, 165u8, 19u8, 251u8, 182u8, - 76u8, 163u8, 73u8, 227u8, 2u8, 212u8, 74u8, 128u8, 27u8, - 165u8, 164u8, 111u8, 22u8, 209u8, 190u8, 103u8, 7u8, - 116u8, 16u8, 160u8, 144u8, 123u8, 64u8, - ] - { - let entry = LowestUnbaked; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "LowestUnbaked", + vec![], + [ + 4u8, 51u8, 108u8, 11u8, 48u8, 165u8, 19u8, 251u8, 182u8, + 76u8, 163u8, 73u8, 227u8, 2u8, 212u8, 74u8, 128u8, 27u8, + 165u8, 164u8, 111u8, 22u8, 209u8, 190u8, 103u8, 7u8, 116u8, + 16u8, 160u8, 144u8, 123u8, 64u8, + ], + ) } #[doc = " Information concerning any given referendum."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as indexes are not under an attacker’s control."] pub fn referendum_info_of( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_democracy::types::ReferendumInfo< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::core::primitive::u128, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 112u8, 206u8, 173u8, 93u8, 255u8, 76u8, 85u8, 122u8, - 24u8, 97u8, 177u8, 67u8, 44u8, 143u8, 53u8, 159u8, 206u8, - 135u8, 63u8, 74u8, 230u8, 47u8, 27u8, 224u8, 138u8, - 217u8, 194u8, 229u8, 148u8, 249u8, 230u8, 114u8, - ] - { - let entry = ReferendumInfoOf(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "ReferendumInfoOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 132u8, 4u8, 108u8, 126u8, 91u8, 168u8, 18u8, 17u8, 86u8, + 79u8, 219u8, 222u8, 195u8, 137u8, 149u8, 177u8, 101u8, 134u8, + 130u8, 41u8, 217u8, 109u8, 18u8, 18u8, 33u8, 206u8, 117u8, + 131u8, 98u8, 26u8, 51u8, 8u8, + ], + ) } #[doc = " Information concerning any given referendum."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as indexes are not under an attacker’s control."] - pub fn referendum_info_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ReferendumInfoOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 112u8, 206u8, 173u8, 93u8, 255u8, 76u8, 85u8, 122u8, - 24u8, 97u8, 177u8, 67u8, 44u8, 143u8, 53u8, 159u8, 206u8, - 135u8, 63u8, 74u8, 230u8, 47u8, 27u8, 224u8, 138u8, - 217u8, 194u8, 229u8, 148u8, 249u8, 230u8, 114u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn referendum_info_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "ReferendumInfoOf", + Vec::new(), + [ + 132u8, 4u8, 108u8, 126u8, 91u8, 168u8, 18u8, 17u8, 86u8, + 79u8, 219u8, 222u8, 195u8, 137u8, 149u8, 177u8, 101u8, 134u8, + 130u8, 41u8, 217u8, 109u8, 18u8, 18u8, 33u8, 206u8, 117u8, + 131u8, 98u8, 26u8, 51u8, 8u8, + ], + ) } #[doc = " All votes for a particular voter. We store the balance for the number of votes that we"] #[doc = " have recorded. The second item is the total amount of delegations, that will be added."] @@ -14668,338 +9575,244 @@ pub mod api { #[doc = " TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway."] pub fn voting_of( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_democracy::vote::Voting< ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 194u8, 13u8, 151u8, 207u8, 194u8, 79u8, 233u8, 214u8, - 193u8, 52u8, 78u8, 62u8, 71u8, 35u8, 139u8, 11u8, 41u8, - 163u8, 143u8, 156u8, 236u8, 207u8, 132u8, 138u8, 2u8, - 176u8, 56u8, 224u8, 67u8, 39u8, 190u8, 13u8, - ] - { - let entry = VotingOf(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "VotingOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 211u8, 38u8, 232u8, 65u8, 215u8, 97u8, 157u8, 208u8, 177u8, + 150u8, 250u8, 226u8, 72u8, 185u8, 187u8, 162u8, 80u8, 67u8, + 195u8, 87u8, 190u8, 180u8, 167u8, 137u8, 253u8, 142u8, 34u8, + 158u8, 249u8, 168u8, 209u8, 18u8, + ], + ) } #[doc = " All votes for a particular voter. We store the balance for the number of votes that we"] #[doc = " have recorded. The second item is the total amount of delegations, that will be added."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway."] - pub fn voting_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, VotingOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 194u8, 13u8, 151u8, 207u8, 194u8, 79u8, 233u8, 214u8, - 193u8, 52u8, 78u8, 62u8, 71u8, 35u8, 139u8, 11u8, 41u8, - 163u8, 143u8, 156u8, 236u8, 207u8, 132u8, 138u8, 2u8, - 176u8, 56u8, 224u8, 67u8, 39u8, 190u8, 13u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn voting_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "VotingOf", + Vec::new(), + [ + 211u8, 38u8, 232u8, 65u8, 215u8, 97u8, 157u8, 208u8, 177u8, + 150u8, 250u8, 226u8, 72u8, 185u8, 187u8, 162u8, 80u8, 67u8, + 195u8, 87u8, 190u8, 180u8, 167u8, 137u8, 253u8, 142u8, 34u8, + 158u8, 249u8, 168u8, 209u8, 18u8, + ], + ) } #[doc = " True if the last referendum tabled was submitted externally. False if it was a public"] #[doc = " proposal."] pub fn last_tabled_was_external( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 3u8, 67u8, 106u8, 1u8, 89u8, 204u8, 4u8, 145u8, 121u8, - 44u8, 34u8, 76u8, 18u8, 206u8, 65u8, 214u8, 222u8, 82u8, - 31u8, 223u8, 144u8, 169u8, 17u8, 6u8, 138u8, 36u8, 113u8, - 155u8, 241u8, 106u8, 189u8, 218u8, - ] - { - let entry = LastTabledWasExternal; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "LastTabledWasExternal", + vec![], + [ + 3u8, 67u8, 106u8, 1u8, 89u8, 204u8, 4u8, 145u8, 121u8, 44u8, + 34u8, 76u8, 18u8, 206u8, 65u8, 214u8, 222u8, 82u8, 31u8, + 223u8, 144u8, 169u8, 17u8, 6u8, 138u8, 36u8, 113u8, 155u8, + 241u8, 106u8, 189u8, 218u8, + ], + ) } #[doc = " The referendum to be tabled whenever it would be valid to table an external proposal."] #[doc = " This happens when a referendum needs to be tabled and one of two conditions are met:"] #[doc = " - `LastTabledWasExternal` is `false`; or"] - #[doc = " - `PublicProps` is empty."] pub fn next_external (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < (:: subxt :: sp_core :: H256 , runtime_types :: pallet_democracy :: vote_threshold :: VoteThreshold ,) > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 167u8, 226u8, 113u8, 10u8, 12u8, 157u8, 190u8, 117u8, - 233u8, 177u8, 254u8, 126u8, 2u8, 55u8, 100u8, 249u8, - 78u8, 127u8, 148u8, 239u8, 193u8, 246u8, 123u8, 58u8, - 150u8, 132u8, 209u8, 228u8, 105u8, 195u8, 217u8, 99u8, - ] - { - let entry = NextExternal; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " - `PublicProps` is empty."] + pub fn next_external( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + )>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "NextExternal", + vec![], + [ + 123u8, 49u8, 252u8, 184u8, 75u8, 204u8, 16u8, 130u8, 43u8, + 109u8, 62u8, 113u8, 95u8, 0u8, 20u8, 163u8, 186u8, 210u8, + 253u8, 33u8, 58u8, 121u8, 36u8, 80u8, 9u8, 242u8, 180u8, + 230u8, 167u8, 250u8, 32u8, 180u8, + ], + ) } #[doc = " A record of who vetoed what. Maps proposal hash to a possible existent block number"] #[doc = " (until when it may not be resubmitted) and who vetoed it."] pub fn blacklist( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 9u8, 76u8, 174u8, 143u8, 210u8, 103u8, 197u8, 219u8, - 152u8, 134u8, 67u8, 78u8, 109u8, 39u8, 246u8, 214u8, 3u8, - 51u8, 69u8, 208u8, 32u8, 69u8, 247u8, 14u8, 236u8, 37u8, - 112u8, 226u8, 146u8, 169u8, 153u8, 217u8, - ] - { - let entry = Blacklist(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Blacklist", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 93u8, 165u8, 219u8, 135u8, 41u8, 114u8, 144u8, 133u8, 171u8, + 83u8, 153u8, 157u8, 79u8, 14u8, 170u8, 29u8, 179u8, 23u8, + 222u8, 124u8, 237u8, 253u8, 122u8, 21u8, 186u8, 209u8, 184u8, + 89u8, 197u8, 5u8, 178u8, 255u8, + ], + ) } #[doc = " A record of who vetoed what. Maps proposal hash to a possible existent block number"] #[doc = " (until when it may not be resubmitted) and who vetoed it."] - pub fn blacklist_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Blacklist<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 9u8, 76u8, 174u8, 143u8, 210u8, 103u8, 197u8, 219u8, - 152u8, 134u8, 67u8, 78u8, 109u8, 39u8, 246u8, 214u8, 3u8, - 51u8, 69u8, 208u8, 32u8, 69u8, 247u8, 14u8, 236u8, 37u8, - 112u8, 226u8, 146u8, 169u8, 153u8, 217u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn blacklist_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Blacklist", + Vec::new(), + [ + 93u8, 165u8, 219u8, 135u8, 41u8, 114u8, 144u8, 133u8, 171u8, + 83u8, 153u8, 157u8, 79u8, 14u8, 170u8, 29u8, 179u8, 23u8, + 222u8, 124u8, 237u8, 253u8, 122u8, 21u8, 186u8, 209u8, 184u8, + 89u8, 197u8, 5u8, 178u8, 255u8, + ], + ) } #[doc = " Record of all proposals that have been subject to emergency cancellation."] pub fn cancellations( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 55u8, 142u8, 79u8, 35u8, 110u8, 215u8, 163u8, - 134u8, 172u8, 171u8, 71u8, 180u8, 175u8, 7u8, 29u8, - 126u8, 141u8, 236u8, 234u8, 214u8, 132u8, 192u8, 197u8, - 205u8, 31u8, 106u8, 122u8, 204u8, 71u8, 155u8, 18u8, - ] - { - let entry = Cancellations(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Cancellations", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 154u8, 36u8, 172u8, 46u8, 65u8, 218u8, 30u8, 151u8, 173u8, + 186u8, 166u8, 79u8, 35u8, 226u8, 94u8, 200u8, 67u8, 44u8, + 47u8, 7u8, 17u8, 89u8, 169u8, 166u8, 236u8, 101u8, 68u8, + 54u8, 114u8, 141u8, 177u8, 135u8, + ], + ) } #[doc = " Record of all proposals that have been subject to emergency cancellation."] - pub fn cancellations_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Cancellations<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 55u8, 142u8, 79u8, 35u8, 110u8, 215u8, 163u8, - 134u8, 172u8, 171u8, 71u8, 180u8, 175u8, 7u8, 29u8, - 126u8, 141u8, 236u8, 234u8, 214u8, 132u8, 192u8, 197u8, - 205u8, 31u8, 106u8, 122u8, 204u8, 71u8, 155u8, 18u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn cancellations_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Cancellations", + Vec::new(), + [ + 154u8, 36u8, 172u8, 46u8, 65u8, 218u8, 30u8, 151u8, 173u8, + 186u8, 166u8, 79u8, 35u8, 226u8, 94u8, 200u8, 67u8, 44u8, + 47u8, 7u8, 17u8, 89u8, 169u8, 166u8, 236u8, 101u8, 68u8, + 54u8, 114u8, 141u8, 177u8, 135u8, + ], + ) } #[doc = " Storage version of the pallet."] #[doc = ""] #[doc = " New networks start with last version."] pub fn storage_version( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 39u8, 219u8, 134u8, 64u8, 250u8, 96u8, 95u8, 156u8, - 100u8, 236u8, 18u8, 78u8, 59u8, 146u8, 5u8, 245u8, 113u8, - 125u8, 220u8, 140u8, 125u8, 5u8, 194u8, 134u8, 248u8, - 95u8, 250u8, 108u8, 142u8, 230u8, 21u8, 120u8, - ] - { - let entry = StorageVersion; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::Releases, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "StorageVersion", + vec![], + [ + 39u8, 219u8, 134u8, 64u8, 250u8, 96u8, 95u8, 156u8, 100u8, + 236u8, 18u8, 78u8, 59u8, 146u8, 5u8, 245u8, 113u8, 125u8, + 220u8, 140u8, 125u8, 5u8, 194u8, 134u8, 248u8, 95u8, 250u8, + 108u8, 142u8, 230u8, 21u8, 120u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The period between a proposal being approved and enacted."] #[doc = ""] #[doc = " It should generally be a little more than the unstake period to ensure that"] @@ -15007,74 +9820,53 @@ pub mod api { #[doc = " where they are on the losing side of a vote."] pub fn enactment_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "EnactmentPeriod")? - == [ - 227u8, 73u8, 197u8, 72u8, 142u8, 160u8, 229u8, 180u8, 110u8, - 6u8, 124u8, 129u8, 184u8, 113u8, 222u8, 215u8, 48u8, 18u8, - 122u8, 154u8, 102u8, 11u8, 104u8, 133u8, 113u8, 173u8, 206u8, - 238u8, 58u8, 198u8, 200u8, 246u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("EnactmentPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "EnactmentPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " How often (in blocks) new public referenda are launched."] pub fn launch_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "LaunchPeriod")? - == [ - 107u8, 166u8, 54u8, 10u8, 127u8, 204u8, 15u8, 249u8, 71u8, - 253u8, 175u8, 240u8, 150u8, 89u8, 148u8, 152u8, 66u8, 26u8, - 113u8, 84u8, 118u8, 106u8, 160u8, 240u8, 157u8, 248u8, 230u8, - 38u8, 62u8, 210u8, 23u8, 60u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("LaunchPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "LaunchPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " How often (in blocks) to check for new votes."] pub fn voting_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "VotingPeriod")? - == [ - 53u8, 228u8, 6u8, 131u8, 171u8, 179u8, 33u8, 29u8, 46u8, - 186u8, 198u8, 72u8, 94u8, 151u8, 172u8, 181u8, 89u8, 81u8, - 247u8, 11u8, 103u8, 94u8, 225u8, 61u8, 194u8, 169u8, 18u8, - 100u8, 162u8, 17u8, 202u8, 243u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("VotingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "VotingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The minimum period of vote locking."] #[doc = ""] @@ -15082,148 +9874,106 @@ pub mod api { #[doc = " those successful voters are locked into the consequences that their votes entail."] pub fn vote_locking_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "VoteLockingPeriod")? - == [ - 30u8, 71u8, 100u8, 117u8, 139u8, 71u8, 77u8, 189u8, 33u8, - 64u8, 110u8, 164u8, 172u8, 225u8, 163u8, 83u8, 210u8, 130u8, - 108u8, 57u8, 169u8, 55u8, 190u8, 140u8, 68u8, 0u8, 45u8, - 179u8, 115u8, 239u8, 13u8, 179u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("VoteLockingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "VoteLockingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] pub fn minimum_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "MinimumDeposit")? - == [ - 13u8, 97u8, 190u8, 80u8, 197u8, 219u8, 115u8, 167u8, 134u8, - 146u8, 163u8, 219u8, 46u8, 173u8, 77u8, 197u8, 212u8, 95u8, - 47u8, 29u8, 234u8, 36u8, 175u8, 32u8, 16u8, 46u8, 180u8, - 141u8, 204u8, 178u8, 56u8, 123u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("MinimumDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "MinimumDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Indicator for whether an emergency origin is even allowed to happen. Some chains may"] #[doc = " want to set this permanently to `false`, others may want to condition it on things such"] #[doc = " as an upgrade having happened recently."] pub fn instant_allowed( &self, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "InstantAllowed")? - == [ - 66u8, 19u8, 43u8, 75u8, 149u8, 2u8, 157u8, 136u8, 33u8, - 102u8, 57u8, 127u8, 246u8, 72u8, 14u8, 94u8, 240u8, 2u8, - 162u8, 86u8, 232u8, 70u8, 22u8, 133u8, 209u8, 205u8, 115u8, - 236u8, 17u8, 9u8, 37u8, 14u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("InstantAllowed")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "InstantAllowed", + [ + 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, + 1u8, 68u8, 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, + 47u8, 126u8, 134u8, 100u8, 14u8, 86u8, 209u8, 39u8, 20u8, + 4u8, 233u8, 115u8, 102u8, 131u8, + ], + ) } #[doc = " Minimum voting period allowed for a fast-track referendum."] pub fn fast_track_voting_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "FastTrackVotingPeriod")? - == [ - 72u8, 110u8, 169u8, 125u8, 65u8, 142u8, 75u8, 117u8, 252u8, - 246u8, 35u8, 219u8, 65u8, 54u8, 101u8, 225u8, 34u8, 125u8, - 233u8, 19u8, 193u8, 67u8, 103u8, 150u8, 205u8, 226u8, 235u8, - 246u8, 251u8, 38u8, 254u8, 243u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("FastTrackVotingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "FastTrackVotingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Period in blocks where an external proposal may not be re-submitted after being vetoed."] pub fn cooloff_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "CooloffPeriod")? - == [ - 216u8, 225u8, 208u8, 207u8, 23u8, 216u8, 8u8, 144u8, 183u8, - 173u8, 133u8, 8u8, 63u8, 177u8, 86u8, 208u8, 183u8, 201u8, - 123u8, 18u8, 235u8, 166u8, 192u8, 226u8, 172u8, 212u8, 62u8, - 73u8, 89u8, 181u8, 16u8, 103u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("CooloffPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "CooloffPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The amount of balance that must be deposited per byte of preimage stored."] pub fn preimage_byte_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "PreimageByteDeposit")? - == [ - 123u8, 228u8, 214u8, 37u8, 90u8, 98u8, 166u8, 29u8, 231u8, - 48u8, 110u8, 195u8, 211u8, 149u8, 127u8, 243u8, 22u8, 2u8, - 191u8, 68u8, 128u8, 133u8, 246u8, 20u8, 158u8, 117u8, 181u8, - 154u8, 141u8, 104u8, 128u8, 68u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("PreimageByteDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "PreimageByteDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum number of votes for an account."] #[doc = ""] @@ -15231,87 +9981,75 @@ pub mod api { #[doc = " lead to extrinsic with very big weight: see `delegate` for instance."] pub fn max_votes( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "MaxVotes")? - == [ - 218u8, 111u8, 73u8, 160u8, 254u8, 247u8, 22u8, 113u8, 78u8, - 79u8, 145u8, 255u8, 29u8, 155u8, 89u8, 144u8, 4u8, 167u8, - 134u8, 190u8, 232u8, 124u8, 36u8, 207u8, 7u8, 204u8, 40u8, - 32u8, 38u8, 216u8, 249u8, 29u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("MaxVotes")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "MaxVotes", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The maximum number of public proposals that can exist at any time."] pub fn max_proposals( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Democracy", "MaxProposals")? - == [ - 125u8, 103u8, 31u8, 211u8, 29u8, 50u8, 100u8, 13u8, 229u8, - 120u8, 216u8, 228u8, 4u8, 121u8, 229u8, 90u8, 172u8, 228u8, - 86u8, 73u8, 64u8, 153u8, 249u8, 48u8, 232u8, 150u8, 150u8, - 65u8, 205u8, 182u8, 12u8, 81u8, - ] - { - let pallet = metadata.pallet("Democracy")?; - let constant = pallet.constant("MaxProposals")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "MaxProposals", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod council { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetMembers { - pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub new_members: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub prime: + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, pub old_count: ::core::primitive::u32, } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Execute { pub proposal: ::std::boxed::Box, #[codec(compact)] pub length_bound: ::core::primitive::u32, } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Propose { #[codec(compact)] pub threshold: ::core::primitive::u32, @@ -15319,24 +10057,24 @@ pub mod api { #[codec(compact)] pub length_bound: ::core::primitive::u32, } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Vote { - pub proposal: ::subxt::sp_core::H256, + pub proposal: ::subxt::ext::sp_core::H256, #[codec(compact)] pub index: ::core::primitive::u32, pub approve: ::core::primitive::bool, } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub index: ::core::primitive::u32, #[codec(compact)] @@ -15344,33 +10082,16 @@ pub mod api { #[codec(compact)] pub length_bound: ::core::primitive::u32, } - impl ::subxt::Call for Close { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct DisapproveProposal { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for DisapproveProposal { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "disapprove_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Set the collective's membership."] #[doc = ""] #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] @@ -15405,42 +10126,29 @@ pub mod api { #[doc = "# "] pub fn set_members( &self, - new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + new_members: ::std::vec::Vec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + prime: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, old_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, - 200u8, 68u8, 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, - 95u8, 215u8, 36u8, 49u8, 0u8, 163u8, 172u8, 252u8, 221u8, - 9u8, 1u8, 222u8, 44u8, 214u8, - ] - { - let call = SetMembers { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "set_members", + SetMembers { new_members, prime, old_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 196u8, 103u8, 123u8, 125u8, 226u8, 177u8, 126u8, 37u8, 160u8, + 114u8, 34u8, 136u8, 219u8, 84u8, 199u8, 94u8, 242u8, 20u8, + 126u8, 126u8, 166u8, 190u8, 198u8, 33u8, 162u8, 113u8, 237u8, + 222u8, 90u8, 1u8, 2u8, 234u8, + ], + ) } #[doc = "Dispatch a proposal from a member using the `Member` origin."] #[doc = ""] @@ -15457,38 +10165,21 @@ pub mod api { &self, proposal: runtime_types::polkadot_runtime::Call, length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 220u8, 252u8, 255u8, 167u8, 88u8, 242u8, 119u8, 7u8, 5u8, - 239u8, 103u8, 220u8, 50u8, 118u8, 103u8, 53u8, 98u8, 181u8, - 118u8, 56u8, 74u8, 223u8, 192u8, 15u8, 175u8, 108u8, 76u8, - 19u8, 109u8, 11u8, 253u8, 48u8, - ] - { - let call = Execute { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "execute", + Execute { proposal: ::std::boxed::Box::new(proposal), length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 33u8, 251u8, 197u8, 226u8, 205u8, 157u8, 230u8, 48u8, 209u8, + 221u8, 174u8, 102u8, 151u8, 204u8, 26u8, 44u8, 62u8, 89u8, + 233u8, 113u8, 48u8, 77u8, 110u8, 219u8, 165u8, 108u8, 66u8, + 85u8, 35u8, 59u8, 67u8, 245u8, + ], + ) } #[doc = "Add a new proposal to either be voted on or executed directly."] #[doc = ""] @@ -15522,39 +10213,22 @@ pub mod api { threshold: ::core::primitive::u32, proposal: runtime_types::polkadot_runtime::Call, length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 129u8, 211u8, 11u8, 197u8, 105u8, 143u8, 4u8, 133u8, 237u8, - 211u8, 117u8, 57u8, 39u8, 139u8, 57u8, 198u8, 75u8, 63u8, - 158u8, 17u8, 239u8, 76u8, 189u8, 142u8, 253u8, 137u8, 236u8, - 214u8, 151u8, 121u8, 186u8, 26u8, - ] - { - let call = Propose { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "propose", + Propose { threshold, proposal: ::std::boxed::Box::new(proposal), length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 247u8, 17u8, 193u8, 12u8, 110u8, 242u8, 5u8, 205u8, 136u8, + 31u8, 130u8, 60u8, 101u8, 145u8, 131u8, 199u8, 221u8, 183u8, + 165u8, 9u8, 182u8, 204u8, 134u8, 160u8, 78u8, 22u8, 83u8, + 178u8, 97u8, 66u8, 183u8, 38u8, + ], + ) } #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] @@ -15573,42 +10247,25 @@ pub mod api { #[doc = "# "] pub fn vote( &self, - proposal: ::subxt::sp_core::H256, + proposal: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, approve: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, - 27u8, 38u8, 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, - 220u8, 120u8, 231u8, 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, - 154u8, 183u8, 142u8, 165u8, 161u8, - ] - { - let call = Vote { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "vote", + Vote { proposal, index, approve, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 108u8, 46u8, 180u8, 148u8, 145u8, 24u8, 173u8, 56u8, 36u8, + 100u8, 216u8, 43u8, 178u8, 202u8, 26u8, 136u8, 93u8, 84u8, + 80u8, 134u8, 14u8, 42u8, 248u8, 205u8, 68u8, 92u8, 79u8, + 11u8, 113u8, 115u8, 157u8, 100u8, + ], + ) } #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] #[doc = ""] @@ -15644,44 +10301,27 @@ pub mod api { #[doc = "# "] pub fn close( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, proposal_weight_bound: ::core::primitive::u64, length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Close, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, - 217u8, 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, - 173u8, 172u8, 227u8, 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, - 135u8, 203u8, 69u8, 105u8, 47u8, - ] - { - let call = Close { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "close", + Close { proposal_hash, index, proposal_weight_bound, length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 88u8, 8u8, 33u8, 184u8, 4u8, 97u8, 120u8, 237u8, 43u8, 183u8, + 130u8, 139u8, 65u8, 74u8, 166u8, 119u8, 246u8, 65u8, 132u8, + 219u8, 118u8, 69u8, 182u8, 195u8, 111u8, 204u8, 107u8, 78u8, + 152u8, 218u8, 181u8, 208u8, + ], + ) } #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] #[doc = "state."] @@ -15699,36 +10339,19 @@ pub mod api { #[doc = "# "] pub fn disapprove_proposal( &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DisapproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, - 191u8, 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, - 219u8, 30u8, 51u8, 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, - 197u8, 95u8, 232u8, 59u8, 169u8, 133u8, - ] - { - let call = DisapproveProposal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "disapprove_proposal", + DisapproveProposal { proposal_hash }, + [ + 25u8, 123u8, 1u8, 8u8, 74u8, 37u8, 3u8, 40u8, 97u8, 37u8, + 175u8, 224u8, 72u8, 155u8, 123u8, 109u8, 104u8, 43u8, 91u8, + 125u8, 199u8, 51u8, 17u8, 225u8, 133u8, 38u8, 120u8, 76u8, + 164u8, 5u8, 194u8, 201u8, + ], + ) } } } @@ -15736,482 +10359,353 @@ pub mod api { pub type Event = runtime_types::pallet_collective::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] #[doc = "`MemberCount`)."] pub struct Proposed { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub proposal_index: ::core::primitive::u32, - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub threshold: ::core::primitive::u32, } - impl ::subxt::Event for Proposed { + impl ::subxt::events::StaticEvent for Proposed { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Proposed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion (given hash) has been voted on by given account, leaving"] #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] pub struct Voted { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub voted: ::core::primitive::bool, pub yes: ::core::primitive::u32, pub no: ::core::primitive::u32, } - impl ::subxt::Event for Voted { + impl ::subxt::events::StaticEvent for Voted { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Voted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion was approved by the required threshold."] pub struct Approved { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Approved { + impl ::subxt::events::StaticEvent for Approved { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Approved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion was not approved by the required threshold."] pub struct Disapproved { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Disapproved { + impl ::subxt::events::StaticEvent for Disapproved { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Disapproved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion was executed; result will be `Ok` if it returned without error."] pub struct Executed { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for Executed { + impl ::subxt::events::StaticEvent for Executed { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Executed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A single member did some action; result will be `Ok` if it returned without error."] pub struct MemberExecuted { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for MemberExecuted { + impl ::subxt::events::StaticEvent for MemberExecuted { const PALLET: &'static str = "Council"; const EVENT: &'static str = "MemberExecuted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] pub struct Closed { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub yes: ::core::primitive::u32, pub no: ::core::primitive::u32, } - impl ::subxt::Event for Closed { + impl ::subxt::events::StaticEvent for Closed { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Closed"; } } pub mod storage { use super::runtime_types; - pub struct Proposals; - impl ::subxt::StorageEntry for Proposals { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Proposals"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf<'_> { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::polkadot_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The hashes of the active proposals."] pub fn proposals( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 75u8, 108u8, 245u8, 86u8, 50u8, 107u8, 212u8, - 244u8, 113u8, 232u8, 168u8, 194u8, 33u8, 247u8, 97u8, - 54u8, 115u8, 236u8, 189u8, 59u8, 2u8, 252u8, 84u8, 199u8, - 127u8, 197u8, 72u8, 23u8, 1u8, 118u8, 95u8, - ] - { - let entry = Proposals; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Proposals", + vec![], + [ + 10u8, 133u8, 82u8, 54u8, 193u8, 41u8, 253u8, 159u8, 56u8, + 96u8, 249u8, 148u8, 43u8, 57u8, 116u8, 43u8, 222u8, 243u8, + 237u8, 231u8, 238u8, 60u8, 26u8, 225u8, 19u8, 203u8, 213u8, + 220u8, 114u8, 217u8, 100u8, 27u8, + ], + ) } #[doc = " Actual proposal for a given hash, if it's current."] pub fn proposal_of( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 161u8, 189u8, 214u8, 228u8, 141u8, 241u8, 207u8, 45u8, - 15u8, 55u8, 4u8, 183u8, 17u8, 169u8, 209u8, 157u8, 51u8, - 244u8, 241u8, 34u8, 139u8, 219u8, 155u8, 41u8, 116u8, - 117u8, 171u8, 156u8, 247u8, 44u8, 203u8, 214u8, - ] - { - let entry = ProposalOf(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime::Call, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "ProposalOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 60u8, 175u8, 110u8, 170u8, 166u8, 54u8, 206u8, 178u8, 126u8, + 151u8, 46u8, 160u8, 245u8, 230u8, 165u8, 139u8, 9u8, 171u8, + 126u8, 223u8, 199u8, 70u8, 245u8, 146u8, 115u8, 2u8, 78u8, + 33u8, 54u8, 144u8, 247u8, 27u8, + ], + ) } #[doc = " Actual proposal for a given hash, if it's current."] - pub fn proposal_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 161u8, 189u8, 214u8, 228u8, 141u8, 241u8, 207u8, 45u8, - 15u8, 55u8, 4u8, 183u8, 17u8, 169u8, 209u8, 157u8, 51u8, - 244u8, 241u8, 34u8, 139u8, 219u8, 155u8, 41u8, 116u8, - 117u8, 171u8, 156u8, 247u8, 44u8, 203u8, 214u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn proposal_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime::Call, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "ProposalOf", + Vec::new(), + [ + 60u8, 175u8, 110u8, 170u8, 166u8, 54u8, 206u8, 178u8, 126u8, + 151u8, 46u8, 160u8, 245u8, 230u8, 165u8, 139u8, 9u8, 171u8, + 126u8, 223u8, 199u8, 70u8, 245u8, 146u8, 115u8, 2u8, 78u8, + 33u8, 54u8, 144u8, 247u8, 27u8, + ], + ) } #[doc = " Votes on a given proposal, if it is ongoing."] pub fn voting( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 145u8, 223u8, 203u8, 2u8, 137u8, 33u8, 22u8, 239u8, - 175u8, 149u8, 254u8, 185u8, 0u8, 139u8, 71u8, 134u8, - 109u8, 95u8, 45u8, 75u8, 33u8, 228u8, 127u8, 67u8, 53u8, - 119u8, 188u8, 198u8, 11u8, 92u8, 4u8, 177u8, - ] - { - let entry = Voting(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Voting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, + 73u8, 161u8, 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, + 70u8, 209u8, 170u8, 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, + 217u8, 240u8, 230u8, 107u8, 221u8, + ], + ) } #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Voting<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 145u8, 223u8, 203u8, 2u8, 137u8, 33u8, 22u8, 239u8, - 175u8, 149u8, 254u8, 185u8, 0u8, 139u8, 71u8, 134u8, - 109u8, 95u8, 45u8, 75u8, 33u8, 228u8, 127u8, 67u8, 53u8, - 119u8, 188u8, 198u8, 11u8, 92u8, 4u8, 177u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn voting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Voting", + Vec::new(), + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, + 73u8, 161u8, 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, + 70u8, 209u8, 170u8, 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, + 217u8, 240u8, 230u8, 107u8, 221u8, + ], + ) } #[doc = " Proposals so far."] pub fn proposal_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, - 143u8, 33u8, 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, - 154u8, 110u8, 32u8, 142u8, 24u8, 149u8, 109u8, 105u8, - 30u8, 83u8, 39u8, 177u8, 127u8, 160u8, 34u8, 70u8, - ] - { - let entry = ProposalCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "ProposalCount", + vec![], + [ + 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, 143u8, + 33u8, 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, 154u8, 110u8, + 32u8, 142u8, 24u8, 149u8, 109u8, 105u8, 30u8, 83u8, 39u8, + 177u8, 127u8, 160u8, 34u8, 70u8, + ], + ) } #[doc = " The current members of the collective. This is stored sorted (just by value)."] pub fn members( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 136u8, 91u8, 140u8, 173u8, 238u8, 221u8, 4u8, 132u8, - 238u8, 99u8, 195u8, 142u8, 10u8, 35u8, 210u8, 227u8, - 22u8, 72u8, 218u8, 222u8, 227u8, 51u8, 55u8, 31u8, 252u8, - 78u8, 195u8, 11u8, 195u8, 242u8, 171u8, 75u8, - ] - { - let entry = Members; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Members", + vec![], + [ + 162u8, 72u8, 174u8, 204u8, 140u8, 105u8, 205u8, 176u8, 197u8, + 117u8, 206u8, 134u8, 157u8, 110u8, 139u8, 54u8, 43u8, 233u8, + 25u8, 51u8, 36u8, 238u8, 94u8, 124u8, 221u8, 52u8, 237u8, + 71u8, 125u8, 56u8, 129u8, 222u8, + ], + ) } #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] pub fn prime( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 70u8, 101u8, 20u8, 160u8, 173u8, 87u8, 190u8, 85u8, 60u8, - 249u8, 144u8, 77u8, 175u8, 195u8, 51u8, 196u8, 234u8, - 62u8, 243u8, 199u8, 126u8, 12u8, 88u8, 252u8, 1u8, 210u8, - 65u8, 210u8, 33u8, 19u8, 222u8, 11u8, - ] - { - let entry = Prime; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Prime", + vec![], + [ + 108u8, 118u8, 54u8, 193u8, 207u8, 227u8, 119u8, 97u8, 23u8, + 239u8, 157u8, 69u8, 56u8, 142u8, 106u8, 17u8, 215u8, 159u8, + 48u8, 42u8, 185u8, 209u8, 49u8, 159u8, 32u8, 168u8, 111u8, + 158u8, 159u8, 217u8, 244u8, 158u8, + ], + ) } } } } pub mod technical_committee { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetMembers { - pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub new_members: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub prime: + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, pub old_count: ::core::primitive::u32, } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Execute { pub proposal: ::std::boxed::Box, #[codec(compact)] pub length_bound: ::core::primitive::u32, } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Propose { #[codec(compact)] pub threshold: ::core::primitive::u32, @@ -16219,24 +10713,24 @@ pub mod api { #[codec(compact)] pub length_bound: ::core::primitive::u32, } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Vote { - pub proposal: ::subxt::sp_core::H256, + pub proposal: ::subxt::ext::sp_core::H256, #[codec(compact)] pub index: ::core::primitive::u32, pub approve: ::core::primitive::bool, } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub index: ::core::primitive::u32, #[codec(compact)] @@ -16244,33 +10738,16 @@ pub mod api { #[codec(compact)] pub length_bound: ::core::primitive::u32, } - impl ::subxt::Call for Close { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct DisapproveProposal { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for DisapproveProposal { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "disapprove_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Set the collective's membership."] #[doc = ""] #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] @@ -16305,42 +10782,29 @@ pub mod api { #[doc = "# "] pub fn set_members( &self, - new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + new_members: ::std::vec::Vec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + prime: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, old_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, - 200u8, 68u8, 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, - 95u8, 215u8, 36u8, 49u8, 0u8, 163u8, 172u8, 252u8, 221u8, - 9u8, 1u8, 222u8, 44u8, 214u8, - ] - { - let call = SetMembers { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "set_members", + SetMembers { new_members, prime, old_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 196u8, 103u8, 123u8, 125u8, 226u8, 177u8, 126u8, 37u8, 160u8, + 114u8, 34u8, 136u8, 219u8, 84u8, 199u8, 94u8, 242u8, 20u8, + 126u8, 126u8, 166u8, 190u8, 198u8, 33u8, 162u8, 113u8, 237u8, + 222u8, 90u8, 1u8, 2u8, 234u8, + ], + ) } #[doc = "Dispatch a proposal from a member using the `Member` origin."] #[doc = ""] @@ -16357,38 +10821,21 @@ pub mod api { &self, proposal: runtime_types::polkadot_runtime::Call, length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 220u8, 252u8, 255u8, 167u8, 88u8, 242u8, 119u8, 7u8, 5u8, - 239u8, 103u8, 220u8, 50u8, 118u8, 103u8, 53u8, 98u8, 181u8, - 118u8, 56u8, 74u8, 223u8, 192u8, 15u8, 175u8, 108u8, 76u8, - 19u8, 109u8, 11u8, 253u8, 48u8, - ] - { - let call = Execute { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "execute", + Execute { proposal: ::std::boxed::Box::new(proposal), length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 33u8, 251u8, 197u8, 226u8, 205u8, 157u8, 230u8, 48u8, 209u8, + 221u8, 174u8, 102u8, 151u8, 204u8, 26u8, 44u8, 62u8, 89u8, + 233u8, 113u8, 48u8, 77u8, 110u8, 219u8, 165u8, 108u8, 66u8, + 85u8, 35u8, 59u8, 67u8, 245u8, + ], + ) } #[doc = "Add a new proposal to either be voted on or executed directly."] #[doc = ""] @@ -16422,39 +10869,22 @@ pub mod api { threshold: ::core::primitive::u32, proposal: runtime_types::polkadot_runtime::Call, length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 129u8, 211u8, 11u8, 197u8, 105u8, 143u8, 4u8, 133u8, 237u8, - 211u8, 117u8, 57u8, 39u8, 139u8, 57u8, 198u8, 75u8, 63u8, - 158u8, 17u8, 239u8, 76u8, 189u8, 142u8, 253u8, 137u8, 236u8, - 214u8, 151u8, 121u8, 186u8, 26u8, - ] - { - let call = Propose { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "propose", + Propose { threshold, proposal: ::std::boxed::Box::new(proposal), length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 247u8, 17u8, 193u8, 12u8, 110u8, 242u8, 5u8, 205u8, 136u8, + 31u8, 130u8, 60u8, 101u8, 145u8, 131u8, 199u8, 221u8, 183u8, + 165u8, 9u8, 182u8, 204u8, 134u8, 160u8, 78u8, 22u8, 83u8, + 178u8, 97u8, 66u8, 183u8, 38u8, + ], + ) } #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] @@ -16473,42 +10903,25 @@ pub mod api { #[doc = "# "] pub fn vote( &self, - proposal: ::subxt::sp_core::H256, + proposal: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, approve: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, - 27u8, 38u8, 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, - 220u8, 120u8, 231u8, 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, - 154u8, 183u8, 142u8, 165u8, 161u8, - ] - { - let call = Vote { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "vote", + Vote { proposal, index, approve, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 108u8, 46u8, 180u8, 148u8, 145u8, 24u8, 173u8, 56u8, 36u8, + 100u8, 216u8, 43u8, 178u8, 202u8, 26u8, 136u8, 93u8, 84u8, + 80u8, 134u8, 14u8, 42u8, 248u8, 205u8, 68u8, 92u8, 79u8, + 11u8, 113u8, 115u8, 157u8, 100u8, + ], + ) } #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] #[doc = ""] @@ -16544,44 +10957,27 @@ pub mod api { #[doc = "# "] pub fn close( &self, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, proposal_weight_bound: ::core::primitive::u64, length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Close, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, - 217u8, 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, - 173u8, 172u8, 227u8, 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, - 135u8, 203u8, 69u8, 105u8, 47u8, - ] - { - let call = Close { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "close", + Close { proposal_hash, index, proposal_weight_bound, length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 88u8, 8u8, 33u8, 184u8, 4u8, 97u8, 120u8, 237u8, 43u8, 183u8, + 130u8, 139u8, 65u8, 74u8, 166u8, 119u8, 246u8, 65u8, 132u8, + 219u8, 118u8, 69u8, 182u8, 195u8, 111u8, 204u8, 107u8, 78u8, + 152u8, 218u8, 181u8, 208u8, + ], + ) } #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] #[doc = "state."] @@ -16599,36 +10995,19 @@ pub mod api { #[doc = "# "] pub fn disapprove_proposal( &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DisapproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, - 191u8, 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, - 219u8, 30u8, 51u8, 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, - 197u8, 95u8, 232u8, 59u8, 169u8, 133u8, - ] - { - let call = DisapproveProposal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "disapprove_proposal", + DisapproveProposal { proposal_hash }, + [ + 25u8, 123u8, 1u8, 8u8, 74u8, 37u8, 3u8, 40u8, 97u8, 37u8, + 175u8, 224u8, 72u8, 155u8, 123u8, 109u8, 104u8, 43u8, 91u8, + 125u8, 199u8, 51u8, 17u8, 225u8, 133u8, 38u8, 120u8, 76u8, + 164u8, 5u8, 194u8, 201u8, + ], + ) } } } @@ -16636,530 +11015,382 @@ pub mod api { pub type Event = runtime_types::pallet_collective::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] #[doc = "`MemberCount`)."] pub struct Proposed { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub proposal_index: ::core::primitive::u32, - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub threshold: ::core::primitive::u32, } - impl ::subxt::Event for Proposed { + impl ::subxt::events::StaticEvent for Proposed { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Proposed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion (given hash) has been voted on by given account, leaving"] #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] pub struct Voted { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub voted: ::core::primitive::bool, pub yes: ::core::primitive::u32, pub no: ::core::primitive::u32, } - impl ::subxt::Event for Voted { + impl ::subxt::events::StaticEvent for Voted { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Voted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion was approved by the required threshold."] pub struct Approved { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Approved { + impl ::subxt::events::StaticEvent for Approved { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Approved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion was not approved by the required threshold."] pub struct Disapproved { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Disapproved { + impl ::subxt::events::StaticEvent for Disapproved { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Disapproved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A motion was executed; result will be `Ok` if it returned without error."] pub struct Executed { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for Executed { + impl ::subxt::events::StaticEvent for Executed { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Executed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A single member did some action; result will be `Ok` if it returned without error."] pub struct MemberExecuted { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for MemberExecuted { + impl ::subxt::events::StaticEvent for MemberExecuted { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "MemberExecuted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] pub struct Closed { - pub proposal_hash: ::subxt::sp_core::H256, + pub proposal_hash: ::subxt::ext::sp_core::H256, pub yes: ::core::primitive::u32, pub no: ::core::primitive::u32, } - impl ::subxt::Event for Closed { + impl ::subxt::events::StaticEvent for Closed { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Closed"; } } pub mod storage { use super::runtime_types; - pub struct Proposals; - impl ::subxt::StorageEntry for Proposals { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Proposals"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf<'_> { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::polkadot_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The hashes of the active proposals."] pub fn proposals( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 75u8, 108u8, 245u8, 86u8, 50u8, 107u8, 212u8, - 244u8, 113u8, 232u8, 168u8, 194u8, 33u8, 247u8, 97u8, - 54u8, 115u8, 236u8, 189u8, 59u8, 2u8, 252u8, 84u8, 199u8, - 127u8, 197u8, 72u8, 23u8, 1u8, 118u8, 95u8, - ] - { - let entry = Proposals; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Proposals", + vec![], + [ + 10u8, 133u8, 82u8, 54u8, 193u8, 41u8, 253u8, 159u8, 56u8, + 96u8, 249u8, 148u8, 43u8, 57u8, 116u8, 43u8, 222u8, 243u8, + 237u8, 231u8, 238u8, 60u8, 26u8, 225u8, 19u8, 203u8, 213u8, + 220u8, 114u8, 217u8, 100u8, 27u8, + ], + ) } #[doc = " Actual proposal for a given hash, if it's current."] pub fn proposal_of( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 161u8, 189u8, 214u8, 228u8, 141u8, 241u8, 207u8, 45u8, - 15u8, 55u8, 4u8, 183u8, 17u8, 169u8, 209u8, 157u8, 51u8, - 244u8, 241u8, 34u8, 139u8, 219u8, 155u8, 41u8, 116u8, - 117u8, 171u8, 156u8, 247u8, 44u8, 203u8, 214u8, - ] - { - let entry = ProposalOf(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime::Call, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "ProposalOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 60u8, 175u8, 110u8, 170u8, 166u8, 54u8, 206u8, 178u8, 126u8, + 151u8, 46u8, 160u8, 245u8, 230u8, 165u8, 139u8, 9u8, 171u8, + 126u8, 223u8, 199u8, 70u8, 245u8, 146u8, 115u8, 2u8, 78u8, + 33u8, 54u8, 144u8, 247u8, 27u8, + ], + ) } #[doc = " Actual proposal for a given hash, if it's current."] - pub fn proposal_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 161u8, 189u8, 214u8, 228u8, 141u8, 241u8, 207u8, 45u8, - 15u8, 55u8, 4u8, 183u8, 17u8, 169u8, 209u8, 157u8, 51u8, - 244u8, 241u8, 34u8, 139u8, 219u8, 155u8, 41u8, 116u8, - 117u8, 171u8, 156u8, 247u8, 44u8, 203u8, 214u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn proposal_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime::Call, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "ProposalOf", + Vec::new(), + [ + 60u8, 175u8, 110u8, 170u8, 166u8, 54u8, 206u8, 178u8, 126u8, + 151u8, 46u8, 160u8, 245u8, 230u8, 165u8, 139u8, 9u8, 171u8, + 126u8, 223u8, 199u8, 70u8, 245u8, 146u8, 115u8, 2u8, 78u8, + 33u8, 54u8, 144u8, 247u8, 27u8, + ], + ) } #[doc = " Votes on a given proposal, if it is ongoing."] pub fn voting( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 145u8, 223u8, 203u8, 2u8, 137u8, 33u8, 22u8, 239u8, - 175u8, 149u8, 254u8, 185u8, 0u8, 139u8, 71u8, 134u8, - 109u8, 95u8, 45u8, 75u8, 33u8, 228u8, 127u8, 67u8, 53u8, - 119u8, 188u8, 198u8, 11u8, 92u8, 4u8, 177u8, - ] - { - let entry = Voting(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Voting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, + 73u8, 161u8, 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, + 70u8, 209u8, 170u8, 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, + 217u8, 240u8, 230u8, 107u8, 221u8, + ], + ) } #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Voting<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 145u8, 223u8, 203u8, 2u8, 137u8, 33u8, 22u8, 239u8, - 175u8, 149u8, 254u8, 185u8, 0u8, 139u8, 71u8, 134u8, - 109u8, 95u8, 45u8, 75u8, 33u8, 228u8, 127u8, 67u8, 53u8, - 119u8, 188u8, 198u8, 11u8, 92u8, 4u8, 177u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn voting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Voting", + Vec::new(), + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, + 73u8, 161u8, 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, + 70u8, 209u8, 170u8, 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, + 217u8, 240u8, 230u8, 107u8, 221u8, + ], + ) } #[doc = " Proposals so far."] pub fn proposal_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, - 143u8, 33u8, 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, - 154u8, 110u8, 32u8, 142u8, 24u8, 149u8, 109u8, 105u8, - 30u8, 83u8, 39u8, 177u8, 127u8, 160u8, 34u8, 70u8, - ] - { - let entry = ProposalCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "ProposalCount", + vec![], + [ + 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, 143u8, + 33u8, 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, 154u8, 110u8, + 32u8, 142u8, 24u8, 149u8, 109u8, 105u8, 30u8, 83u8, 39u8, + 177u8, 127u8, 160u8, 34u8, 70u8, + ], + ) } #[doc = " The current members of the collective. This is stored sorted (just by value)."] pub fn members( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 136u8, 91u8, 140u8, 173u8, 238u8, 221u8, 4u8, 132u8, - 238u8, 99u8, 195u8, 142u8, 10u8, 35u8, 210u8, 227u8, - 22u8, 72u8, 218u8, 222u8, 227u8, 51u8, 55u8, 31u8, 252u8, - 78u8, 195u8, 11u8, 195u8, 242u8, 171u8, 75u8, - ] - { - let entry = Members; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Members", + vec![], + [ + 162u8, 72u8, 174u8, 204u8, 140u8, 105u8, 205u8, 176u8, 197u8, + 117u8, 206u8, 134u8, 157u8, 110u8, 139u8, 54u8, 43u8, 233u8, + 25u8, 51u8, 36u8, 238u8, 94u8, 124u8, 221u8, 52u8, 237u8, + 71u8, 125u8, 56u8, 129u8, 222u8, + ], + ) } #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] pub fn prime( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 70u8, 101u8, 20u8, 160u8, 173u8, 87u8, 190u8, 85u8, 60u8, - 249u8, 144u8, 77u8, 175u8, 195u8, 51u8, 196u8, 234u8, - 62u8, 243u8, 199u8, 126u8, 12u8, 88u8, 252u8, 1u8, 210u8, - 65u8, 210u8, 33u8, 19u8, 222u8, 11u8, - ] - { - let entry = Prime; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Prime", + vec![], + [ + 108u8, 118u8, 54u8, 193u8, 207u8, 227u8, 119u8, 97u8, 23u8, + 239u8, 157u8, 69u8, 56u8, 142u8, 106u8, 17u8, 215u8, 159u8, + 48u8, 42u8, 185u8, 209u8, 49u8, 159u8, 32u8, 168u8, 111u8, + 158u8, 159u8, 217u8, 244u8, 158u8, + ], + ) } } } } pub mod phragmen_election { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Vote { - pub votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub votes: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, #[codec(compact)] pub value: ::core::primitive::u128, } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveVoter; - impl ::subxt::Call for RemoveVoter { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "remove_voter"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SubmitCandidacy { #[codec(compact)] pub candidate_count: ::core::primitive::u32, } - impl ::subxt::Call for SubmitCandidacy { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "submit_candidacy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RenounceCandidacy { pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, } - impl ::subxt::Call for RenounceCandidacy { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "renounce_candidacy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveMember { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub has_replacement: ::core::primitive::bool, } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "remove_member"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CleanDefunctVoters { pub num_voters: ::core::primitive::u32, pub num_defunct: ::core::primitive::u32, } - impl ::subxt::Call for CleanDefunctVoters { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "clean_defunct_voters"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] #[doc = "set the initial votes, or update already existing votes."] #[doc = ""] @@ -17185,74 +11416,38 @@ pub mod api { #[doc = "# "] pub fn vote( &self, - votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + votes: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 245u8, 122u8, 160u8, 64u8, 234u8, 121u8, 191u8, 224u8, 12u8, - 16u8, 153u8, 70u8, 41u8, 236u8, 211u8, 145u8, 238u8, 112u8, - 11u8, 94u8, 92u8, 160u8, 67u8, 176u8, 126u8, 232u8, 63u8, - 226u8, 207u8, 205u8, 90u8, 61u8, - ] - { - let call = Vote { votes, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "PhragmenElection", + "vote", + Vote { votes, value }, + [ + 71u8, 90u8, 175u8, 225u8, 51u8, 202u8, 197u8, 252u8, 183u8, + 92u8, 239u8, 83u8, 112u8, 144u8, 128u8, 211u8, 109u8, 33u8, + 252u8, 6u8, 156u8, 15u8, 91u8, 88u8, 70u8, 19u8, 32u8, 29u8, + 224u8, 255u8, 26u8, 145u8, + ], + ) } #[doc = "Remove `origin` as a voter."] #[doc = ""] #[doc = "This removes the lock and returns the deposit."] #[doc = ""] #[doc = "The dispatch origin of this call must be signed and be a voter."] - pub fn remove_voter( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveVoter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn remove_voter(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "PhragmenElection", + "remove_voter", + RemoveVoter {}, + [ 254u8, 46u8, 140u8, 4u8, 218u8, 45u8, 150u8, 72u8, 67u8, 131u8, 108u8, 201u8, 46u8, 157u8, 104u8, 161u8, 53u8, 155u8, 130u8, 50u8, 88u8, 149u8, 255u8, 12u8, 17u8, 85u8, 95u8, 69u8, 153u8, 130u8, 221u8, 1u8, - ] - { - let call = RemoveVoter {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] #[doc = ""] @@ -17272,35 +11467,18 @@ pub mod api { pub fn submit_candidacy( &self, candidate_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SubmitCandidacy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 100u8, 38u8, 146u8, 5u8, 234u8, 101u8, 193u8, 9u8, 245u8, - 237u8, 220u8, 21u8, 36u8, 64u8, 205u8, 103u8, 11u8, 194u8, - 18u8, 96u8, 44u8, 231u8, 125u8, 82u8, 63u8, 51u8, 51u8, - 183u8, 28u8, 33u8, 121u8, 89u8, - ] - { - let call = SubmitCandidacy { candidate_count }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "PhragmenElection", + "submit_candidacy", + SubmitCandidacy { candidate_count }, + [ + 228u8, 63u8, 217u8, 99u8, 128u8, 104u8, 175u8, 10u8, 30u8, + 35u8, 47u8, 14u8, 254u8, 122u8, 146u8, 239u8, 61u8, 145u8, + 82u8, 7u8, 181u8, 98u8, 238u8, 208u8, 23u8, 84u8, 48u8, + 255u8, 177u8, 255u8, 84u8, 83u8, + ], + ) } #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] #[doc = "outcomes exist:"] @@ -17323,35 +11501,18 @@ pub mod api { pub fn renounce_candidacy( &self, renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RenounceCandidacy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 184u8, 45u8, 220u8, 198u8, 21u8, 54u8, 15u8, 235u8, 192u8, - 78u8, 96u8, 172u8, 12u8, 152u8, 147u8, 183u8, 172u8, 85u8, - 26u8, 243u8, 250u8, 248u8, 104u8, 76u8, 88u8, 150u8, 197u8, - 130u8, 221u8, 234u8, 53u8, 174u8, - ] - { - let call = RenounceCandidacy { renouncing }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "PhragmenElection", + "renounce_candidacy", + RenounceCandidacy { renouncing }, + [ + 70u8, 72u8, 208u8, 36u8, 80u8, 245u8, 224u8, 75u8, 60u8, + 142u8, 19u8, 49u8, 142u8, 90u8, 14u8, 69u8, 15u8, 61u8, + 170u8, 235u8, 16u8, 252u8, 86u8, 200u8, 120u8, 127u8, 36u8, + 42u8, 143u8, 130u8, 217u8, 128u8, + ], + ) } #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] #[doc = "the outgoing member is slashed."] @@ -17369,43 +11530,26 @@ pub mod api { #[doc = "# "] pub fn remove_member( &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, has_replacement: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 0u8, 99u8, 154u8, 250u8, 4u8, 102u8, 172u8, 220u8, 86u8, - 147u8, 113u8, 248u8, 152u8, 189u8, 179u8, 149u8, 73u8, 97u8, - 201u8, 143u8, 83u8, 11u8, 94u8, 123u8, 149u8, 253u8, 179u8, - 154u8, 132u8, 42u8, 70u8, 189u8, - ] - { - let call = RemoveMember { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "PhragmenElection", + "remove_member", + RemoveMember { who, has_replacement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 174u8, 77u8, 175u8, 88u8, 205u8, 45u8, 109u8, 227u8, 27u8, + 175u8, 46u8, 179u8, 170u8, 235u8, 136u8, 43u8, 27u8, 47u8, + 78u8, 201u8, 99u8, 23u8, 79u8, 57u8, 193u8, 94u8, 143u8, + 242u8, 181u8, 226u8, 214u8, 171u8, + ], + ) } #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] #[doc = "deposit of the removed voters are returned."] @@ -17421,38 +11565,21 @@ pub mod api { &self, num_voters: ::core::primitive::u32, num_defunct: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CleanDefunctVoters, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 80u8, 248u8, 122u8, 6u8, 88u8, 255u8, 17u8, 206u8, 104u8, - 208u8, 66u8, 191u8, 118u8, 163u8, 154u8, 9u8, 37u8, 106u8, - 232u8, 178u8, 17u8, 177u8, 225u8, 101u8, 76u8, 207u8, 175u8, - 117u8, 21u8, 203u8, 229u8, 140u8, - ] - { - let call = CleanDefunctVoters { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "PhragmenElection", + "clean_defunct_voters", + CleanDefunctVoters { num_voters, num_defunct, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 198u8, 162u8, 30u8, 249u8, 191u8, 38u8, 141u8, 123u8, 230u8, + 90u8, 213u8, 103u8, 168u8, 28u8, 5u8, 215u8, 213u8, 152u8, + 46u8, 189u8, 238u8, 209u8, 209u8, 142u8, 159u8, 222u8, 161u8, + 26u8, 161u8, 250u8, 9u8, 100u8, + ], + ) } } } @@ -17460,7 +11587,11 @@ pub mod api { pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] #[doc = "the election, not that enough have has been elected. The inner value must be examined"] #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] @@ -17468,186 +11599,129 @@ pub mod api { #[doc = "begin with."] pub struct NewTerm { pub new_members: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, } - impl ::subxt::Event for NewTerm { + impl ::subxt::events::StaticEvent for NewTerm { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "NewTerm"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "No (or not enough) candidates existed for this round. This is different from"] #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] pub struct EmptyTerm; - impl ::subxt::Event for EmptyTerm { + impl ::subxt::events::StaticEvent for EmptyTerm { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "EmptyTerm"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Internal error happened while trying to perform election."] pub struct ElectionError; - impl ::subxt::Event for ElectionError { + impl ::subxt::events::StaticEvent for ElectionError { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "ElectionError"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] #[doc = "`EmptyTerm`."] pub struct MemberKicked { - pub member: ::subxt::sp_core::crypto::AccountId32, + pub member: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for MemberKicked { + impl ::subxt::events::StaticEvent for MemberKicked { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "MemberKicked"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Someone has renounced their candidacy."] pub struct Renounced { - pub candidate: ::subxt::sp_core::crypto::AccountId32, + pub candidate: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Renounced { + impl ::subxt::events::StaticEvent for Renounced { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "Renounced"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] #[doc = "runner-up."] #[doc = ""] #[doc = "Note that old members and runners-up are also candidates."] pub struct CandidateSlashed { - pub candidate: ::subxt::sp_core::crypto::AccountId32, + pub candidate: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for CandidateSlashed { + impl ::subxt::events::StaticEvent for CandidateSlashed { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "CandidateSlashed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] pub struct SeatHolderSlashed { - pub seat_holder: ::subxt::sp_core::crypto::AccountId32, + pub seat_holder: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for SeatHolderSlashed { + impl ::subxt::events::StaticEvent for SeatHolderSlashed { const PALLET: &'static str = "PhragmenElection"; const EVENT: &'static str = "SeatHolderSlashed"; } } pub mod storage { use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct RunnersUp; - impl ::subxt::StorageEntry for RunnersUp { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "RunnersUp"; - type Value = ::std::vec::Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Candidates; - impl ::subxt::StorageEntry for Candidates { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "Candidates"; - type Value = ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ElectionRounds; - impl ::subxt::StorageEntry for ElectionRounds { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "ElectionRounds"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The current elected members."] #[doc = ""] #[doc = " Invariant: Always sorted based on account id."] pub fn members( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 193u8, 166u8, 79u8, 96u8, 31u8, 4u8, 133u8, 133u8, 115u8, - 236u8, 253u8, 177u8, 176u8, 10u8, 50u8, 97u8, 254u8, - 234u8, 169u8, 236u8, 77u8, 243u8, 173u8, 187u8, 129u8, - 122u8, 160u8, 73u8, 25u8, 150u8, 140u8, 56u8, - ] - { - let entry = Members; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "PhragmenElection", + "Members", + vec![], + [ + 2u8, 182u8, 43u8, 180u8, 87u8, 185u8, 26u8, 79u8, 196u8, + 55u8, 28u8, 26u8, 174u8, 133u8, 158u8, 221u8, 101u8, 161u8, + 83u8, 9u8, 221u8, 175u8, 221u8, 220u8, 81u8, 80u8, 1u8, + 236u8, 74u8, 121u8, 10u8, 82u8, + ], + ) } #[doc = " The current reserved runners-up."] #[doc = ""] @@ -17655,42 +11729,30 @@ pub mod api { #[doc = " last (i.e. _best_) runner-up will be replaced."] pub fn runners_up( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 59u8, 65u8, 218u8, 225u8, 49u8, 140u8, 168u8, 143u8, - 195u8, 106u8, 207u8, 181u8, 157u8, 129u8, 140u8, 122u8, - 145u8, 207u8, 179u8, 144u8, 146u8, 206u8, 204u8, 245u8, - 6u8, 201u8, 192u8, 232u8, 84u8, 108u8, 86u8, 187u8, - ] - { - let entry = RunnersUp; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "PhragmenElection", + "RunnersUp", + vec![], + [ + 248u8, 81u8, 190u8, 53u8, 121u8, 49u8, 55u8, 69u8, 116u8, + 177u8, 46u8, 30u8, 131u8, 14u8, 32u8, 198u8, 10u8, 132u8, + 73u8, 117u8, 2u8, 146u8, 188u8, 146u8, 214u8, 227u8, 97u8, + 77u8, 7u8, 131u8, 208u8, 209u8, + ], + ) } #[doc = " The present candidate list. A current member or runner-up can never enter this vector"] #[doc = " and is always implicitly assumed to be a candidate."] @@ -17700,213 +11762,149 @@ pub mod api { #[doc = " Invariant: Always sorted based on account id."] pub fn candidates( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 172u8, 196u8, 249u8, 114u8, 195u8, 161u8, 43u8, 219u8, - 208u8, 127u8, 144u8, 87u8, 13u8, 253u8, 114u8, 209u8, - 199u8, 65u8, 77u8, 7u8, 131u8, 166u8, 212u8, 94u8, 253u8, - 166u8, 234u8, 42u8, 36u8, 175u8, 100u8, 14u8, - ] - { - let entry = Candidates; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "PhragmenElection", + "Candidates", + vec![], + [ + 224u8, 107u8, 141u8, 11u8, 54u8, 86u8, 117u8, 45u8, 195u8, + 252u8, 152u8, 21u8, 165u8, 23u8, 198u8, 117u8, 5u8, 216u8, + 183u8, 163u8, 243u8, 56u8, 11u8, 102u8, 85u8, 107u8, 219u8, + 250u8, 45u8, 80u8, 108u8, 127u8, + ], + ) } #[doc = " The total number of vote rounds that have happened, excluding the upcoming one."] pub fn election_rounds( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 144u8, 146u8, 10u8, 32u8, 149u8, 147u8, 59u8, 205u8, - 61u8, 246u8, 28u8, 169u8, 130u8, 136u8, 143u8, 104u8, - 253u8, 86u8, 228u8, 68u8, 19u8, 184u8, 166u8, 214u8, - 58u8, 103u8, 176u8, 160u8, 240u8, 249u8, 117u8, 115u8, - ] - { - let entry = ElectionRounds; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "PhragmenElection", + "ElectionRounds", + vec![], + [ + 144u8, 146u8, 10u8, 32u8, 149u8, 147u8, 59u8, 205u8, 61u8, + 246u8, 28u8, 169u8, 130u8, 136u8, 143u8, 104u8, 253u8, 86u8, + 228u8, 68u8, 19u8, 184u8, 166u8, 214u8, 58u8, 103u8, 176u8, + 160u8, 240u8, 249u8, 117u8, 115u8, + ], + ) } #[doc = " Votes and locked stake of a particular voter."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] pub fn voting( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 107u8, 14u8, 228u8, 167u8, 43u8, 105u8, 221u8, 70u8, - 234u8, 157u8, 36u8, 16u8, 63u8, 225u8, 89u8, 111u8, - 201u8, 172u8, 98u8, 169u8, 232u8, 175u8, 172u8, 20u8, - 223u8, 80u8, 107u8, 183u8, 252u8, 175u8, 50u8, 171u8, - ] - { - let entry = Voting(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "PhragmenElection", + "Voting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 9u8, 135u8, 76u8, 194u8, 240u8, 182u8, 111u8, 207u8, 102u8, + 37u8, 126u8, 36u8, 84u8, 112u8, 26u8, 216u8, 175u8, 5u8, + 14u8, 189u8, 83u8, 185u8, 136u8, 39u8, 171u8, 221u8, 147u8, + 20u8, 168u8, 126u8, 111u8, 137u8, + ], + ) } #[doc = " Votes and locked stake of a particular voter."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] - pub fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Voting<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 107u8, 14u8, 228u8, 167u8, 43u8, 105u8, 221u8, 70u8, - 234u8, 157u8, 36u8, 16u8, 63u8, 225u8, 89u8, 111u8, - 201u8, 172u8, 98u8, 169u8, 232u8, 175u8, 172u8, 20u8, - 223u8, 80u8, 107u8, 183u8, 252u8, 175u8, 50u8, 171u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn voting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_elections_phragmen::Voter< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "PhragmenElection", + "Voting", + Vec::new(), + [ + 9u8, 135u8, 76u8, 194u8, 240u8, 182u8, 111u8, 207u8, 102u8, + 37u8, 126u8, 36u8, 84u8, 112u8, 26u8, 216u8, 175u8, 5u8, + 14u8, 189u8, 83u8, 185u8, 136u8, 39u8, 171u8, 221u8, 147u8, + 20u8, 168u8, 126u8, 111u8, 137u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Identifier for the elections-phragmen pallet's lock"] pub fn pallet_id( &self, - ) -> ::core::result::Result< - [::core::primitive::u8; 8usize], - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "PalletId")? - == [ - 95u8, 63u8, 229u8, 200u8, 231u8, 11u8, 95u8, 106u8, 62u8, - 240u8, 37u8, 146u8, 230u8, 74u8, 169u8, 185u8, 160u8, 90u8, - 136u8, 209u8, 127u8, 221u8, 173u8, 200u8, 243u8, 198u8, 18u8, - 226u8, 144u8, 188u8, 105u8, 230u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("PalletId")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u8; 8usize]>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "PalletId", + [ + 224u8, 197u8, 247u8, 125u8, 62u8, 180u8, 69u8, 91u8, 226u8, + 36u8, 82u8, 148u8, 70u8, 147u8, 209u8, 40u8, 210u8, 229u8, + 181u8, 191u8, 170u8, 205u8, 138u8, 97u8, 127u8, 59u8, 124u8, + 244u8, 252u8, 30u8, 213u8, 179u8, + ], + ) } #[doc = " How much should be locked up in order to submit one's candidacy."] pub fn candidacy_bond( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "CandidacyBond")? - == [ - 14u8, 234u8, 73u8, 125u8, 101u8, 97u8, 55u8, 15u8, 230u8, - 193u8, 135u8, 62u8, 132u8, 7u8, 151u8, 65u8, 210u8, 170u8, - 155u8, 50u8, 143u8, 209u8, 184u8, 111u8, 170u8, 206u8, 167u8, - 195u8, 213u8, 27u8, 123u8, 241u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("CandidacyBond")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "CandidacyBond", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Base deposit associated with voting."] #[doc = ""] @@ -17914,281 +11912,195 @@ pub mod api { #[doc = " creating a gigantic number of votes."] pub fn voting_bond_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "VotingBondBase")? - == [ - 180u8, 167u8, 175u8, 40u8, 243u8, 172u8, 143u8, 55u8, 194u8, - 84u8, 98u8, 81u8, 247u8, 171u8, 109u8, 53u8, 136u8, 143u8, - 225u8, 114u8, 75u8, 55u8, 241u8, 160u8, 116u8, 229u8, 255u8, - 7u8, 104u8, 187u8, 103u8, 64u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("VotingBondBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "VotingBondBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount of bond that need to be locked for each vote (32 bytes)."] pub fn voting_bond_factor( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "VotingBondFactor")? - == [ - 221u8, 163u8, 2u8, 102u8, 69u8, 249u8, 39u8, 153u8, 236u8, - 75u8, 249u8, 122u8, 29u8, 193u8, 16u8, 199u8, 113u8, 87u8, - 171u8, 97u8, 72u8, 40u8, 76u8, 2u8, 35u8, 125u8, 30u8, 126u8, - 137u8, 118u8, 98u8, 147u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("VotingBondFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "VotingBondFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Number of members to elect."] pub fn desired_members( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "DesiredMembers")? - == [ - 202u8, 93u8, 82u8, 184u8, 101u8, 152u8, 110u8, 247u8, 155u8, - 43u8, 205u8, 219u8, 41u8, 184u8, 141u8, 32u8, 33u8, 30u8, - 129u8, 33u8, 132u8, 18u8, 172u8, 114u8, 226u8, 81u8, 21u8, - 55u8, 197u8, 42u8, 65u8, 162u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("DesiredMembers")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "DesiredMembers", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Number of runners_up to keep."] pub fn desired_runners_up( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "DesiredRunnersUp")? - == [ - 126u8, 79u8, 206u8, 94u8, 16u8, 223u8, 112u8, 34u8, 160u8, - 227u8, 74u8, 26u8, 14u8, 191u8, 98u8, 119u8, 230u8, 187u8, - 18u8, 37u8, 13u8, 143u8, 128u8, 62u8, 131u8, 158u8, 138u8, - 110u8, 16u8, 216u8, 42u8, 113u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("DesiredRunnersUp")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "DesiredRunnersUp", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " How long each seat is kept. This defines the next block number at which an election"] #[doc = " round will happen. If set to zero, no elections are ever triggered and the module will"] #[doc = " be in passive mode."] pub fn term_duration( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("PhragmenElection", "TermDuration")? - == [ - 193u8, 236u8, 82u8, 251u8, 38u8, 164u8, 72u8, 149u8, 65u8, - 240u8, 45u8, 82u8, 210u8, 168u8, 68u8, 219u8, 11u8, 241u8, - 118u8, 117u8, 248u8, 9u8, 1u8, 187u8, 98u8, 189u8, 18u8, - 119u8, 255u8, 89u8, 192u8, 231u8, - ] - { - let pallet = metadata.pallet("PhragmenElection")?; - let constant = pallet.constant("TermDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "PhragmenElection", + "TermDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod technical_membership { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for AddMember { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "add_member"; + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "remove_member"; + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SwapMember { - pub remove: ::subxt::sp_core::crypto::AccountId32, - pub add: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SwapMember { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "swap_member"; + pub remove: ::subxt::ext::sp_core::crypto::AccountId32, + pub add: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ResetMembers { - pub members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, } - impl ::subxt::Call for ResetMembers { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "reset_members"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ChangeKey { - pub new: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChangeKey { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "change_key"; + pub new: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetPrime { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetPrime { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "set_prime"; + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClearPrime; - impl ::subxt::Call for ClearPrime { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "clear_prime"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Add a member `who` to the set."] #[doc = ""] #[doc = "May only be called from `T::AddOrigin`."] pub fn add_member( &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 1u8, 149u8, 115u8, 222u8, 93u8, 9u8, 208u8, 58u8, 22u8, - 148u8, 215u8, 141u8, 204u8, 48u8, 107u8, 210u8, 202u8, 165u8, - 43u8, 159u8, 45u8, 161u8, 255u8, 127u8, 225u8, 100u8, 161u8, - 195u8, 197u8, 206u8, 57u8, 166u8, - ] - { - let call = AddMember { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "add_member", + AddMember { who }, + [ + 106u8, 33u8, 171u8, 114u8, 223u8, 105u8, 71u8, 15u8, 77u8, + 253u8, 40u8, 204u8, 244u8, 142u8, 103u8, 177u8, 200u8, 243u8, + 114u8, 241u8, 36u8, 135u8, 175u8, 255u8, 124u8, 193u8, 30u8, + 46u8, 186u8, 172u8, 176u8, 98u8, + ], + ) } #[doc = "Remove a member `who` from the set."] #[doc = ""] #[doc = "May only be called from `T::RemoveOrigin`."] pub fn remove_member( &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 137u8, 249u8, 148u8, 139u8, 147u8, 47u8, 226u8, 228u8, 139u8, - 219u8, 109u8, 128u8, 254u8, 51u8, 227u8, 154u8, 105u8, 91u8, - 229u8, 69u8, 217u8, 241u8, 107u8, 229u8, 41u8, 202u8, 228u8, - 227u8, 160u8, 162u8, 45u8, 211u8, - ] - { - let call = RemoveMember { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "remove_member", + RemoveMember { who }, + [ + 100u8, 17u8, 75u8, 92u8, 58u8, 100u8, 34u8, 187u8, 41u8, + 160u8, 137u8, 58u8, 78u8, 166u8, 161u8, 116u8, 1u8, 67u8, + 201u8, 144u8, 103u8, 84u8, 55u8, 246u8, 133u8, 180u8, 148u8, + 86u8, 175u8, 175u8, 70u8, 73u8, + ], + ) } #[doc = "Swap out one member `remove` for another `add`."] #[doc = ""] @@ -18197,37 +12109,20 @@ pub mod api { #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] pub fn swap_member( &self, - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SwapMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 62u8, 254u8, 117u8, 56u8, 185u8, 99u8, 29u8, 146u8, - 210u8, 40u8, 77u8, 169u8, 224u8, 215u8, 34u8, 106u8, 95u8, - 204u8, 109u8, 72u8, 67u8, 11u8, 183u8, 33u8, 84u8, 133u8, - 4u8, 5u8, 13u8, 188u8, 123u8, - ] - { - let call = SwapMember { remove, add }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + remove: ::subxt::ext::sp_core::crypto::AccountId32, + add: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "swap_member", + SwapMember { remove, add }, + [ + 66u8, 84u8, 183u8, 29u8, 104u8, 163u8, 220u8, 217u8, 103u8, + 234u8, 233u8, 138u8, 191u8, 147u8, 51u8, 98u8, 46u8, 51u8, + 179u8, 200u8, 23u8, 59u8, 112u8, 53u8, 8u8, 75u8, 135u8, + 232u8, 116u8, 201u8, 60u8, 249u8, + ], + ) } #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] #[doc = "pass `members` pre-sorted."] @@ -18235,36 +12130,19 @@ pub mod api { #[doc = "May only be called from `T::ResetOrigin`."] pub fn reset_members( &self, - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ResetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 246u8, 84u8, 91u8, 191u8, 61u8, 245u8, 171u8, 80u8, 18u8, - 120u8, 61u8, 86u8, 23u8, 115u8, 161u8, 203u8, 128u8, 34u8, - 166u8, 128u8, 33u8, 28u8, 229u8, 81u8, 103u8, 217u8, 173u8, - 151u8, 31u8, 118u8, 151u8, 217u8, - ] - { - let call = ResetMembers { members }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "reset_members", + ResetMembers { members }, + [ + 9u8, 35u8, 28u8, 59u8, 158u8, 232u8, 89u8, 78u8, 101u8, 53u8, + 240u8, 98u8, 13u8, 104u8, 235u8, 161u8, 201u8, 150u8, 117u8, + 32u8, 75u8, 209u8, 166u8, 252u8, 57u8, 131u8, 96u8, 215u8, + 51u8, 81u8, 42u8, 123u8, + ], + ) } #[doc = "Swap out the sending member for some other key `new`."] #[doc = ""] @@ -18273,107 +12151,54 @@ pub mod api { #[doc = "Prime membership is passed from the origin account to `new`, if extant."] pub fn change_key( &self, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ChangeKey, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 198u8, 93u8, 41u8, 52u8, 241u8, 11u8, 225u8, 82u8, 30u8, - 114u8, 111u8, 204u8, 13u8, 31u8, 34u8, 82u8, 171u8, 58u8, - 180u8, 65u8, 3u8, 246u8, 33u8, 167u8, 200u8, 23u8, 150u8, - 235u8, 130u8, 172u8, 202u8, 216u8, - ] - { - let call = ChangeKey { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + new: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "change_key", + ChangeKey { new }, + [ + 53u8, 60u8, 54u8, 231u8, 151u8, 0u8, 27u8, 175u8, 250u8, + 80u8, 74u8, 184u8, 184u8, 63u8, 90u8, 216u8, 186u8, 136u8, + 74u8, 214u8, 111u8, 186u8, 137u8, 140u8, 108u8, 194u8, 128u8, + 97u8, 168u8, 184u8, 112u8, 60u8, + ], + ) } #[doc = "Set the prime member. Must be a current member."] #[doc = ""] #[doc = "May only be called from `T::PrimeOrigin`."] pub fn set_prime( &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPrime, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 185u8, 53u8, 61u8, 154u8, 234u8, 77u8, 195u8, 126u8, 19u8, - 39u8, 78u8, 205u8, 109u8, 210u8, 137u8, 245u8, 128u8, 110u8, - 2u8, 201u8, 20u8, 153u8, 146u8, 177u8, 4u8, 144u8, 229u8, - 125u8, 91u8, 131u8, 199u8, 15u8, - ] - { - let call = SetPrime { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "set_prime", + SetPrime { who }, + [ + 123u8, 95u8, 75u8, 129u8, 19u8, 34u8, 192u8, 65u8, 169u8, + 47u8, 184u8, 246u8, 55u8, 250u8, 31u8, 158u8, 57u8, 197u8, + 22u8, 112u8, 167u8, 198u8, 136u8, 17u8, 15u8, 203u8, 101u8, + 149u8, 15u8, 39u8, 16u8, 232u8, + ], + ) } #[doc = "Remove the prime member if it exists."] #[doc = ""] #[doc = "May only be called from `T::PrimeOrigin`."] - pub fn clear_prime( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearPrime, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn clear_prime(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "clear_prime", + ClearPrime {}, + [ 186u8, 182u8, 225u8, 90u8, 71u8, 124u8, 69u8, 100u8, 234u8, 25u8, 53u8, 23u8, 182u8, 32u8, 176u8, 81u8, 54u8, 140u8, 235u8, 126u8, 247u8, 7u8, 155u8, 62u8, 35u8, 135u8, 48u8, 61u8, 88u8, 160u8, 183u8, 72u8, - ] - { - let call = ClearPrime {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } } } @@ -18381,233 +12206,191 @@ pub mod api { pub type Event = runtime_types::pallet_membership::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The given member was added; see the transaction for who."] pub struct MemberAdded; - impl ::subxt::Event for MemberAdded { + impl ::subxt::events::StaticEvent for MemberAdded { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MemberAdded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The given member was removed; see the transaction for who."] pub struct MemberRemoved; - impl ::subxt::Event for MemberRemoved { + impl ::subxt::events::StaticEvent for MemberRemoved { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MemberRemoved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Two members were swapped; see the transaction for who."] pub struct MembersSwapped; - impl ::subxt::Event for MembersSwapped { + impl ::subxt::events::StaticEvent for MembersSwapped { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MembersSwapped"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The membership was reset; see the transaction for who the new set is."] pub struct MembersReset; - impl ::subxt::Event for MembersReset { + impl ::subxt::events::StaticEvent for MembersReset { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MembersReset"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "One of the members' keys changed."] pub struct KeyChanged; - impl ::subxt::Event for KeyChanged { + impl ::subxt::events::StaticEvent for KeyChanged { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "KeyChanged"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Phantom member, never used."] pub struct Dummy; - impl ::subxt::Event for Dummy { + impl ::subxt::events::StaticEvent for Dummy { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "Dummy"; } } pub mod storage { use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "TechnicalMembership"; - const STORAGE: &'static str = "Members"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "TechnicalMembership"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The current membership, stored as an ordered Vec."] pub fn members( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 156u8, 246u8, 35u8, 153u8, 141u8, 104u8, 106u8, 242u8, - 233u8, 125u8, 1u8, 18u8, 97u8, 147u8, 157u8, 89u8, 3u8, - 206u8, 177u8, 219u8, 97u8, 7u8, 84u8, 90u8, 7u8, 178u8, - 80u8, 21u8, 166u8, 246u8, 160u8, 217u8, - ] - { - let entry = Members; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalMembership", + "Members", + vec![], + [ + 56u8, 56u8, 29u8, 90u8, 26u8, 115u8, 252u8, 185u8, 37u8, + 108u8, 16u8, 46u8, 136u8, 139u8, 30u8, 19u8, 235u8, 78u8, + 176u8, 129u8, 180u8, 57u8, 178u8, 239u8, 211u8, 6u8, 64u8, + 129u8, 195u8, 46u8, 178u8, 157u8, + ], + ) } #[doc = " The current prime member, if one exists."] pub fn prime( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 70u8, 101u8, 20u8, 160u8, 173u8, 87u8, 190u8, 85u8, 60u8, - 249u8, 144u8, 77u8, 175u8, 195u8, 51u8, 196u8, 234u8, - 62u8, 243u8, 199u8, 126u8, 12u8, 88u8, 252u8, 1u8, 210u8, - 65u8, 210u8, 33u8, 19u8, 222u8, 11u8, - ] - { - let entry = Prime; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalMembership", + "Prime", + vec![], + [ + 108u8, 118u8, 54u8, 193u8, 207u8, 227u8, 119u8, 97u8, 23u8, + 239u8, 157u8, 69u8, 56u8, 142u8, 106u8, 17u8, 215u8, 159u8, + 48u8, 42u8, 185u8, 209u8, 49u8, 159u8, 32u8, 168u8, 111u8, + 158u8, 159u8, 217u8, 244u8, 158u8, + ], + ) } } } } pub mod treasury { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProposeSpend { #[codec(compact)] pub value: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for ProposeSpend { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "propose_spend"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RejectProposal { #[codec(compact)] pub proposal_id: ::core::primitive::u32, } - impl ::subxt::Call for RejectProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "reject_proposal"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ApproveProposal { #[codec(compact)] pub proposal_id: ::core::primitive::u32, } - impl ::subxt::Call for ApproveProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "approve_proposal"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Spend { #[codec(compact)] pub amount: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for Spend { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "spend"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveApproval { #[codec(compact)] pub proposal_id: ::core::primitive::u32, } - impl ::subxt::Call for RemoveApproval { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "remove_approval"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] #[doc = "proposal is awarded."] @@ -18620,39 +12403,22 @@ pub mod api { pub fn propose_spend( &self, value: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeSpend, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 117u8, 11u8, 194u8, 76u8, 160u8, 114u8, 119u8, 94u8, 47u8, - 239u8, 193u8, 54u8, 42u8, 208u8, 225u8, 47u8, 22u8, 90u8, - 166u8, 169u8, 192u8, 145u8, 159u8, 38u8, 209u8, 134u8, 102u8, - 91u8, 65u8, 129u8, 251u8, 3u8, - ] - { - let call = ProposeSpend { value, beneficiary }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "propose_spend", + ProposeSpend { value, beneficiary }, + [ + 109u8, 46u8, 8u8, 159u8, 127u8, 79u8, 27u8, 100u8, 92u8, + 244u8, 78u8, 46u8, 105u8, 246u8, 169u8, 210u8, 149u8, 7u8, + 108u8, 153u8, 203u8, 223u8, 8u8, 117u8, 126u8, 250u8, 255u8, + 52u8, 245u8, 69u8, 45u8, 136u8, + ], + ) } #[doc = "Reject a proposed spend. The original deposit will be slashed."] #[doc = ""] @@ -18666,35 +12432,18 @@ pub mod api { pub fn reject_proposal( &self, proposal_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RejectProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 238u8, 223u8, 212u8, 86u8, 178u8, 184u8, 150u8, 117u8, - 91u8, 69u8, 30u8, 196u8, 134u8, 56u8, 54u8, 236u8, 145u8, - 202u8, 139u8, 135u8, 254u8, 80u8, 189u8, 40u8, 56u8, 148u8, - 108u8, 42u8, 118u8, 74u8, 242u8, - ] - { - let call = RejectProposal { proposal_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "reject_proposal", + RejectProposal { proposal_id }, + [ + 106u8, 223u8, 97u8, 22u8, 111u8, 208u8, 128u8, 26u8, 198u8, + 140u8, 118u8, 126u8, 187u8, 51u8, 193u8, 50u8, 193u8, 68u8, + 143u8, 144u8, 34u8, 132u8, 44u8, 244u8, 105u8, 186u8, 223u8, + 234u8, 17u8, 145u8, 209u8, 145u8, + ], + ) } #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] #[doc = "and the original deposit will be returned."] @@ -18709,35 +12458,18 @@ pub mod api { pub fn approve_proposal( &self, proposal_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 191u8, 81u8, 78u8, 230u8, 230u8, 192u8, 144u8, 232u8, 81u8, - 70u8, 227u8, 212u8, 194u8, 228u8, 231u8, 147u8, 57u8, 222u8, - 156u8, 77u8, 173u8, 60u8, 92u8, 84u8, 255u8, 64u8, 240u8, - 45u8, 131u8, 200u8, 206u8, 231u8, - ] - { - let call = ApproveProposal { proposal_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "approve_proposal", + ApproveProposal { proposal_id }, + [ + 164u8, 229u8, 172u8, 98u8, 129u8, 62u8, 84u8, 128u8, 47u8, + 108u8, 33u8, 120u8, 89u8, 79u8, 57u8, 121u8, 4u8, 197u8, + 170u8, 153u8, 156u8, 17u8, 59u8, 164u8, 123u8, 227u8, 175u8, + 195u8, 220u8, 160u8, 60u8, 186u8, + ], + ) } #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] @@ -18750,42 +12482,25 @@ pub mod api { pub fn spend( &self, amount: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Spend, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 112u8, 73u8, 16u8, 107u8, 190u8, 200u8, 211u8, 68u8, 179u8, - 105u8, 127u8, 30u8, 210u8, 77u8, 137u8, 128u8, 167u8, 59u8, - 177u8, 185u8, 237u8, 200u8, 174u8, 218u8, 137u8, 208u8, 70u8, - 23u8, 226u8, 38u8, 151u8, 153u8, - ] - { - let call = Spend { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "spend", + Spend { amount, beneficiary, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 177u8, 178u8, 242u8, 136u8, 135u8, 237u8, 114u8, 71u8, 233u8, + 239u8, 7u8, 84u8, 14u8, 228u8, 58u8, 31u8, 158u8, 185u8, + 25u8, 91u8, 70u8, 33u8, 19u8, 92u8, 100u8, 162u8, 5u8, 48u8, + 20u8, 120u8, 9u8, 109u8, + ], + ) } #[doc = "Force a previously approved proposal to be removed from the approval queue."] #[doc = "The original deposit will no longer be returned."] @@ -18805,35 +12520,18 @@ pub mod api { pub fn remove_approval( &self, proposal_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveApproval, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 199u8, 214u8, 142u8, 168u8, 99u8, 226u8, 70u8, 161u8, - 36u8, 122u8, 95u8, 242u8, 2u8, 191u8, 163u8, 192u8, 26u8, - 185u8, 75u8, 47u8, 155u8, 80u8, 175u8, 88u8, 85u8, 83u8, 8u8, - 138u8, 130u8, 12u8, 228u8, - ] - { - let call = RemoveApproval { proposal_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "remove_approval", + RemoveApproval { proposal_id }, + [ + 133u8, 126u8, 181u8, 47u8, 196u8, 243u8, 7u8, 46u8, 25u8, + 251u8, 154u8, 125u8, 217u8, 77u8, 54u8, 245u8, 240u8, 180u8, + 97u8, 34u8, 186u8, 53u8, 225u8, 144u8, 155u8, 107u8, 172u8, + 54u8, 250u8, 184u8, 178u8, 86u8, + ], + ) } } } @@ -18842,515 +12540,388 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "New proposal."] pub struct Proposed { pub proposal_index: ::core::primitive::u32, } - impl ::subxt::Event for Proposed { + impl ::subxt::events::StaticEvent for Proposed { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Proposed"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "We have ended a spend period and will now allocate funds."] pub struct Spending { pub budget_remaining: ::core::primitive::u128, } - impl ::subxt::Event for Spending { + impl ::subxt::events::StaticEvent for Spending { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Spending"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some funds have been allocated."] pub struct Awarded { pub proposal_index: ::core::primitive::u32, pub award: ::core::primitive::u128, - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Awarded { + impl ::subxt::events::StaticEvent for Awarded { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Awarded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proposal was rejected; funds were slashed."] pub struct Rejected { pub proposal_index: ::core::primitive::u32, pub slashed: ::core::primitive::u128, } - impl ::subxt::Event for Rejected { + impl ::subxt::events::StaticEvent for Rejected { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Rejected"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "Some of our funds have been burnt."] pub struct Burnt { pub burnt_funds: ::core::primitive::u128, } - impl ::subxt::Event for Burnt { + impl ::subxt::events::StaticEvent for Burnt { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Burnt"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "Spending has finished; this is the amount that rolls over until next spend."] pub struct Rollover { pub rollover_balance: ::core::primitive::u128, } - impl ::subxt::Event for Rollover { + impl ::subxt::events::StaticEvent for Rollover { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Rollover"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "Some funds have been deposited."] pub struct Deposit { pub value: ::core::primitive::u128, } - impl ::subxt::Event for Deposit { + impl ::subxt::events::StaticEvent for Deposit { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Deposit"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new spend proposal has been approved."] pub struct SpendApproved { pub proposal_index: ::core::primitive::u32, pub amount: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for SpendApproved { + impl ::subxt::events::StaticEvent for SpendApproved { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "SpendApproved"; } } pub mod storage { use super::runtime_types; - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Proposals<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Proposals<'_> { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "Proposals"; - type Value = runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Approvals; - impl ::subxt::StorageEntry for Approvals { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "Approvals"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Number of proposals that have been made."] pub fn proposal_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, - 143u8, 33u8, 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, - 154u8, 110u8, 32u8, 142u8, 24u8, 149u8, 109u8, 105u8, - 30u8, 83u8, 39u8, 177u8, 127u8, 160u8, 34u8, 70u8, - ] - { - let entry = ProposalCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "ProposalCount", + vec![], + [ + 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, 143u8, + 33u8, 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, 154u8, 110u8, + 32u8, 142u8, 24u8, 149u8, 109u8, 105u8, 30u8, 83u8, 39u8, + 177u8, 127u8, 160u8, 34u8, 70u8, + ], + ) } #[doc = " Proposals that have been made."] pub fn proposals( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_treasury::Proposal< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 242u8, 203u8, 56u8, 166u8, 200u8, 95u8, 110u8, - 47u8, 71u8, 71u8, 45u8, 12u8, 93u8, 222u8, 120u8, 40u8, - 130u8, 29u8, 236u8, 189u8, 49u8, 115u8, 238u8, 135u8, - 64u8, 252u8, 171u8, 29u8, 229u8, 63u8, 31u8, - ] - { - let entry = Proposals(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "Proposals", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 62u8, 223u8, 55u8, 209u8, 151u8, 134u8, 122u8, 65u8, 207u8, + 38u8, 113u8, 213u8, 237u8, 48u8, 129u8, 32u8, 91u8, 228u8, + 108u8, 91u8, 37u8, 49u8, 94u8, 4u8, 75u8, 122u8, 25u8, 34u8, + 198u8, 224u8, 246u8, 160u8, + ], + ) } #[doc = " Proposals that have been made."] - pub fn proposals_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Proposals<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 242u8, 203u8, 56u8, 166u8, 200u8, 95u8, 110u8, - 47u8, 71u8, 71u8, 45u8, 12u8, 93u8, 222u8, 120u8, 40u8, - 130u8, 29u8, 236u8, 189u8, 49u8, 115u8, 238u8, 135u8, - 64u8, 252u8, 171u8, 29u8, 229u8, 63u8, 31u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn proposals_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_treasury::Proposal< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "Proposals", + Vec::new(), + [ + 62u8, 223u8, 55u8, 209u8, 151u8, 134u8, 122u8, 65u8, 207u8, + 38u8, 113u8, 213u8, 237u8, 48u8, 129u8, 32u8, 91u8, 228u8, + 108u8, 91u8, 37u8, 49u8, 94u8, 4u8, 75u8, 122u8, 25u8, 34u8, + 198u8, 224u8, 246u8, 160u8, + ], + ) } #[doc = " Proposal indices that have been approved but not yet awarded."] pub fn approvals( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 152u8, 185u8, 127u8, 54u8, 169u8, 155u8, 124u8, 22u8, - 142u8, 132u8, 254u8, 197u8, 162u8, 152u8, 15u8, 18u8, - 192u8, 138u8, 196u8, 231u8, 234u8, 178u8, 111u8, 181u8, - 20u8, 131u8, 149u8, 36u8, 222u8, 4u8, 119u8, 135u8, - ] - { - let entry = Approvals; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "Approvals", + vec![], + [ + 202u8, 106u8, 189u8, 40u8, 127u8, 172u8, 108u8, 50u8, 193u8, + 4u8, 248u8, 226u8, 176u8, 101u8, 212u8, 222u8, 64u8, 206u8, + 244u8, 175u8, 111u8, 106u8, 86u8, 96u8, 19u8, 109u8, 218u8, + 152u8, 30u8, 59u8, 96u8, 1u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Fraction of a proposal's value that should be bonded in order to place the proposal."] #[doc = " An accepted proposal gets these back. A rejected proposal does not."] pub fn proposal_bond( &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Permill, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "ProposalBond")? - == [ - 254u8, 112u8, 56u8, 108u8, 71u8, 90u8, 128u8, 114u8, 54u8, - 239u8, 87u8, 235u8, 71u8, 56u8, 11u8, 132u8, 179u8, 134u8, - 115u8, 139u8, 109u8, 136u8, 59u8, 69u8, 108u8, 160u8, 18u8, - 120u8, 34u8, 213u8, 166u8, 13u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("ProposalBond")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Permill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "ProposalBond", + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, + 19u8, 87u8, 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, + 225u8, 53u8, 212u8, 52u8, 177u8, 79u8, 4u8, 116u8, 201u8, + 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) } #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] pub fn proposal_bond_minimum( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "ProposalBondMinimum")? - == [ - 233u8, 16u8, 162u8, 158u8, 32u8, 30u8, 243u8, 215u8, 145u8, - 211u8, 68u8, 173u8, 77u8, 212u8, 78u8, 195u8, 144u8, 4u8, - 72u8, 249u8, 90u8, 11u8, 26u8, 64u8, 65u8, 90u8, 193u8, 69u8, - 145u8, 33u8, 163u8, 122u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("ProposalBondMinimum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "ProposalBondMinimum", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] pub fn proposal_bond_maximum( &self, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "ProposalBondMaximum")? - == [ - 12u8, 199u8, 104u8, 127u8, 224u8, 233u8, 186u8, 181u8, 74u8, - 51u8, 175u8, 78u8, 57u8, 170u8, 220u8, 114u8, 122u8, 205u8, - 53u8, 5u8, 92u8, 121u8, 71u8, 10u8, 35u8, 190u8, 184u8, - 233u8, 193u8, 92u8, 27u8, 189u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("ProposalBondMaximum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::core::option::Option<::core::primitive::u128>, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "ProposalBondMaximum", + [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, + 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, + 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, + 43u8, 243u8, 122u8, 60u8, 216u8, + ], + ) } #[doc = " Period between successive spends."] pub fn spend_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "SpendPeriod")? - == [ - 71u8, 58u8, 201u8, 70u8, 240u8, 191u8, 67u8, 71u8, 12u8, - 146u8, 142u8, 91u8, 114u8, 44u8, 213u8, 89u8, 113u8, 124u8, - 210u8, 82u8, 61u8, 48u8, 9u8, 121u8, 236u8, 143u8, 99u8, - 246u8, 5u8, 195u8, 15u8, 247u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("SpendPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "SpendPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] pub fn burn( &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Permill, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "Burn")? - == [ - 179u8, 112u8, 148u8, 197u8, 209u8, 103u8, 231u8, 44u8, 227u8, - 103u8, 105u8, 229u8, 107u8, 183u8, 25u8, 151u8, 112u8, 20u8, - 24u8, 1u8, 72u8, 183u8, 179u8, 243u8, 0u8, 136u8, 204u8, - 139u8, 164u8, 52u8, 22u8, 168u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("Burn")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Permill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "Burn", + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, + 19u8, 87u8, 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, + 225u8, 53u8, 212u8, 52u8, 177u8, 79u8, 4u8, 116u8, 201u8, + 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) } #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] pub fn pallet_id( &self, - ) -> ::core::result::Result< - runtime_types::frame_support::PalletId, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "PalletId")? - == [ - 65u8, 140u8, 92u8, 164u8, 174u8, 209u8, 169u8, 31u8, 29u8, - 55u8, 10u8, 151u8, 10u8, 165u8, 68u8, 7u8, 110u8, 108u8, - 233u8, 42u8, 19u8, 211u8, 98u8, 108u8, 73u8, 14u8, 235u8, - 97u8, 23u8, 118u8, 211u8, 21u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("PalletId")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::PalletId, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "PalletId", + [ + 139u8, 109u8, 228u8, 151u8, 252u8, 32u8, 130u8, 69u8, 112u8, + 154u8, 174u8, 45u8, 83u8, 245u8, 51u8, 132u8, 173u8, 5u8, + 186u8, 24u8, 243u8, 9u8, 12u8, 214u8, 80u8, 74u8, 69u8, + 189u8, 30u8, 94u8, 22u8, 39u8, + ], + ) } #[doc = " The maximum number of approvals that can wait in the spending queue."] #[doc = ""] #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] pub fn max_approvals( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Treasury", "MaxApprovals")? - == [ - 90u8, 101u8, 189u8, 20u8, 137u8, 178u8, 7u8, 81u8, 148u8, - 6u8, 59u8, 229u8, 228u8, 66u8, 13u8, 179u8, 199u8, 159u8, - 168u8, 227u8, 3u8, 76u8, 124u8, 35u8, 199u8, 142u8, 79u8, - 78u8, 254u8, 63u8, 2u8, 175u8, - ] - { - let pallet = metadata.pallet("Treasury")?; - let constant = pallet.constant("MaxApprovals")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "MaxApprovals", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod claims { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Claim { - pub dest: ::subxt::sp_core::crypto::AccountId32, + pub dest: ::subxt::ext::sp_core::crypto::AccountId32, pub ethereum_signature: runtime_types::polkadot_runtime_common::claims::EcdsaSignature, } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "claim"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct MintClaim { pub who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, pub value: ::core::primitive::u128, @@ -19363,55 +12934,38 @@ pub mod api { runtime_types::polkadot_runtime_common::claims::StatementKind, >, } - impl ::subxt::Call for MintClaim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "mint_claim"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClaimAttest { - pub dest: ::subxt::sp_core::crypto::AccountId32, + pub dest: ::subxt::ext::sp_core::crypto::AccountId32, pub ethereum_signature: runtime_types::polkadot_runtime_common::claims::EcdsaSignature, pub statement: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for ClaimAttest { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "claim_attest"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Attest { pub statement: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for Attest { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "attest"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct MoveClaim { pub old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, pub new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, pub maybe_preclaim: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, } - impl ::subxt::Call for MoveClaim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "move_claim"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Make a claim to collect your DOTs."] #[doc = ""] #[doc = "The dispatch origin for this call must be _None_."] @@ -19438,40 +12992,23 @@ pub mod api { #[doc = ""] pub fn claim( &self, - dest: ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_core::crypto::AccountId32, ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Claim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 8u8, 205u8, 188u8, 57u8, 197u8, 203u8, 156u8, 65u8, 246u8, - 236u8, 199u8, 6u8, 152u8, 34u8, 251u8, 178u8, 206u8, 127u8, - 167u8, 59u8, 43u8, 162u8, 154u8, 89u8, 215u8, 192u8, 18u8, - 100u8, 66u8, 7u8, 97u8, 229u8, - ] - { - let call = Claim { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Claims", + "claim", + Claim { dest, ethereum_signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 33u8, 63u8, 71u8, 104u8, 200u8, 179u8, 248u8, 38u8, 193u8, + 198u8, 250u8, 49u8, 106u8, 26u8, 109u8, 183u8, 33u8, 50u8, + 217u8, 28u8, 50u8, 107u8, 249u8, 80u8, 199u8, 10u8, 192u8, + 1u8, 54u8, 41u8, 146u8, 11u8, + ], + ) } #[doc = "Mint a new claim to collect DOTs."] #[doc = ""] @@ -19500,40 +13037,23 @@ pub mod api { statement: ::core::option::Option< runtime_types::polkadot_runtime_common::claims::StatementKind, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - MintClaim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 10u8, 141u8, 200u8, 102u8, 21u8, 205u8, 178u8, 247u8, 154u8, - 245u8, 172u8, 178u8, 26u8, 249u8, 179u8, 236u8, 198u8, 4u8, - 183u8, 239u8, 39u8, 188u8, 146u8, 231u8, 244u8, 6u8, 31u8, - 180u8, 101u8, 157u8, 53u8, 59u8, - ] - { - let call = MintClaim { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Claims", + "mint_claim", + MintClaim { who, value, vesting_schedule, statement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 213u8, 79u8, 204u8, 40u8, 104u8, 84u8, 82u8, 62u8, 193u8, + 93u8, 246u8, 21u8, 37u8, 244u8, 166u8, 132u8, 208u8, 18u8, + 86u8, 195u8, 156u8, 9u8, 220u8, 120u8, 40u8, 183u8, 28u8, + 103u8, 84u8, 163u8, 153u8, 110u8, + ], + ) } #[doc = "Make a claim to collect your DOTs by signing a statement."] #[doc = ""] @@ -19563,42 +13083,25 @@ pub mod api { #[doc = ""] pub fn claim_attest( &self, - dest: ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_core::crypto::AccountId32, ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, statement: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClaimAttest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 116u8, 181u8, 28u8, 215u8, 245u8, 86u8, 215u8, 114u8, 201u8, - 250u8, 168u8, 43u8, 91u8, 74u8, 0u8, 61u8, 40u8, 135u8, 6u8, - 241u8, 18u8, 24u8, 153u8, 152u8, 22u8, 165u8, 172u8, 94u8, - 200u8, 53u8, 92u8, 212u8, - ] - { - let call = ClaimAttest { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Claims", + "claim_attest", + ClaimAttest { dest, ethereum_signature, statement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 255u8, 10u8, 87u8, 106u8, 101u8, 195u8, 249u8, 25u8, 109u8, + 82u8, 213u8, 95u8, 203u8, 145u8, 224u8, 113u8, 92u8, 141u8, + 31u8, 54u8, 218u8, 47u8, 218u8, 239u8, 211u8, 206u8, 77u8, + 176u8, 19u8, 176u8, 175u8, 135u8, + ], + ) } #[doc = "Attest to a statement, needed to finalize the claims process."] #[doc = ""] @@ -19620,76 +13123,42 @@ pub mod api { pub fn attest( &self, statement: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Attest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 7u8, 206u8, 87u8, 155u8, 225u8, 220u8, 145u8, 206u8, 87u8, - 132u8, 171u8, 67u8, 104u8, 91u8, 247u8, 39u8, 114u8, 156u8, - 185u8, 28u8, 194u8, 104u8, 32u8, 25u8, 50u8, 94u8, 249u8, - 196u8, 83u8, 36u8, 123u8, 106u8, - ] - { - let call = Attest { statement }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Claims", + "attest", + Attest { statement }, + [ + 8u8, 218u8, 97u8, 237u8, 185u8, 61u8, 55u8, 4u8, 134u8, 18u8, + 244u8, 226u8, 40u8, 97u8, 222u8, 246u8, 221u8, 74u8, 253u8, + 22u8, 52u8, 223u8, 224u8, 83u8, 21u8, 218u8, 248u8, 100u8, + 107u8, 58u8, 247u8, 10u8, + ], + ) } pub fn move_claim( &self, old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, maybe_preclaim: ::core::option::Option< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - MoveClaim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 7u8, 59u8, 57u8, 165u8, 149u8, 105u8, 40u8, 11u8, 62u8, - 212u8, 35u8, 185u8, 38u8, 244u8, 14u8, 170u8, 73u8, 160u8, - 100u8, 124u8, 20u8, 147u8, 12u8, 208u8, 124u8, 122u8, 148u8, - 12u8, 173u8, 61u8, 137u8, 20u8, - ] - { - let call = MoveClaim { + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Claims", + "move_claim", + MoveClaim { old, new, maybe_preclaim, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 63u8, 48u8, 217u8, 16u8, 161u8, 102u8, 165u8, 241u8, 57u8, + 185u8, 230u8, 161u8, 202u8, 11u8, 223u8, 15u8, 57u8, 181u8, + 34u8, 131u8, 235u8, 168u8, 227u8, 152u8, 157u8, 4u8, 192u8, + 243u8, 194u8, 120u8, 130u8, 202u8, + ], + ) } } } @@ -19697,198 +13166,92 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Someone claimed some DOTs."] pub struct Claimed { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub ethereum_address: runtime_types::polkadot_runtime_common::claims::EthereumAddress, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Claimed { + impl ::subxt::events::StaticEvent for Claimed { const PALLET: &'static str = "Claims"; const EVENT: &'static str = "Claimed"; } } pub mod storage { use super::runtime_types; - pub struct Claims<'a>( - pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Claims<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Claims"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Total; - impl ::subxt::StorageEntry for Total { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Total"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Vesting<'a>( - pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Vesting<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Vesting"; - type Value = ( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Signing<'a>( - pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Signing<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Signing"; - type Value = - runtime_types::polkadot_runtime_common::claims::StatementKind; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Preclaims<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Preclaims<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Preclaims"; - type Value = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { pub fn claims( &self, - _0 : & 'a runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 66u8, 232u8, 109u8, 190u8, 15u8, 207u8, 114u8, 12u8, - 91u8, 228u8, 103u8, 37u8, 152u8, 245u8, 51u8, 121u8, - 179u8, 228u8, 187u8, 121u8, 141u8, 225u8, 122u8, 235u8, - 201u8, 94u8, 207u8, 50u8, 51u8, 166u8, 32u8, 119u8, - ] - { - let entry = Claims(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - pub fn claims_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Claims<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 66u8, 232u8, 109u8, 190u8, 15u8, 207u8, 114u8, 12u8, - 91u8, 228u8, 103u8, 37u8, 152u8, 245u8, 51u8, 121u8, - 179u8, 228u8, 187u8, 121u8, 141u8, 225u8, 122u8, 235u8, - 201u8, 94u8, 207u8, 50u8, 51u8, 166u8, 32u8, 119u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Claims", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 36u8, 247u8, 169u8, 171u8, 103u8, 176u8, 70u8, 213u8, 255u8, + 175u8, 97u8, 142u8, 231u8, 70u8, 90u8, 213u8, 128u8, 67u8, + 50u8, 37u8, 51u8, 184u8, 72u8, 27u8, 193u8, 254u8, 12u8, + 253u8, 91u8, 60u8, 88u8, 182u8, + ], + ) + } + pub fn claims_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Claims", + Vec::new(), + [ + 36u8, 247u8, 169u8, 171u8, 103u8, 176u8, 70u8, 213u8, 255u8, + 175u8, 97u8, 142u8, 231u8, 70u8, 90u8, 213u8, 128u8, 67u8, + 50u8, 37u8, 51u8, 184u8, 72u8, 27u8, 193u8, 254u8, 12u8, + 253u8, 91u8, 60u8, 88u8, 182u8, + ], + ) } pub fn total( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 162u8, 59u8, 237u8, 63u8, 23u8, 44u8, 74u8, 169u8, 131u8, - 166u8, 174u8, 61u8, 127u8, 165u8, 32u8, 115u8, 73u8, - 171u8, 36u8, 10u8, 6u8, 23u8, 19u8, 202u8, 3u8, 189u8, - 29u8, 169u8, 144u8, 187u8, 235u8, 77u8, - ] - { - let entry = Total; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Total", + vec![], + [ + 162u8, 59u8, 237u8, 63u8, 23u8, 44u8, 74u8, 169u8, 131u8, + 166u8, 174u8, 61u8, 127u8, 165u8, 32u8, 115u8, 73u8, 171u8, + 36u8, 10u8, 6u8, 23u8, 19u8, 202u8, 3u8, 189u8, 29u8, 169u8, + 144u8, 187u8, 235u8, 77u8, + ], + ) } #[doc = " Vesting schedule for a claim."] #[doc = " First balance is the total amount that should be held for vesting."] @@ -19896,284 +13259,224 @@ pub mod api { #[doc = " The block number is when the vesting should start."] pub fn vesting( &self, - _0 : & 'a runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 177u8, 83u8, 172u8, 137u8, 213u8, 11u8, 74u8, - 192u8, 92u8, 96u8, 63u8, 139u8, 156u8, 62u8, 207u8, 47u8, - 156u8, 185u8, 145u8, 149u8, 112u8, 101u8, 17u8, 183u8, - 4u8, 220u8, 31u8, 56u8, 175u8, 97u8, 12u8, - ] - { - let entry = Vesting(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Vesting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 112u8, 174u8, 151u8, 185u8, 225u8, 170u8, 63u8, 147u8, 100u8, + 23u8, 102u8, 148u8, 244u8, 47u8, 87u8, 99u8, 28u8, 59u8, + 48u8, 205u8, 43u8, 41u8, 87u8, 225u8, 191u8, 164u8, 31u8, + 208u8, 80u8, 53u8, 25u8, 205u8, + ], + ) } #[doc = " Vesting schedule for a claim."] #[doc = " First balance is the total amount that should be held for vesting."] #[doc = " Second balance is how much should be unlocked per block."] #[doc = " The block number is when the vesting should start."] - pub fn vesting_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Vesting<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 177u8, 83u8, 172u8, 137u8, 213u8, 11u8, 74u8, - 192u8, 92u8, 96u8, 63u8, 139u8, 156u8, 62u8, 207u8, 47u8, - 156u8, 185u8, 145u8, 149u8, 112u8, 101u8, 17u8, 183u8, - 4u8, 220u8, 31u8, 56u8, 175u8, 97u8, 12u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn vesting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Vesting", + Vec::new(), + [ + 112u8, 174u8, 151u8, 185u8, 225u8, 170u8, 63u8, 147u8, 100u8, + 23u8, 102u8, 148u8, 244u8, 47u8, 87u8, 99u8, 28u8, 59u8, + 48u8, 205u8, 43u8, 41u8, 87u8, 225u8, 191u8, 164u8, 31u8, + 208u8, 80u8, 53u8, 25u8, 205u8, + ], + ) } #[doc = " The statement kind that must be signed, if any."] pub fn signing( &self, - _0 : & 'a runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 85u8, 167u8, 23u8, 218u8, 101u8, 189u8, 129u8, 64u8, - 189u8, 159u8, 108u8, 22u8, 234u8, 189u8, 122u8, 145u8, - 225u8, 202u8, 158u8, 244u8, 1u8, 19u8, 66u8, 78u8, 250u8, - 208u8, 116u8, 222u8, 118u8, 231u8, 45u8, 170u8, - ] - { - let entry = Signing(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Signing", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 51u8, 184u8, 211u8, 207u8, 13u8, 194u8, 181u8, 153u8, 25u8, + 212u8, 106u8, 189u8, 149u8, 14u8, 19u8, 61u8, 210u8, 109u8, + 23u8, 168u8, 191u8, 74u8, 112u8, 190u8, 242u8, 112u8, 183u8, + 17u8, 30u8, 125u8, 85u8, 107u8, + ], + ) } #[doc = " The statement kind that must be signed, if any."] - pub fn signing_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Signing<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 85u8, 167u8, 23u8, 218u8, 101u8, 189u8, 129u8, 64u8, - 189u8, 159u8, 108u8, 22u8, 234u8, 189u8, 122u8, 145u8, - 225u8, 202u8, 158u8, 244u8, 1u8, 19u8, 66u8, 78u8, 250u8, - 208u8, 116u8, 222u8, 118u8, 231u8, 45u8, 170u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn signing_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Signing", + Vec::new(), + [ + 51u8, 184u8, 211u8, 207u8, 13u8, 194u8, 181u8, 153u8, 25u8, + 212u8, 106u8, 189u8, 149u8, 14u8, 19u8, 61u8, 210u8, 109u8, + 23u8, 168u8, 191u8, 74u8, 112u8, 190u8, 242u8, 112u8, 183u8, + 17u8, 30u8, 125u8, 85u8, 107u8, + ], + ) } - #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] pub fn preclaims (& self , _0 : & 'a :: subxt :: sp_core :: crypto :: AccountId32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 208u8, 119u8, 9u8, 98u8, 68u8, 27u8, 159u8, 132u8, - 22u8, 72u8, 80u8, 83u8, 147u8, 224u8, 241u8, 98u8, 143u8, - 219u8, 240u8, 199u8, 54u8, 36u8, 188u8, 187u8, 255u8, - 12u8, 163u8, 136u8, 53u8, 210u8, 206u8, - ] - { - let entry = Preclaims(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] + pub fn preclaims( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Preclaims", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 149u8, 61u8, 170u8, 170u8, 60u8, 212u8, 29u8, 214u8, 141u8, + 136u8, 207u8, 248u8, 51u8, 135u8, 242u8, 105u8, 121u8, 91u8, + 186u8, 30u8, 0u8, 173u8, 154u8, 133u8, 20u8, 244u8, 58u8, + 184u8, 133u8, 214u8, 67u8, 95u8, + ], + ) } #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] - pub fn preclaims_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Preclaims<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 208u8, 119u8, 9u8, 98u8, 68u8, 27u8, 159u8, 132u8, - 22u8, 72u8, 80u8, 83u8, 147u8, 224u8, 241u8, 98u8, 143u8, - 219u8, 240u8, 199u8, 54u8, 36u8, 188u8, 187u8, 255u8, - 12u8, 163u8, 136u8, 53u8, 210u8, 206u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn preclaims_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Claims", + "Preclaims", + Vec::new(), + [ + 149u8, 61u8, 170u8, 170u8, 60u8, 212u8, 29u8, 214u8, 141u8, + 136u8, 207u8, 248u8, 51u8, 135u8, 242u8, 105u8, 121u8, 91u8, + 186u8, 30u8, 0u8, 173u8, 154u8, 133u8, 20u8, 244u8, 58u8, + 184u8, 133u8, 214u8, 67u8, 95u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { pub fn prefix( &self, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Claims", "Prefix")? - == [ - 151u8, 15u8, 166u8, 7u8, 98u8, 182u8, 188u8, 119u8, 175u8, - 44u8, 205u8, 188u8, 45u8, 196u8, 52u8, 235u8, 147u8, 241u8, - 62u8, 53u8, 48u8, 127u8, 177u8, 227u8, 224u8, 81u8, 58u8, - 244u8, 157u8, 148u8, 127u8, 80u8, - ] - { - let pallet = metadata.pallet("Claims")?; - let constant = pallet.constant("Prefix")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u8>, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Claims", + "Prefix", + [ + 106u8, 50u8, 57u8, 116u8, 43u8, 202u8, 37u8, 248u8, 102u8, + 22u8, 62u8, 22u8, 242u8, 54u8, 152u8, 168u8, 107u8, 64u8, + 72u8, 172u8, 124u8, 40u8, 42u8, 110u8, 104u8, 145u8, 31u8, + 144u8, 242u8, 189u8, 145u8, 208u8, + ], + ) } } } } pub mod vesting { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Vest; - impl ::subxt::Call for Vest { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct VestOther { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for VestOther { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest_other"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct VestedTransfer { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< @@ -20181,18 +13484,18 @@ pub mod api { ::core::primitive::u32, >, } - impl ::subxt::Call for VestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vested_transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceVestedTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< @@ -20200,34 +13503,17 @@ pub mod api { ::core::primitive::u32, >, } - impl ::subxt::Call for ForceVestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "force_vested_transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct MergeSchedules { pub schedule1_index: ::core::primitive::u32, pub schedule2_index: ::core::primitive::u32, } - impl ::subxt::Call for MergeSchedules { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "merge_schedules"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Unlock any vested funds of the sender account."] #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] @@ -20241,37 +13527,18 @@ pub mod api { #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] #[doc = "# "] - pub fn vest( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn vest(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "vest", + Vest {}, + [ 123u8, 54u8, 10u8, 208u8, 154u8, 24u8, 39u8, 166u8, 64u8, 27u8, 74u8, 29u8, 243u8, 97u8, 155u8, 5u8, 130u8, 155u8, 65u8, 181u8, 196u8, 125u8, 45u8, 133u8, 25u8, 33u8, 3u8, 34u8, 21u8, 167u8, 172u8, 54u8, - ] - { - let call = Vest {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Unlock any vested funds of a `target` account."] #[doc = ""] @@ -20290,39 +13557,22 @@ pub mod api { #[doc = "# "] pub fn vest_other( &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - VestOther, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 220u8, 214u8, 201u8, 84u8, 89u8, 137u8, 126u8, 80u8, 57u8, - 1u8, 178u8, 144u8, 1u8, 79u8, 232u8, 136u8, 62u8, 227u8, - 26u8, 148u8, 78u8, 92u8, 222u8, 210u8, 5u8, 108u8, 245u8, - 51u8, 208u8, 98u8, 184u8, 8u8, - ] - { - let call = VestOther { target }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "vest_other", + VestOther { target }, + [ + 164u8, 19u8, 93u8, 81u8, 235u8, 101u8, 18u8, 52u8, 187u8, + 81u8, 243u8, 216u8, 116u8, 84u8, 188u8, 135u8, 1u8, 241u8, + 128u8, 90u8, 117u8, 164u8, 111u8, 0u8, 251u8, 148u8, 250u8, + 248u8, 102u8, 79u8, 165u8, 175u8, + ], + ) } #[doc = "Create a vested transfer."] #[doc = ""] @@ -20343,43 +13593,26 @@ pub mod api { #[doc = "# "] pub fn vested_transfer( &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< ::core::primitive::u128, ::core::primitive::u32, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - VestedTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 117u8, 107u8, 28u8, 234u8, 240u8, 253u8, 122u8, 25u8, 134u8, - 41u8, 162u8, 36u8, 157u8, 82u8, 214u8, 174u8, 132u8, 24u8, - 241u8, 68u8, 126u8, 122u8, 162u8, 130u8, 62u8, 43u8, 145u8, - 90u8, 49u8, 200u8, 25u8, 137u8, - ] - { - let call = VestedTransfer { target, schedule }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "vested_transfer", + VestedTransfer { target, schedule }, + [ + 135u8, 172u8, 56u8, 97u8, 45u8, 141u8, 93u8, 173u8, 111u8, + 252u8, 75u8, 246u8, 92u8, 181u8, 138u8, 87u8, 145u8, 174u8, + 71u8, 108u8, 126u8, 118u8, 49u8, 122u8, 249u8, 132u8, 19u8, + 2u8, 132u8, 160u8, 247u8, 195u8, + ], + ) } #[doc = "Force a vested transfer."] #[doc = ""] @@ -20401,51 +13634,34 @@ pub mod api { #[doc = "# "] pub fn force_vested_transfer( &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< ::core::primitive::u128, ::core::primitive::u32, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceVestedTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 32u8, 195u8, 99u8, 57u8, 6u8, 182u8, 106u8, 47u8, 9u8, 19u8, - 255u8, 80u8, 244u8, 205u8, 129u8, 78u8, 6u8, 215u8, 224u8, - 151u8, 14u8, 219u8, 46u8, 11u8, 200u8, 160u8, 79u8, 193u8, - 49u8, 252u8, 180u8, 151u8, - ] - { - let call = ForceVestedTransfer { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "force_vested_transfer", + ForceVestedTransfer { source, target, schedule, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 110u8, 142u8, 63u8, 148u8, 90u8, 229u8, 237u8, 183u8, 240u8, + 237u8, 242u8, 32u8, 88u8, 48u8, 220u8, 101u8, 210u8, 212u8, + 27u8, 7u8, 186u8, 98u8, 28u8, 197u8, 148u8, 140u8, 77u8, + 59u8, 202u8, 166u8, 63u8, 97u8, + ], + ) } #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] #[doc = "the highest possible start and end blocks. If both schedules have already started the"] @@ -20472,38 +13688,21 @@ pub mod api { &self, schedule1_index: ::core::primitive::u32, schedule2_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - MergeSchedules, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 185u8, 253u8, 214u8, 24u8, 208u8, 226u8, 0u8, 212u8, 92u8, - 174u8, 252u8, 44u8, 250u8, 96u8, 66u8, 55u8, 88u8, 252u8, - 152u8, 238u8, 186u8, 85u8, 45u8, 213u8, 49u8, 42u8, 50u8, - 127u8, 30u8, 53u8, 73u8, 7u8, - ] - { - let call = MergeSchedules { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "merge_schedules", + MergeSchedules { schedule1_index, schedule2_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 95u8, 255u8, 147u8, 12u8, 49u8, 25u8, 70u8, 112u8, 55u8, + 154u8, 183u8, 97u8, 56u8, 244u8, 148u8, 61u8, 107u8, 163u8, + 220u8, 31u8, 153u8, 25u8, 193u8, 251u8, 131u8, 26u8, 166u8, + 157u8, 75u8, 4u8, 110u8, 125u8, + ], + ) } } } @@ -20511,307 +13710,219 @@ pub mod api { pub type Event = runtime_types::pallet_vesting::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The amount vested has been updated. This could indicate a change in funds available."] #[doc = "The balance given is the amount which is left unvested (and thus locked)."] pub struct VestingUpdated { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub unvested: ::core::primitive::u128, } - impl ::subxt::Event for VestingUpdated { + impl ::subxt::events::StaticEvent for VestingUpdated { const PALLET: &'static str = "Vesting"; const EVENT: &'static str = "VestingUpdated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An \\[account\\] has become fully vested."] pub struct VestingCompleted { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for VestingCompleted { + impl ::subxt::events::StaticEvent for VestingCompleted { const PALLET: &'static str = "Vesting"; const EVENT: &'static str = "VestingCompleted"; } } pub mod storage { use super::runtime_types; - pub struct Vesting<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Vesting<'_> { - const PALLET: &'static str = "Vesting"; - const STORAGE: &'static str = "Vesting"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Vesting"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_vesting::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Information regarding the vesting of a given account."] pub fn vesting( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 237u8, 216u8, 145u8, 89u8, 52u8, 38u8, 126u8, 212u8, - 173u8, 3u8, 57u8, 156u8, 208u8, 160u8, 249u8, 177u8, - 83u8, 140u8, 178u8, 221u8, 106u8, 66u8, 171u8, 25u8, - 230u8, 69u8, 78u8, 223u8, 182u8, 156u8, 218u8, 206u8, - ] - { - let entry = Vesting(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Vesting", + "Vesting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 23u8, 209u8, 233u8, 126u8, 89u8, 156u8, 193u8, 204u8, 100u8, + 90u8, 14u8, 120u8, 36u8, 167u8, 148u8, 239u8, 179u8, 74u8, + 207u8, 83u8, 54u8, 77u8, 27u8, 135u8, 74u8, 31u8, 33u8, 11u8, + 168u8, 239u8, 212u8, 36u8, + ], + ) } #[doc = " Information regarding the vesting of a given account."] - pub fn vesting_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Vesting<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 237u8, 216u8, 145u8, 89u8, 52u8, 38u8, 126u8, 212u8, - 173u8, 3u8, 57u8, 156u8, 208u8, 160u8, 249u8, 177u8, - 83u8, 140u8, 178u8, 221u8, 106u8, 66u8, 171u8, 25u8, - 230u8, 69u8, 78u8, 223u8, 182u8, 156u8, 218u8, 206u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn vesting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Vesting", + "Vesting", + Vec::new(), + [ + 23u8, 209u8, 233u8, 126u8, 89u8, 156u8, 193u8, 204u8, 100u8, + 90u8, 14u8, 120u8, 36u8, 167u8, 148u8, 239u8, 179u8, 74u8, + 207u8, 83u8, 54u8, 77u8, 27u8, 135u8, 74u8, 31u8, 33u8, 11u8, + 168u8, 239u8, 212u8, 36u8, + ], + ) } #[doc = " Storage version of the pallet."] #[doc = ""] #[doc = " New networks start with latest version, as determined by the genesis build."] pub fn storage_version( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_vesting::Releases, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 50u8, 143u8, 26u8, 88u8, 129u8, 31u8, 61u8, 118u8, 19u8, - 202u8, 119u8, 160u8, 34u8, 219u8, 60u8, 57u8, 189u8, - 66u8, 93u8, 239u8, 121u8, 114u8, 241u8, 116u8, 0u8, - 122u8, 232u8, 94u8, 189u8, 23u8, 45u8, 191u8, - ] - { - let entry = StorageVersion; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Vesting", + "StorageVersion", + vec![], + [ + 50u8, 143u8, 26u8, 88u8, 129u8, 31u8, 61u8, 118u8, 19u8, + 202u8, 119u8, 160u8, 34u8, 219u8, 60u8, 57u8, 189u8, 66u8, + 93u8, 239u8, 121u8, 114u8, 241u8, 116u8, 0u8, 122u8, 232u8, + 94u8, 189u8, 23u8, 45u8, 191u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The minimum amount transferred to call `vested_transfer`."] pub fn min_vested_transfer( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Vesting", "MinVestedTransfer")? - == [ - 92u8, 250u8, 99u8, 224u8, 124u8, 3u8, 41u8, 238u8, 116u8, - 235u8, 81u8, 85u8, 152u8, 180u8, 129u8, 205u8, 190u8, 88u8, - 54u8, 86u8, 184u8, 185u8, 221u8, 85u8, 203u8, 161u8, 201u8, - 77u8, 143u8, 170u8, 128u8, 176u8, - ] - { - let pallet = metadata.pallet("Vesting")?; - let constant = pallet.constant("MinVestedTransfer")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Vesting", + "MinVestedTransfer", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } pub fn max_vesting_schedules( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Vesting", "MaxVestingSchedules")? - == [ - 156u8, 82u8, 251u8, 182u8, 112u8, 167u8, 99u8, 73u8, 181u8, - 140u8, 52u8, 5u8, 46u8, 113u8, 139u8, 65u8, 61u8, 139u8, - 212u8, 238u8, 240u8, 112u8, 245u8, 187u8, 124u8, 21u8, 211u8, - 130u8, 61u8, 48u8, 245u8, 137u8, - ] - { - let pallet = metadata.pallet("Vesting")?; - let constant = pallet.constant("MaxVestingSchedules")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Vesting", + "MaxVestingSchedules", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod utility { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Batch { pub calls: ::std::vec::Vec, } - impl ::subxt::Call for Batch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AsDerivative { pub index: ::core::primitive::u16, pub call: ::std::boxed::Box, } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct BatchAll { pub calls: ::std::vec::Vec, } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct DispatchAs { pub as_origin: ::std::boxed::Box, pub call: ::std::boxed::Box, } - impl ::subxt::Call for DispatchAs { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "dispatch_as"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceBatch { pub calls: ::std::vec::Vec, } - impl ::subxt::Call for ForceBatch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "force_batch"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Send a batch of dispatch calls."] #[doc = ""] #[doc = "May be called from any origin."] @@ -20834,35 +13945,18 @@ pub mod api { pub fn batch( &self, calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Batch, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 118u8, 153u8, 248u8, 10u8, 95u8, 87u8, 241u8, 183u8, 110u8, - 81u8, 134u8, 246u8, 127u8, 18u8, 37u8, 94u8, 97u8, 157u8, - 203u8, 100u8, 55u8, 106u8, 200u8, 152u8, 69u8, 250u8, 231u8, - 196u8, 214u8, 62u8, 154u8, 59u8, - ] - { - let call = Batch { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "batch", + Batch { calls }, + [ + 230u8, 242u8, 253u8, 157u8, 0u8, 86u8, 104u8, 163u8, 42u8, + 162u8, 114u8, 169u8, 67u8, 132u8, 54u8, 68u8, 32u8, 42u8, + 172u8, 56u8, 29u8, 54u8, 151u8, 226u8, 195u8, 239u8, 113u8, + 87u8, 21u8, 125u8, 40u8, 26u8, + ], + ) } #[doc = "Send a call through an indexed pseudonym of the sender."] #[doc = ""] @@ -20881,38 +13975,21 @@ pub mod api { &self, index: ::core::primitive::u16, call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsDerivative, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 57u8, 222u8, 171u8, 71u8, 110u8, 45u8, 232u8, 229u8, 107u8, - 186u8, 96u8, 126u8, 103u8, 175u8, 43u8, 13u8, 231u8, 179u8, - 224u8, 41u8, 123u8, 129u8, 107u8, 126u8, 201u8, 243u8, 126u8, - 203u8, 165u8, 104u8, 124u8, 137u8, - ] - { - let call = AsDerivative { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "as_derivative", + AsDerivative { index, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 209u8, 64u8, 30u8, 168u8, 146u8, 109u8, 20u8, 238u8, 158u8, + 153u8, 28u8, 18u8, 100u8, 210u8, 98u8, 203u8, 144u8, 225u8, + 110u8, 242u8, 244u8, 204u8, 183u8, 255u8, 165u8, 95u8, 166u8, + 131u8, 135u8, 41u8, 116u8, 201u8, + ], + ) } #[doc = "Send a batch of dispatch calls and atomically execute them."] #[doc = "The whole transaction will rollback and fail if any of the calls failed."] @@ -20931,35 +14008,18 @@ pub mod api { pub fn batch_all( &self, calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - BatchAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 244u8, 150u8, 6u8, 141u8, 240u8, 33u8, 249u8, 11u8, - 131u8, 248u8, 156u8, 131u8, 121u8, 245u8, 181u8, 218u8, - 132u8, 79u8, 111u8, 188u8, 232u8, 148u8, 209u8, 193u8, 51u8, - 54u8, 231u8, 62u8, 219u8, 129u8, 198u8, - ] - { - let call = BatchAll { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "batch_all", + BatchAll { calls }, + [ + 169u8, 101u8, 230u8, 159u8, 101u8, 77u8, 48u8, 75u8, 209u8, + 42u8, 1u8, 95u8, 117u8, 254u8, 136u8, 162u8, 194u8, 255u8, + 67u8, 45u8, 188u8, 209u8, 155u8, 1u8, 252u8, 9u8, 253u8, + 225u8, 215u8, 210u8, 125u8, 44u8, + ], + ) } #[doc = "Dispatches a function call with a provided origin."] #[doc = ""] @@ -20975,38 +14035,21 @@ pub mod api { &self, as_origin: runtime_types::polkadot_runtime::OriginCaller, call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DispatchAs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 151u8, 231u8, 206u8, 220u8, 213u8, 118u8, 138u8, 198u8, - 252u8, 44u8, 211u8, 231u8, 205u8, 96u8, 86u8, 253u8, 190u8, - 136u8, 200u8, 223u8, 152u8, 183u8, 123u8, 48u8, 168u8, 56u8, - 24u8, 165u8, 79u8, 190u8, 13u8, 230u8, - ] - { - let call = DispatchAs { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "dispatch_as", + DispatchAs { as_origin: ::std::boxed::Box::new(as_origin), call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 21u8, 250u8, 30u8, 78u8, 60u8, 151u8, 157u8, 90u8, 167u8, + 9u8, 134u8, 177u8, 58u8, 69u8, 157u8, 169u8, 203u8, 130u8, + 160u8, 26u8, 170u8, 142u8, 30u8, 206u8, 161u8, 84u8, 94u8, + 205u8, 138u8, 248u8, 120u8, 61u8, + ], + ) } #[doc = "Send a batch of dispatch calls."] #[doc = "Unlike `batch`, it allows errors and won't interrupt."] @@ -21025,35 +14068,18 @@ pub mod api { pub fn force_batch( &self, calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceBatch, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 82u8, 204u8, 241u8, 136u8, 126u8, 230u8, 50u8, 149u8, 95u8, - 70u8, 61u8, 138u8, 29u8, 63u8, 217u8, 169u8, 1u8, 200u8, - 60u8, 157u8, 190u8, 200u8, 111u8, 171u8, 83u8, 168u8, 81u8, - 225u8, 182u8, 113u8, 24u8, 97u8, - ] - { - let call = ForceBatch { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "force_batch", + ForceBatch { calls }, + [ + 195u8, 179u8, 12u8, 198u8, 131u8, 78u8, 95u8, 171u8, 209u8, + 198u8, 177u8, 95u8, 116u8, 196u8, 112u8, 71u8, 41u8, 13u8, + 73u8, 86u8, 241u8, 226u8, 224u8, 146u8, 110u8, 60u8, 77u8, + 99u8, 131u8, 151u8, 28u8, 141u8, + ], + ) } } } @@ -21061,187 +14087,195 @@ pub mod api { pub type Event = runtime_types::pallet_utility::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] #[doc = "well as the error."] pub struct BatchInterrupted { pub index: ::core::primitive::u32, pub error: runtime_types::sp_runtime::DispatchError, } - impl ::subxt::Event for BatchInterrupted { + impl ::subxt::events::StaticEvent for BatchInterrupted { const PALLET: &'static str = "Utility"; const EVENT: &'static str = "BatchInterrupted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Batch of dispatches completed fully with no error."] pub struct BatchCompleted; - impl ::subxt::Event for BatchCompleted { + impl ::subxt::events::StaticEvent for BatchCompleted { const PALLET: &'static str = "Utility"; const EVENT: &'static str = "BatchCompleted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Batch of dispatches completed but has errors."] pub struct BatchCompletedWithErrors; - impl ::subxt::Event for BatchCompletedWithErrors { + impl ::subxt::events::StaticEvent for BatchCompletedWithErrors { const PALLET: &'static str = "Utility"; const EVENT: &'static str = "BatchCompletedWithErrors"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A single item within a Batch of dispatches has completed with no error."] pub struct ItemCompleted; - impl ::subxt::Event for ItemCompleted { + impl ::subxt::events::StaticEvent for ItemCompleted { const PALLET: &'static str = "Utility"; const EVENT: &'static str = "ItemCompleted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A single item within a Batch of dispatches has completed with error."] pub struct ItemFailed { pub error: runtime_types::sp_runtime::DispatchError, } - impl ::subxt::Event for ItemFailed { + impl ::subxt::events::StaticEvent for ItemFailed { const PALLET: &'static str = "Utility"; const EVENT: &'static str = "ItemFailed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A call was dispatched."] pub struct DispatchedAs { pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for DispatchedAs { + impl ::subxt::events::StaticEvent for DispatchedAs { const PALLET: &'static str = "Utility"; const EVENT: &'static str = "DispatchedAs"; } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The limit on the number of batched calls."] pub fn batched_calls_limit( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Utility", "batched_calls_limit")? - == [ - 230u8, 161u8, 6u8, 191u8, 162u8, 108u8, 149u8, 245u8, 68u8, - 101u8, 120u8, 129u8, 140u8, 51u8, 77u8, 97u8, 30u8, 155u8, - 115u8, 70u8, 72u8, 235u8, 251u8, 192u8, 5u8, 8u8, 188u8, - 72u8, 132u8, 227u8, 44u8, 2u8, - ] - { - let pallet = metadata.pallet("Utility")?; - let constant = pallet.constant("batched_calls_limit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Utility", + "batched_calls_limit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod identity { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Identity pallet declaration."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddRegistrar { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for AddRegistrar { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "add_registrar"; + pub account: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetIdentity { pub info: ::std::boxed::Box< runtime_types::pallet_identity::types::IdentityInfo, >, } - impl ::subxt::Call for SetIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_identity"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetSubs { pub subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::pallet_identity::types::Data, )>, } - impl ::subxt::Call for SetSubs { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_subs"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClearIdentity; - impl ::subxt::Call for ClearIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "clear_identity"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RequestJudgement { #[codec(compact)] pub reg_index: ::core::primitive::u32, #[codec(compact)] pub max_fee: ::core::primitive::u128, } - impl ::subxt::Call for RequestJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "request_judgement"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct CancelRequest { pub reg_index: ::core::primitive::u32, } - impl ::subxt::Call for CancelRequest { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "cancel_request"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetFee { #[codec(compact)] pub index: ::core::primitive::u32, #[codec(compact)] pub fee: ::core::primitive::u128, } - impl ::subxt::Call for SetFee { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_fee"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetAccountId { #[codec(compact)] pub index: ::core::primitive::u32, - pub new: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetAccountId { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_account_id"; + pub new: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetFields { #[codec(compact)] pub index: ::core::primitive::u32, @@ -21249,93 +14283,76 @@ pub mod api { runtime_types::pallet_identity::types::IdentityField, >, } - impl ::subxt::Call for SetFields { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_fields"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProvideJudgement { #[codec(compact)] pub reg_index: ::core::primitive::u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub judgement: runtime_types::pallet_identity::types::Judgement< ::core::primitive::u128, >, } - impl ::subxt::Call for ProvideJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "provide_judgement"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct KillIdentity { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for KillIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "kill_identity"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub data: runtime_types::pallet_identity::types::Data, } - impl ::subxt::Call for AddSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "add_sub"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RenameSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, pub data: runtime_types::pallet_identity::types::Data, } - impl ::subxt::Call for RenameSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "rename_sub"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for RemoveSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "remove_sub"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct QuitSub; - impl ::subxt::Call for QuitSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "quit_sub"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Add a registrar to the system."] #[doc = ""] #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] @@ -21351,36 +14368,19 @@ pub mod api { #[doc = "# "] pub fn add_registrar( &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddRegistrar, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 252u8, 233u8, 148u8, 186u8, 42u8, 127u8, 183u8, 107u8, 205u8, - 34u8, 63u8, 170u8, 82u8, 218u8, 141u8, 136u8, 174u8, 45u8, - 3u8, 226u8, 175u8, 22u8, 18u8, 120u8, 70u8, 4u8, 164u8, - 147u8, 228u8, 52u8, 199u8, 196u8, - ] - { - let call = AddRegistrar { account }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + account: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "add_registrar", + AddRegistrar { account }, + [ + 231u8, 221u8, 79u8, 233u8, 107u8, 34u8, 195u8, 186u8, 192u8, + 129u8, 103u8, 159u8, 159u8, 83u8, 151u8, 161u8, 137u8, 164u8, + 143u8, 31u8, 75u8, 42u8, 27u8, 203u8, 19u8, 70u8, 173u8, + 11u8, 241u8, 189u8, 137u8, 127u8, + ], + ) } #[doc = "Set an account's identity information and reserve the appropriate deposit."] #[doc = ""] @@ -21404,37 +14404,20 @@ pub mod api { pub fn set_identity( &self, info: runtime_types::pallet_identity::types::IdentityInfo, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetIdentity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 174u8, 5u8, 84u8, 201u8, 219u8, 147u8, 45u8, 241u8, 46u8, - 192u8, 221u8, 20u8, 233u8, 128u8, 206u8, 1u8, 71u8, 244u8, - 153u8, 167u8, 150u8, 164u8, 16u8, 58u8, 51u8, 168u8, 58u8, - 184u8, 204u8, 229u8, 135u8, 91u8, - ] - { - let call = SetIdentity { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_identity", + SetIdentity { info: ::std::boxed::Box::new(info), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 130u8, 89u8, 118u8, 6u8, 134u8, 166u8, 35u8, 192u8, 73u8, + 6u8, 171u8, 20u8, 225u8, 255u8, 152u8, 142u8, 111u8, 8u8, + 206u8, 200u8, 64u8, 52u8, 110u8, 123u8, 42u8, 101u8, 191u8, + 242u8, 133u8, 139u8, 154u8, 205u8, + ], + ) } #[doc = "Set the sub-accounts of the sender."] #[doc = ""] @@ -21460,38 +14443,21 @@ pub mod api { pub fn set_subs( &self, subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::pallet_identity::types::Data, )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetSubs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 157u8, 141u8, 52u8, 45u8, 109u8, 252u8, 84u8, 0u8, 38u8, - 209u8, 193u8, 212u8, 177u8, 47u8, 219u8, 132u8, 254u8, 234u8, - 43u8, 200u8, 104u8, 149u8, 250u8, 169u8, 119u8, 208u8, 111u8, - 184u8, 70u8, 161u8, 245u8, 33u8, - ] - { - let call = SetSubs { subs }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_subs", + SetSubs { subs }, + [ + 177u8, 219u8, 84u8, 183u8, 5u8, 32u8, 192u8, 82u8, 174u8, + 68u8, 198u8, 224u8, 56u8, 85u8, 134u8, 171u8, 30u8, 132u8, + 140u8, 236u8, 117u8, 24u8, 150u8, 218u8, 146u8, 194u8, 144u8, + 92u8, 103u8, 206u8, 46u8, 90u8, + ], + ) } #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] #[doc = ""] @@ -21513,35 +14479,18 @@ pub mod api { #[doc = "# "] pub fn clear_identity( &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearIdentity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "clear_identity", + ClearIdentity {}, + [ 75u8, 44u8, 74u8, 122u8, 149u8, 202u8, 114u8, 230u8, 0u8, 255u8, 140u8, 122u8, 14u8, 196u8, 205u8, 249u8, 220u8, 94u8, 216u8, 34u8, 63u8, 14u8, 8u8, 205u8, 74u8, 23u8, 181u8, 129u8, 252u8, 110u8, 231u8, 114u8, - ] - { - let call = ClearIdentity {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Request a judgement from a registrar."] #[doc = ""] @@ -21570,35 +14519,18 @@ pub mod api { &self, reg_index: ::core::primitive::u32, max_fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RequestJudgement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 90u8, 137u8, 162u8, 2u8, 124u8, 245u8, 7u8, 200u8, 235u8, - 138u8, 217u8, 247u8, 77u8, 87u8, 152u8, 2u8, 13u8, 175u8, - 106u8, 202u8, 204u8, 113u8, 24u8, 127u8, 105u8, 136u8, 191u8, - 133u8, 212u8, 138u8, 22u8, 173u8, - ] - { - let call = RequestJudgement { reg_index, max_fee }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "request_judgement", + RequestJudgement { reg_index, max_fee }, + [ + 186u8, 149u8, 61u8, 54u8, 159u8, 194u8, 77u8, 161u8, 220u8, + 157u8, 3u8, 216u8, 23u8, 105u8, 119u8, 76u8, 144u8, 198u8, + 157u8, 45u8, 235u8, 139u8, 87u8, 82u8, 81u8, 12u8, 25u8, + 134u8, 225u8, 92u8, 182u8, 101u8, + ], + ) } #[doc = "Cancel a previous request."] #[doc = ""] @@ -21620,35 +14552,18 @@ pub mod api { pub fn cancel_request( &self, reg_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelRequest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 44u8, 7u8, 70u8, 91u8, 44u8, 138u8, 219u8, 118u8, - 67u8, 166u8, 133u8, 90u8, 234u8, 248u8, 42u8, 108u8, 51u8, - 229u8, 196u8, 74u8, 167u8, 40u8, 229u8, 168u8, 159u8, 2u8, - 231u8, 236u8, 58u8, 109u8, 32u8, - ] - { - let call = CancelRequest { reg_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "cancel_request", + CancelRequest { reg_index }, + [ + 83u8, 180u8, 239u8, 126u8, 32u8, 51u8, 17u8, 20u8, 180u8, + 3u8, 59u8, 96u8, 24u8, 32u8, 136u8, 92u8, 58u8, 254u8, 68u8, + 70u8, 50u8, 11u8, 51u8, 91u8, 180u8, 79u8, 81u8, 84u8, 216u8, + 138u8, 6u8, 215u8, + ], + ) } #[doc = "Set the fee required for a judgement to be requested from a registrar."] #[doc = ""] @@ -21667,35 +14582,18 @@ pub mod api { &self, index: ::core::primitive::u32, fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetFee, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 222u8, 115u8, 155u8, 44u8, 68u8, 179u8, 201u8, 247u8, 141u8, - 226u8, 124u8, 20u8, 188u8, 47u8, 190u8, 21u8, 212u8, 192u8, - 213u8, 76u8, 241u8, 75u8, 87u8, 142u8, 157u8, 229u8, 136u8, - 254u8, 250u8, 28u8, 69u8, 218u8, - ] - { - let call = SetFee { index, fee }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_fee", + SetFee { index, fee }, + [ + 21u8, 157u8, 123u8, 182u8, 160u8, 190u8, 117u8, 37u8, 136u8, + 133u8, 104u8, 234u8, 31u8, 145u8, 115u8, 154u8, 125u8, 40u8, + 2u8, 87u8, 118u8, 56u8, 247u8, 73u8, 89u8, 0u8, 251u8, 3u8, + 58u8, 105u8, 239u8, 211u8, + ], + ) } #[doc = "Change the account associated with a registrar."] #[doc = ""] @@ -21713,36 +14611,19 @@ pub mod api { pub fn set_account_id( &self, index: ::core::primitive::u32, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetAccountId, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 191u8, 243u8, 30u8, 116u8, 109u8, 235u8, 23u8, 106u8, 24u8, - 23u8, 80u8, 203u8, 68u8, 40u8, 116u8, 38u8, 68u8, 161u8, - 219u8, 64u8, 249u8, 179u8, 203u8, 113u8, 55u8, 7u8, 180u8, - 161u8, 37u8, 66u8, 6u8, 90u8, - ] - { - let call = SetAccountId { index, new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + new: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_account_id", + SetAccountId { index, new }, + [ + 245u8, 76u8, 110u8, 237u8, 219u8, 246u8, 219u8, 136u8, 146u8, + 42u8, 139u8, 60u8, 30u8, 188u8, 87u8, 10u8, 231u8, 89u8, + 225u8, 24u8, 152u8, 188u8, 59u8, 194u8, 199u8, 78u8, 169u8, + 90u8, 122u8, 29u8, 80u8, 42u8, + ], + ) } #[doc = "Set the field information for a registrar."] #[doc = ""] @@ -21763,35 +14644,18 @@ pub mod api { fields: runtime_types::pallet_identity::types::BitFlags< runtime_types::pallet_identity::types::IdentityField, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetFields, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 253u8, 43u8, 154u8, 17u8, 161u8, 187u8, 72u8, 96u8, 20u8, - 240u8, 97u8, 43u8, 242u8, 79u8, 115u8, 38u8, 130u8, 243u8, - 176u8, 46u8, 16u8, 126u8, 191u8, 32u8, 106u8, 200u8, 134u8, - 72u8, 244u8, 189u8, 165u8, 125u8, - ] - { - let call = SetFields { index, fields }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_fields", + SetFields { index, fields }, + [ + 50u8, 196u8, 179u8, 71u8, 66u8, 65u8, 235u8, 7u8, 51u8, 14u8, + 81u8, 173u8, 201u8, 58u8, 6u8, 151u8, 174u8, 245u8, 102u8, + 184u8, 28u8, 84u8, 125u8, 93u8, 126u8, 134u8, 92u8, 203u8, + 200u8, 129u8, 240u8, 252u8, + ], + ) } #[doc = "Provide a judgement for an account's identity."] #[doc = ""] @@ -21815,46 +14679,29 @@ pub mod api { pub fn provide_judgement( &self, reg_index: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, judgement: runtime_types::pallet_identity::types::Judgement< ::core::primitive::u128, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProvideJudgement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 238u8, 210u8, 71u8, 239u8, 251u8, 52u8, 145u8, 71u8, 68u8, - 185u8, 103u8, 82u8, 21u8, 164u8, 128u8, 189u8, 123u8, 141u8, - 213u8, 77u8, 139u8, 10u8, 6u8, 229u8, 227u8, 58u8, 236u8, - 123u8, 139u8, 192u8, 200u8, 170u8, - ] - { - let call = ProvideJudgement { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "provide_judgement", + ProvideJudgement { reg_index, target, judgement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 221u8, 244u8, 12u8, 17u8, 197u8, 130u8, 189u8, 136u8, 253u8, + 143u8, 5u8, 145u8, 177u8, 105u8, 220u8, 8u8, 157u8, 63u8, + 131u8, 5u8, 152u8, 167u8, 158u8, 47u8, 123u8, 86u8, 225u8, + 88u8, 218u8, 20u8, 82u8, 230u8, + ], + ) } #[doc = "Remove an account's identity and sub-account information and slash the deposits."] #[doc = ""] @@ -21877,39 +14724,22 @@ pub mod api { #[doc = "# "] pub fn kill_identity( &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillIdentity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 91u8, 164u8, 242u8, 44u8, 253u8, 203u8, 102u8, 89u8, 218u8, - 150u8, 227u8, 56u8, 179u8, 135u8, 93u8, 107u8, 166u8, 157u8, - 187u8, 180u8, 215u8, 129u8, 56u8, 110u8, 5u8, 243u8, 219u8, - 205u8, 11u8, 229u8, 29u8, 188u8, - ] - { - let call = KillIdentity { target }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "kill_identity", + KillIdentity { target }, + [ + 76u8, 13u8, 158u8, 219u8, 221u8, 0u8, 151u8, 241u8, 137u8, + 136u8, 179u8, 194u8, 188u8, 230u8, 56u8, 16u8, 254u8, 28u8, + 127u8, 216u8, 205u8, 117u8, 224u8, 121u8, 240u8, 231u8, + 126u8, 181u8, 230u8, 68u8, 13u8, 174u8, + ], + ) } #[doc = "Add the given account to the sender's subs."] #[doc = ""] @@ -21920,40 +14750,23 @@ pub mod api { #[doc = "sub identity of `sub`."] pub fn add_sub( &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, data: runtime_types::pallet_identity::types::Data, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 105u8, 38u8, 167u8, 99u8, 224u8, 183u8, 88u8, 133u8, 180u8, - 78u8, 211u8, 239u8, 49u8, 128u8, 224u8, 61u8, 23u8, 249u8, - 91u8, 16u8, 216u8, 40u8, 240u8, 77u8, 209u8, 91u8, 174u8, - 211u8, 175u8, 238u8, 131u8, 208u8, - ] - { - let call = AddSub { sub, data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "add_sub", + AddSub { sub, data }, + [ + 122u8, 218u8, 25u8, 93u8, 33u8, 176u8, 191u8, 254u8, 223u8, + 147u8, 100u8, 135u8, 86u8, 71u8, 47u8, 163u8, 105u8, 222u8, + 162u8, 173u8, 207u8, 182u8, 130u8, 128u8, 214u8, 242u8, + 101u8, 250u8, 242u8, 24u8, 17u8, 84u8, + ], + ) } #[doc = "Alter the associated name of the given sub-account."] #[doc = ""] @@ -21961,40 +14774,23 @@ pub mod api { #[doc = "sub identity of `sub`."] pub fn rename_sub( &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, data: runtime_types::pallet_identity::types::Data, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RenameSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 17u8, 110u8, 213u8, 124u8, 4u8, 76u8, 182u8, 53u8, 102u8, - 224u8, 240u8, 250u8, 94u8, 96u8, 181u8, 107u8, 114u8, 127u8, - 37u8, 15u8, 95u8, 7u8, 238u8, 172u8, 30u8, 125u8, 70u8, 7u8, - 97u8, 182u8, 3u8, 197u8, - ] - { - let call = RenameSub { sub, data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "rename_sub", + RenameSub { sub, data }, + [ + 166u8, 167u8, 49u8, 114u8, 199u8, 168u8, 187u8, 221u8, 100u8, + 85u8, 147u8, 211u8, 157u8, 31u8, 109u8, 135u8, 194u8, 135u8, + 15u8, 89u8, 59u8, 57u8, 252u8, 163u8, 9u8, 138u8, 216u8, + 189u8, 177u8, 42u8, 96u8, 34u8, + ], + ) } #[doc = "Remove the given account from the sender's subs."] #[doc = ""] @@ -22005,39 +14801,22 @@ pub mod api { #[doc = "sub identity of `sub`."] pub fn remove_sub( &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 161u8, 114u8, 68u8, 57u8, 166u8, 240u8, 150u8, 95u8, 176u8, - 93u8, 62u8, 67u8, 185u8, 226u8, 117u8, 97u8, 119u8, 139u8, - 86u8, 52u8, 161u8, 88u8, 30u8, 20u8, 123u8, 20u8, 130u8, - 17u8, 44u8, 17u8, 47u8, 14u8, - ] - { - let call = RemoveSub { sub }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "remove_sub", + RemoveSub { sub }, + [ + 106u8, 223u8, 210u8, 67u8, 54u8, 11u8, 144u8, 222u8, 42u8, + 46u8, 157u8, 33u8, 13u8, 245u8, 166u8, 195u8, 227u8, 81u8, + 224u8, 149u8, 154u8, 158u8, 187u8, 203u8, 215u8, 91u8, 43u8, + 105u8, 69u8, 213u8, 141u8, 124u8, + ], + ) } #[doc = "Remove the sender as a sub-account."] #[doc = ""] @@ -22049,37 +14828,18 @@ pub mod api { #[doc = ""] #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] #[doc = "controller of an account is maliciously registered as a sub-account."] - pub fn quit_sub( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - QuitSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn quit_sub(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "quit_sub", + QuitSub {}, + [ 62u8, 57u8, 73u8, 72u8, 119u8, 216u8, 250u8, 155u8, 57u8, 169u8, 157u8, 44u8, 87u8, 51u8, 63u8, 231u8, 77u8, 7u8, 0u8, 119u8, 244u8, 42u8, 179u8, 51u8, 254u8, 240u8, 55u8, 25u8, 142u8, 38u8, 87u8, 44u8, - ] - { - let call = QuitSub {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } } } @@ -22087,337 +14847,265 @@ pub mod api { pub type Event = runtime_types::pallet_identity::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A name was set or reset (which will remove all judgements)."] pub struct IdentitySet { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for IdentitySet { + impl ::subxt::events::StaticEvent for IdentitySet { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "IdentitySet"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A name was cleared, and the given balance returned."] pub struct IdentityCleared { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for IdentityCleared { + impl ::subxt::events::StaticEvent for IdentityCleared { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "IdentityCleared"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A name was removed and the given balance slashed."] pub struct IdentityKilled { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for IdentityKilled { + impl ::subxt::events::StaticEvent for IdentityKilled { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "IdentityKilled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A judgement was asked from a registrar."] pub struct JudgementRequested { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub registrar_index: ::core::primitive::u32, } - impl ::subxt::Event for JudgementRequested { + impl ::subxt::events::StaticEvent for JudgementRequested { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "JudgementRequested"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A judgement request was retracted."] pub struct JudgementUnrequested { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub registrar_index: ::core::primitive::u32, } - impl ::subxt::Event for JudgementUnrequested { + impl ::subxt::events::StaticEvent for JudgementUnrequested { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "JudgementUnrequested"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A judgement was given by a registrar."] pub struct JudgementGiven { - pub target: ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_core::crypto::AccountId32, pub registrar_index: ::core::primitive::u32, } - impl ::subxt::Event for JudgementGiven { + impl ::subxt::events::StaticEvent for JudgementGiven { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "JudgementGiven"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A registrar was added."] pub struct RegistrarAdded { pub registrar_index: ::core::primitive::u32, } - impl ::subxt::Event for RegistrarAdded { + impl ::subxt::events::StaticEvent for RegistrarAdded { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "RegistrarAdded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A sub-identity was added to an identity and the deposit paid."] pub struct SubIdentityAdded { - pub sub: ::subxt::sp_core::crypto::AccountId32, - pub main: ::subxt::sp_core::crypto::AccountId32, + pub sub: ::subxt::ext::sp_core::crypto::AccountId32, + pub main: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for SubIdentityAdded { + impl ::subxt::events::StaticEvent for SubIdentityAdded { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "SubIdentityAdded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A sub-identity was removed from an identity and the deposit freed."] pub struct SubIdentityRemoved { - pub sub: ::subxt::sp_core::crypto::AccountId32, - pub main: ::subxt::sp_core::crypto::AccountId32, + pub sub: ::subxt::ext::sp_core::crypto::AccountId32, + pub main: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for SubIdentityRemoved { + impl ::subxt::events::StaticEvent for SubIdentityRemoved { const PALLET: &'static str = "Identity"; const EVENT: &'static str = "SubIdentityRemoved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] #[doc = "main identity account to the sub-identity account."] pub struct SubIdentityRevoked { - pub sub: ::subxt::sp_core::crypto::AccountId32, - pub main: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for SubIdentityRevoked { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRevoked"; - } - } - pub mod storage { - use super::runtime_types; - pub struct IdentityOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for IdentityOf<'_> { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "IdentityOf"; - type Value = runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct SuperOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SuperOf<'_> { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "SuperOf"; - type Value = ( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct SubsOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SubsOf<'_> { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "SubsOf"; - type Value = ( - ::core::primitive::u128, - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + pub sub: ::subxt::ext::sp_core::crypto::AccountId32, + pub main: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, } - pub struct Registrars; - impl ::subxt::StorageEntry for Registrars { + impl ::subxt::events::StaticEvent for SubIdentityRevoked { const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "Registrars"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_identity::types::RegistrarInfo< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + const EVENT: &'static str = "SubIdentityRevoked"; } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { #[doc = " Information that is pertinent to identify the entity behind an account."] #[doc = ""] #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn identity_of( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 225u8, 101u8, 83u8, 137u8, 207u8, 77u8, 139u8, 227u8, - 36u8, 100u8, 14u8, 30u8, 197u8, 65u8, 248u8, 227u8, - 175u8, 19u8, 189u8, 86u8, 189u8, 244u8, 144u8, 137u8, - 17u8, 249u8, 223u8, 200u8, 115u8, 190u8, 225u8, 30u8, - ] - { - let entry = IdentityOf(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "IdentityOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 193u8, 195u8, 180u8, 188u8, 129u8, 250u8, 180u8, 219u8, 22u8, + 95u8, 175u8, 170u8, 143u8, 188u8, 80u8, 124u8, 234u8, 228u8, + 245u8, 39u8, 72u8, 153u8, 107u8, 199u8, 23u8, 75u8, 47u8, + 247u8, 104u8, 208u8, 171u8, 82u8, + ], + ) } #[doc = " Information that is pertinent to identify the entity behind an account."] #[doc = ""] #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub fn identity_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, IdentityOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 225u8, 101u8, 83u8, 137u8, 207u8, 77u8, 139u8, 227u8, - 36u8, 100u8, 14u8, 30u8, 197u8, 65u8, 248u8, 227u8, - 175u8, 19u8, 189u8, 86u8, 189u8, 244u8, 144u8, 137u8, - 17u8, 249u8, 223u8, 200u8, 115u8, 190u8, 225u8, 30u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn identity_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "IdentityOf", + Vec::new(), + [ + 193u8, 195u8, 180u8, 188u8, 129u8, 250u8, 180u8, 219u8, 22u8, + 95u8, 175u8, 170u8, 143u8, 188u8, 80u8, 124u8, 234u8, 228u8, + 245u8, 39u8, 72u8, 153u8, 107u8, 199u8, 23u8, 75u8, 47u8, + 247u8, 104u8, 208u8, 171u8, 82u8, + ], + ) } #[doc = " The super-identity of an alternative \"sub\" identity together with its name, within that"] #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] pub fn super_of( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 128u8, 234u8, 82u8, 152u8, 41u8, 4u8, 220u8, 41u8, 179u8, - 131u8, 72u8, 121u8, 131u8, 17u8, 40u8, 87u8, 186u8, - 159u8, 209u8, 33u8, 97u8, 28u8, 236u8, 196u8, 217u8, - 15u8, 126u8, 197u8, 32u8, 165u8, 78u8, 28u8, - ] - { - let entry = SuperOf(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SuperOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 170u8, 249u8, 112u8, 249u8, 75u8, 176u8, 21u8, 29u8, 152u8, + 149u8, 69u8, 113u8, 20u8, 92u8, 113u8, 130u8, 135u8, 62u8, + 18u8, 204u8, 166u8, 193u8, 133u8, 167u8, 248u8, 117u8, 80u8, + 137u8, 158u8, 111u8, 100u8, 137u8, + ], + ) } #[doc = " The super-identity of an alternative \"sub\" identity together with its name, within that"] #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] - pub fn super_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SuperOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 128u8, 234u8, 82u8, 152u8, 41u8, 4u8, 220u8, 41u8, 179u8, - 131u8, 72u8, 121u8, 131u8, 17u8, 40u8, 87u8, 186u8, - 159u8, 209u8, 33u8, 97u8, 28u8, 236u8, 196u8, 217u8, - 15u8, 126u8, 197u8, 32u8, 165u8, 78u8, 28u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn super_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SuperOf", + Vec::new(), + [ + 170u8, 249u8, 112u8, 249u8, 75u8, 176u8, 21u8, 29u8, 152u8, + 149u8, 69u8, 113u8, 20u8, 92u8, 113u8, 130u8, 135u8, 62u8, + 18u8, 204u8, 166u8, 193u8, 133u8, 167u8, 248u8, 117u8, 80u8, + 137u8, 158u8, 111u8, 100u8, 137u8, + ], + ) } #[doc = " Alternative \"sub\" identities of this account."] #[doc = ""] @@ -22426,81 +15114,62 @@ pub mod api { #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn subs_of( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ( - ::core::primitive::u128, - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 136u8, 240u8, 238u8, 121u8, 194u8, 242u8, 139u8, 155u8, - 32u8, 201u8, 123u8, 76u8, 116u8, 219u8, 193u8, 45u8, - 251u8, 212u8, 46u8, 194u8, 93u8, 30u8, 174u8, 133u8, - 218u8, 147u8, 175u8, 38u8, 200u8, 109u8, 104u8, 52u8, - ] - { - let entry = SubsOf(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u128, + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SubsOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 128u8, 15u8, 175u8, 155u8, 216u8, 225u8, 200u8, 169u8, 215u8, + 206u8, 110u8, 22u8, 204u8, 89u8, 212u8, 210u8, 159u8, 169u8, + 53u8, 7u8, 44u8, 164u8, 91u8, 151u8, 7u8, 227u8, 38u8, 230u8, + 175u8, 84u8, 6u8, 4u8, + ], + ) } #[doc = " Alternative \"sub\" identities of this account."] #[doc = ""] #[doc = " The first item is the deposit, the second is a vector of the accounts."] #[doc = ""] #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub fn subs_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SubsOf<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 136u8, 240u8, 238u8, 121u8, 194u8, 242u8, 139u8, 155u8, - 32u8, 201u8, 123u8, 76u8, 116u8, 219u8, 193u8, 45u8, - 251u8, 212u8, 46u8, 194u8, 93u8, 30u8, 174u8, 133u8, - 218u8, 147u8, 175u8, 38u8, 200u8, 109u8, 104u8, 52u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn subs_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u128, + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SubsOf", + Vec::new(), + [ + 128u8, 15u8, 175u8, 155u8, 216u8, 225u8, 200u8, 169u8, 215u8, + 206u8, 110u8, 22u8, 204u8, 89u8, 212u8, 210u8, 159u8, 169u8, + 53u8, 7u8, 44u8, 164u8, 91u8, 151u8, 7u8, 227u8, 38u8, 230u8, + 175u8, 84u8, 6u8, 4u8, + ], + ) } #[doc = " The set of registrars. Not expected to get very big as can only be added through a"] #[doc = " special origin (likely a council motion)."] @@ -22508,269 +15177,210 @@ pub mod api { #[doc = " The index into this can be cast to `RegistrarIndex` to get a valid value."] pub fn registrars( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< ::core::option::Option< runtime_types::pallet_identity::types::RegistrarInfo< ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 92u8, 161u8, 80u8, 77u8, 121u8, 65u8, 69u8, 26u8, 171u8, - 158u8, 66u8, 36u8, 81u8, 1u8, 79u8, 144u8, 188u8, 236u8, - 88u8, 158u8, 84u8, 100u8, 71u8, 86u8, 20u8, 68u8, 178u8, - 164u8, 157u8, 105u8, 58u8, 7u8, - ] - { - let entry = Registrars; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "Registrars", + vec![], + [ + 157u8, 87u8, 39u8, 240u8, 154u8, 54u8, 241u8, 229u8, 76u8, + 9u8, 62u8, 252u8, 40u8, 143u8, 186u8, 182u8, 233u8, 187u8, + 251u8, 61u8, 236u8, 229u8, 19u8, 55u8, 42u8, 36u8, 82u8, + 173u8, 215u8, 155u8, 229u8, 111u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The amount held on deposit for a registered identity"] pub fn basic_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Identity", "BasicDeposit")? - == [ - 240u8, 163u8, 226u8, 52u8, 199u8, 248u8, 206u8, 2u8, 38u8, - 147u8, 0u8, 126u8, 225u8, 252u8, 36u8, 203u8, 148u8, 244u8, - 120u8, 212u8, 65u8, 221u8, 145u8, 126u8, 119u8, 190u8, 233u8, - 27u8, 185u8, 174u8, 6u8, 150u8, - ] - { - let pallet = metadata.pallet("Identity")?; - let constant = pallet.constant("BasicDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "BasicDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount held on deposit per additional field for a registered identity."] pub fn field_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Identity", "FieldDeposit")? - == [ - 165u8, 151u8, 74u8, 173u8, 28u8, 8u8, 195u8, 171u8, 159u8, - 247u8, 246u8, 108u8, 239u8, 176u8, 142u8, 132u8, 101u8, 6u8, - 70u8, 168u8, 25u8, 58u8, 231u8, 151u8, 29u8, 122u8, 83u8, - 8u8, 52u8, 215u8, 151u8, 132u8, - ] - { - let pallet = metadata.pallet("Identity")?; - let constant = pallet.constant("FieldDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "FieldDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount held on deposit for a registered subaccount. This should account for the fact"] #[doc = " that one storage item's value will increase by the size of an account ID, and there will"] #[doc = " be another trie item whose value is the size of an account ID plus 32 bytes."] pub fn sub_account_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Identity", "SubAccountDeposit")? - == [ - 132u8, 115u8, 135u8, 88u8, 142u8, 44u8, 215u8, 122u8, 22u8, - 223u8, 174u8, 100u8, 180u8, 215u8, 108u8, 55u8, 67u8, 4u8, - 220u8, 23u8, 74u8, 148u8, 28u8, 100u8, 91u8, 73u8, 95u8, - 175u8, 213u8, 177u8, 56u8, 25u8, - ] - { - let pallet = metadata.pallet("Identity")?; - let constant = pallet.constant("SubAccountDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "SubAccountDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum number of sub-accounts allowed per identified account."] pub fn max_sub_accounts( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Identity", "MaxSubAccounts")? - == [ - 75u8, 1u8, 223u8, 132u8, 121u8, 0u8, 145u8, 246u8, 118u8, - 222u8, 108u8, 45u8, 1u8, 1u8, 238u8, 13u8, 162u8, 100u8, 2u8, - 24u8, 108u8, 168u8, 44u8, 133u8, 240u8, 3u8, 244u8, 76u8, - 150u8, 248u8, 153u8, 144u8, - ] - { - let pallet = metadata.pallet("Identity")?; - let constant = pallet.constant("MaxSubAccounts")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "MaxSubAccounts", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O"] #[doc = " required to access an identity, but can be pretty high."] pub fn max_additional_fields( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Identity", "MaxAdditionalFields")? - == [ - 52u8, 246u8, 245u8, 172u8, 242u8, 40u8, 79u8, 11u8, 106u8, - 28u8, 59u8, 171u8, 135u8, 210u8, 67u8, 174u8, 63u8, 72u8, - 28u8, 214u8, 124u8, 140u8, 172u8, 255u8, 36u8, 40u8, 51u8, - 46u8, 207u8, 202u8, 248u8, 125u8, - ] - { - let pallet = metadata.pallet("Identity")?; - let constant = pallet.constant("MaxAdditionalFields")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "MaxAdditionalFields", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Maxmimum number of registrars allowed in the system. Needed to bound the complexity"] #[doc = " of, e.g., updating judgements."] pub fn max_registrars( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Identity", "MaxRegistrars")? - == [ - 172u8, 101u8, 183u8, 243u8, 249u8, 249u8, 95u8, 104u8, 100u8, - 120u8, 13u8, 188u8, 132u8, 255u8, 115u8, 90u8, 19u8, 111u8, - 100u8, 17u8, 147u8, 179u8, 209u8, 41u8, 37u8, 25u8, 180u8, - 206u8, 120u8, 211u8, 188u8, 184u8, - ] - { - let pallet = metadata.pallet("Identity")?; - let constant = pallet.constant("MaxRegistrars")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "MaxRegistrars", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod proxy { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, + pub real: ::subxt::ext::sp_core::crypto::AccountId32, pub force_proxy_type: ::core::option::Option, pub call: ::std::boxed::Box, } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub delegate: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub delay: ::core::primitive::u32, } - impl ::subxt::Call for AddProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "add_proxy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub delegate: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub delay: ::core::primitive::u32, } - impl ::subxt::Call for RemoveProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveProxies; - impl ::subxt::Call for RemoveProxies { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxies"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Anonymous { pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub delay: ::core::primitive::u32, pub index: ::core::primitive::u16, } - impl ::subxt::Call for Anonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "anonymous"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct KillAnonymous { - pub spawner: ::subxt::sp_core::crypto::AccountId32, + pub spawner: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub index: ::core::primitive::u16, #[codec(compact)] @@ -22778,64 +15388,47 @@ pub mod api { #[codec(compact)] pub ext_index: ::core::primitive::u32, } - impl ::subxt::Call for KillAnonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "kill_anonymous"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Announce { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, + pub real: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for Announce { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "announce"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RemoveAnnouncement { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RemoveAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_announcement"; + pub real: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RejectAnnouncement { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RejectAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "reject_announcement"; + pub delegate: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProxyAnnounced { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub real: ::subxt::sp_core::crypto::AccountId32, + pub delegate: ::subxt::ext::sp_core::crypto::AccountId32, + pub real: ::subxt::ext::sp_core::crypto::AccountId32, pub force_proxy_type: ::core::option::Option, pub call: ::std::boxed::Box, } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] #[doc = "`add_proxy`."] #[doc = ""] @@ -22853,44 +15446,27 @@ pub mod api { #[doc = "# "] pub fn proxy( &self, - real: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::ext::sp_core::crypto::AccountId32, force_proxy_type: ::core::option::Option< runtime_types::polkadot_runtime::ProxyType, >, call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Proxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 51u8, 175u8, 21u8, 83u8, 132u8, 88u8, 162u8, 49u8, 52u8, - 139u8, 241u8, 197u8, 48u8, 252u8, 27u8, 221u8, 166u8, 226u8, - 61u8, 236u8, 249u8, 207u8, 22u8, 213u8, 23u8, 229u8, 200u8, - 224u8, 125u8, 208u8, 115u8, 138u8, - ] - { - let call = Proxy { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "proxy", + Proxy { real, force_proxy_type, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 228u8, 178u8, 79u8, 159u8, 147u8, 71u8, 47u8, 204u8, 220u8, + 224u8, 189u8, 73u8, 15u8, 82u8, 202u8, 30u8, 72u8, 217u8, + 199u8, 84u8, 37u8, 127u8, 181u8, 116u8, 238u8, 176u8, 173u8, + 8u8, 151u8, 122u8, 28u8, 230u8, + ], + ) } #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] #[doc = ""] @@ -22907,42 +15483,25 @@ pub mod api { #[doc = "# "] pub fn add_proxy( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddProxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 97u8, 149u8, 34u8, 218u8, 51u8, 242u8, 47u8, 167u8, 203u8, - 128u8, 248u8, 193u8, 156u8, 141u8, 184u8, 221u8, 209u8, 79u8, - 162u8, 36u8, 48u8, 110u8, 208u8, 62u8, 105u8, 117u8, 192u8, - 18u8, 37u8, 185u8, 136u8, 66u8, - ] - { - let call = AddProxy { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "add_proxy", + AddProxy { delegate, proxy_type, delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 25u8, 189u8, 96u8, 67u8, 195u8, 60u8, 158u8, 251u8, 72u8, + 165u8, 156u8, 44u8, 9u8, 143u8, 246u8, 50u8, 58u8, 226u8, + 111u8, 122u8, 160u8, 152u8, 108u8, 106u8, 181u8, 49u8, 232u8, + 177u8, 4u8, 144u8, 27u8, 177u8, + ], + ) } #[doc = "Unregister a proxy account for the sender."] #[doc = ""] @@ -22957,42 +15516,25 @@ pub mod api { #[doc = "# "] pub fn remove_proxy( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveProxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 246u8, 251u8, 192u8, 17u8, 128u8, 248u8, 24u8, 118u8, 127u8, - 101u8, 140u8, 72u8, 248u8, 161u8, 187u8, 89u8, 193u8, 44u8, - 0u8, 86u8, 16u8, 116u8, 28u8, 227u8, 108u8, 120u8, 177u8, - 213u8, 218u8, 20u8, 196u8, 7u8, - ] - { - let call = RemoveProxy { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "remove_proxy", + RemoveProxy { delegate, proxy_type, delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 40u8, 172u8, 127u8, 108u8, 114u8, 22u8, 17u8, 90u8, 153u8, + 200u8, 110u8, 118u8, 149u8, 124u8, 51u8, 245u8, 142u8, 61u8, + 136u8, 138u8, 27u8, 160u8, 32u8, 192u8, 73u8, 24u8, 72u8, + 218u8, 22u8, 32u8, 163u8, 156u8, + ], + ) } #[doc = "Unregister all proxy accounts for the sender."] #[doc = ""] @@ -23006,35 +15548,18 @@ pub mod api { #[doc = "# "] pub fn remove_proxies( &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveProxies, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "remove_proxies", + RemoveProxies {}, + [ 15u8, 237u8, 27u8, 166u8, 254u8, 218u8, 92u8, 5u8, 213u8, 239u8, 99u8, 59u8, 1u8, 26u8, 73u8, 252u8, 81u8, 94u8, 214u8, 227u8, 169u8, 58u8, 40u8, 253u8, 187u8, 225u8, 192u8, 26u8, 19u8, 23u8, 121u8, 129u8, - ] - { - let call = RemoveProxies {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] @@ -23064,39 +15589,22 @@ pub mod api { proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, index: ::core::primitive::u16, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Anonymous, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 186u8, 126u8, 58u8, 255u8, 163u8, 207u8, 66u8, 165u8, - 182u8, 248u8, 28u8, 134u8, 186u8, 1u8, 122u8, 40u8, 64u8, - 0u8, 124u8, 0u8, 5u8, 140u8, 131u8, 21u8, 66u8, 182u8, 216u8, - 202u8, 29u8, 75u8, 180u8, - ] - { - let call = Anonymous { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "anonymous", + Anonymous { proxy_type, delay, index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 181u8, 76u8, 106u8, 208u8, 138u8, 11u8, 212u8, 10u8, 87u8, + 63u8, 201u8, 120u8, 26u8, 75u8, 120u8, 79u8, 225u8, 212u8, + 181u8, 9u8, 166u8, 24u8, 4u8, 15u8, 181u8, 28u8, 173u8, + 184u8, 122u8, 254u8, 20u8, 208u8, + ], + ) } #[doc = "Removes a previously spawned anonymous proxy."] #[doc = ""] @@ -23120,46 +15628,29 @@ pub mod api { #[doc = "# "] pub fn kill_anonymous( &self, - spawner: ::subxt::sp_core::crypto::AccountId32, + spawner: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, index: ::core::primitive::u16, height: ::core::primitive::u32, ext_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillAnonymous, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 59u8, 188u8, 45u8, 180u8, 9u8, 242u8, 36u8, 245u8, 25u8, - 57u8, 66u8, 216u8, 82u8, 220u8, 144u8, 233u8, 83u8, 1u8, - 182u8, 185u8, 27u8, 106u8, 33u8, 5u8, 22u8, 171u8, 222u8, - 130u8, 125u8, 73u8, 127u8, 156u8, - ] - { - let call = KillAnonymous { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "kill_anonymous", + KillAnonymous { spawner, proxy_type, index, height, ext_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 216u8, 42u8, 41u8, 194u8, 47u8, 221u8, 65u8, 109u8, 144u8, + 161u8, 223u8, 238u8, 241u8, 199u8, 138u8, 100u8, 77u8, 175u8, + 220u8, 208u8, 64u8, 74u8, 123u8, 253u8, 111u8, 13u8, 188u8, + 235u8, 58u8, 111u8, 144u8, 177u8, + ], + ) } #[doc = "Publish the hash of a proxy-call that will be made in the future."] #[doc = ""] @@ -23184,37 +15675,20 @@ pub mod api { #[doc = "# "] pub fn announce( &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Announce, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 102u8, 8u8, 136u8, 179u8, 13u8, 47u8, 158u8, 24u8, 93u8, - 196u8, 52u8, 22u8, 118u8, 98u8, 17u8, 8u8, 12u8, 51u8, 181u8, - 75u8, 215u8, 133u8, 201u8, 180u8, 231u8, 122u8, 198u8, 190u8, - 188u8, 127u8, 228u8, 218u8, - ] - { - let call = Announce { real, call_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + real: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "announce", + Announce { real, call_hash }, + [ + 99u8, 237u8, 158u8, 131u8, 185u8, 119u8, 88u8, 167u8, 253u8, + 29u8, 82u8, 216u8, 225u8, 33u8, 181u8, 244u8, 85u8, 176u8, + 106u8, 66u8, 166u8, 174u8, 218u8, 98u8, 119u8, 86u8, 218u8, + 89u8, 150u8, 255u8, 86u8, 40u8, + ], + ) } #[doc = "Remove a given announcement."] #[doc = ""] @@ -23234,37 +15708,20 @@ pub mod api { #[doc = "# "] pub fn remove_announcement( &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveAnnouncement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 209u8, 156u8, 215u8, 188u8, 225u8, 230u8, 171u8, 228u8, - 241u8, 105u8, 43u8, 183u8, 234u8, 18u8, 170u8, 239u8, 232u8, - 188u8, 37u8, 84u8, 156u8, 50u8, 241u8, 170u8, 9u8, 148u8, - 185u8, 172u8, 204u8, 63u8, 187u8, 253u8, - ] - { - let call = RemoveAnnouncement { real, call_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + real: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "remove_announcement", + RemoveAnnouncement { real, call_hash }, + [ + 197u8, 54u8, 240u8, 51u8, 65u8, 218u8, 154u8, 165u8, 24u8, + 54u8, 157u8, 30u8, 144u8, 22u8, 247u8, 177u8, 105u8, 38u8, + 9u8, 25u8, 127u8, 36u8, 97u8, 84u8, 18u8, 3u8, 246u8, 238u8, + 60u8, 17u8, 236u8, 69u8, + ], + ) } #[doc = "Remove the given announcement of a delegate."] #[doc = ""] @@ -23284,40 +15741,23 @@ pub mod api { #[doc = "# "] pub fn reject_announcement( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RejectAnnouncement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 26u8, 67u8, 197u8, 169u8, 243u8, 11u8, 94u8, 153u8, 50u8, - 22u8, 176u8, 103u8, 88u8, 2u8, 13u8, 10u8, 96u8, 7u8, 121u8, - 148u8, 13u8, 96u8, 20u8, 67u8, 76u8, 51u8, 81u8, 54u8, 244u8, - 44u8, 94u8, 52u8, - ] - { - let call = RejectAnnouncement { + delegate: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "reject_announcement", + RejectAnnouncement { delegate, call_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 205u8, 123u8, 102u8, 30u8, 196u8, 250u8, 247u8, 50u8, 243u8, + 55u8, 67u8, 66u8, 160u8, 147u8, 92u8, 204u8, 75u8, 69u8, + 68u8, 140u8, 40u8, 250u8, 53u8, 203u8, 228u8, 239u8, 62u8, + 66u8, 254u8, 30u8, 126u8, 206u8, + ], + ) } #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] #[doc = "`add_proxy`."] @@ -23338,46 +15778,29 @@ pub mod api { #[doc = "# "] pub fn proxy_announced( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, + real: ::subxt::ext::sp_core::crypto::AccountId32, force_proxy_type: ::core::option::Option< runtime_types::polkadot_runtime::ProxyType, >, call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProxyAnnounced, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 134u8, 43u8, 27u8, 202u8, 142u8, 8u8, 253u8, 43u8, 76u8, - 95u8, 152u8, 92u8, 151u8, 137u8, 74u8, 39u8, 185u8, 144u8, - 200u8, 115u8, 62u8, 250u8, 186u8, 59u8, 203u8, 244u8, 181u8, - 59u8, 47u8, 128u8, 33u8, 223u8, - ] - { - let call = ProxyAnnounced { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Proxy", + "proxy_announced", + ProxyAnnounced { delegate, real, force_proxy_type, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 11u8, 45u8, 62u8, 39u8, 183u8, 91u8, 202u8, 137u8, 241u8, + 208u8, 226u8, 6u8, 184u8, 14u8, 196u8, 104u8, 108u8, 46u8, + 138u8, 21u8, 226u8, 195u8, 41u8, 187u8, 95u8, 136u8, 239u8, + 208u8, 224u8, 203u8, 109u8, 49u8, + ], + ) } } } @@ -23385,313 +15808,244 @@ pub mod api { pub type Event = runtime_types::pallet_proxy::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proxy was executed correctly, with the given."] pub struct ProxyExecuted { pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for ProxyExecuted { + impl ::subxt::events::StaticEvent for ProxyExecuted { const PALLET: &'static str = "Proxy"; const EVENT: &'static str = "ProxyExecuted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Anonymous account has been created by new proxy with given"] #[doc = "disambiguation index and proxy type."] pub struct AnonymousCreated { - pub anonymous: ::subxt::sp_core::crypto::AccountId32, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub anonymous: ::subxt::ext::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub disambiguation_index: ::core::primitive::u16, } - impl ::subxt::Event for AnonymousCreated { + impl ::subxt::events::StaticEvent for AnonymousCreated { const PALLET: &'static str = "Proxy"; const EVENT: &'static str = "AnonymousCreated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An announcement was placed to make a call in the future."] pub struct Announced { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub proxy: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, + pub real: ::subxt::ext::sp_core::crypto::AccountId32, + pub proxy: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for Announced { + impl ::subxt::events::StaticEvent for Announced { const PALLET: &'static str = "Proxy"; const EVENT: &'static str = "Announced"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proxy was added."] pub struct ProxyAdded { - pub delegator: ::subxt::sp_core::crypto::AccountId32, - pub delegatee: ::subxt::sp_core::crypto::AccountId32, + pub delegator: ::subxt::ext::sp_core::crypto::AccountId32, + pub delegatee: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub delay: ::core::primitive::u32, } - impl ::subxt::Event for ProxyAdded { + impl ::subxt::events::StaticEvent for ProxyAdded { const PALLET: &'static str = "Proxy"; const EVENT: &'static str = "ProxyAdded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A proxy was removed."] pub struct ProxyRemoved { - pub delegator: ::subxt::sp_core::crypto::AccountId32, - pub delegatee: ::subxt::sp_core::crypto::AccountId32, + pub delegator: ::subxt::ext::sp_core::crypto::AccountId32, + pub delegatee: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub delay: ::core::primitive::u32, } - impl ::subxt::Event for ProxyRemoved { + impl ::subxt::events::StaticEvent for ProxyRemoved { const PALLET: &'static str = "Proxy"; const EVENT: &'static str = "ProxyRemoved"; } } pub mod storage { use super::runtime_types; - pub struct Proxies<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Proxies<'_> { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Proxies"; - type Value = ( - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Announcements<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Announcements<'_> { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Announcements"; - type Value = ( - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The set of account proxies. Maps the account which has delegated to the accounts"] #[doc = " which are being delegated to, together with the amount held on deposit."] pub fn proxies( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ( - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::ProxyDefinition< + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::ProxyType, + ::core::primitive::u32, >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 252u8, 154u8, 187u8, 5u8, 19u8, 254u8, 127u8, 64u8, - 214u8, 133u8, 33u8, 95u8, 47u8, 5u8, 39u8, 107u8, 27u8, - 117u8, 238u8, 14u8, 44u8, 74u8, 154u8, 158u8, 71u8, 88u8, - 167u8, 75u8, 112u8, 229u8, 107u8, 145u8, - ] - { - let entry = Proxies(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Proxy", + "Proxies", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 106u8, 101u8, 77u8, 184u8, 193u8, 162u8, 132u8, 209u8, 130u8, + 70u8, 249u8, 183u8, 78u8, 52u8, 153u8, 120u8, 84u8, 224u8, + 233u8, 37u8, 171u8, 192u8, 99u8, 31u8, 49u8, 43u8, 126u8, + 67u8, 161u8, 103u8, 248u8, 14u8, + ], + ) } #[doc = " The set of account proxies. Maps the account which has delegated to the accounts"] #[doc = " which are being delegated to, together with the amount held on deposit."] - pub fn proxies_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Proxies<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 252u8, 154u8, 187u8, 5u8, 19u8, 254u8, 127u8, 64u8, - 214u8, 133u8, 33u8, 95u8, 47u8, 5u8, 39u8, 107u8, 27u8, - 117u8, 238u8, 14u8, 44u8, 74u8, 154u8, 158u8, 71u8, 88u8, - 167u8, 75u8, 112u8, 229u8, 107u8, 145u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn proxies_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::ProxyDefinition< + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::ProxyType, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + )>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Proxy", + "Proxies", + Vec::new(), + [ + 106u8, 101u8, 77u8, 184u8, 193u8, 162u8, 132u8, 209u8, 130u8, + 70u8, 249u8, 183u8, 78u8, 52u8, 153u8, 120u8, 84u8, 224u8, + 233u8, 37u8, 171u8, 192u8, 99u8, 31u8, 49u8, 43u8, 126u8, + 67u8, 161u8, 103u8, 248u8, 14u8, + ], + ) } #[doc = " The announcements made by the proxy (key)."] pub fn announcements( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ( - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::Announcement< + ::subxt::ext::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 247u8, 243u8, 109u8, 142u8, 99u8, 156u8, 61u8, 101u8, - 200u8, 211u8, 158u8, 60u8, 159u8, 232u8, 147u8, 125u8, - 139u8, 150u8, 4u8, 129u8, 189u8, 117u8, 74u8, 32u8, 85u8, - 39u8, 46u8, 47u8, 164u8, 130u8, 254u8, 43u8, - ] - { - let entry = Announcements(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Proxy", + "Announcements", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 233u8, 38u8, 249u8, 89u8, 103u8, 87u8, 64u8, 52u8, 140u8, + 228u8, 110u8, 37u8, 8u8, 92u8, 48u8, 7u8, 46u8, 99u8, 179u8, + 83u8, 232u8, 171u8, 160u8, 45u8, 37u8, 23u8, 151u8, 198u8, + 237u8, 103u8, 217u8, 53u8, + ], + ) } #[doc = " The announcements made by the proxy (key)."] - pub fn announcements_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Announcements<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 247u8, 243u8, 109u8, 142u8, 99u8, 156u8, 61u8, 101u8, - 200u8, 211u8, 158u8, 60u8, 159u8, 232u8, 147u8, 125u8, - 139u8, 150u8, 4u8, 129u8, 189u8, 117u8, 74u8, 32u8, 85u8, - 39u8, 46u8, 47u8, 164u8, 130u8, 254u8, 43u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn announcements_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::Announcement< + ::subxt::ext::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + )>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Proxy", + "Announcements", + Vec::new(), + [ + 233u8, 38u8, 249u8, 89u8, 103u8, 87u8, 64u8, 52u8, 140u8, + 228u8, 110u8, 37u8, 8u8, 92u8, 48u8, 7u8, 46u8, 99u8, 179u8, + 83u8, 232u8, 171u8, 160u8, 45u8, 37u8, 23u8, 151u8, 198u8, + 237u8, 103u8, 217u8, 53u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The base amount of currency needed to reserve for creating a proxy."] #[doc = ""] #[doc = " This is held for an additional storage item whose value size is"] #[doc = " `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes."] pub fn proxy_deposit_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Proxy", "ProxyDepositBase")? - == [ - 103u8, 165u8, 87u8, 140u8, 136u8, 233u8, 165u8, 158u8, 117u8, - 69u8, 202u8, 102u8, 135u8, 123u8, 209u8, 117u8, 114u8, 254u8, - 28u8, 195u8, 55u8, 55u8, 54u8, 214u8, 19u8, 26u8, 209u8, - 184u8, 93u8, 110u8, 33u8, 139u8, - ] - { - let pallet = metadata.pallet("Proxy")?; - let constant = pallet.constant("ProxyDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Proxy", + "ProxyDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount of currency needed per proxy added."] #[doc = ""] @@ -23700,74 +16054,53 @@ pub mod api { #[doc = " into account `32 + proxy_type.encode().len()` bytes of data."] pub fn proxy_deposit_factor( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Proxy", "ProxyDepositFactor")? - == [ - 163u8, 148u8, 34u8, 63u8, 153u8, 113u8, 173u8, 220u8, 242u8, - 64u8, 66u8, 151u8, 198u8, 202u8, 46u8, 157u8, 175u8, 26u8, - 188u8, 96u8, 97u8, 66u8, 86u8, 2u8, 149u8, 133u8, 72u8, 33u8, - 249u8, 42u8, 79u8, 61u8, - ] - { - let pallet = metadata.pallet("Proxy")?; - let constant = pallet.constant("ProxyDepositFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Proxy", + "ProxyDepositFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum amount of proxies allowed for a single account."] pub fn max_proxies( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Proxy", "MaxProxies")? - == [ - 249u8, 153u8, 224u8, 128u8, 161u8, 3u8, 39u8, 192u8, 120u8, - 150u8, 184u8, 92u8, 225u8, 222u8, 76u8, 172u8, 131u8, 87u8, - 231u8, 128u8, 5u8, 62u8, 116u8, 112u8, 103u8, 4u8, 39u8, - 163u8, 71u8, 97u8, 221u8, 19u8, - ] - { - let pallet = metadata.pallet("Proxy")?; - let constant = pallet.constant("MaxProxies")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Proxy", + "MaxProxies", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The maximum amount of time-delayed announcements that are allowed to be pending."] pub fn max_pending( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Proxy", "MaxPending")? - == [ - 88u8, 148u8, 146u8, 152u8, 151u8, 208u8, 255u8, 193u8, 239u8, - 105u8, 197u8, 153u8, 151u8, 18u8, 86u8, 13u8, 242u8, 242u8, - 59u8, 92u8, 107u8, 203u8, 102u8, 69u8, 147u8, 147u8, 37u8, - 83u8, 237u8, 9u8, 114u8, 196u8, - ] - { - let pallet = metadata.pallet("Proxy")?; - let constant = pallet.constant("MaxPending")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Proxy", + "MaxPending", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The base amount of currency needed to reserve for creating an announcement."] #[doc = ""] @@ -23775,139 +16108,109 @@ pub mod api { #[doc = " bytes)."] pub fn announcement_deposit_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Proxy", "AnnouncementDepositBase")? - == [ - 167u8, 193u8, 39u8, 36u8, 61u8, 75u8, 122u8, 88u8, 86u8, - 61u8, 154u8, 153u8, 99u8, 130u8, 56u8, 114u8, 66u8, 196u8, - 148u8, 163u8, 29u8, 167u8, 17u8, 95u8, 228u8, 168u8, 43u8, - 130u8, 53u8, 7u8, 180u8, 181u8, - ] - { - let pallet = metadata.pallet("Proxy")?; - let constant = pallet.constant("AnnouncementDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Proxy", + "AnnouncementDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount of currency needed per announcement made."] #[doc = ""] #[doc = " This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)"] #[doc = " into a pre-existing storage value."] pub fn announcement_deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Proxy", "AnnouncementDepositFactor")? - == [ - 234u8, 50u8, 92u8, 12u8, 170u8, 230u8, 151u8, 220u8, 202u8, - 254u8, 123u8, 123u8, 40u8, 59u8, 188u8, 0u8, 55u8, 153u8, - 188u8, 146u8, 115u8, 250u8, 114u8, 233u8, 64u8, 35u8, 25u8, - 130u8, 189u8, 236u8, 169u8, 233u8, - ] - { - let pallet = metadata.pallet("Proxy")?; - let constant = pallet.constant("AnnouncementDepositFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Proxy", + "AnnouncementDepositFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } } pub mod multisig { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AsMultiThreshold1 { pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, pub call: ::std::boxed::Box, } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold_1"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AsMulti { pub threshold: ::core::primitive::u16, pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, pub maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, - pub call: - ::subxt::WrapperKeepOpaque, + pub call: ::subxt::utils::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, pub store_call: ::core::primitive::bool, pub max_weight: ::core::primitive::u64, } - impl ::subxt::Call for AsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ApproveAsMulti { pub threshold: ::core::primitive::u16, pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, pub maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, pub call_hash: [::core::primitive::u8; 32usize], pub max_weight: ::core::primitive::u64, } - impl ::subxt::Call for ApproveAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "approve_as_multi"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CancelAsMulti { pub threshold: ::core::primitive::u16, pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, pub call_hash: [::core::primitive::u8; 32usize], } - impl ::subxt::Call for CancelAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "cancel_as_multi"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] @@ -23927,41 +16230,24 @@ pub mod api { pub fn as_multi_threshold_1( &self, other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsMultiThreshold1, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 111u8, 92u8, 188u8, 136u8, 71u8, 227u8, 141u8, 53u8, 135u8, - 53u8, 106u8, 156u8, 255u8, 15u8, 103u8, 116u8, 159u8, 14u8, - 183u8, 102u8, 237u8, 18u8, 87u8, 181u8, 140u8, 29u8, 74u8, - 195u8, 146u8, 58u8, 102u8, 220u8, - ] - { - let call = AsMultiThreshold1 { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "as_multi_threshold_1", + AsMultiThreshold1 { other_signatories, call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 246u8, 222u8, 148u8, 4u8, 239u8, 222u8, 193u8, 79u8, 53u8, + 143u8, 34u8, 82u8, 133u8, 251u8, 125u8, 142u8, 125u8, 208u8, + 2u8, 135u8, 0u8, 12u8, 26u8, 112u8, 241u8, 209u8, 190u8, + 101u8, 40u8, 155u8, 98u8, 108u8, + ], + ) } #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] @@ -24012,52 +16298,35 @@ pub mod api { &self, threshold: ::core::primitive::u16, other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, - call: ::subxt::WrapperKeepOpaque< + call: ::subxt::utils::WrapperKeepOpaque< runtime_types::polkadot_runtime::Call, >, store_call: ::core::primitive::bool, max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 172u8, 58u8, 168u8, 231u8, 103u8, 158u8, 131u8, 110u8, 93u8, - 90u8, 82u8, 97u8, 67u8, 237u8, 138u8, 225u8, 158u8, 111u8, - 178u8, 16u8, 254u8, 252u8, 97u8, 21u8, 110u8, 152u8, 46u8, - 61u8, 238u8, 69u8, 100u8, 158u8, - ] - { - let call = AsMulti { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "as_multi", + AsMulti { threshold, other_signatories, maybe_timepoint, call, store_call, max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 145u8, 219u8, 104u8, 65u8, 73u8, 34u8, 65u8, 60u8, 105u8, + 39u8, 225u8, 227u8, 64u8, 98u8, 129u8, 181u8, 53u8, 217u8, + 224u8, 3u8, 228u8, 62u8, 231u8, 227u8, 174u8, 153u8, 75u8, + 81u8, 131u8, 104u8, 31u8, 133u8, + ], + ) } #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] @@ -24098,48 +16367,31 @@ pub mod api { &self, threshold: ::core::primitive::u16, other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, call_hash: [::core::primitive::u8; 32usize], max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveAsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 114u8, 29u8, 118u8, 154u8, 91u8, 4u8, 127u8, 126u8, 190u8, - 180u8, 57u8, 112u8, 72u8, 8u8, 248u8, 126u8, 25u8, 190u8, - 130u8, 86u8, 160u8, 164u8, 76u8, 64u8, 25u8, 175u8, 132u8, - 225u8, 147u8, 166u8, 12u8, 38u8, - ] - { - let call = ApproveAsMulti { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "approve_as_multi", + ApproveAsMulti { threshold, other_signatories, maybe_timepoint, call_hash, max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 55u8, 94u8, 230u8, 217u8, 37u8, 143u8, 44u8, 108u8, 123u8, + 250u8, 26u8, 44u8, 236u8, 69u8, 63u8, 90u8, 126u8, 15u8, + 233u8, 142u8, 213u8, 11u8, 141u8, 147u8, 151u8, 24u8, 167u8, + 62u8, 96u8, 227u8, 181u8, 140u8, + ], + ) } #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] #[doc = "for this operation will be unreserved on success."] @@ -24171,46 +16423,29 @@ pub mod api { &self, threshold: ::core::primitive::u16, other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, call_hash: [::core::primitive::u8; 32usize], - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelAsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 195u8, 216u8, 37u8, 179u8, 9u8, 19u8, 238u8, 94u8, 156u8, - 5u8, 120u8, 78u8, 129u8, 99u8, 239u8, 142u8, 68u8, 12u8, - 254u8, 46u8, 251u8, 8u8, 193u8, 43u8, 37u8, 68u8, 249u8, - 85u8, 163u8, 85u8, 193u8, 47u8, - ] - { - let call = CancelAsMulti { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "cancel_as_multi", + CancelAsMulti { threshold, other_signatories, timepoint, call_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 30u8, 25u8, 186u8, 142u8, 168u8, 81u8, 235u8, 164u8, 82u8, + 209u8, 66u8, 129u8, 209u8, 78u8, 172u8, 9u8, 163u8, 222u8, + 125u8, 57u8, 2u8, 43u8, 169u8, 174u8, 159u8, 167u8, 25u8, + 226u8, 254u8, 110u8, 80u8, 216u8, + ], + ) } } } @@ -24218,271 +16453,187 @@ pub mod api { pub type Event = runtime_types::pallet_multisig::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new multisig operation has begun."] pub struct NewMultisig { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub approving: ::subxt::ext::sp_core::crypto::AccountId32, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, pub call_hash: [::core::primitive::u8; 32usize], } - impl ::subxt::Event for NewMultisig { + impl ::subxt::events::StaticEvent for NewMultisig { const PALLET: &'static str = "Multisig"; const EVENT: &'static str = "NewMultisig"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A multisig operation has been approved by someone."] pub struct MultisigApproval { - pub approving: ::subxt::sp_core::crypto::AccountId32, + pub approving: ::subxt::ext::sp_core::crypto::AccountId32, pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, pub call_hash: [::core::primitive::u8; 32usize], } - impl ::subxt::Event for MultisigApproval { + impl ::subxt::events::StaticEvent for MultisigApproval { const PALLET: &'static str = "Multisig"; const EVENT: &'static str = "MultisigApproval"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A multisig operation has been executed."] pub struct MultisigExecuted { - pub approving: ::subxt::sp_core::crypto::AccountId32, + pub approving: ::subxt::ext::sp_core::crypto::AccountId32, pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, pub call_hash: [::core::primitive::u8; 32usize], pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for MultisigExecuted { + impl ::subxt::events::StaticEvent for MultisigExecuted { const PALLET: &'static str = "Multisig"; const EVENT: &'static str = "MultisigExecuted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A multisig operation has been cancelled."] pub struct MultisigCancelled { - pub cancelling: ::subxt::sp_core::crypto::AccountId32, + pub cancelling: ::subxt::ext::sp_core::crypto::AccountId32, pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, pub call_hash: [::core::primitive::u8; 32usize], } - impl ::subxt::Event for MultisigCancelled { + impl ::subxt::events::StaticEvent for MultisigCancelled { const PALLET: &'static str = "Multisig"; const EVENT: &'static str = "MultisigCancelled"; } } pub mod storage { use super::runtime_types; - pub struct Multisigs<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a [::core::primitive::u8; 32usize], - ); - impl ::subxt::StorageEntry for Multisigs<'_> { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Multisigs"; - type Value = runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Calls<'a>(pub &'a [::core::primitive::u8; 32usize]); - impl ::subxt::StorageEntry for Calls<'_> { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = ( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The set of open multisig operations."] pub fn multisigs( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - _1: &'a [::core::primitive::u8; 32usize], - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + _1: impl ::std::borrow::Borrow<[::core::primitive::u8; 32usize]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 137u8, 130u8, 173u8, 65u8, 126u8, 244u8, 194u8, 167u8, - 93u8, 174u8, 104u8, 131u8, 115u8, 155u8, 93u8, 185u8, - 54u8, 204u8, 155u8, 149u8, 184u8, 24u8, 111u8, 40u8, - 249u8, 215u8, 34u8, 251u8, 224u8, 110u8, 202u8, 2u8, - ] - { - let entry = Multisigs(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + :: subxt :: storage :: address :: StaticStorageAddress :: new ("Multisig" , "Multisigs" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [145u8 , 78u8 , 57u8 , 171u8 , 199u8 , 158u8 , 226u8 , 250u8 , 224u8 , 133u8 , 45u8 , 251u8 , 202u8 , 22u8 , 171u8 , 132u8 , 229u8 , 110u8 , 248u8 , 233u8 , 38u8 , 2u8 , 247u8 , 140u8 , 150u8 , 103u8 , 211u8 , 209u8 , 160u8 , 158u8 , 23u8 , 215u8 ,]) } #[doc = " The set of open multisig operations."] - pub fn multisigs_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Multisigs<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 137u8, 130u8, 173u8, 65u8, 126u8, 244u8, 194u8, 167u8, - 93u8, 174u8, 104u8, 131u8, 115u8, 155u8, 93u8, 185u8, - 54u8, 204u8, 155u8, 149u8, 184u8, 24u8, 111u8, 40u8, - 249u8, 215u8, 34u8, 251u8, 224u8, 110u8, 202u8, 2u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - pub fn calls( + pub fn multisigs_root( &self, - _0: &'a [::core::primitive::u8; 32usize], - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::subxt::WrapperKeepOpaque< - runtime_types::polkadot_runtime::Call, - >, - ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, ::core::primitive::u128, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 215u8, 30u8, 84u8, 216u8, 201u8, 91u8, 161u8, 0u8, - 194u8, 216u8, 43u8, 91u8, 65u8, 231u8, 38u8, 35u8, 197u8, - 230u8, 146u8, 206u8, 251u8, 122u8, 50u8, 90u8, 60u8, - 177u8, 226u8, 90u8, 181u8, 95u8, 62u8, - ] - { - let entry = Calls(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Multisigs", + Vec::new(), + [ + 145u8, 78u8, 57u8, 171u8, 199u8, 158u8, 226u8, 250u8, 224u8, + 133u8, 45u8, 251u8, 202u8, 22u8, 171u8, 132u8, 229u8, 110u8, + 248u8, 233u8, 38u8, 2u8, 247u8, 140u8, 150u8, 103u8, 211u8, + 209u8, 160u8, 158u8, 23u8, 215u8, + ], + ) } - pub fn calls_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Calls<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 215u8, 30u8, 84u8, 216u8, 201u8, 91u8, 161u8, 0u8, - 194u8, 216u8, 43u8, 91u8, 65u8, 231u8, 38u8, 35u8, 197u8, - 230u8, 146u8, 206u8, 251u8, 122u8, 50u8, 90u8, 60u8, - 177u8, 226u8, 90u8, 181u8, 95u8, 62u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn calls( + &self, + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 32usize]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::utils::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Calls", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 221u8, 242u8, 184u8, 125u8, 128u8, 166u8, 46u8, 122u8, 150u8, + 0u8, 138u8, 146u8, 248u8, 236u8, 34u8, 84u8, 219u8, 16u8, + 4u8, 173u8, 100u8, 22u8, 182u8, 174u8, 108u8, 167u8, 72u8, + 121u8, 254u8, 47u8, 200u8, 145u8, + ], + ) + } + pub fn calls_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::utils::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Calls", + Vec::new(), + [ + 221u8, 242u8, 184u8, 125u8, 128u8, 166u8, 46u8, 122u8, 150u8, + 0u8, 138u8, 146u8, 248u8, 236u8, 34u8, 84u8, 219u8, 16u8, + 4u8, 173u8, 100u8, 22u8, 182u8, 174u8, 108u8, 167u8, 72u8, + 121u8, 254u8, 47u8, 200u8, 145u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The base amount of currency needed to reserve for creating a multisig execution or to"] #[doc = " store a dispatch call for later."] #[doc = ""] @@ -24491,200 +16642,162 @@ pub mod api { #[doc = " `32 + sizeof(AccountId)` bytes."] pub fn deposit_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Multisig", "DepositBase")? - == [ - 184u8, 205u8, 30u8, 80u8, 201u8, 56u8, 94u8, 154u8, 82u8, - 189u8, 62u8, 221u8, 158u8, 69u8, 166u8, 229u8, 114u8, 175u8, - 18u8, 68u8, 189u8, 36u8, 51u8, 115u8, 82u8, 203u8, 106u8, - 161u8, 186u8, 8u8, 56u8, 4u8, - ] - { - let pallet = metadata.pallet("Multisig")?; - let constant = pallet.constant("DepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Multisig", + "DepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount of currency needed per unit threshold when creating a multisig execution."] #[doc = ""] #[doc = " This is held for adding 32 bytes more into a pre-existing storage value."] pub fn deposit_factor( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Multisig", "DepositFactor")? - == [ - 226u8, 132u8, 1u8, 18u8, 51u8, 22u8, 235u8, 140u8, 210u8, - 182u8, 190u8, 176u8, 59u8, 98u8, 137u8, 93u8, 118u8, 55u8, - 125u8, 33u8, 174u8, 152u8, 70u8, 62u8, 84u8, 46u8, 159u8, - 246u8, 17u8, 40u8, 120u8, 193u8, - ] - { - let pallet = metadata.pallet("Multisig")?; - let constant = pallet.constant("DepositFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Multisig", + "DepositFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum amount of signatories allowed in the multisig."] pub fn max_signatories( &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Multisig", "MaxSignatories")? - == [ - 139u8, 36u8, 140u8, 198u8, 176u8, 106u8, 89u8, 194u8, 33u8, - 23u8, 60u8, 134u8, 143u8, 24u8, 176u8, 64u8, 47u8, 109u8, - 159u8, 134u8, 240u8, 231u8, 181u8, 146u8, 136u8, 249u8, - 175u8, 67u8, 41u8, 152u8, 90u8, 15u8, - ] - { - let pallet = metadata.pallet("Multisig")?; - let constant = pallet.constant("MaxSignatories")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u16>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Multisig", + "MaxSignatories", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, + 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, + 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, + 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) } } } } pub mod bounties { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProposeBounty { #[codec(compact)] pub value: ::core::primitive::u128, pub description: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for ProposeBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ApproveBounty { #[codec(compact)] pub bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for ApproveBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "approve_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProposeCurator { #[codec(compact)] pub bounty_id: ::core::primitive::u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] pub fee: ::core::primitive::u128, } - impl ::subxt::Call for ProposeCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_curator"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct UnassignCurator { #[codec(compact)] pub bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for UnassignCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "unassign_curator"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AcceptCurator { #[codec(compact)] pub bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for AcceptCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "accept_curator"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AwardBounty { #[codec(compact)] pub bounty_id: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for AwardBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "award_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClaimBounty { #[codec(compact)] pub bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for ClaimBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "claim_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CloseBounty { #[codec(compact)] pub bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for CloseBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "close_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ExtendBountyExpiry { #[codec(compact)] pub bounty_id: ::core::primitive::u32, pub remark: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for ExtendBountyExpiry { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "extend_bounty_expiry"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Propose a new bounty."] #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] @@ -24701,35 +16814,18 @@ pub mod api { &self, value: ::core::primitive::u128, description: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 208u8, 22u8, 157u8, 134u8, 214u8, 95u8, 249u8, 10u8, 67u8, - 223u8, 190u8, 192u8, 69u8, 32u8, 7u8, 235u8, 205u8, 145u8, - 90u8, 80u8, 60u8, 4u8, 16u8, 189u8, 59u8, 180u8, 68u8, 77u8, - 69u8, 121u8, 92u8, 33u8, - ] - { - let call = ProposeBounty { value, description }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "propose_bounty", + ProposeBounty { value, description }, + [ + 99u8, 160u8, 94u8, 74u8, 105u8, 161u8, 123u8, 239u8, 241u8, + 117u8, 97u8, 99u8, 84u8, 101u8, 87u8, 3u8, 88u8, 175u8, 75u8, + 59u8, 114u8, 87u8, 18u8, 113u8, 126u8, 26u8, 42u8, 104u8, + 201u8, 128u8, 102u8, 219u8, + ], + ) } #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] #[doc = "and the original deposit will be returned."] @@ -24742,35 +16838,18 @@ pub mod api { pub fn approve_bounty( &self, bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 127u8, 220u8, 25u8, 197u8, 19u8, 183u8, 177u8, 17u8, 164u8, - 29u8, 250u8, 136u8, 125u8, 90u8, 247u8, 177u8, 37u8, 180u8, - 77u8, 75u8, 164u8, 32u8, 195u8, 207u8, 58u8, 249u8, 141u8, - 11u8, 53u8, 184u8, 224u8, 135u8, - ] - { - let call = ApproveBounty { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "approve_bounty", + ApproveBounty { bounty_id }, + [ + 82u8, 228u8, 232u8, 103u8, 198u8, 173u8, 190u8, 148u8, 159u8, + 86u8, 48u8, 4u8, 32u8, 169u8, 1u8, 129u8, 96u8, 145u8, 235u8, + 68u8, 48u8, 34u8, 5u8, 1u8, 76u8, 26u8, 100u8, 228u8, 92u8, + 198u8, 183u8, 173u8, + ], + ) } #[doc = "Assign a curator to a funded bounty."] #[doc = ""] @@ -24782,44 +16861,27 @@ pub mod api { pub fn propose_curator( &self, bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 180u8, 13u8, 171u8, 39u8, 160u8, 233u8, 162u8, 39u8, 100u8, - 144u8, 156u8, 212u8, 139u8, 128u8, 105u8, 49u8, 157u8, 16u8, - 125u8, 72u8, 36u8, 45u8, 199u8, 139u8, 165u8, 100u8, 40u8, - 163u8, 117u8, 32u8, 164u8, 23u8, - ] - { - let call = ProposeCurator { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "propose_curator", + ProposeCurator { bounty_id, curator, fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 123u8, 148u8, 21u8, 204u8, 216u8, 6u8, 47u8, 83u8, 182u8, + 30u8, 171u8, 48u8, 193u8, 200u8, 197u8, 147u8, 111u8, 88u8, + 14u8, 242u8, 66u8, 175u8, 241u8, 208u8, 95u8, 151u8, 41u8, + 46u8, 213u8, 188u8, 65u8, 196u8, + ], + ) } #[doc = "Unassign curator from a bounty."] #[doc = ""] @@ -24842,35 +16904,18 @@ pub mod api { pub fn unassign_curator( &self, bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnassignCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 156u8, 163u8, 248u8, 148u8, 22u8, 231u8, 232u8, 182u8, 48u8, - 87u8, 85u8, 118u8, 169u8, 249u8, 123u8, 199u8, 248u8, 206u8, - 221u8, 196u8, 69u8, 69u8, 52u8, 116u8, 65u8, 165u8, 172u8, - 242u8, 61u8, 109u8, 143u8, 69u8, - ] - { - let call = UnassignCurator { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "unassign_curator", + UnassignCurator { bounty_id }, + [ + 218u8, 241u8, 247u8, 89u8, 95u8, 120u8, 93u8, 18u8, 85u8, + 114u8, 158u8, 254u8, 68u8, 77u8, 230u8, 186u8, 230u8, 201u8, + 63u8, 223u8, 28u8, 173u8, 244u8, 82u8, 113u8, 177u8, 99u8, + 27u8, 207u8, 247u8, 207u8, 213u8, + ], + ) } #[doc = "Accept the curator role for a bounty."] #[doc = "A deposit will be reserved from curator and refund upon successful payout."] @@ -24883,35 +16928,18 @@ pub mod api { pub fn accept_curator( &self, bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AcceptCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 50u8, 149u8, 252u8, 40u8, 169u8, 113u8, 60u8, 153u8, 123u8, - 146u8, 40u8, 196u8, 176u8, 195u8, 95u8, 94u8, 14u8, 81u8, - 136u8, 225u8, 24u8, 59u8, 87u8, 118u8, 77u8, 60u8, 150u8, - 102u8, 206u8, 219u8, 241u8, 99u8, - ] - { - let call = AcceptCurator { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "accept_curator", + AcceptCurator { bounty_id }, + [ + 106u8, 96u8, 22u8, 67u8, 52u8, 109u8, 180u8, 225u8, 122u8, + 253u8, 209u8, 214u8, 132u8, 131u8, 247u8, 131u8, 162u8, 51u8, + 144u8, 30u8, 12u8, 126u8, 50u8, 152u8, 229u8, 119u8, 54u8, + 116u8, 112u8, 235u8, 34u8, 166u8, + ], + ) } #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] #[doc = "after a delay."] @@ -24927,42 +16955,25 @@ pub mod api { pub fn award_bounty( &self, bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AwardBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 42u8, 49u8, 134u8, 134u8, 5u8, 98u8, 72u8, 95u8, 227u8, - 156u8, 224u8, 249u8, 209u8, 42u8, 160u8, 15u8, 239u8, 195u8, - 128u8, 251u8, 217u8, 132u8, 15u8, 221u8, 191u8, 105u8, 39u8, - 228u8, 189u8, 174u8, 115u8, 53u8, - ] - { - let call = AwardBounty { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "award_bounty", + AwardBounty { bounty_id, beneficiary, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 203u8, 164u8, 214u8, 242u8, 1u8, 11u8, 217u8, 32u8, 189u8, + 136u8, 29u8, 230u8, 88u8, 17u8, 134u8, 189u8, 15u8, 204u8, + 223u8, 20u8, 168u8, 182u8, 129u8, 48u8, 83u8, 25u8, 125u8, + 25u8, 209u8, 155u8, 170u8, 68u8, + ], + ) } #[doc = "Claim the payout from an awarded bounty after payout delay."] #[doc = ""] @@ -24976,35 +16987,18 @@ pub mod api { pub fn claim_bounty( &self, bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClaimBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 119u8, 9u8, 122u8, 55u8, 224u8, 139u8, 26u8, 186u8, 3u8, - 178u8, 78u8, 41u8, 91u8, 183u8, 222u8, 197u8, 189u8, 172u8, - 154u8, 47u8, 2u8, 164u8, 141u8, 163u8, 211u8, 117u8, 186u8, - 121u8, 130u8, 91u8, 13u8, 241u8, - ] - { - let call = ClaimBounty { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "claim_bounty", + ClaimBounty { bounty_id }, + [ + 102u8, 95u8, 8u8, 89u8, 4u8, 126u8, 189u8, 28u8, 241u8, 16u8, + 125u8, 218u8, 42u8, 92u8, 177u8, 91u8, 8u8, 235u8, 33u8, + 48u8, 64u8, 115u8, 177u8, 95u8, 242u8, 97u8, 181u8, 50u8, + 68u8, 37u8, 59u8, 85u8, + ], + ) } #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] #[doc = "the curator deposit will be unreserved if possible."] @@ -25019,35 +17013,18 @@ pub mod api { pub fn close_bounty( &self, bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CloseBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 119u8, 47u8, 246u8, 188u8, 235u8, 22u8, 53u8, 70u8, 182u8, - 15u8, 247u8, 153u8, 208u8, 191u8, 144u8, 132u8, 30u8, 200u8, - 36u8, 186u8, 194u8, 225u8, 140u8, 160u8, 152u8, 194u8, 38u8, - 223u8, 33u8, 130u8, 120u8, 254u8, - ] - { - let call = CloseBounty { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "close_bounty", + CloseBounty { bounty_id }, + [ + 64u8, 113u8, 151u8, 228u8, 90u8, 55u8, 251u8, 63u8, 27u8, + 211u8, 119u8, 229u8, 137u8, 137u8, 183u8, 240u8, 241u8, + 146u8, 69u8, 169u8, 124u8, 220u8, 236u8, 111u8, 98u8, 188u8, + 100u8, 52u8, 127u8, 245u8, 244u8, 92u8, + ], + ) } #[doc = "Extend the expiry time of an active bounty."] #[doc = ""] @@ -25063,35 +17040,18 @@ pub mod api { &self, bounty_id: ::core::primitive::u32, remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExtendBountyExpiry, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 127u8, 142u8, 138u8, 230u8, 147u8, 187u8, 201u8, 210u8, - 216u8, 61u8, 62u8, 125u8, 168u8, 188u8, 16u8, 73u8, 157u8, - 53u8, 165u8, 236u8, 181u8, 26u8, 28u8, 67u8, 59u8, 234u8, - 189u8, 167u8, 92u8, 242u8, 138u8, 35u8, - ] - { - let call = ExtendBountyExpiry { bounty_id, remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "extend_bounty_expiry", + ExtendBountyExpiry { bounty_id, remark }, + [ + 97u8, 69u8, 157u8, 39u8, 59u8, 72u8, 79u8, 88u8, 104u8, + 119u8, 91u8, 26u8, 73u8, 216u8, 174u8, 95u8, 254u8, 214u8, + 63u8, 138u8, 100u8, 112u8, 185u8, 81u8, 159u8, 247u8, 221u8, + 60u8, 87u8, 40u8, 80u8, 202u8, + ], + ) } } } @@ -25100,456 +17060,323 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "New bounty proposal."] pub struct BountyProposed { pub index: ::core::primitive::u32, } - impl ::subxt::Event for BountyProposed { + impl ::subxt::events::StaticEvent for BountyProposed { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyProposed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A bounty proposal was rejected; funds were slashed."] pub struct BountyRejected { pub index: ::core::primitive::u32, pub bond: ::core::primitive::u128, } - impl ::subxt::Event for BountyRejected { + impl ::subxt::events::StaticEvent for BountyRejected { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyRejected"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A bounty proposal is funded and became active."] pub struct BountyBecameActive { pub index: ::core::primitive::u32, } - impl ::subxt::Event for BountyBecameActive { + impl ::subxt::events::StaticEvent for BountyBecameActive { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyBecameActive"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A bounty is awarded to a beneficiary."] pub struct BountyAwarded { pub index: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for BountyAwarded { + impl ::subxt::events::StaticEvent for BountyAwarded { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyAwarded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A bounty is claimed by beneficiary."] pub struct BountyClaimed { pub index: ::core::primitive::u32, pub payout: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for BountyClaimed { + impl ::subxt::events::StaticEvent for BountyClaimed { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyClaimed"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A bounty is cancelled."] pub struct BountyCanceled { pub index: ::core::primitive::u32, } - impl ::subxt::Event for BountyCanceled { + impl ::subxt::events::StaticEvent for BountyCanceled { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyCanceled"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A bounty expiry is extended."] pub struct BountyExtended { pub index: ::core::primitive::u32, } - impl ::subxt::Event for BountyExtended { + impl ::subxt::events::StaticEvent for BountyExtended { const PALLET: &'static str = "Bounties"; const EVENT: &'static str = "BountyExtended"; } } pub mod storage { use super::runtime_types; - pub struct BountyCount; - impl ::subxt::StorageEntry for BountyCount { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bounties<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Bounties<'_> { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "Bounties"; - type Value = runtime_types::pallet_bounties::Bounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BountyDescriptions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for BountyDescriptions<'_> { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyDescriptions"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BountyApprovals; - impl ::subxt::StorageEntry for BountyApprovals { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyApprovals"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Number of bounty proposals that have been made."] pub fn bounty_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 5u8, 188u8, 134u8, 220u8, 64u8, 49u8, 188u8, 98u8, 185u8, - 186u8, 230u8, 65u8, 247u8, 199u8, 28u8, 178u8, 202u8, - 193u8, 41u8, 83u8, 115u8, 253u8, 182u8, 123u8, 92u8, - 138u8, 12u8, 31u8, 31u8, 213u8, 23u8, 118u8, - ] - { - let entry = BountyCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "BountyCount", + vec![], + [ + 5u8, 188u8, 134u8, 220u8, 64u8, 49u8, 188u8, 98u8, 185u8, + 186u8, 230u8, 65u8, 247u8, 199u8, 28u8, 178u8, 202u8, 193u8, + 41u8, 83u8, 115u8, 253u8, 182u8, 123u8, 92u8, 138u8, 12u8, + 31u8, 31u8, 213u8, 23u8, 118u8, + ], + ) } #[doc = " Bounties that have been made."] pub fn bounties( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_bounties::Bounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bounties::Bounty< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 27u8, 154u8, 97u8, 199u8, 230u8, 195u8, 155u8, 198u8, - 4u8, 28u8, 5u8, 202u8, 175u8, 11u8, 243u8, 166u8, 67u8, - 231u8, 125u8, 203u8, 141u8, 168u8, 106u8, 218u8, 129u8, - 25u8, 231u8, 253u8, 126u8, 144u8, 46u8, 255u8, - ] - { - let entry = Bounties(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "Bounties", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 111u8, 149u8, 33u8, 54u8, 172u8, 143u8, 41u8, 231u8, 184u8, + 255u8, 238u8, 206u8, 87u8, 142u8, 84u8, 10u8, 236u8, 141u8, + 190u8, 193u8, 72u8, 170u8, 19u8, 110u8, 135u8, 136u8, 220u8, + 11u8, 99u8, 126u8, 225u8, 208u8, + ], + ) } #[doc = " Bounties that have been made."] - pub fn bounties_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Bounties<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 27u8, 154u8, 97u8, 199u8, 230u8, 195u8, 155u8, 198u8, - 4u8, 28u8, 5u8, 202u8, 175u8, 11u8, 243u8, 166u8, 67u8, - 231u8, 125u8, 203u8, 141u8, 168u8, 106u8, 218u8, 129u8, - 25u8, 231u8, 253u8, 126u8, 144u8, 46u8, 255u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn bounties_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bounties::Bounty< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "Bounties", + Vec::new(), + [ + 111u8, 149u8, 33u8, 54u8, 172u8, 143u8, 41u8, 231u8, 184u8, + 255u8, 238u8, 206u8, 87u8, 142u8, 84u8, 10u8, 236u8, 141u8, + 190u8, 193u8, 72u8, 170u8, 19u8, 110u8, 135u8, 136u8, 220u8, + 11u8, 99u8, 126u8, 225u8, 208u8, + ], + ) } #[doc = " The description of each bounty."] pub fn bounty_descriptions( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 41u8, 78u8, 19u8, 48u8, 241u8, 95u8, 175u8, 69u8, 236u8, - 54u8, 84u8, 58u8, 69u8, 28u8, 20u8, 20u8, 214u8, 138u8, - 163u8, 252u8, 239u8, 116u8, 171u8, 136u8, 0u8, 159u8, - 192u8, 51u8, 191u8, 160u8, 131u8, 123u8, - ] - { - let entry = BountyDescriptions(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "BountyDescriptions", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 252u8, 0u8, 9u8, 225u8, 13u8, 135u8, 7u8, 121u8, 154u8, + 155u8, 116u8, 83u8, 160u8, 37u8, 72u8, 11u8, 72u8, 0u8, + 248u8, 73u8, 158u8, 84u8, 125u8, 221u8, 176u8, 231u8, 100u8, + 239u8, 111u8, 22u8, 29u8, 13u8, + ], + ) } #[doc = " The description of each bounty."] - pub fn bounty_descriptions_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, BountyDescriptions<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 41u8, 78u8, 19u8, 48u8, 241u8, 95u8, 175u8, 69u8, 236u8, - 54u8, 84u8, 58u8, 69u8, 28u8, 20u8, 20u8, 214u8, 138u8, - 163u8, 252u8, 239u8, 116u8, 171u8, 136u8, 0u8, 159u8, - 192u8, 51u8, 191u8, 160u8, 131u8, 123u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn bounty_descriptions_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "BountyDescriptions", + Vec::new(), + [ + 252u8, 0u8, 9u8, 225u8, 13u8, 135u8, 7u8, 121u8, 154u8, + 155u8, 116u8, 83u8, 160u8, 37u8, 72u8, 11u8, 72u8, 0u8, + 248u8, 73u8, 158u8, 84u8, 125u8, 221u8, 176u8, 231u8, 100u8, + 239u8, 111u8, 22u8, 29u8, 13u8, + ], + ) } #[doc = " Bounty indices that have been approved but not yet funded."] pub fn bounty_approvals( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 18u8, 142u8, 244u8, 64u8, 172u8, 62u8, 230u8, 114u8, - 165u8, 158u8, 123u8, 163u8, 35u8, 125u8, 218u8, 23u8, - 113u8, 73u8, 233u8, 242u8, 181u8, 205u8, 60u8, 54u8, - 64u8, 115u8, 207u8, 94u8, 22u8, 14u8, 238u8, 49u8, - ] - { - let entry = BountyApprovals; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "BountyApprovals", + vec![], + [ + 64u8, 93u8, 54u8, 94u8, 122u8, 9u8, 246u8, 86u8, 234u8, 30u8, + 125u8, 132u8, 49u8, 128u8, 1u8, 219u8, 241u8, 13u8, 217u8, + 186u8, 48u8, 21u8, 5u8, 227u8, 71u8, 157u8, 128u8, 226u8, + 214u8, 49u8, 249u8, 183u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The amount held on deposit for placing a bounty proposal."] pub fn bounty_deposit_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "BountyDepositBase")? - == [ - 239u8, 17u8, 86u8, 242u8, 39u8, 104u8, 7u8, 123u8, 210u8, - 141u8, 18u8, 248u8, 45u8, 172u8, 17u8, 58u8, 175u8, 58u8, - 246u8, 239u8, 147u8, 98u8, 85u8, 237u8, 42u8, 202u8, 25u8, - 227u8, 31u8, 207u8, 98u8, 83u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("BountyDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The delay period for which a bounty beneficiary need to wait before claim the payout."] pub fn bounty_deposit_payout_delay( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "BountyDepositPayoutDelay")? - == [ - 128u8, 86u8, 220u8, 124u8, 89u8, 11u8, 42u8, 36u8, 116u8, - 160u8, 162u8, 57u8, 129u8, 172u8, 167u8, 210u8, 34u8, 188u8, - 183u8, 109u8, 166u8, 10u8, 161u8, 134u8, 145u8, 60u8, 242u8, - 105u8, 137u8, 133u8, 102u8, 212u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("BountyDepositPayoutDelay")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyDepositPayoutDelay", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Bounty duration in blocks."] pub fn bounty_update_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "BountyUpdatePeriod")? - == [ - 10u8, 209u8, 160u8, 42u8, 47u8, 204u8, 58u8, 28u8, 137u8, - 252u8, 123u8, 123u8, 194u8, 151u8, 43u8, 90u8, 0u8, 154u8, - 132u8, 183u8, 50u8, 168u8, 204u8, 91u8, 235u8, 13u8, 116u8, - 219u8, 47u8, 215u8, 107u8, 136u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("BountyUpdatePeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyUpdatePeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The curator deposit is calculated as a percentage of the curator fee."] #[doc = ""] @@ -25557,171 +17384,129 @@ pub mod api { #[doc = " `CuratorDepositMin`."] pub fn curator_deposit_multiplier( &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Permill, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "CuratorDepositMultiplier")? - == [ - 119u8, 126u8, 117u8, 41u8, 6u8, 165u8, 141u8, 28u8, 50u8, - 24u8, 197u8, 238u8, 10u8, 25u8, 186u8, 143u8, 77u8, 212u8, - 156u8, 98u8, 147u8, 70u8, 188u8, 56u8, 23u8, 176u8, 175u8, - 248u8, 158u8, 34u8, 97u8, 39u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("CuratorDepositMultiplier")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Permill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "CuratorDepositMultiplier", + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, + 19u8, 87u8, 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, + 225u8, 53u8, 212u8, 52u8, 177u8, 79u8, 4u8, 116u8, 201u8, + 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) } #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] pub fn curator_deposit_max( &self, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "CuratorDepositMax")? - == [ - 197u8, 116u8, 193u8, 36u8, 38u8, 161u8, 84u8, 35u8, 214u8, - 57u8, 117u8, 1u8, 205u8, 210u8, 187u8, 254u8, 240u8, 142u8, - 234u8, 3u8, 128u8, 248u8, 17u8, 26u8, 220u8, 250u8, 135u8, - 74u8, 60u8, 75u8, 37u8, 102u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("CuratorDepositMax")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::core::option::Option<::core::primitive::u128>, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "CuratorDepositMax", + [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, + 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, + 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, + 43u8, 243u8, 122u8, 60u8, 216u8, + ], + ) } #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] pub fn curator_deposit_min( &self, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "CuratorDepositMin")? - == [ - 103u8, 117u8, 57u8, 115u8, 148u8, 210u8, 125u8, 147u8, 240u8, - 124u8, 116u8, 42u8, 123u8, 201u8, 167u8, 70u8, 33u8, 230u8, - 204u8, 237u8, 197u8, 52u8, 184u8, 86u8, 191u8, 153u8, 56u8, - 233u8, 154u8, 127u8, 129u8, 59u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("CuratorDepositMin")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::core::option::Option<::core::primitive::u128>, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "CuratorDepositMin", + [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, + 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, + 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, + 43u8, 243u8, 122u8, 60u8, 216u8, + ], + ) } #[doc = " Minimum value for a bounty."] pub fn bounty_value_minimum( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "BountyValueMinimum")? - == [ - 151u8, 218u8, 51u8, 10u8, 253u8, 91u8, 115u8, 68u8, 30u8, - 12u8, 122u8, 150u8, 203u8, 237u8, 234u8, 220u8, 103u8, 54u8, - 222u8, 239u8, 112u8, 28u8, 3u8, 7u8, 206u8, 89u8, 106u8, - 138u8, 86u8, 88u8, 38u8, 116u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("BountyValueMinimum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyValueMinimum", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] pub fn data_deposit_per_byte( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "DataDepositPerByte")? - == [ - 70u8, 208u8, 250u8, 66u8, 143u8, 90u8, 112u8, 229u8, 138u8, - 156u8, 116u8, 16u8, 65u8, 250u8, 203u8, 188u8, 255u8, 123u8, - 211u8, 66u8, 19u8, 231u8, 22u8, 224u8, 95u8, 6u8, 164u8, - 26u8, 103u8, 226u8, 234u8, 89u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "DataDepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Maximum acceptable reason length."] #[doc = ""] #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] pub fn maximum_reason_length( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Bounties", "MaximumReasonLength")? - == [ - 137u8, 135u8, 60u8, 208u8, 169u8, 200u8, 219u8, 180u8, 48u8, - 114u8, 22u8, 9u8, 163u8, 54u8, 133u8, 198u8, 72u8, 186u8, - 183u8, 134u8, 130u8, 198u8, 61u8, 79u8, 86u8, 218u8, 212u8, - 166u8, 195u8, 81u8, 58u8, 191u8, - ] - { - let pallet = metadata.pallet("Bounties")?; - let constant = pallet.constant("MaximumReasonLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "MaximumReasonLength", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod child_bounties { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddChildBounty { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, @@ -25729,101 +17514,84 @@ pub mod api { pub value: ::core::primitive::u128, pub description: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for AddChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "add_child_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProposeCurator { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, #[codec(compact)] pub child_bounty_id: ::core::primitive::u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] pub fee: ::core::primitive::u128, } - impl ::subxt::Call for ProposeCurator { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "propose_curator"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AcceptCurator { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, #[codec(compact)] pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for AcceptCurator { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "accept_curator"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct UnassignCurator { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, #[codec(compact)] pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for UnassignCurator { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "unassign_curator"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AwardChildBounty { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, #[codec(compact)] pub child_bounty_id: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, } - impl ::subxt::Call for AwardChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "award_child_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClaimChildBounty { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, #[codec(compact)] pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for ClaimChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "claim_child_bounty"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CloseChildBounty { #[codec(compact)] pub parent_bounty_id: ::core::primitive::u32, #[codec(compact)] pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for CloseChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "close_child_bounty"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Add a new child-bounty."] #[doc = ""] #[doc = "The dispatch origin for this call must be the curator of parent"] @@ -25848,39 +17616,22 @@ pub mod api { parent_bounty_id: ::core::primitive::u32, value: ::core::primitive::u128, description: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 216u8, 166u8, 226u8, 107u8, 159u8, 235u8, 35u8, 207u8, - 154u8, 124u8, 226u8, 242u8, 241u8, 4u8, 20u8, 1u8, 215u8, - 110u8, 127u8, 19u8, 211u8, 36u8, 159u8, 110u8, 146u8, 58u8, - 23u8, 210u8, 51u8, 193u8, 228u8, - ] - { - let call = AddChildBounty { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "add_child_bounty", + AddChildBounty { parent_bounty_id, value, description, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 210u8, 156u8, 242u8, 121u8, 28u8, 214u8, 212u8, 203u8, 46u8, + 45u8, 110u8, 25u8, 33u8, 138u8, 136u8, 71u8, 23u8, 102u8, + 203u8, 122u8, 77u8, 162u8, 112u8, 133u8, 43u8, 73u8, 201u8, + 176u8, 102u8, 68u8, 188u8, 8u8, + ], + ) } #[doc = "Propose curator for funded child-bounty."] #[doc = ""] @@ -25901,45 +17652,28 @@ pub mod api { &self, parent_bounty_id: ::core::primitive::u32, child_bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 34u8, 219u8, 159u8, 152u8, 29u8, 12u8, 222u8, 91u8, 193u8, - 218u8, 28u8, 0u8, 102u8, 15u8, 180u8, 155u8, 135u8, 175u8, - 182u8, 51u8, 220u8, 97u8, 169u8, 97u8, 135u8, 26u8, 237u8, - 22u8, 100u8, 8u8, 203u8, 229u8, - ] - { - let call = ProposeCurator { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "propose_curator", + ProposeCurator { parent_bounty_id, child_bounty_id, curator, fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 37u8, 101u8, 96u8, 75u8, 254u8, 212u8, 42u8, 140u8, 72u8, + 107u8, 157u8, 110u8, 147u8, 236u8, 17u8, 138u8, 161u8, 153u8, + 119u8, 177u8, 225u8, 22u8, 83u8, 5u8, 123u8, 38u8, 30u8, + 240u8, 134u8, 208u8, 183u8, 247u8, + ], + ) } #[doc = "Accept the curator role for the child-bounty."] #[doc = ""] @@ -25964,38 +17698,21 @@ pub mod api { &self, parent_bounty_id: ::core::primitive::u32, child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AcceptCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 115u8, 24u8, 36u8, 188u8, 30u8, 11u8, 184u8, 102u8, 151u8, - 96u8, 41u8, 162u8, 104u8, 54u8, 76u8, 251u8, 189u8, 50u8, - 190u8, 50u8, 15u8, 171u8, 231u8, 218u8, 45u8, 129u8, 137u8, - 69u8, 130u8, 39u8, 190u8, 223u8, - ] - { - let call = AcceptCurator { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "accept_curator", + AcceptCurator { parent_bounty_id, child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 112u8, 175u8, 238u8, 54u8, 132u8, 20u8, 206u8, 59u8, 220u8, + 228u8, 207u8, 222u8, 132u8, 240u8, 188u8, 0u8, 210u8, 225u8, + 234u8, 142u8, 232u8, 53u8, 64u8, 89u8, 220u8, 29u8, 28u8, + 123u8, 125u8, 207u8, 10u8, 52u8, + ], + ) } #[doc = "Unassign curator from a child-bounty."] #[doc = ""] @@ -26035,38 +17752,21 @@ pub mod api { &self, parent_bounty_id: ::core::primitive::u32, child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnassignCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 210u8, 24u8, 20u8, 200u8, 106u8, 200u8, 33u8, 43u8, 169u8, - 133u8, 157u8, 108u8, 220u8, 36u8, 110u8, 172u8, 218u8, 1u8, - 209u8, 254u8, 69u8, 117u8, 70u8, 173u8, 66u8, 177u8, 54u8, - 128u8, 239u8, 83u8, 60u8, 118u8, - ] - { - let call = UnassignCurator { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "unassign_curator", + UnassignCurator { parent_bounty_id, child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 228u8, 189u8, 46u8, 75u8, 121u8, 161u8, 150u8, 87u8, 207u8, + 86u8, 192u8, 50u8, 52u8, 61u8, 49u8, 88u8, 178u8, 182u8, + 89u8, 72u8, 203u8, 45u8, 41u8, 26u8, 149u8, 114u8, 154u8, + 169u8, 118u8, 128u8, 13u8, 211u8, + ], + ) } #[doc = "Award child-bounty to a beneficiary."] #[doc = ""] @@ -26089,43 +17789,26 @@ pub mod api { &self, parent_bounty_id: ::core::primitive::u32, child_bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AwardChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 135u8, 134u8, 237u8, 216u8, 152u8, 75u8, 11u8, 209u8, 152u8, - 99u8, 166u8, 78u8, 162u8, 34u8, 37u8, 158u8, 95u8, 74u8, - 137u8, 50u8, 43u8, 117u8, 166u8, 91u8, 212u8, 30u8, 243u8, - 67u8, 140u8, 66u8, 56u8, 206u8, - ] - { - let call = AwardChildBounty { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "award_child_bounty", + AwardChildBounty { parent_bounty_id, child_bounty_id, beneficiary, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 231u8, 185u8, 73u8, 232u8, 92u8, 116u8, 204u8, 165u8, 216u8, + 194u8, 151u8, 21u8, 127u8, 239u8, 78u8, 45u8, 27u8, 252u8, + 119u8, 23u8, 71u8, 140u8, 137u8, 209u8, 189u8, 128u8, 126u8, + 247u8, 13u8, 42u8, 68u8, 134u8, + ], + ) } #[doc = "Claim the payout from an awarded child-bounty after payout delay."] #[doc = ""] @@ -26147,38 +17830,21 @@ pub mod api { &self, parent_bounty_id: ::core::primitive::u32, child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClaimChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 54u8, 194u8, 203u8, 13u8, 230u8, 207u8, 25u8, 249u8, 203u8, - 199u8, 123u8, 79u8, 255u8, 85u8, 40u8, 125u8, 73u8, 5u8, - 126u8, 103u8, 205u8, 222u8, 232u8, 161u8, 178u8, 206u8, 39u8, - 5u8, 16u8, 167u8, 198u8, 93u8, - ] - { - let call = ClaimChildBounty { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "claim_child_bounty", + ClaimChildBounty { parent_bounty_id, child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 134u8, 243u8, 151u8, 228u8, 38u8, 174u8, 96u8, 140u8, 104u8, + 124u8, 166u8, 206u8, 126u8, 211u8, 17u8, 100u8, 172u8, 5u8, + 234u8, 171u8, 125u8, 2u8, 191u8, 163u8, 72u8, 29u8, 163u8, + 107u8, 65u8, 92u8, 41u8, 45u8, + ], + ) } #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] #[doc = "are transferred to parent bounty account. The child-bounty curator"] @@ -26206,38 +17872,21 @@ pub mod api { &self, parent_bounty_id: ::core::primitive::u32, child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CloseChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 123u8, 201u8, 206u8, 242u8, 80u8, 37u8, 113u8, 182u8, 237u8, - 187u8, 51u8, 229u8, 226u8, 250u8, 129u8, 203u8, 196u8, 22u8, - 91u8, 154u8, 118u8, 233u8, 254u8, 240u8, 113u8, 86u8, 55u8, - 5u8, 59u8, 15u8, 160u8, 204u8, - ] - { - let call = CloseChildBounty { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ChildBounties", + "close_child_bounty", + CloseChildBounty { parent_bounty_id, child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 40u8, 0u8, 235u8, 75u8, 36u8, 196u8, 29u8, 26u8, 30u8, 172u8, + 240u8, 44u8, 129u8, 243u8, 55u8, 211u8, 96u8, 159u8, 72u8, + 96u8, 142u8, 68u8, 41u8, 238u8, 157u8, 167u8, 90u8, 141u8, + 213u8, 249u8, 222u8, 22u8, + ], + ) } } } @@ -26245,604 +17894,411 @@ pub mod api { pub type Event = runtime_types::pallet_child_bounties::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A child-bounty is added."] pub struct Added { pub index: ::core::primitive::u32, pub child_index: ::core::primitive::u32, } - impl ::subxt::Event for Added { + impl ::subxt::events::StaticEvent for Added { const PALLET: &'static str = "ChildBounties"; const EVENT: &'static str = "Added"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A child-bounty is awarded to a beneficiary."] pub struct Awarded { pub index: ::core::primitive::u32, pub child_index: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Awarded { + impl ::subxt::events::StaticEvent for Awarded { const PALLET: &'static str = "ChildBounties"; const EVENT: &'static str = "Awarded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A child-bounty is claimed by beneficiary."] pub struct Claimed { pub index: ::core::primitive::u32, pub child_index: ::core::primitive::u32, pub payout: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Claimed { + impl ::subxt::events::StaticEvent for Claimed { const PALLET: &'static str = "ChildBounties"; const EVENT: &'static str = "Claimed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A child-bounty is cancelled."] pub struct Canceled { pub index: ::core::primitive::u32, pub child_index: ::core::primitive::u32, } - impl ::subxt::Event for Canceled { + impl ::subxt::events::StaticEvent for Canceled { const PALLET: &'static str = "ChildBounties"; const EVENT: &'static str = "Canceled"; } } pub mod storage { use super::runtime_types; - pub struct ChildBountyCount; - impl ::subxt::StorageEntry for ChildBountyCount { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildBountyCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParentChildBounties<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ParentChildBounties<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ParentChildBounties"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ChildBounties<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for ChildBounties<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildBounties"; - type Value = runtime_types::pallet_child_bounties::ChildBounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ChildBountyDescriptions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ChildBountyDescriptions<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildBountyDescriptions"; - type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ChildrenCuratorFees<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ChildrenCuratorFees<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildrenCuratorFees"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Number of total child bounties."] pub fn child_bounty_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 10u8, 183u8, 160u8, 98u8, 215u8, 39u8, 253u8, 81u8, - 94u8, 114u8, 147u8, 115u8, 162u8, 33u8, 117u8, 160u8, - 214u8, 167u8, 7u8, 109u8, 143u8, 158u8, 1u8, 200u8, - 205u8, 17u8, 93u8, 89u8, 26u8, 30u8, 95u8, - ] - { - let entry = ChildBountyCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildBountyCount", + vec![], + [ + 46u8, 10u8, 183u8, 160u8, 98u8, 215u8, 39u8, 253u8, 81u8, + 94u8, 114u8, 147u8, 115u8, 162u8, 33u8, 117u8, 160u8, 214u8, + 167u8, 7u8, 109u8, 143u8, 158u8, 1u8, 200u8, 205u8, 17u8, + 93u8, 89u8, 26u8, 30u8, 95u8, + ], + ) } #[doc = " Number of child bounties per parent bounty."] #[doc = " Map of parent bounty index to number of child bounties."] pub fn parent_child_bounties( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 127u8, 161u8, 181u8, 79u8, 235u8, 196u8, 252u8, 162u8, - 39u8, 15u8, 251u8, 49u8, 125u8, 80u8, 101u8, 24u8, 234u8, - 88u8, 212u8, 126u8, 63u8, 63u8, 19u8, 75u8, 137u8, 125u8, - 38u8, 250u8, 77u8, 49u8, 76u8, 188u8, - ] - { - let entry = ParentChildBounties(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ParentChildBounties", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 127u8, 161u8, 181u8, 79u8, 235u8, 196u8, 252u8, 162u8, 39u8, + 15u8, 251u8, 49u8, 125u8, 80u8, 101u8, 24u8, 234u8, 88u8, + 212u8, 126u8, 63u8, 63u8, 19u8, 75u8, 137u8, 125u8, 38u8, + 250u8, 77u8, 49u8, 76u8, 188u8, + ], + ) } #[doc = " Number of child bounties per parent bounty."] #[doc = " Map of parent bounty index to number of child bounties."] - pub fn parent_child_bounties_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ParentChildBounties<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 127u8, 161u8, 181u8, 79u8, 235u8, 196u8, 252u8, 162u8, - 39u8, 15u8, 251u8, 49u8, 125u8, 80u8, 101u8, 24u8, 234u8, - 88u8, 212u8, 126u8, 63u8, 63u8, 19u8, 75u8, 137u8, 125u8, - 38u8, 250u8, 77u8, 49u8, 76u8, 188u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn parent_child_bounties_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ParentChildBounties", + Vec::new(), + [ + 127u8, 161u8, 181u8, 79u8, 235u8, 196u8, 252u8, 162u8, 39u8, + 15u8, 251u8, 49u8, 125u8, 80u8, 101u8, 24u8, 234u8, 88u8, + 212u8, 126u8, 63u8, 63u8, 19u8, 75u8, 137u8, 125u8, 38u8, + 250u8, 77u8, 49u8, 76u8, 188u8, + ], + ) } #[doc = " Child bounties that have been added."] pub fn child_bounties( &self, - _0: &'a ::core::primitive::u32, - _1: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_child_bounties::ChildBounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_child_bounties::ChildBounty< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 66u8, 224u8, 32u8, 188u8, 0u8, 175u8, 253u8, 132u8, 17u8, - 243u8, 51u8, 237u8, 230u8, 40u8, 198u8, 178u8, 222u8, - 159u8, 99u8, 29u8, 237u8, 147u8, 183u8, 111u8, 103u8, - 195u8, 185u8, 27u8, 252u8, 2u8, 55u8, 108u8, - ] - { - let entry = ChildBounties(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildBounties", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 66u8, 132u8, 251u8, 223u8, 216u8, 52u8, 162u8, 150u8, 229u8, + 239u8, 219u8, 182u8, 211u8, 228u8, 181u8, 46u8, 243u8, 151u8, + 111u8, 235u8, 105u8, 40u8, 39u8, 10u8, 245u8, 113u8, 78u8, + 116u8, 219u8, 186u8, 165u8, 91u8, + ], + ) } #[doc = " Child bounties that have been added."] - pub fn child_bounties_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ChildBounties<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 66u8, 224u8, 32u8, 188u8, 0u8, 175u8, 253u8, 132u8, 17u8, - 243u8, 51u8, 237u8, 230u8, 40u8, 198u8, 178u8, 222u8, - 159u8, 99u8, 29u8, 237u8, 147u8, 183u8, 111u8, 103u8, - 195u8, 185u8, 27u8, 252u8, 2u8, 55u8, 108u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn child_bounties_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_child_bounties::ChildBounty< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildBounties", + Vec::new(), + [ + 66u8, 132u8, 251u8, 223u8, 216u8, 52u8, 162u8, 150u8, 229u8, + 239u8, 219u8, 182u8, 211u8, 228u8, 181u8, 46u8, 243u8, 151u8, + 111u8, 235u8, 105u8, 40u8, 39u8, 10u8, 245u8, 113u8, 78u8, + 116u8, 219u8, 186u8, 165u8, 91u8, + ], + ) } #[doc = " The description of each child-bounty."] pub fn child_bounty_descriptions( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 20u8, 134u8, 50u8, 207u8, 242u8, 159u8, 242u8, 22u8, - 76u8, 80u8, 193u8, 247u8, 73u8, 51u8, 113u8, 241u8, - 186u8, 26u8, 227u8, 44u8, 122u8, 189u8, 171u8, 137u8, - 31u8, 103u8, 184u8, 129u8, 31u8, 98u8, 19u8, 60u8, - ] - { - let entry = ChildBountyDescriptions(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildBountyDescriptions", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 193u8, 200u8, 40u8, 30u8, 14u8, 71u8, 90u8, 42u8, 58u8, + 253u8, 225u8, 158u8, 172u8, 10u8, 45u8, 238u8, 36u8, 144u8, + 184u8, 153u8, 11u8, 157u8, 125u8, 220u8, 175u8, 31u8, 28u8, + 93u8, 207u8, 212u8, 141u8, 74u8, + ], + ) } #[doc = " The description of each child-bounty."] - pub fn child_bounty_descriptions_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ChildBountyDescriptions<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 20u8, 134u8, 50u8, 207u8, 242u8, 159u8, 242u8, 22u8, - 76u8, 80u8, 193u8, 247u8, 73u8, 51u8, 113u8, 241u8, - 186u8, 26u8, 227u8, 44u8, 122u8, 189u8, 171u8, 137u8, - 31u8, 103u8, 184u8, 129u8, 31u8, 98u8, 19u8, 60u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn child_bounty_descriptions_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildBountyDescriptions", + Vec::new(), + [ + 193u8, 200u8, 40u8, 30u8, 14u8, 71u8, 90u8, 42u8, 58u8, + 253u8, 225u8, 158u8, 172u8, 10u8, 45u8, 238u8, 36u8, 144u8, + 184u8, 153u8, 11u8, 157u8, 125u8, 220u8, 175u8, 31u8, 28u8, + 93u8, 207u8, 212u8, 141u8, 74u8, + ], + ) } #[doc = " The cumulative child-bounty curator fee for each parent bounty."] pub fn children_curator_fees( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u128, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 128u8, 86u8, 179u8, 133u8, 76u8, 98u8, 169u8, - 234u8, 166u8, 249u8, 214u8, 172u8, 171u8, 8u8, 161u8, - 105u8, 69u8, 148u8, 151u8, 35u8, 174u8, 118u8, 139u8, - 101u8, 56u8, 85u8, 211u8, 121u8, 168u8, 0u8, 216u8, - ] - { - let entry = ChildrenCuratorFees(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildrenCuratorFees", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 174u8, 128u8, 86u8, 179u8, 133u8, 76u8, 98u8, 169u8, 234u8, + 166u8, 249u8, 214u8, 172u8, 171u8, 8u8, 161u8, 105u8, 69u8, + 148u8, 151u8, 35u8, 174u8, 118u8, 139u8, 101u8, 56u8, 85u8, + 211u8, 121u8, 168u8, 0u8, 216u8, + ], + ) } #[doc = " The cumulative child-bounty curator fee for each parent bounty."] - pub fn children_curator_fees_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ChildrenCuratorFees<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 128u8, 86u8, 179u8, 133u8, 76u8, 98u8, 169u8, - 234u8, 166u8, 249u8, 214u8, 172u8, 171u8, 8u8, 161u8, - 105u8, 69u8, 148u8, 151u8, 35u8, 174u8, 118u8, 139u8, - 101u8, 56u8, 85u8, 211u8, 121u8, 168u8, 0u8, 216u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn children_curator_fees_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ChildBounties", + "ChildrenCuratorFees", + Vec::new(), + [ + 174u8, 128u8, 86u8, 179u8, 133u8, 76u8, 98u8, 169u8, 234u8, + 166u8, 249u8, 214u8, 172u8, 171u8, 8u8, 161u8, 105u8, 69u8, + 148u8, 151u8, 35u8, 174u8, 118u8, 139u8, 101u8, 56u8, 85u8, + 211u8, 121u8, 168u8, 0u8, 216u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Maximum number of child bounties that can be added to a parent bounty."] pub fn max_active_child_bounty_count( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ChildBounties", "MaxActiveChildBountyCount")? - == [ - 118u8, 151u8, 94u8, 73u8, 30u8, 79u8, 217u8, 50u8, 98u8, - 108u8, 97u8, 243u8, 136u8, 184u8, 120u8, 141u8, 19u8, 204u8, - 233u8, 46u8, 86u8, 5u8, 76u8, 170u8, 80u8, 113u8, 192u8, 9u8, - 108u8, 89u8, 169u8, 241u8, - ] - { - let pallet = metadata.pallet("ChildBounties")?; - let constant = pallet.constant("MaxActiveChildBountyCount")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ChildBounties", + "MaxActiveChildBountyCount", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Minimum value for a child-bounty."] pub fn child_bounty_value_minimum( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ChildBounties", "ChildBountyValueMinimum")? - == [ - 42u8, 42u8, 180u8, 115u8, 221u8, 155u8, 245u8, 216u8, 68u8, - 88u8, 3u8, 177u8, 198u8, 36u8, 182u8, 210u8, 63u8, 29u8, 7u8, - 184u8, 208u8, 39u8, 118u8, 169u8, 87u8, 179u8, 105u8, 185u8, - 89u8, 167u8, 150u8, 73u8, - ] - { - let pallet = metadata.pallet("ChildBounties")?; - let constant = pallet.constant("ChildBountyValueMinimum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ChildBounties", + "ChildBountyValueMinimum", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } } pub mod tips { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReportAwesome { pub reason: ::std::vec::Vec<::core::primitive::u8>, - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ReportAwesome { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "report_awesome"; + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RetractTip { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for RetractTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "retract_tip"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct TipNew { pub reason: ::std::vec::Vec<::core::primitive::u8>, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, #[codec(compact)] pub tip_value: ::core::primitive::u128, } - impl ::subxt::Call for TipNew { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip_new"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Tip { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub tip_value: ::core::primitive::u128, } - impl ::subxt::Call for Tip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CloseTip { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for CloseTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "close_tip"; + pub hash: ::subxt::ext::sp_core::H256, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SlashTip { - pub hash: ::subxt::sp_core::H256, + pub hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Call for SlashTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "slash_tip"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] @@ -26865,36 +18321,19 @@ pub mod api { pub fn report_awesome( &self, reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportAwesome, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 90u8, 58u8, 149u8, 226u8, 88u8, 237u8, 150u8, 165u8, 172u8, - 179u8, 195u8, 226u8, 200u8, 20u8, 152u8, 103u8, 157u8, 208u8, - 86u8, 101u8, 178u8, 54u8, 42u8, 171u8, 172u8, 201u8, 20u8, - 254u8, 165u8, 7u8, 15u8, 197u8, - ] - { - let call = ReportAwesome { reason, who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "report_awesome", + ReportAwesome { reason, who }, + [ + 43u8, 6u8, 185u8, 209u8, 110u8, 99u8, 94u8, 100u8, 33u8, 5u8, + 27u8, 199u8, 67u8, 255u8, 252u8, 26u8, 104u8, 192u8, 55u8, + 122u8, 106u8, 129u8, 249u8, 181u8, 246u8, 205u8, 213u8, + 175u8, 241u8, 59u8, 151u8, 197u8, + ], + ) } #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] #[doc = ""] @@ -26917,36 +18356,19 @@ pub mod api { #[doc = "# "] pub fn retract_tip( &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RetractTip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 213u8, 70u8, 11u8, 81u8, 39u8, 125u8, 42u8, 247u8, 80u8, - 55u8, 123u8, 247u8, 45u8, 18u8, 86u8, 205u8, 26u8, 229u8, - 21u8, 106u8, 196u8, 125u8, 63u8, 65u8, 117u8, 219u8, 138u8, - 163u8, 161u8, 115u8, 157u8, 231u8, - ] - { - let call = RetractTip { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "retract_tip", + RetractTip { hash }, + [ + 137u8, 42u8, 229u8, 188u8, 157u8, 195u8, 184u8, 176u8, 64u8, + 142u8, 67u8, 175u8, 185u8, 207u8, 214u8, 71u8, 165u8, 29u8, + 137u8, 227u8, 132u8, 195u8, 255u8, 66u8, 186u8, 57u8, 34u8, + 184u8, 187u8, 65u8, 129u8, 131u8, + ], + ) } #[doc = "Give a tip for something new; no finder's fee will be taken."] #[doc = ""] @@ -26973,41 +18395,24 @@ pub mod api { pub fn tip_new( &self, reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, tip_value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TipNew, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 137u8, 119u8, 91u8, 139u8, 238u8, 180u8, 247u8, 5u8, 194u8, - 35u8, 33u8, 151u8, 50u8, 212u8, 208u8, 134u8, 98u8, 133u8, - 83u8, 212u8, 27u8, 218u8, 186u8, 188u8, 111u8, 102u8, 34u8, - 211u8, 112u8, 48u8, 98u8, 206u8, - ] - { - let call = TipNew { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "tip_new", + TipNew { reason, who, tip_value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 146u8, 216u8, 159u8, 132u8, 163u8, 180u8, 42u8, 203u8, 181u8, + 76u8, 217u8, 120u8, 75u8, 32u8, 165u8, 41u8, 250u8, 222u8, + 204u8, 63u8, 61u8, 218u8, 161u8, 37u8, 172u8, 10u8, 66u8, + 218u8, 14u8, 130u8, 160u8, 126u8, + ], + ) } #[doc = "Declare a tip value for an already-open tip."] #[doc = ""] @@ -27035,37 +18440,20 @@ pub mod api { #[doc = "# "] pub fn tip( &self, - hash: ::subxt::sp_core::H256, + hash: ::subxt::ext::sp_core::H256, tip_value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Tip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 2u8, 38u8, 219u8, 220u8, 183u8, 243u8, 108u8, 40u8, 179u8, - 21u8, 218u8, 158u8, 126u8, 19u8, 22u8, 115u8, 95u8, 17u8, - 73u8, 219u8, 179u8, 69u8, 60u8, 115u8, 196u8, 170u8, 23u8, - 218u8, 75u8, 9u8, 227u8, 204u8, - ] - { - let call = Tip { hash, tip_value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "tip", + Tip { hash, tip_value }, + [ + 133u8, 52u8, 131u8, 14u8, 71u8, 232u8, 254u8, 31u8, 33u8, + 206u8, 50u8, 76u8, 56u8, 167u8, 228u8, 202u8, 195u8, 0u8, + 164u8, 107u8, 170u8, 98u8, 192u8, 37u8, 209u8, 199u8, 130u8, + 15u8, 168u8, 63u8, 181u8, 134u8, + ], + ) } #[doc = "Close and payout a tip."] #[doc = ""] @@ -27085,36 +18473,19 @@ pub mod api { #[doc = "# "] pub fn close_tip( &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CloseTip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 85u8, 180u8, 115u8, 177u8, 2u8, 252u8, 139u8, 37u8, 233u8, - 127u8, 115u8, 4u8, 169u8, 169u8, 214u8, 223u8, 181u8, 150u8, - 137u8, 226u8, 99u8, 23u8, 205u8, 31u8, 160u8, 185u8, 97u8, - 128u8, 197u8, 110u8, 142u8, 160u8, - ] - { - let call = CloseTip { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "close_tip", + CloseTip { hash }, + [ + 32u8, 53u8, 0u8, 222u8, 45u8, 157u8, 107u8, 174u8, 203u8, + 50u8, 81u8, 230u8, 6u8, 111u8, 79u8, 55u8, 49u8, 151u8, + 107u8, 114u8, 81u8, 200u8, 144u8, 175u8, 29u8, 142u8, 115u8, + 184u8, 102u8, 116u8, 156u8, 173u8, + ], + ) } #[doc = "Remove and slash an already-open tip."] #[doc = ""] @@ -27130,36 +18501,19 @@ pub mod api { #[doc = "# "] pub fn slash_tip( &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SlashTip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 135u8, 7u8, 55u8, 167u8, 26u8, 108u8, 43u8, 20u8, 162u8, - 185u8, 209u8, 88u8, 148u8, 181u8, 51u8, 102u8, 17u8, 105u8, - 162u8, 223u8, 126u8, 46u8, 254u8, 79u8, 64u8, 248u8, 193u8, - 10u8, 110u8, 40u8, 5u8, 199u8, - ] - { - let call = SlashTip { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "slash_tip", + SlashTip { hash }, + [ + 222u8, 209u8, 22u8, 47u8, 114u8, 230u8, 81u8, 200u8, 131u8, + 0u8, 209u8, 54u8, 17u8, 200u8, 175u8, 125u8, 100u8, 254u8, + 41u8, 178u8, 20u8, 27u8, 9u8, 184u8, 79u8, 93u8, 208u8, + 148u8, 27u8, 190u8, 176u8, 169u8, + ], + ) } } } @@ -27167,427 +18521,336 @@ pub mod api { pub type Event = runtime_types::pallet_tips::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new tip suggestion has been opened."] pub struct NewTip { - pub tip_hash: ::subxt::sp_core::H256, + pub tip_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for NewTip { + impl ::subxt::events::StaticEvent for NewTip { const PALLET: &'static str = "Tips"; const EVENT: &'static str = "NewTip"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A tip suggestion has reached threshold and is closing."] pub struct TipClosing { - pub tip_hash: ::subxt::sp_core::H256, + pub tip_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for TipClosing { + impl ::subxt::events::StaticEvent for TipClosing { const PALLET: &'static str = "Tips"; const EVENT: &'static str = "TipClosing"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A tip suggestion has been closed."] pub struct TipClosed { - pub tip_hash: ::subxt::sp_core::H256, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub tip_hash: ::subxt::ext::sp_core::H256, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub payout: ::core::primitive::u128, } - impl ::subxt::Event for TipClosed { + impl ::subxt::events::StaticEvent for TipClosed { const PALLET: &'static str = "Tips"; const EVENT: &'static str = "TipClosed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A tip suggestion has been retracted."] pub struct TipRetracted { - pub tip_hash: ::subxt::sp_core::H256, + pub tip_hash: ::subxt::ext::sp_core::H256, } - impl ::subxt::Event for TipRetracted { + impl ::subxt::events::StaticEvent for TipRetracted { const PALLET: &'static str = "Tips"; const EVENT: &'static str = "TipRetracted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A tip suggestion has been slashed."] pub struct TipSlashed { - pub tip_hash: ::subxt::sp_core::H256, - pub finder: ::subxt::sp_core::crypto::AccountId32, + pub tip_hash: ::subxt::ext::sp_core::H256, + pub finder: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for TipSlashed { + impl ::subxt::events::StaticEvent for TipSlashed { const PALLET: &'static str = "Tips"; const EVENT: &'static str = "TipSlashed"; } } pub mod storage { use super::runtime_types; - pub struct Tips<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Tips<'_> { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Tips"; - type Value = runtime_types::pallet_tips::OpenTip< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Reasons<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reasons<'_> { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Reasons"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value."] #[doc = " This has the insecure enumerable hash function since the key itself is already"] #[doc = " guaranteed to be a secure hash."] pub fn tips( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_tips::OpenTip< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::sp_core::H256, - >, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_tips::OpenTip< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 147u8, 163u8, 201u8, 236u8, 134u8, 199u8, 172u8, 47u8, - 40u8, 168u8, 105u8, 145u8, 238u8, 204u8, 133u8, 116u8, - 185u8, 240u8, 122u8, 181u8, 102u8, 194u8, 38u8, 40u8, - 230u8, 215u8, 159u8, 71u8, 100u8, 240u8, 169u8, 64u8, - ] - { - let entry = Tips(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Tips", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 241u8, 196u8, 105u8, 248u8, 29u8, 66u8, 86u8, 98u8, 6u8, + 159u8, 191u8, 0u8, 227u8, 232u8, 147u8, 248u8, 173u8, 20u8, + 225u8, 12u8, 232u8, 5u8, 93u8, 78u8, 18u8, 154u8, 130u8, + 38u8, 142u8, 36u8, 66u8, 0u8, + ], + ) } #[doc = " TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value."] #[doc = " This has the insecure enumerable hash function since the key itself is already"] #[doc = " guaranteed to be a secure hash."] - pub fn tips_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Tips<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 147u8, 163u8, 201u8, 236u8, 134u8, 199u8, 172u8, 47u8, - 40u8, 168u8, 105u8, 145u8, 238u8, 204u8, 133u8, 116u8, - 185u8, 240u8, 122u8, 181u8, 102u8, 194u8, 38u8, 40u8, - 230u8, 215u8, 159u8, 71u8, 100u8, 240u8, 169u8, 64u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn tips_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_tips::OpenTip< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Tips", + Vec::new(), + [ + 241u8, 196u8, 105u8, 248u8, 29u8, 66u8, 86u8, 98u8, 6u8, + 159u8, 191u8, 0u8, 227u8, 232u8, 147u8, 248u8, 173u8, 20u8, + 225u8, 12u8, 232u8, 5u8, 93u8, 78u8, 18u8, 154u8, 130u8, + 38u8, 142u8, 36u8, 66u8, 0u8, + ], + ) } #[doc = " Simple preimage lookup from the reason's hash to the original data. Again, has an"] #[doc = " insecure enumerable hash since the key is guaranteed to be the result of a secure hash."] pub fn reasons( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 224u8, 172u8, 6u8, 195u8, 254u8, 210u8, 186u8, 62u8, - 224u8, 53u8, 196u8, 78u8, 84u8, 218u8, 0u8, 135u8, 247u8, - 130u8, 17u8, 93u8, 149u8, 220u8, 36u8, 61u8, 62u8, 60u8, - 210u8, 142u8, 24u8, 145u8, 151u8, 19u8, - ] - { - let entry = Reasons(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u8>, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Reasons", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 202u8, 191u8, 36u8, 162u8, 156u8, 102u8, 115u8, 10u8, 203u8, + 35u8, 201u8, 70u8, 195u8, 151u8, 89u8, 82u8, 202u8, 35u8, + 210u8, 176u8, 82u8, 1u8, 77u8, 94u8, 31u8, 70u8, 252u8, + 194u8, 166u8, 91u8, 189u8, 134u8, + ], + ) } #[doc = " Simple preimage lookup from the reason's hash to the original data. Again, has an"] #[doc = " insecure enumerable hash since the key is guaranteed to be the result of a secure hash."] - pub fn reasons_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Reasons<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 224u8, 172u8, 6u8, 195u8, 254u8, 210u8, 186u8, 62u8, - 224u8, 53u8, 196u8, 78u8, 84u8, 218u8, 0u8, 135u8, 247u8, - 130u8, 17u8, 93u8, 149u8, 220u8, 36u8, 61u8, 62u8, 60u8, - 210u8, 142u8, 24u8, 145u8, 151u8, 19u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn reasons_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u8>, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Reasons", + Vec::new(), + [ + 202u8, 191u8, 36u8, 162u8, 156u8, 102u8, 115u8, 10u8, 203u8, + 35u8, 201u8, 70u8, 195u8, 151u8, 89u8, 82u8, 202u8, 35u8, + 210u8, 176u8, 82u8, 1u8, 77u8, 94u8, 31u8, 70u8, 252u8, + 194u8, 166u8, 91u8, 189u8, 134u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Maximum acceptable reason length."] #[doc = ""] #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] pub fn maximum_reason_length( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Tips", "MaximumReasonLength")? - == [ - 137u8, 135u8, 60u8, 208u8, 169u8, 200u8, 219u8, 180u8, 48u8, - 114u8, 22u8, 9u8, 163u8, 54u8, 133u8, 198u8, 72u8, 186u8, - 183u8, 134u8, 130u8, 198u8, 61u8, 79u8, 86u8, 218u8, 212u8, - 166u8, 195u8, 81u8, 58u8, 191u8, - ] - { - let pallet = metadata.pallet("Tips")?; - let constant = pallet.constant("MaximumReasonLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Tips", + "MaximumReasonLength", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] pub fn data_deposit_per_byte( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Tips", "DataDepositPerByte")? - == [ - 70u8, 208u8, 250u8, 66u8, 143u8, 90u8, 112u8, 229u8, 138u8, - 156u8, 116u8, 16u8, 65u8, 250u8, 203u8, 188u8, 255u8, 123u8, - 211u8, 66u8, 19u8, 231u8, 22u8, 224u8, 95u8, 6u8, 164u8, - 26u8, 103u8, 226u8, 234u8, 89u8, - ] - { - let pallet = metadata.pallet("Tips")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Tips", + "DataDepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The period for which a tip remains open after is has achieved threshold tippers."] pub fn tip_countdown( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Tips", "TipCountdown")? - == [ - 77u8, 181u8, 253u8, 112u8, 168u8, 146u8, 251u8, 28u8, 30u8, - 194u8, 163u8, 60u8, 23u8, 147u8, 144u8, 89u8, 218u8, 9u8, - 171u8, 173u8, 214u8, 23u8, 123u8, 71u8, 94u8, 107u8, 78u8, - 3u8, 197u8, 203u8, 38u8, 220u8, - ] - { - let pallet = metadata.pallet("Tips")?; - let constant = pallet.constant("TipCountdown")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Tips", + "TipCountdown", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The percent of the final tip which goes to the original reporter of the tip."] pub fn tip_finders_fee( &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Percent, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Tips", "TipFindersFee")? - == [ - 27u8, 137u8, 241u8, 28u8, 69u8, 248u8, 212u8, 12u8, 176u8, - 157u8, 130u8, 223u8, 38u8, 193u8, 191u8, 102u8, 6u8, 0u8, - 9u8, 207u8, 111u8, 16u8, 182u8, 135u8, 198u8, 209u8, 210u8, - 247u8, 21u8, 135u8, 120u8, 62u8, - ] - { - let pallet = metadata.pallet("Tips")?; - let constant = pallet.constant("TipFindersFee")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Percent, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Tips", + "TipFindersFee", + [ + 99u8, 121u8, 176u8, 172u8, 235u8, 159u8, 116u8, 114u8, 179u8, + 91u8, 129u8, 117u8, 204u8, 135u8, 53u8, 7u8, 151u8, 26u8, + 124u8, 151u8, 202u8, 171u8, 171u8, 207u8, 183u8, 177u8, 24u8, + 53u8, 109u8, 185u8, 71u8, 183u8, + ], + ) } #[doc = " The amount held on deposit for placing a tip report."] pub fn tip_report_deposit_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Tips", "TipReportDepositBase")? - == [ - 101u8, 101u8, 22u8, 17u8, 169u8, 8u8, 182u8, 88u8, 11u8, - 146u8, 64u8, 157u8, 3u8, 242u8, 85u8, 122u8, 67u8, 198u8, - 96u8, 217u8, 154u8, 139u8, 58u8, 245u8, 172u8, 177u8, 71u8, - 217u8, 240u8, 7u8, 109u8, 92u8, - ] - { - let pallet = metadata.pallet("Tips")?; - let constant = pallet.constant("TipReportDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Tips", + "TipReportDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } } pub mod election_provider_multi_phase { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SubmitUnsigned { pub raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , pub witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } - impl ::subxt::Call for SubmitUnsigned { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit_unsigned"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetMinimumUntrustedScore { pub maybe_next_score: ::core::option::Option< runtime_types::sp_npos_elections::ElectionScore, >, } - impl ::subxt::Call for SetMinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_minimum_untrusted_score"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetEmergencyElectionResult { pub supports: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, )>, } - impl ::subxt::Call for SetEmergencyElectionResult { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_emergency_election_result"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Submit { pub raw_solution: ::std::boxed::Box< runtime_types::pallet_election_provider_multi_phase::RawSolution< @@ -27595,34 +18858,17 @@ pub mod api { >, >, } - impl ::subxt::Call for Submit { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct GovernanceFallback { pub maybe_max_voters: ::core::option::Option<::core::primitive::u32>, pub maybe_max_targets: ::core::option::Option<::core::primitive::u32>, } - impl ::subxt::Call for GovernanceFallback { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "governance_fallback"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Submit a solution for the unsigned phase."] #[doc = ""] #[doc = "The dispatch origin fo this call must be __none__."] @@ -27641,38 +18887,21 @@ pub mod api { &self, raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SubmitUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 212u8, 126u8, 4u8, 62u8, 15u8, 223u8, 54u8, 80u8, 27u8, 96u8, - 170u8, 169u8, 238u8, 149u8, 139u8, 190u8, 179u8, 158u8, - 126u8, 191u8, 50u8, 201u8, 108u8, 200u8, 78u8, 139u8, 92u8, - 69u8, 50u8, 239u8, 51u8, 18u8, - ] - { - let call = SubmitUnsigned { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "submit_unsigned", + SubmitUnsigned { raw_solution: ::std::boxed::Box::new(raw_solution), witness, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 100u8, 240u8, 31u8, 34u8, 93u8, 98u8, 93u8, 57u8, 41u8, + 197u8, 97u8, 58u8, 242u8, 10u8, 69u8, 250u8, 185u8, 169u8, + 21u8, 8u8, 202u8, 61u8, 36u8, 25u8, 4u8, 148u8, 82u8, 56u8, + 242u8, 18u8, 27u8, 219u8, + ], + ) } #[doc = "Set a new value for `MinimumUntrustedScore`."] #[doc = ""] @@ -27684,35 +18913,19 @@ pub mod api { maybe_next_score: ::core::option::Option< runtime_types::sp_npos_elections::ElectionScore, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMinimumUntrustedScore, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 207u8, 31u8, 247u8, 72u8, 55u8, 18u8, 99u8, 157u8, 155u8, - 89u8, 59u8, 156u8, 254u8, 3u8, 181u8, 85u8, 48u8, 42u8, 73u8, - 243u8, 35u8, 90u8, 142u8, 14u8, 62u8, 48u8, 15u8, 125u8, - 194u8, 103u8, 2u8, 175u8, - ] - { - let call = SetMinimumUntrustedScore { maybe_next_score }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "set_minimum_untrusted_score", + SetMinimumUntrustedScore { maybe_next_score }, + [ + 63u8, 101u8, 105u8, 146u8, 133u8, 162u8, 149u8, 112u8, 150u8, + 219u8, 183u8, 213u8, 234u8, 211u8, 144u8, 74u8, 106u8, 15u8, + 62u8, 196u8, 247u8, 49u8, 20u8, 48u8, 3u8, 105u8, 85u8, 46u8, + 76u8, 4u8, 67u8, 81u8, + ], + ) } #[doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] #[doc = "call to `ElectionProvider::elect`."] @@ -27725,40 +18938,24 @@ pub mod api { pub fn set_emergency_election_result( &self, supports: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetEmergencyElectionResult, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 195u8, 164u8, 133u8, 193u8, 58u8, 154u8, 182u8, 83u8, 231u8, - 217u8, 199u8, 27u8, 239u8, 143u8, 60u8, 103u8, 139u8, 253u8, - 49u8, 242u8, 8u8, 41u8, 160u8, 192u8, 123u8, 98u8, 137u8, - 13u8, 170u8, 167u8, 246u8, 175u8, - ] - { - let call = SetEmergencyElectionResult { supports }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "set_emergency_election_result", + SetEmergencyElectionResult { supports }, + [ + 115u8, 255u8, 205u8, 58u8, 153u8, 1u8, 246u8, 8u8, 225u8, + 36u8, 66u8, 144u8, 250u8, 145u8, 70u8, 76u8, 54u8, 63u8, + 251u8, 51u8, 214u8, 204u8, 55u8, 112u8, 46u8, 228u8, 255u8, + 250u8, 151u8, 5u8, 44u8, 133u8, + ], + ) } #[doc = "Submit a solution for the signed phase."] #[doc = ""] @@ -27772,37 +18969,20 @@ pub mod api { pub fn submit( &self, raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Submit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 2u8, 131u8, 162u8, 38u8, 102u8, 73u8, 144u8, 71u8, 200u8, - 229u8, 140u8, 38u8, 58u8, 159u8, 59u8, 167u8, 91u8, 169u8, - 22u8, 228u8, 127u8, 153u8, 125u8, 241u8, 60u8, 61u8, 103u8, - 192u8, 95u8, 87u8, 81u8, 73u8, - ] - { - let call = Submit { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "submit", + Submit { raw_solution: ::std::boxed::Box::new(raw_solution), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 220u8, 167u8, 40u8, 47u8, 253u8, 244u8, 72u8, 124u8, 30u8, + 123u8, 127u8, 227u8, 2u8, 66u8, 119u8, 64u8, 211u8, 200u8, + 210u8, 98u8, 248u8, 132u8, 68u8, 25u8, 34u8, 182u8, 230u8, + 225u8, 241u8, 58u8, 193u8, 134u8, + ], + ) } #[doc = "Trigger the governance fallback."] #[doc = ""] @@ -27812,38 +18992,21 @@ pub mod api { &self, maybe_max_voters: ::core::option::Option<::core::primitive::u32>, maybe_max_targets: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - GovernanceFallback, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 195u8, 190u8, 140u8, 94u8, 209u8, 100u8, 92u8, 194u8, 78u8, - 226u8, 16u8, 168u8, 52u8, 117u8, 88u8, 178u8, 84u8, 248u8, - 117u8, 38u8, 152u8, 71u8, 37u8, 158u8, 77u8, 204u8, 59u8, - 184u8, 22u8, 239u8, 92u8, 209u8, - ] - { - let call = GovernanceFallback { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "governance_fallback", + GovernanceFallback { maybe_max_voters, maybe_max_targets, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 206u8, 247u8, 76u8, 85u8, 7u8, 24u8, 231u8, 226u8, 192u8, + 143u8, 43u8, 67u8, 91u8, 202u8, 88u8, 176u8, 130u8, 1u8, + 83u8, 229u8, 227u8, 200u8, 179u8, 4u8, 113u8, 60u8, 99u8, + 190u8, 53u8, 226u8, 142u8, 182u8, + ], + ) } } } @@ -27852,7 +19015,11 @@ pub mod api { runtime_types::pallet_election_provider_multi_phase::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A solution was stored with the given compute."] #[doc = ""] #[doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] @@ -27864,11 +19031,15 @@ pub mod api { runtime_types::pallet_election_provider_multi_phase::ElectionCompute, pub prev_ejected: ::core::primitive::bool, } - impl ::subxt::Event for SolutionStored { + impl ::subxt::events::StaticEvent for SolutionStored { const PALLET: &'static str = "ElectionProviderMultiPhase"; const EVENT: &'static str = "SolutionStored"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The election has been finalized, with `Some` of the given computation, or else if the"] #[doc = "election failed, `None`."] pub struct ElectionFinalized { @@ -27876,167 +19047,71 @@ pub mod api { runtime_types::pallet_election_provider_multi_phase::ElectionCompute, >, } - impl ::subxt::Event for ElectionFinalized { + impl ::subxt::events::StaticEvent for ElectionFinalized { const PALLET: &'static str = "ElectionProviderMultiPhase"; const EVENT: &'static str = "ElectionFinalized"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has been rewarded for their signed submission being finalized."] pub struct Rewarded { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub value: ::core::primitive::u128, } - impl ::subxt::Event for Rewarded { + impl ::subxt::events::StaticEvent for Rewarded { const PALLET: &'static str = "ElectionProviderMultiPhase"; const EVENT: &'static str = "Rewarded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An account has been slashed for submitting an invalid signed submission."] pub struct Slashed { - pub account: ::subxt::sp_core::crypto::AccountId32, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, pub value: ::core::primitive::u128, } - impl ::subxt::Event for Slashed { + impl ::subxt::events::StaticEvent for Slashed { const PALLET: &'static str = "ElectionProviderMultiPhase"; const EVENT: &'static str = "Slashed"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "The signed phase of the given round has started."] pub struct SignedPhaseStarted { pub round: ::core::primitive::u32, } - impl ::subxt::Event for SignedPhaseStarted { + impl ::subxt::events::StaticEvent for SignedPhaseStarted { const PALLET: &'static str = "ElectionProviderMultiPhase"; const EVENT: &'static str = "SignedPhaseStarted"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "The unsigned phase of the given round has started."] pub struct UnsignedPhaseStarted { pub round: ::core::primitive::u32, } - impl ::subxt::Event for UnsignedPhaseStarted { + impl ::subxt::events::StaticEvent for UnsignedPhaseStarted { const PALLET: &'static str = "ElectionProviderMultiPhase"; const EVENT: &'static str = "UnsignedPhaseStarted"; } } pub mod storage { use super::runtime_types; - pub struct Round; - impl ::subxt::StorageEntry for Round { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "Round"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentPhase; - impl ::subxt::StorageEntry for CurrentPhase { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "CurrentPhase"; - type Value = runtime_types::pallet_election_provider_multi_phase::Phase< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedSolution; - impl ::subxt::StorageEntry for QueuedSolution { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "QueuedSolution"; - type Value = - runtime_types::pallet_election_provider_multi_phase::ReadySolution< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Snapshot; - impl ::subxt::StorageEntry for Snapshot { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "Snapshot"; - type Value = - runtime_types::pallet_election_provider_multi_phase::RoundSnapshot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DesiredTargets; - impl ::subxt::StorageEntry for DesiredTargets { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "DesiredTargets"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SnapshotMetadata; - impl ::subxt::StorageEntry for SnapshotMetadata { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SnapshotMetadata"; - type Value = runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionNextIndex; - impl ::subxt::StorageEntry for SignedSubmissionNextIndex { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionNextIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionIndices; - impl ::subxt::StorageEntry for SignedSubmissionIndices { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionIndices"; - type Value = runtime_types :: sp_runtime :: bounded :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionsMap<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for SignedSubmissionsMap<'_> { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionsMap"; - type Value = runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MinimumUntrustedScore; - impl ::subxt::StorageEntry for MinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "MinimumUntrustedScore"; - type Value = runtime_types::sp_npos_elections::ElectionScore; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Internal counter for the number of rounds."] #[doc = ""] #[doc = " This is useful for de-duplication of transactions submitted to the pool, and general"] @@ -28045,193 +19120,114 @@ pub mod api { #[doc = " This is merely incremented once per every time that an upstream `elect` is called."] pub fn round( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 16u8, 49u8, 176u8, 52u8, 202u8, 111u8, 120u8, 8u8, 217u8, - 96u8, 35u8, 14u8, 233u8, 130u8, 47u8, 98u8, 34u8, 44u8, - 166u8, 188u8, 199u8, 210u8, 21u8, 19u8, 70u8, 96u8, - 139u8, 8u8, 53u8, 82u8, 165u8, 239u8, - ] - { - let entry = Round; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "Round", + vec![], + [ + 16u8, 49u8, 176u8, 52u8, 202u8, 111u8, 120u8, 8u8, 217u8, + 96u8, 35u8, 14u8, 233u8, 130u8, 47u8, 98u8, 34u8, 44u8, + 166u8, 188u8, 199u8, 210u8, 21u8, 19u8, 70u8, 96u8, 139u8, + 8u8, 53u8, 82u8, 165u8, 239u8, + ], + ) } #[doc = " Current phase."] pub fn current_phase( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::pallet_election_provider_multi_phase::Phase< ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 162u8, 177u8, 133u8, 63u8, 175u8, 78u8, 85u8, 0u8, 233u8, - 84u8, 10u8, 250u8, 190u8, 39u8, 101u8, 11u8, 52u8, 31u8, - 129u8, 151u8, 63u8, 179u8, 120u8, 28u8, 70u8, 61u8, 91u8, - 153u8, 95u8, 32u8, 33u8, 157u8, - ] - { - let entry = CurrentPhase; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Current best solution, signed or unsigned, queued to be returned upon `elect`."] pub fn queued_solution (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 145u8, 177u8, 147u8, 52u8, 30u8, 135u8, 33u8, 145u8, - 204u8, 82u8, 1u8, 165u8, 208u8, 39u8, 181u8, 2u8, 96u8, - 236u8, 19u8, 144u8, 87u8, 197u8, 25u8, 164u8, 116u8, 0u8, - 120u8, 245u8, 154u8, 30u8, 191u8, 155u8, - ] - { - let entry = QueuedSolution; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "CurrentPhase", + vec![], + [ + 236u8, 101u8, 8u8, 52u8, 68u8, 240u8, 74u8, 159u8, 181u8, + 53u8, 153u8, 101u8, 228u8, 81u8, 96u8, 161u8, 34u8, 67u8, + 35u8, 28u8, 121u8, 44u8, 229u8, 45u8, 196u8, 87u8, 73u8, + 125u8, 216u8, 245u8, 255u8, 15u8, + ], + ) + } + #[doc = " Current best solution, signed or unsigned, queued to be returned upon `elect`."] pub fn queued_solution (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > , :: subxt :: storage :: address :: Yes , () , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "QueuedSolution", + vec![], + [ + 149u8, 246u8, 152u8, 57u8, 54u8, 217u8, 14u8, 124u8, 125u8, + 202u8, 242u8, 149u8, 147u8, 201u8, 168u8, 99u8, 249u8, 17u8, + 163u8, 184u8, 254u8, 115u8, 100u8, 108u8, 28u8, 14u8, 139u8, + 215u8, 26u8, 93u8, 215u8, 251u8, + ], + ) } #[doc = " Snapshot data of the round."] #[doc = ""] - #[doc = " This is created at the beginning of the signed phase and cleared upon calling `elect`."] pub fn snapshot (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 28u8, 163u8, 105u8, 94u8, 66u8, 226u8, 134u8, 29u8, - 210u8, 211u8, 182u8, 236u8, 180u8, 109u8, 203u8, 44u8, - 1u8, 50u8, 112u8, 201u8, 200u8, 12u8, 88u8, 248u8, 253u8, - 182u8, 56u8, 156u8, 169u8, 179u8, 19u8, 161u8, - ] - { - let entry = Snapshot; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " This is created at the beginning of the signed phase and cleared upon calling `elect`."] pub fn snapshot (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot > , :: subxt :: storage :: address :: Yes , () , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "Snapshot", + vec![], + [ + 239u8, 56u8, 191u8, 77u8, 150u8, 224u8, 248u8, 88u8, 132u8, + 224u8, 164u8, 83u8, 253u8, 36u8, 46u8, 156u8, 72u8, 152u8, + 36u8, 206u8, 72u8, 27u8, 226u8, 87u8, 146u8, 220u8, 93u8, + 178u8, 26u8, 115u8, 232u8, 71u8, + ], + ) } #[doc = " Desired number of targets to elect for this round."] #[doc = ""] #[doc = " Only exists when [`Snapshot`] is present."] pub fn desired_targets( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 16u8, 247u8, 4u8, 181u8, 93u8, 79u8, 12u8, 212u8, 146u8, - 167u8, 80u8, 58u8, 118u8, 52u8, 68u8, 87u8, 90u8, 140u8, - 31u8, 210u8, 2u8, 116u8, 220u8, 231u8, 115u8, 112u8, - 118u8, 118u8, 68u8, 34u8, 151u8, 165u8, - ] - { - let entry = DesiredTargets; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "DesiredTargets", + vec![], + [ + 16u8, 247u8, 4u8, 181u8, 93u8, 79u8, 12u8, 212u8, 146u8, + 167u8, 80u8, 58u8, 118u8, 52u8, 68u8, 87u8, 90u8, 140u8, + 31u8, 210u8, 2u8, 116u8, 220u8, 231u8, 115u8, 112u8, 118u8, + 118u8, 68u8, 34u8, 151u8, 165u8, + ], + ) } #[doc = " The metadata of the [`RoundSnapshot`]"] #[doc = ""] - #[doc = " Only exists when [`Snapshot`] is present."] pub fn snapshot_metadata (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 240u8, 57u8, 126u8, 76u8, 84u8, 244u8, 120u8, 136u8, - 164u8, 49u8, 185u8, 89u8, 126u8, 18u8, 117u8, 235u8, - 33u8, 226u8, 173u8, 254u8, 79u8, 194u8, 154u8, 123u8, - 29u8, 237u8, 116u8, 185u8, 36u8, 248u8, 46u8, 103u8, - ] - { - let entry = SnapshotMetadata; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " Only exists when [`Snapshot`] is present."] pub fn snapshot_metadata (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: storage :: address :: Yes , () , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SnapshotMetadata", + vec![], + [ + 135u8, 122u8, 60u8, 75u8, 194u8, 240u8, 187u8, 96u8, 240u8, + 203u8, 192u8, 22u8, 117u8, 148u8, 118u8, 24u8, 240u8, 213u8, + 94u8, 22u8, 194u8, 47u8, 181u8, 245u8, 77u8, 149u8, 11u8, + 251u8, 117u8, 220u8, 205u8, 78u8, + ], + ) } #[doc = " The next index to be assigned to an incoming signed submission."] #[doc = ""] @@ -28244,68 +19240,41 @@ pub mod api { #[doc = " because iteration is slow. Instead, we store the value here."] pub fn signed_submission_next_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 242u8, 11u8, 157u8, 105u8, 96u8, 7u8, 31u8, 20u8, 51u8, - 141u8, 182u8, 180u8, 13u8, 172u8, 155u8, 59u8, 42u8, - 238u8, 115u8, 8u8, 6u8, 137u8, 45u8, 2u8, 123u8, 187u8, - 53u8, 215u8, 19u8, 129u8, 54u8, 22u8, - ] - { - let entry = SignedSubmissionNextIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionNextIndex", + vec![], + [ + 242u8, 11u8, 157u8, 105u8, 96u8, 7u8, 31u8, 20u8, 51u8, + 141u8, 182u8, 180u8, 13u8, 172u8, 155u8, 59u8, 42u8, 238u8, + 115u8, 8u8, 6u8, 137u8, 45u8, 2u8, 123u8, 187u8, 53u8, 215u8, + 19u8, 129u8, 54u8, 22u8, + ], + ) } #[doc = " A sorted, bounded set of `(score, index)`, where each `index` points to a value in"] #[doc = " `SignedSubmissions`."] #[doc = ""] #[doc = " We never need to process more than a single signed submission at a time. Signed submissions"] #[doc = " can be quite large, so we're willing to pay the cost of multiple database accesses to access"] - #[doc = " them one at a time instead of reading and decoding all of them at once."] pub fn signed_submission_indices (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: sp_runtime :: bounded :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 191u8, 143u8, 241u8, 251u8, 74u8, 9u8, 145u8, 136u8, - 135u8, 76u8, 182u8, 85u8, 140u8, 252u8, 58u8, 183u8, - 217u8, 121u8, 213u8, 200u8, 167u8, 89u8, 15u8, 212u8, - 62u8, 90u8, 192u8, 214u8, 130u8, 196u8, 14u8, 175u8, - ] - { - let entry = SignedSubmissionIndices; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " them one at a time instead of reading and decoding all of them at once."] pub fn signed_submission_indices (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_runtime :: bounded :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionIndices", + vec![], + [ + 121u8, 119u8, 26u8, 183u8, 167u8, 33u8, 230u8, 159u8, 230u8, + 171u8, 8u8, 52u8, 178u8, 214u8, 245u8, 148u8, 202u8, 6u8, + 7u8, 50u8, 84u8, 174u8, 253u8, 131u8, 235u8, 136u8, 40u8, + 83u8, 2u8, 64u8, 9u8, 83u8, + ], + ) } #[doc = " Unchecked, signed solutions."] #[doc = ""] @@ -28313,31 +19282,21 @@ pub mod api { #[doc = " allowing us to keep only a single one in memory at a time."] #[doc = ""] #[doc = " Twox note: the key of the map is an auto-incrementing index which users cannot inspect or"] - #[doc = " affect; we shouldn't need a cryptographically secure hasher."] pub fn signed_submissions_map (& self , _0 : & 'a :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 75u8, 2u8, 76u8, 74u8, 73u8, 167u8, 243u8, 1u8, 31u8, - 26u8, 48u8, 196u8, 177u8, 21u8, 233u8, 66u8, 251u8, 11u8, - 11u8, 252u8, 63u8, 206u8, 115u8, 116u8, 73u8, 232u8, - 241u8, 179u8, 249u8, 34u8, 61u8, 171u8, - ] - { - let entry = SignedSubmissionsMap(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " affect; we shouldn't need a cryptographically secure hasher."] pub fn signed_submissions_map (& self , _0 : impl :: std :: borrow :: Borrow < :: core :: primitive :: u32 > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: ext :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , :: subxt :: storage :: address :: Yes , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionsMap", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 84u8, 65u8, 205u8, 191u8, 143u8, 246u8, 239u8, 27u8, 243u8, + 54u8, 250u8, 8u8, 125u8, 32u8, 241u8, 141u8, 210u8, 225u8, + 56u8, 101u8, 241u8, 52u8, 157u8, 29u8, 13u8, 155u8, 73u8, + 132u8, 118u8, 53u8, 2u8, 135u8, + ], + ) } #[doc = " Unchecked, signed solutions."] #[doc = ""] @@ -28345,39 +19304,18 @@ pub mod api { #[doc = " allowing us to keep only a single one in memory at a time."] #[doc = ""] #[doc = " Twox note: the key of the map is an auto-incrementing index which users cannot inspect or"] - #[doc = " affect; we shouldn't need a cryptographically secure hasher."] - pub fn signed_submissions_map_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SignedSubmissionsMap<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 75u8, 2u8, 76u8, 74u8, 73u8, 167u8, 243u8, 1u8, 31u8, - 26u8, 48u8, 196u8, 177u8, 21u8, 233u8, 66u8, 251u8, 11u8, - 11u8, 252u8, 63u8, 206u8, 115u8, 116u8, 73u8, 232u8, - 241u8, 179u8, 249u8, 34u8, 61u8, 171u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " affect; we shouldn't need a cryptographically secure hasher."] pub fn signed_submissions_map_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: ext :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , () , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionsMap", + Vec::new(), + [ + 84u8, 65u8, 205u8, 191u8, 143u8, 246u8, 239u8, 27u8, 243u8, + 54u8, 250u8, 8u8, 125u8, 32u8, 241u8, 141u8, 210u8, 225u8, + 56u8, 101u8, 241u8, 52u8, 157u8, 29u8, 13u8, 155u8, 73u8, + 132u8, 118u8, 53u8, 2u8, 135u8, + ], + ) } #[doc = " The minimum score that each 'untrusted' solution must attain in order to be considered"] #[doc = " feasible."] @@ -28385,156 +19323,105 @@ pub mod api { #[doc = " Can be set via `set_minimum_untrusted_score`."] pub fn minimum_untrusted_score( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::sp_npos_elections::ElectionScore, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 18u8, 171u8, 56u8, 63u8, 7u8, 1u8, 53u8, 42u8, 72u8, - 35u8, 26u8, 124u8, 223u8, 95u8, 170u8, 176u8, 134u8, - 140u8, 66u8, 115u8, 51u8, 163u8, 202u8, 82u8, 189u8, - 180u8, 139u8, 98u8, 18u8, 14u8, 176u8, 66u8, - ] - { - let entry = MinimumUntrustedScore; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_npos_elections::ElectionScore, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "MinimumUntrustedScore", + vec![], + [ + 77u8, 235u8, 181u8, 45u8, 230u8, 12u8, 0u8, 179u8, 152u8, + 38u8, 74u8, 199u8, 47u8, 84u8, 85u8, 55u8, 171u8, 226u8, + 217u8, 125u8, 17u8, 194u8, 95u8, 157u8, 73u8, 245u8, 75u8, + 130u8, 248u8, 7u8, 53u8, 226u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " Duration of the unsigned phase."] pub fn unsigned_phase( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "UnsignedPhase")? - == [ - 252u8, 58u8, 254u8, 55u8, 124u8, 222u8, 252u8, 218u8, 73u8, - 211u8, 18u8, 206u8, 233u8, 17u8, 202u8, 176u8, 32u8, 189u8, - 143u8, 185u8, 56u8, 120u8, 184u8, 158u8, 10u8, 166u8, 193u8, - 36u8, 118u8, 58u8, 239u8, 95u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("UnsignedPhase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "UnsignedPhase", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Duration of the signed phase."] pub fn signed_phase( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "SignedPhase")? - == [ - 63u8, 15u8, 168u8, 217u8, 6u8, 184u8, 197u8, 27u8, 10u8, - 102u8, 5u8, 140u8, 61u8, 101u8, 26u8, 255u8, 226u8, 2u8, - 58u8, 242u8, 169u8, 115u8, 80u8, 199u8, 6u8, 8u8, 212u8, - 243u8, 171u8, 167u8, 102u8, 73u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedPhase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedPhase", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The minimum amount of improvement to the solution score that defines a solution as"] #[doc = " \"better\" in the Signed phase."] pub fn better_signed_threshold( &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Perbill, + >, > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "BetterSignedThreshold", - )? == [ - 77u8, 124u8, 224u8, 100u8, 113u8, 25u8, 159u8, 166u8, 136u8, - 195u8, 84u8, 168u8, 142u8, 209u8, 89u8, 249u8, 7u8, 218u8, 51u8, - 240u8, 211u8, 135u8, 183u8, 192u8, 194u8, 195u8, 107u8, 37u8, - 23u8, 191u8, 254u8, 185u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("BetterSignedThreshold")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, + 19u8, 87u8, 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, + 225u8, 53u8, 212u8, 52u8, 177u8, 79u8, 4u8, 116u8, 201u8, + 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) } #[doc = " The minimum amount of improvement to the solution score that defines a solution as"] #[doc = " \"better\" in the Unsigned phase."] pub fn better_unsigned_threshold( &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Perbill, + >, > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "BetterUnsignedThreshold", - )? == [ - 38u8, 62u8, 189u8, 136u8, 151u8, 166u8, 34u8, 147u8, 119u8, 70u8, - 126u8, 29u8, 200u8, 206u8, 195u8, 24u8, 14u8, 80u8, 151u8, 132u8, - 83u8, 135u8, 206u8, 68u8, 169u8, 75u8, 1u8, 40u8, 186u8, 203u8, - 226u8, 118u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("BetterUnsignedThreshold")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, + 19u8, 87u8, 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, + 225u8, 53u8, 212u8, 52u8, 177u8, 79u8, 4u8, 116u8, 201u8, + 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) } #[doc = " The repeat threshold of the offchain worker."] #[doc = ""] @@ -28542,52 +19429,36 @@ pub mod api { #[doc = " to submit the worker's solution."] pub fn offchain_repeat( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "OffchainRepeat")? - == [ - 55u8, 45u8, 136u8, 82u8, 224u8, 82u8, 150u8, 198u8, 78u8, - 58u8, 31u8, 9u8, 161u8, 129u8, 11u8, 112u8, 146u8, 226u8, - 210u8, 94u8, 167u8, 169u8, 146u8, 149u8, 110u8, 122u8, 168u8, - 148u8, 73u8, 100u8, 166u8, 103u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("OffchainRepeat")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "OffchainRepeat", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The priority of the unsigned transaction submitted in the unsigned-phase"] pub fn miner_tx_priority( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "MinerTxPriority")? - == [ - 153u8, 173u8, 61u8, 171u8, 80u8, 43u8, 214u8, 150u8, 233u8, - 153u8, 197u8, 226u8, 116u8, 21u8, 156u8, 154u8, 131u8, 241u8, - 214u8, 151u8, 136u8, 203u8, 251u8, 42u8, 170u8, 221u8, 211u8, - 97u8, 45u8, 93u8, 60u8, 5u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MinerTxPriority")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "MinerTxPriority", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } #[doc = " Maximum number of signed submissions that can be queued."] #[doc = ""] @@ -28598,27 +19469,19 @@ pub mod api { #[doc = " attempts to submit new solutions may cause a runtime panic."] pub fn signed_max_submissions( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "SignedMaxSubmissions", - )? == [ - 51u8, 141u8, 203u8, 103u8, 212u8, 173u8, 160u8, 148u8, 108u8, - 30u8, 104u8, 248u8, 65u8, 237u8, 167u8, 11u8, 102u8, 146u8, - 117u8, 133u8, 0u8, 61u8, 129u8, 138u8, 157u8, 221u8, 248u8, 33u8, - 118u8, 182u8, 199u8, 248u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedMaxSubmissions")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Maximum weight of a signed solution."] #[doc = ""] @@ -28627,251 +19490,170 @@ pub mod api { #[doc = " this value."] pub fn signed_max_weight( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "SignedMaxWeight")? - == [ - 117u8, 253u8, 133u8, 43u8, 175u8, 132u8, 239u8, 225u8, 67u8, - 29u8, 254u8, 37u8, 97u8, 178u8, 196u8, 155u8, 18u8, 178u8, - 230u8, 237u8, 183u8, 47u8, 252u8, 120u8, 8u8, 253u8, 32u8, - 21u8, 210u8, 122u8, 220u8, 10u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedMaxWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedMaxWeight", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } #[doc = " The maximum amount of unchecked solutions to refund the call fee for."] pub fn signed_max_refunds( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "SignedMaxRefunds")? - == [ - 86u8, 134u8, 190u8, 26u8, 28u8, 169u8, 156u8, 24u8, 50u8, - 139u8, 26u8, 80u8, 81u8, 111u8, 60u8, 175u8, 250u8, 7u8, - 92u8, 177u8, 191u8, 226u8, 198u8, 12u8, 179u8, 243u8, 38u8, - 21u8, 212u8, 121u8, 52u8, 148u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedMaxRefunds")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedMaxRefunds", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " Base reward for a signed solution"] pub fn signed_reward_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata - .constant_hash("ElectionProviderMultiPhase", "SignedRewardBase")? - == [ - 32u8, 167u8, 245u8, 56u8, 96u8, 125u8, 239u8, 237u8, 40u8, - 201u8, 204u8, 55u8, 92u8, 234u8, 12u8, 129u8, 215u8, 35u8, - 67u8, 199u8, 150u8, 222u8, 178u8, 242u8, 35u8, 177u8, 104u8, - 145u8, 162u8, 129u8, 28u8, 87u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedRewardBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedRewardBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Base deposit for a signed solution."] pub fn signed_deposit_base( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "SignedDepositBase", - )? == [ - 81u8, 103u8, 118u8, 215u8, 167u8, 76u8, 76u8, 213u8, 52u8, 45u8, - 186u8, 167u8, 71u8, 75u8, 193u8, 59u8, 156u8, 7u8, 199u8, 110u8, - 166u8, 131u8, 227u8, 92u8, 168u8, 138u8, 125u8, 16u8, 131u8, - 167u8, 156u8, 157u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Per-byte deposit for a signed solution."] pub fn signed_deposit_byte( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "SignedDepositByte", - )? == [ - 86u8, 255u8, 18u8, 115u8, 127u8, 231u8, 26u8, 5u8, 206u8, 90u8, - 51u8, 22u8, 240u8, 61u8, 5u8, 117u8, 191u8, 231u8, 167u8, 48u8, - 13u8, 101u8, 79u8, 17u8, 251u8, 163u8, 23u8, 109u8, 193u8, 190u8, - 92u8, 103u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedDepositByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Per-weight deposit for a signed solution."] pub fn signed_deposit_weight( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "SignedDepositWeight", - )? == [ - 229u8, 168u8, 140u8, 127u8, 138u8, 107u8, 171u8, 116u8, 171u8, - 63u8, 205u8, 84u8, 202u8, 17u8, 134u8, 171u8, 204u8, 31u8, 54u8, - 43u8, 138u8, 50u8, 55u8, 112u8, 27u8, 103u8, 183u8, 209u8, 167u8, - 214u8, 19u8, 95u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedDepositWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum number of electing voters to put in the snapshot. At the moment, snapshots"] #[doc = " are only over a single block, but once multi-block elections are introduced they will"] #[doc = " take place over multiple blocks."] pub fn max_electing_voters( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "MaxElectingVoters", - )? == [ - 202u8, 136u8, 180u8, 3u8, 16u8, 142u8, 77u8, 250u8, 154u8, 116u8, - 78u8, 110u8, 72u8, 135u8, 115u8, 120u8, 109u8, 12u8, 156u8, - 129u8, 250u8, 120u8, 71u8, 221u8, 93u8, 172u8, 53u8, 44u8, 192u8, - 164u8, 213u8, 68u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MaxElectingVoters")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The maximum number of electable targets to put in the snapshot."] pub fn max_electable_targets( &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash( + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u16>, + > { + ::subxt::constants::StaticConstantAddress::new( "ElectionProviderMultiPhase", "MaxElectableTargets", - )? == [ - 71u8, 15u8, 36u8, 77u8, 111u8, 52u8, 73u8, 94u8, 27u8, 213u8, - 122u8, 58u8, 126u8, 157u8, 17u8, 238u8, 168u8, 174u8, 0u8, 94u8, - 15u8, 86u8, 206u8, 115u8, 222u8, 234u8, 25u8, 195u8, 107u8, - 138u8, 213u8, 39u8, - ] { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MaxElectableTargets")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, + 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, + 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, + 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) } } } } pub mod voter_list { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Rebag { - pub dislocated: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for Rebag { - const PALLET: &'static str = "VoterList"; - const FUNCTION: &'static str = "rebag"; + pub dislocated: ::subxt::ext::sp_core::crypto::AccountId32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct PutInFrontOf { - pub lighter: ::subxt::sp_core::crypto::AccountId32, + pub lighter: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Call for PutInFrontOf { - const PALLET: &'static str = "VoterList"; - const FUNCTION: &'static str = "put_in_front_of"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] #[doc = "changed its score that it should properly fall into a different bag than its current"] #[doc = "one."] @@ -28884,36 +19666,19 @@ pub mod api { #[doc = "If `dislocated` does not exists, it returns an error."] pub fn rebag( &self, - dislocated: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Rebag, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 46u8, 138u8, 28u8, 6u8, 58u8, 153u8, 5u8, 41u8, 44u8, 7u8, - 228u8, 72u8, 135u8, 184u8, 185u8, 132u8, 146u8, 181u8, 47u8, - 166u8, 149u8, 21u8, 155u8, 29u8, 159u8, 79u8, 83u8, 137u8, - 156u8, 17u8, 60u8, 23u8, - ] - { - let call = Rebag { dislocated }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + dislocated: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "VoterList", + "rebag", + Rebag { dislocated }, + [ + 8u8, 182u8, 221u8, 221u8, 242u8, 48u8, 178u8, 182u8, 236u8, + 54u8, 188u8, 107u8, 32u8, 24u8, 90u8, 76u8, 28u8, 67u8, 8u8, + 231u8, 6u8, 162u8, 169u8, 77u8, 246u8, 88u8, 156u8, 189u8, + 248u8, 19u8, 235u8, 236u8, + ], + ) } #[doc = "Move the caller's Id directly in front of `lighter`."] #[doc = ""] @@ -28925,36 +19690,19 @@ pub mod api { #[doc = "- and `origin` has a greater `Score` than `lighter`."] pub fn put_in_front_of( &self, - lighter: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PutInFrontOf, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 79u8, 254u8, 222u8, 19u8, 17u8, 80u8, 7u8, 68u8, 54u8, 9u8, - 23u8, 133u8, 108u8, 29u8, 166u8, 177u8, 230u8, 247u8, 226u8, - 189u8, 3u8, 241u8, 100u8, 178u8, 234u8, 204u8, 118u8, 215u8, - 84u8, 28u8, 21u8, 136u8, - ] - { - let call = PutInFrontOf { lighter }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + lighter: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "VoterList", + "put_in_front_of", + PutInFrontOf { lighter }, + [ + 247u8, 154u8, 37u8, 142u8, 28u8, 130u8, 53u8, 223u8, 255u8, + 154u8, 21u8, 149u8, 244u8, 21u8, 105u8, 77u8, 189u8, 74u8, + 182u8, 160u8, 30u8, 157u8, 133u8, 5u8, 167u8, 158u8, 131u8, + 244u8, 130u8, 172u8, 146u8, 167u8, + ], + ) } } } @@ -28962,268 +19710,175 @@ pub mod api { pub type Event = runtime_types::pallet_bags_list::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Moved an account from one bag to another."] pub struct Rebagged { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub from: ::core::primitive::u64, pub to: ::core::primitive::u64, } - impl ::subxt::Event for Rebagged { + impl ::subxt::events::StaticEvent for Rebagged { const PALLET: &'static str = "VoterList"; const EVENT: &'static str = "Rebagged"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Updated the score of some account to the given amount."] pub struct ScoreUpdated { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub new_score: ::core::primitive::u64, } - impl ::subxt::Event for ScoreUpdated { + impl ::subxt::events::StaticEvent for ScoreUpdated { const PALLET: &'static str = "VoterList"; const EVENT: &'static str = "ScoreUpdated"; } - } - pub mod storage { - use super::runtime_types; - pub struct ListNodes<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for ListNodes<'_> { - const PALLET: &'static str = "VoterList"; - const STORAGE: &'static str = "ListNodes"; - type Value = runtime_types::pallet_bags_list::list::Node; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CounterForListNodes; - impl ::subxt::StorageEntry for CounterForListNodes { - const PALLET: &'static str = "VoterList"; - const STORAGE: &'static str = "CounterForListNodes"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ListBags<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for ListBags<'_> { - const PALLET: &'static str = "VoterList"; - const STORAGE: &'static str = "ListBags"; - type Value = runtime_types::pallet_bags_list::list::Bag; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { #[doc = " A single node, within some bag."] #[doc = ""] #[doc = " Nodes store links forward and back within their respective bags."] pub fn list_nodes( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_bags_list::list::Node, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 144u8, 72u8, 250u8, 207u8, 66u8, 204u8, 6u8, 146u8, - 219u8, 225u8, 6u8, 82u8, 111u8, 172u8, 171u8, 184u8, - 35u8, 129u8, 246u8, 162u8, 224u8, 116u8, 244u8, 80u8, - 197u8, 146u8, 243u8, 123u8, 209u8, 135u8, 164u8, 201u8, - ] - { - let entry = ListNodes(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bags_list::list::Node, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "VoterList", + "ListNodes", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 176u8, 186u8, 93u8, 51u8, 100u8, 184u8, 240u8, 29u8, 70u8, + 3u8, 117u8, 47u8, 23u8, 66u8, 231u8, 234u8, 53u8, 8u8, 234u8, + 175u8, 181u8, 8u8, 161u8, 154u8, 48u8, 178u8, 147u8, 227u8, + 122u8, 115u8, 57u8, 97u8, + ], + ) } #[doc = " A single node, within some bag."] #[doc = ""] #[doc = " Nodes store links forward and back within their respective bags."] - pub fn list_nodes_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ListNodes<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 144u8, 72u8, 250u8, 207u8, 66u8, 204u8, 6u8, 146u8, - 219u8, 225u8, 6u8, 82u8, 111u8, 172u8, 171u8, 184u8, - 35u8, 129u8, 246u8, 162u8, 224u8, 116u8, 244u8, 80u8, - 197u8, 146u8, 243u8, 123u8, 209u8, 135u8, 164u8, 201u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn list_nodes_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bags_list::list::Node, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "VoterList", + "ListNodes", + Vec::new(), + [ + 176u8, 186u8, 93u8, 51u8, 100u8, 184u8, 240u8, 29u8, 70u8, + 3u8, 117u8, 47u8, 23u8, 66u8, 231u8, 234u8, 53u8, 8u8, 234u8, + 175u8, 181u8, 8u8, 161u8, 154u8, 48u8, 178u8, 147u8, 227u8, + 122u8, 115u8, 57u8, 97u8, + ], + ) } #[doc = "Counter for the related counted storage map"] pub fn counter_for_list_nodes( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 156u8, 168u8, 97u8, 33u8, 84u8, 117u8, 220u8, 89u8, 62u8, - 182u8, 24u8, 88u8, 231u8, 244u8, 41u8, 19u8, 210u8, - 131u8, 87u8, 0u8, 241u8, 230u8, 160u8, 142u8, 128u8, - 153u8, 83u8, 36u8, 88u8, 247u8, 70u8, 130u8, - ] - { - let entry = CounterForListNodes; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "VoterList", + "CounterForListNodes", + vec![], + [ + 156u8, 168u8, 97u8, 33u8, 84u8, 117u8, 220u8, 89u8, 62u8, + 182u8, 24u8, 88u8, 231u8, 244u8, 41u8, 19u8, 210u8, 131u8, + 87u8, 0u8, 241u8, 230u8, 160u8, 142u8, 128u8, 153u8, 83u8, + 36u8, 88u8, 247u8, 70u8, 130u8, + ], + ) } #[doc = " A bag stored in storage."] #[doc = ""] #[doc = " Stores a `Bag` struct, which stores head and tail pointers to itself."] pub fn list_bags( &self, - _0: &'a ::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_bags_list::list::Bag, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 117u8, 35u8, 42u8, 116u8, 5u8, 68u8, 168u8, 75u8, 112u8, - 29u8, 54u8, 49u8, 169u8, 103u8, 22u8, 163u8, 53u8, 122u8, - 181u8, 32u8, 97u8, 41u8, 56u8, 89u8, 77u8, 200u8, 0u8, - 123u8, 226u8, 178u8, 81u8, 138u8, - ] - { - let entry = ListBags(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bags_list::list::Bag, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "VoterList", + "ListBags", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 38u8, 86u8, 63u8, 92u8, 85u8, 59u8, 225u8, 244u8, 14u8, + 155u8, 76u8, 249u8, 153u8, 140u8, 179u8, 7u8, 96u8, 170u8, + 236u8, 179u8, 4u8, 18u8, 232u8, 146u8, 216u8, 51u8, 135u8, + 116u8, 196u8, 117u8, 143u8, 153u8, + ], + ) } #[doc = " A bag stored in storage."] #[doc = ""] #[doc = " Stores a `Bag` struct, which stores head and tail pointers to itself."] - pub fn list_bags_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ListBags<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 117u8, 35u8, 42u8, 116u8, 5u8, 68u8, 168u8, 75u8, 112u8, - 29u8, 54u8, 49u8, 169u8, 103u8, 22u8, 163u8, 53u8, 122u8, - 181u8, 32u8, 97u8, 41u8, 56u8, 89u8, 77u8, 200u8, 0u8, - 123u8, 226u8, 178u8, 81u8, 138u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn list_bags_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bags_list::list::Bag, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "VoterList", + "ListBags", + Vec::new(), + [ + 38u8, 86u8, 63u8, 92u8, 85u8, 59u8, 225u8, 244u8, 14u8, + 155u8, 76u8, 249u8, 153u8, 140u8, 179u8, 7u8, 96u8, 170u8, + 236u8, 179u8, 4u8, 18u8, 232u8, 146u8, 216u8, 51u8, 135u8, + 116u8, 196u8, 117u8, 143u8, 153u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The list of thresholds separating the various bags."] #[doc = ""] #[doc = " Ids are separated into unsorted bags according to their score. This specifies the"] @@ -29269,2097 +19924,1200 @@ pub mod api { #[doc = " With that `List::migrate` can be called, which will perform the appropriate migration."] pub fn bag_thresholds( &self, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u64>, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("VoterList", "BagThresholds")? - == [ - 95u8, 68u8, 224u8, 175u8, 149u8, 202u8, 192u8, 181u8, 221u8, - 32u8, 210u8, 34u8, 242u8, 160u8, 84u8, 54u8, 221u8, 57u8, - 122u8, 238u8, 246u8, 239u8, 28u8, 125u8, 175u8, 46u8, 183u8, - 129u8, 6u8, 103u8, 171u8, 172u8, - ] - { - let pallet = metadata.pallet("VoterList")?; - let constant = pallet.constant("BagThresholds")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u64>, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "VoterList", + "BagThresholds", + [ + 103u8, 102u8, 255u8, 165u8, 124u8, 54u8, 5u8, 172u8, 112u8, + 234u8, 25u8, 175u8, 178u8, 19u8, 251u8, 73u8, 91u8, 192u8, + 227u8, 81u8, 249u8, 45u8, 126u8, 116u8, 7u8, 37u8, 9u8, + 200u8, 167u8, 182u8, 12u8, 131u8, + ], + ) } } } } pub mod parachains_origin { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; } pub mod configuration { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetValidationUpgradeCooldown { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetValidationUpgradeCooldown { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_cooldown"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetValidationUpgradeDelay { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_delay"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetCodeRetentionPeriod { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetCodeRetentionPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_code_retention_period"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxCodeSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxCodeSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_code_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxPovSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxPovSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_pov_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxHeadDataSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxHeadDataSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_head_data_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetParathreadCores { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetParathreadCores { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_cores"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetParathreadRetries { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetParathreadRetries { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_retries"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetGroupRotationFrequency { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetGroupRotationFrequency { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_group_rotation_frequency"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetChainAvailabilityPeriod { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetChainAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_chain_availability_period"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetThreadAvailabilityPeriod { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetThreadAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_thread_availability_period"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetSchedulingLookahead { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetSchedulingLookahead { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_scheduling_lookahead"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetMaxValidatorsPerCore { pub new: ::core::option::Option<::core::primitive::u32>, } - impl ::subxt::Call for SetMaxValidatorsPerCore { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators_per_core"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetMaxValidators { pub new: ::core::option::Option<::core::primitive::u32>, } - impl ::subxt::Call for SetMaxValidators { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetDisputePeriod { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetDisputePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_period"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetDisputePostConclusionAcceptancePeriod { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetDisputePostConclusionAcceptancePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_dispute_post_conclusion_acceptance_period"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetDisputeMaxSpamSlots { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetDisputeMaxSpamSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_max_spam_slots"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetDisputeConclusionByTimeOutPeriod { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetDisputeConclusionByTimeOutPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_dispute_conclusion_by_time_out_period"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetNoShowSlots { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetNoShowSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_no_show_slots"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetNDelayTranches { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetNDelayTranches { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_n_delay_tranches"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetZerothDelayTrancheWidth { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetZerothDelayTrancheWidth { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetNeededApprovals { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetNeededApprovals { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_needed_approvals"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetRelayVrfModuloSamples { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetRelayVrfModuloSamples { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxUpwardQueueCount { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxUpwardQueueCount { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_count"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxUpwardQueueSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxUpwardQueueSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxDownwardMessageSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxDownwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_downward_message_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetUmpServiceTotalWeight { pub new: ::core::primitive::u64, } - impl ::subxt::Call for SetUmpServiceTotalWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_service_total_weight"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxUpwardMessageSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxUpwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMaxUpwardMessageNumPerCandidate { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMaxUpwardMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_num_per_candidate"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpOpenRequestTtl { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpOpenRequestTtl { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_open_request_ttl"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpSenderDeposit { pub new: ::core::primitive::u128, } - impl ::subxt::Call for SetHrmpSenderDeposit { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_sender_deposit"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpRecipientDeposit { pub new: ::core::primitive::u128, } - impl ::subxt::Call for SetHrmpRecipientDeposit { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_recipient_deposit"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpChannelMaxCapacity { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpChannelMaxCapacity { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_capacity"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpChannelMaxTotalSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpChannelMaxTotalSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_total_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpMaxParachainInboundChannels { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpMaxParachainInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpMaxParathreadInboundChannels { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpMaxParathreadInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpChannelMaxMessageSize { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpChannelMaxMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpMaxParachainOutboundChannels { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpMaxParachainOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpMaxParathreadOutboundChannels { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpMaxParathreadOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_hrmp_max_parathread_outbound_channels"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetHrmpMaxMessageNumPerCandidate { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetHrmpMaxMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetUmpMaxIndividualWeight { pub new: ::core::primitive::u64, } - impl ::subxt::Call for SetUmpMaxIndividualWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_max_individual_weight"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetPvfCheckingEnabled { pub new: ::core::primitive::bool, } - impl ::subxt::Call for SetPvfCheckingEnabled { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_pvf_checking_enabled"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetPvfVotingTtl { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetPvfVotingTtl { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_pvf_voting_ttl"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct SetMinimumValidationUpgradeDelay { pub new: ::core::primitive::u32, } - impl ::subxt::Call for SetMinimumValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_minimum_validation_upgrade_delay"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SetBypassConsistencyCheck { pub new: ::core::primitive::bool, } - impl ::subxt::Call for SetBypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_bypass_consistency_check"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Set the validation upgrade cooldown."] pub fn set_validation_upgrade_cooldown( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidationUpgradeCooldown, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 60u8, 171u8, 164u8, 241u8, 214u8, 235u8, 141u8, 4u8, - 32u8, 129u8, 253u8, 128u8, 148u8, 185u8, 51u8, 65u8, 34u8, - 68u8, 72u8, 202u8, 159u8, 74u8, 243u8, 35u8, 138u8, 208u8, - 26u8, 182u8, 189u8, 41u8, 11u8, - ] - { - let call = SetValidationUpgradeCooldown { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_validation_upgrade_cooldown", + SetValidationUpgradeCooldown { new }, + [ + 109u8, 185u8, 0u8, 59u8, 177u8, 198u8, 76u8, 90u8, 108u8, + 190u8, 56u8, 126u8, 147u8, 110u8, 76u8, 111u8, 38u8, 200u8, + 230u8, 144u8, 42u8, 167u8, 175u8, 220u8, 102u8, 37u8, 60u8, + 10u8, 118u8, 79u8, 146u8, 203u8, + ], + ) } #[doc = "Set the validation upgrade delay."] pub fn set_validation_upgrade_delay( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidationUpgradeDelay, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 136u8, 220u8, 63u8, 166u8, 202u8, 19u8, 241u8, 32u8, 100u8, - 14u8, 101u8, 244u8, 241u8, 141u8, 144u8, 213u8, 185u8, 88u8, - 193u8, 2u8, 55u8, 154u8, 24u8, 77u8, 66u8, 167u8, 69u8, - 245u8, 224u8, 63u8, 196u8, 200u8, - ] - { - let call = SetValidationUpgradeDelay { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_validation_upgrade_delay", + SetValidationUpgradeDelay { new }, + [ + 18u8, 130u8, 158u8, 253u8, 160u8, 194u8, 220u8, 120u8, 9u8, + 68u8, 232u8, 176u8, 34u8, 81u8, 200u8, 236u8, 141u8, 139u8, + 62u8, 110u8, 76u8, 9u8, 218u8, 69u8, 55u8, 2u8, 233u8, 109u8, + 83u8, 117u8, 141u8, 253u8, + ], + ) } #[doc = "Set the acceptance period for an included candidate."] pub fn set_code_retention_period( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCodeRetentionPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 94u8, 104u8, 13u8, 127u8, 95u8, 137u8, 66u8, 224u8, 22u8, - 53u8, 14u8, 161u8, 67u8, 85u8, 78u8, 161u8, 92u8, 81u8, - 190u8, 213u8, 113u8, 235u8, 64u8, 19u8, 112u8, 164u8, 71u8, - 88u8, 183u8, 234u8, 237u8, 9u8, - ] - { - let call = SetCodeRetentionPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_code_retention_period", + SetCodeRetentionPeriod { new }, + [ + 221u8, 140u8, 253u8, 111u8, 64u8, 236u8, 93u8, 52u8, 214u8, + 245u8, 178u8, 30u8, 77u8, 166u8, 242u8, 252u8, 203u8, 106u8, + 12u8, 195u8, 27u8, 159u8, 96u8, 197u8, 145u8, 69u8, 241u8, + 59u8, 74u8, 220u8, 62u8, 205u8, + ], + ) } #[doc = "Set the max validation code size for incoming upgrades."] pub fn set_max_code_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxCodeSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 74u8, 39u8, 190u8, 155u8, 121u8, 60u8, 233u8, 95u8, 177u8, - 57u8, 116u8, 107u8, 200u8, 44u8, 2u8, 215u8, 209u8, 50u8, - 37u8, 112u8, 136u8, 107u8, 202u8, 142u8, 114u8, 25u8, 43u8, - 134u8, 250u8, 15u8, 81u8, 13u8, - ] - { - let call = SetMaxCodeSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_code_size", + SetMaxCodeSize { new }, + [ + 232u8, 106u8, 45u8, 195u8, 27u8, 162u8, 188u8, 213u8, 137u8, + 13u8, 123u8, 89u8, 215u8, 141u8, 231u8, 82u8, 205u8, 215u8, + 73u8, 142u8, 115u8, 109u8, 132u8, 118u8, 194u8, 211u8, 82u8, + 20u8, 75u8, 55u8, 218u8, 46u8, + ], + ) } #[doc = "Set the max POV block size for incoming upgrades."] pub fn set_max_pov_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxPovSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 77u8, 199u8, 18u8, 53u8, 223u8, 107u8, 57u8, 141u8, 8u8, - 138u8, 180u8, 175u8, 73u8, 88u8, 205u8, 185u8, 56u8, 106u8, - 43u8, 87u8, 109u8, 9u8, 103u8, 103u8, 50u8, 158u8, 11u8, - 77u8, 162u8, 38u8, 57u8, 27u8, - ] - { - let call = SetMaxPovSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_pov_size", + SetMaxPovSize { new }, + [ + 15u8, 176u8, 13u8, 19u8, 177u8, 160u8, 211u8, 238u8, 29u8, + 194u8, 187u8, 235u8, 244u8, 65u8, 158u8, 47u8, 102u8, 221u8, + 95u8, 10u8, 21u8, 33u8, 219u8, 234u8, 82u8, 122u8, 75u8, + 53u8, 14u8, 126u8, 218u8, 23u8, + ], + ) } #[doc = "Set the max head data size for paras."] pub fn set_max_head_data_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxHeadDataSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 30u8, 132u8, 5u8, 207u8, 126u8, 145u8, 187u8, 129u8, 36u8, - 235u8, 179u8, 61u8, 243u8, 87u8, 178u8, 107u8, 8u8, 21u8, - 43u8, 39u8, 119u8, 138u8, 146u8, 146u8, 109u8, 189u8, 56u8, - 160u8, 14u8, 78u8, 230u8, 149u8, - ] - { - let call = SetMaxHeadDataSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_head_data_size", + SetMaxHeadDataSize { new }, + [ + 219u8, 128u8, 213u8, 65u8, 190u8, 224u8, 87u8, 80u8, 172u8, + 112u8, 160u8, 229u8, 52u8, 1u8, 189u8, 125u8, 177u8, 139u8, + 103u8, 39u8, 21u8, 125u8, 62u8, 177u8, 74u8, 25u8, 41u8, + 11u8, 200u8, 79u8, 139u8, 171u8, + ], + ) } #[doc = "Set the number of parathread execution cores."] pub fn set_parathread_cores( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetParathreadCores, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 198u8, 156u8, 226u8, 125u8, 16u8, 2u8, 64u8, 28u8, - 189u8, 213u8, 85u8, 6u8, 112u8, 173u8, 183u8, 174u8, 207u8, - 129u8, 110u8, 201u8, 161u8, 163u8, 191u8, 20u8, 14u8, 65u8, - 106u8, 234u8, 203u8, 39u8, 75u8, - ] - { - let call = SetParathreadCores { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_parathread_cores", + SetParathreadCores { new }, + [ + 155u8, 102u8, 168u8, 202u8, 236u8, 87u8, 16u8, 128u8, 141u8, + 99u8, 154u8, 162u8, 216u8, 198u8, 236u8, 233u8, 104u8, 230u8, + 137u8, 132u8, 41u8, 106u8, 167u8, 81u8, 195u8, 172u8, 107u8, + 28u8, 138u8, 254u8, 180u8, 61u8, + ], + ) } #[doc = "Set the number of retries for a particular parathread."] pub fn set_parathread_retries( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetParathreadRetries, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 146u8, 134u8, 204u8, 109u8, 167u8, 35u8, 255u8, 245u8, 98u8, - 24u8, 213u8, 33u8, 144u8, 194u8, 196u8, 196u8, 66u8, 220u8, - 168u8, 156u8, 171u8, 179u8, 154u8, 30u8, 221u8, 45u8, 65u8, - 192u8, 194u8, 130u8, 87u8, 100u8, - ] - { - let call = SetParathreadRetries { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_parathread_retries", + SetParathreadRetries { new }, + [ + 192u8, 81u8, 152u8, 41u8, 40u8, 3u8, 251u8, 205u8, 244u8, + 133u8, 42u8, 197u8, 21u8, 221u8, 80u8, 196u8, 222u8, 69u8, + 153u8, 39u8, 161u8, 90u8, 4u8, 38u8, 167u8, 131u8, 237u8, + 42u8, 135u8, 37u8, 156u8, 108u8, + ], + ) } #[doc = "Set the parachain validator-group rotation frequency"] pub fn set_group_rotation_frequency( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetGroupRotationFrequency, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 102u8, 192u8, 226u8, 120u8, 69u8, 117u8, 239u8, 156u8, 111u8, - 239u8, 197u8, 191u8, 221u8, 18u8, 140u8, 214u8, 154u8, 212u8, - 151u8, 35u8, 176u8, 2u8, 162u8, 131u8, 115u8, 102u8, 177u8, - 106u8, 35u8, 214u8, 151u8, 227u8, - ] - { - let call = SetGroupRotationFrequency { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_group_rotation_frequency", + SetGroupRotationFrequency { new }, + [ + 205u8, 222u8, 129u8, 36u8, 136u8, 186u8, 114u8, 70u8, 214u8, + 22u8, 112u8, 65u8, 56u8, 42u8, 103u8, 93u8, 108u8, 242u8, + 188u8, 229u8, 150u8, 19u8, 12u8, 222u8, 25u8, 254u8, 48u8, + 218u8, 200u8, 208u8, 132u8, 251u8, + ], + ) } #[doc = "Set the availability period for parachains."] pub fn set_chain_availability_period( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetChainAvailabilityPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 3u8, 83u8, 31u8, 241u8, 73u8, 137u8, 18u8, 95u8, 119u8, - 143u8, 28u8, 110u8, 151u8, 229u8, 172u8, 208u8, 50u8, 25u8, - 89u8, 222u8, 128u8, 125u8, 112u8, 25u8, 204u8, 141u8, 175u8, - 69u8, 57u8, 161u8, 189u8, 167u8, - ] - { - let call = SetChainAvailabilityPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_chain_availability_period", + SetChainAvailabilityPeriod { new }, + [ + 171u8, 21u8, 54u8, 241u8, 19u8, 100u8, 54u8, 143u8, 97u8, + 191u8, 193u8, 96u8, 7u8, 86u8, 255u8, 109u8, 255u8, 93u8, + 113u8, 28u8, 182u8, 75u8, 120u8, 208u8, 91u8, 125u8, 156u8, + 38u8, 56u8, 230u8, 24u8, 139u8, + ], + ) } #[doc = "Set the availability period for parathreads."] pub fn set_thread_availability_period( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetThreadAvailabilityPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 204u8, 158u8, 5u8, 123u8, 163u8, 6u8, 209u8, 44u8, - 73u8, 112u8, 249u8, 96u8, 160u8, 188u8, 151u8, 107u8, 21u8, - 9u8, 100u8, 104u8, 184u8, 97u8, 77u8, 122u8, 254u8, 88u8, - 94u8, 22u8, 15u8, 57u8, 44u8, - ] - { - let call = SetThreadAvailabilityPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_thread_availability_period", + SetThreadAvailabilityPeriod { new }, + [ + 208u8, 27u8, 246u8, 33u8, 90u8, 200u8, 75u8, 177u8, 19u8, + 107u8, 236u8, 43u8, 159u8, 156u8, 184u8, 10u8, 146u8, 71u8, + 212u8, 129u8, 44u8, 19u8, 162u8, 172u8, 162u8, 46u8, 166u8, + 10u8, 67u8, 112u8, 206u8, 50u8, + ], + ) } #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] pub fn set_scheduling_lookahead( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetSchedulingLookahead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 146u8, 149u8, 10u8, 57u8, 122u8, 116u8, 61u8, 181u8, 97u8, - 240u8, 87u8, 37u8, 227u8, 233u8, 123u8, 26u8, 243u8, 58u8, - 54u8, 93u8, 111u8, 204u8, 108u8, 18u8, 167u8, 20u8, 255u8, - 173u8, 46u8, 212u8, 246u8, 201u8, - ] - { - let call = SetSchedulingLookahead { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_scheduling_lookahead", + SetSchedulingLookahead { new }, + [ + 220u8, 74u8, 0u8, 150u8, 45u8, 29u8, 56u8, 210u8, 66u8, 12u8, + 119u8, 176u8, 103u8, 24u8, 216u8, 55u8, 211u8, 120u8, 233u8, + 204u8, 167u8, 100u8, 199u8, 157u8, 186u8, 174u8, 40u8, 218u8, + 19u8, 230u8, 253u8, 7u8, + ], + ) } #[doc = "Set the maximum number of validators to assign to any core."] pub fn set_max_validators_per_core( &self, new: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxValidatorsPerCore, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 27u8, 160u8, 153u8, 252u8, 121u8, 42u8, 94u8, 131u8, 199u8, - 216u8, 15u8, 65u8, 94u8, 69u8, 127u8, 130u8, 179u8, 236u8, - 49u8, 32u8, 239u8, 37u8, 58u8, 0u8, 50u8, 5u8, 255u8, 30u8, - 203u8, 230u8, 135u8, 202u8, - ] - { - let call = SetMaxValidatorsPerCore { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_validators_per_core", + SetMaxValidatorsPerCore { new }, + [ + 227u8, 113u8, 192u8, 116u8, 114u8, 171u8, 27u8, 22u8, 84u8, + 117u8, 146u8, 152u8, 94u8, 101u8, 14u8, 52u8, 228u8, 170u8, + 163u8, 82u8, 248u8, 130u8, 32u8, 103u8, 225u8, 151u8, 145u8, + 36u8, 98u8, 158u8, 6u8, 245u8, + ], + ) } #[doc = "Set the maximum number of validators to use in parachain consensus."] pub fn set_max_validators( &self, new: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxValidators, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 192u8, 156u8, 115u8, 10u8, 225u8, 94u8, 190u8, 180u8, 242u8, - 131u8, 202u8, 13u8, 82u8, 27u8, 8u8, 144u8, 70u8, 92u8, - 136u8, 206u8, 205u8, 3u8, 242u8, 130u8, 77u8, 114u8, 242u8, - 111u8, 99u8, 24u8, 238u8, 55u8, - ] - { - let call = SetMaxValidators { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_validators", + SetMaxValidators { new }, + [ + 143u8, 212u8, 59u8, 147u8, 4u8, 55u8, 142u8, 209u8, 237u8, + 76u8, 7u8, 178u8, 41u8, 81u8, 4u8, 203u8, 184u8, 149u8, 32u8, + 1u8, 106u8, 180u8, 121u8, 20u8, 137u8, 169u8, 144u8, 77u8, + 38u8, 53u8, 243u8, 127u8, + ], + ) } #[doc = "Set the dispute period, in number of sessions to keep for disputes."] pub fn set_dispute_period( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputePeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 232u8, 96u8, 104u8, 249u8, 183u8, 148u8, 126u8, 80u8, 64u8, - 39u8, 2u8, 208u8, 183u8, 189u8, 139u8, 201u8, 61u8, 63u8, - 42u8, 155u8, 215u8, 32u8, 212u8, 158u8, 90u8, 80u8, 159u8, - 23u8, 249u8, 204u8, 218u8, 217u8, - ] - { - let call = SetDisputePeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_dispute_period", + SetDisputePeriod { new }, + [ + 36u8, 191u8, 142u8, 240u8, 48u8, 101u8, 10u8, 197u8, 117u8, + 125u8, 156u8, 189u8, 130u8, 77u8, 242u8, 130u8, 205u8, 154u8, + 152u8, 47u8, 75u8, 56u8, 63u8, 61u8, 33u8, 163u8, 151u8, + 97u8, 105u8, 99u8, 55u8, 180u8, + ], + ) } #[doc = "Set the dispute post conclusion acceptance period."] pub fn set_dispute_post_conclusion_acceptance_period( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputePostConclusionAcceptancePeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata - .call_hash::()? - }; - if runtime_call_hash - == [ - 45u8, 140u8, 213u8, 62u8, 212u8, 31u8, 126u8, 94u8, 102u8, - 176u8, 203u8, 240u8, 28u8, 25u8, 116u8, 77u8, 187u8, 147u8, - 32u8, 20u8, 25u8, 124u8, 164u8, 162u8, 246u8, 223u8, 146u8, - 28u8, 35u8, 4u8, 174u8, 47u8, - ] - { - let call = SetDisputePostConclusionAcceptancePeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_dispute_post_conclusion_acceptance_period", + SetDisputePostConclusionAcceptancePeriod { new }, + [ + 66u8, 56u8, 45u8, 87u8, 51u8, 49u8, 91u8, 95u8, 255u8, 185u8, + 54u8, 165u8, 85u8, 142u8, 238u8, 251u8, 174u8, 81u8, 3u8, + 61u8, 92u8, 97u8, 203u8, 20u8, 107u8, 50u8, 208u8, 250u8, + 208u8, 159u8, 225u8, 175u8, + ], + ) } #[doc = "Set the maximum number of dispute spam slots."] pub fn set_dispute_max_spam_slots( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputeMaxSpamSlots, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 180u8, 195u8, 6u8, 141u8, 89u8, 252u8, 245u8, 202u8, 36u8, - 123u8, 105u8, 35u8, 161u8, 60u8, 233u8, 213u8, 191u8, 65u8, - 68u8, 4u8, 19u8, 201u8, 226u8, 103u8, 124u8, 181u8, 201u8, - 91u8, 84u8, 170u8, 48u8, 154u8, - ] - { - let call = SetDisputeMaxSpamSlots { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_dispute_max_spam_slots", + SetDisputeMaxSpamSlots { new }, + [ + 177u8, 58u8, 3u8, 205u8, 145u8, 85u8, 160u8, 162u8, 13u8, + 171u8, 124u8, 54u8, 58u8, 209u8, 88u8, 131u8, 230u8, 248u8, + 142u8, 18u8, 121u8, 129u8, 196u8, 121u8, 25u8, 15u8, 252u8, + 229u8, 89u8, 230u8, 14u8, 68u8, + ], + ) } #[doc = "Set the dispute conclusion by time out period."] pub fn set_dispute_conclusion_by_time_out_period( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputeConclusionByTimeOutPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 50u8, 221u8, 129u8, 199u8, 147u8, 98u8, 11u8, 104u8, 133u8, - 161u8, 53u8, 163u8, 100u8, 155u8, 228u8, 167u8, 146u8, 87u8, - 186u8, 228u8, 147u8, 44u8, 142u8, 160u8, 119u8, 146u8, 10u8, - 155u8, 5u8, 35u8, 8u8, 165u8, - ] - { - let call = SetDisputeConclusionByTimeOutPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_dispute_conclusion_by_time_out_period", + SetDisputeConclusionByTimeOutPeriod { new }, + [ + 238u8, 102u8, 27u8, 169u8, 68u8, 116u8, 198u8, 64u8, 190u8, + 33u8, 36u8, 98u8, 176u8, 157u8, 123u8, 148u8, 126u8, 85u8, + 32u8, 19u8, 49u8, 40u8, 172u8, 41u8, 195u8, 182u8, 44u8, + 255u8, 136u8, 204u8, 250u8, 6u8, + ], + ) } #[doc = "Set the no show slots, in number of number of consensus slots."] #[doc = "Must be at least 1."] pub fn set_no_show_slots( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNoShowSlots, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 5u8, 35u8, 159u8, 200u8, 58u8, 171u8, 179u8, 78u8, - 70u8, 161u8, 47u8, 237u8, 245u8, 77u8, 81u8, 1u8, 138u8, - 145u8, 137u8, 45u8, 126u8, 255u8, 227u8, 130u8, 217u8, 36u8, - 251u8, 72u8, 235u8, 16u8, 231u8, - ] - { - let call = SetNoShowSlots { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_no_show_slots", + SetNoShowSlots { new }, + [ + 94u8, 230u8, 89u8, 131u8, 188u8, 246u8, 251u8, 34u8, 249u8, + 16u8, 134u8, 63u8, 238u8, 115u8, 19u8, 97u8, 97u8, 218u8, + 238u8, 115u8, 126u8, 140u8, 236u8, 17u8, 177u8, 192u8, 210u8, + 239u8, 126u8, 107u8, 117u8, 207u8, + ], + ) } #[doc = "Set the total number of delay tranches."] pub fn set_n_delay_tranches( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNDelayTranches, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 109u8, 208u8, 13u8, 18u8, 178u8, 117u8, 101u8, 169u8, 162u8, - 255u8, 28u8, 88u8, 199u8, 89u8, 83u8, 59u8, 46u8, 105u8, - 186u8, 4u8, 7u8, 171u8, 78u8, 122u8, 197u8, 110u8, 63u8, - 164u8, 140u8, 59u8, 179u8, 236u8, - ] - { - let call = SetNDelayTranches { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_n_delay_tranches", + SetNDelayTranches { new }, + [ + 195u8, 168u8, 178u8, 51u8, 20u8, 107u8, 227u8, 236u8, 57u8, + 30u8, 130u8, 93u8, 149u8, 2u8, 161u8, 66u8, 48u8, 37u8, 71u8, + 108u8, 195u8, 65u8, 153u8, 30u8, 181u8, 181u8, 158u8, 252u8, + 120u8, 119u8, 36u8, 146u8, + ], + ) } #[doc = "Set the zeroth delay tranche width."] pub fn set_zeroth_delay_tranche_width( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetZerothDelayTrancheWidth, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 162u8, 20u8, 162u8, 90u8, 59u8, 194u8, 147u8, 255u8, 198u8, - 203u8, 50u8, 13u8, 134u8, 142u8, 6u8, 156u8, 205u8, 128u8, - 222u8, 225u8, 150u8, 68u8, 198u8, 212u8, 198u8, 238u8, 3u8, - 209u8, 224u8, 19u8, 118u8, 147u8, - ] - { - let call = SetZerothDelayTrancheWidth { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_zeroth_delay_tranche_width", + SetZerothDelayTrancheWidth { new }, + [ + 69u8, 56u8, 125u8, 24u8, 181u8, 62u8, 99u8, 92u8, 166u8, + 107u8, 91u8, 134u8, 230u8, 128u8, 214u8, 135u8, 245u8, 64u8, + 62u8, 78u8, 96u8, 231u8, 195u8, 29u8, 158u8, 113u8, 46u8, + 96u8, 29u8, 0u8, 154u8, 80u8, + ], + ) } #[doc = "Set the number of validators needed to approve a block."] pub fn set_needed_approvals( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNeededApprovals, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 83u8, 164u8, 204u8, 168u8, 93u8, 165u8, 118u8, 111u8, 149u8, - 129u8, 126u8, 250u8, 95u8, 148u8, 193u8, 173u8, 239u8, 1u8, - 14u8, 102u8, 77u8, 150u8, 149u8, 55u8, 82u8, 179u8, 2u8, - 117u8, 19u8, 34u8, 223u8, 173u8, - ] - { - let call = SetNeededApprovals { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_needed_approvals", + SetNeededApprovals { new }, + [ + 238u8, 55u8, 134u8, 30u8, 67u8, 153u8, 150u8, 5u8, 226u8, + 227u8, 185u8, 188u8, 66u8, 60u8, 147u8, 118u8, 46u8, 174u8, + 104u8, 100u8, 26u8, 162u8, 65u8, 58u8, 162u8, 52u8, 211u8, + 66u8, 242u8, 177u8, 230u8, 98u8, + ], + ) } #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] pub fn set_relay_vrf_modulo_samples( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetRelayVrfModuloSamples, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 22u8, 11u8, 132u8, 96u8, 58u8, 253u8, 183u8, 31u8, 137u8, - 231u8, 187u8, 145u8, 119u8, 164u8, 55u8, 142u8, 37u8, 151u8, - 227u8, 112u8, 113u8, 18u8, 200u8, 247u8, 238u8, 10u8, 223u8, - 74u8, 4u8, 132u8, 115u8, 119u8, - ] - { - let call = SetRelayVrfModuloSamples { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_relay_vrf_modulo_samples", + SetRelayVrfModuloSamples { new }, + [ + 76u8, 101u8, 207u8, 184u8, 211u8, 8u8, 43u8, 4u8, 165u8, + 147u8, 166u8, 3u8, 189u8, 42u8, 125u8, 130u8, 21u8, 43u8, + 189u8, 120u8, 239u8, 131u8, 235u8, 35u8, 151u8, 15u8, 30u8, + 81u8, 0u8, 2u8, 64u8, 21u8, + ], + ) } #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] pub fn set_max_upward_queue_count( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardQueueCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 16u8, 31u8, 245u8, 94u8, 243u8, 122u8, 55u8, 155u8, 161u8, - 239u8, 5u8, 59u8, 186u8, 207u8, 136u8, 253u8, 255u8, 176u8, - 135u8, 242u8, 199u8, 96u8, 226u8, 150u8, 15u8, 160u8, 60u8, - 101u8, 66u8, 143u8, 93u8, 104u8, - ] - { - let call = SetMaxUpwardQueueCount { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_upward_queue_count", + SetMaxUpwardQueueCount { new }, + [ + 116u8, 186u8, 216u8, 17u8, 150u8, 187u8, 86u8, 154u8, 92u8, + 122u8, 178u8, 167u8, 215u8, 165u8, 55u8, 86u8, 229u8, 114u8, + 10u8, 149u8, 50u8, 183u8, 165u8, 32u8, 233u8, 105u8, 82u8, + 177u8, 120u8, 25u8, 44u8, 130u8, + ], + ) } #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] pub fn set_max_upward_queue_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardQueueSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 203u8, 170u8, 21u8, 149u8, 170u8, 246u8, 91u8, 54u8, 197u8, - 91u8, 41u8, 114u8, 210u8, 239u8, 73u8, 236u8, 68u8, 194u8, - 157u8, 116u8, 229u8, 1u8, 34u8, 135u8, 144u8, 191u8, 56u8, - 77u8, 13u8, 92u8, 221u8, 4u8, - ] - { - let call = SetMaxUpwardQueueSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_upward_queue_size", + SetMaxUpwardQueueSize { new }, + [ + 18u8, 60u8, 141u8, 57u8, 134u8, 96u8, 140u8, 85u8, 137u8, + 9u8, 209u8, 123u8, 10u8, 165u8, 33u8, 184u8, 34u8, 82u8, + 59u8, 60u8, 30u8, 47u8, 22u8, 163u8, 119u8, 200u8, 197u8, + 192u8, 112u8, 243u8, 156u8, 12u8, + ], + ) } #[doc = "Set the critical downward message size."] pub fn set_max_downward_message_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxDownwardMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 55u8, 181u8, 6u8, 126u8, 31u8, 154u8, 42u8, 194u8, 64u8, - 23u8, 34u8, 255u8, 151u8, 186u8, 52u8, 32u8, 168u8, 233u8, - 44u8, 35u8, 152u8, 78u8, 230u8, 242u8, 169u8, 85u8, 103u8, - 133u8, 177u8, 239u8, 175u8, 119u8, - ] - { - let call = SetMaxDownwardMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_downward_message_size", + SetMaxDownwardMessageSize { new }, + [ + 104u8, 25u8, 229u8, 184u8, 53u8, 246u8, 206u8, 180u8, 13u8, + 156u8, 14u8, 224u8, 215u8, 115u8, 104u8, 127u8, 167u8, 189u8, + 239u8, 183u8, 68u8, 124u8, 55u8, 211u8, 186u8, 115u8, 70u8, + 195u8, 61u8, 151u8, 32u8, 218u8, + ], + ) } #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] pub fn set_ump_service_total_weight( &self, new: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUmpServiceTotalWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 14u8, 179u8, 217u8, 169u8, 84u8, 45u8, 193u8, 3u8, 7u8, - 196u8, 56u8, 209u8, 50u8, 148u8, 32u8, 205u8, 99u8, 202u8, - 72u8, 246u8, 151u8, 230u8, 145u8, 98u8, 188u8, 1u8, 136u8, - 241u8, 217u8, 37u8, 6u8, 101u8, - ] - { - let call = SetUmpServiceTotalWeight { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_ump_service_total_weight", + SetUmpServiceTotalWeight { new }, + [ + 253u8, 228u8, 226u8, 127u8, 202u8, 30u8, 148u8, 254u8, 133u8, + 38u8, 2u8, 83u8, 173u8, 147u8, 113u8, 224u8, 16u8, 160u8, + 13u8, 238u8, 196u8, 174u8, 104u8, 147u8, 57u8, 14u8, 213u8, + 32u8, 220u8, 162u8, 89u8, 244u8, + ], + ) } #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] pub fn set_max_upward_message_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 134u8, 232u8, 5u8, 70u8, 81u8, 177u8, 81u8, 235u8, 93u8, - 145u8, 193u8, 42u8, 150u8, 61u8, 236u8, 20u8, 38u8, 176u8, - 124u8, 170u8, 248u8, 149u8, 57u8, 88u8, 17u8, 46u8, 202u8, - 74u8, 35u8, 82u8, 190u8, 223u8, - ] - { - let call = SetMaxUpwardMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_upward_message_size", + SetMaxUpwardMessageSize { new }, + [ + 213u8, 120u8, 21u8, 247u8, 101u8, 21u8, 164u8, 228u8, 33u8, + 115u8, 20u8, 138u8, 28u8, 174u8, 247u8, 39u8, 194u8, 113u8, + 34u8, 73u8, 142u8, 94u8, 116u8, 151u8, 113u8, 92u8, 151u8, + 227u8, 116u8, 250u8, 101u8, 179u8, + ], + ) } #[doc = "Sets the maximum number of messages that a candidate can contain."] pub fn set_max_upward_message_num_per_candidate( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardMessageNumPerCandidate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 14u8, 79u8, 128u8, 66u8, 119u8, 24u8, 26u8, 116u8, 249u8, - 254u8, 86u8, 228u8, 248u8, 75u8, 111u8, 90u8, 101u8, 96u8, - 124u8, 25u8, 245u8, 115u8, 119u8, 14u8, 213u8, 180u8, 224u8, - 224u8, 188u8, 172u8, 152u8, 16u8, - ] - { - let call = SetMaxUpwardMessageNumPerCandidate { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_max_upward_message_num_per_candidate", + SetMaxUpwardMessageNumPerCandidate { new }, + [ + 54u8, 133u8, 226u8, 138u8, 184u8, 27u8, 130u8, 153u8, 130u8, + 196u8, 54u8, 79u8, 124u8, 10u8, 37u8, 139u8, 59u8, 190u8, + 169u8, 87u8, 255u8, 211u8, 38u8, 142u8, 37u8, 74u8, 144u8, + 204u8, 75u8, 94u8, 154u8, 149u8, + ], + ) } #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] pub fn set_hrmp_open_request_ttl( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpOpenRequestTtl, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 168u8, 254u8, 189u8, 22u8, 61u8, 90u8, 131u8, 1u8, 103u8, - 208u8, 179u8, 85u8, 80u8, 215u8, 9u8, 3u8, 34u8, 73u8, 130u8, - 19u8, 166u8, 77u8, 131u8, 148u8, 183u8, 86u8, 186u8, 148u8, - 109u8, 173u8, 74u8, 94u8, - ] - { - let call = SetHrmpOpenRequestTtl { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_open_request_ttl", + SetHrmpOpenRequestTtl { new }, + [ + 192u8, 113u8, 113u8, 133u8, 197u8, 75u8, 88u8, 67u8, 130u8, + 207u8, 37u8, 192u8, 157u8, 159u8, 114u8, 75u8, 83u8, 180u8, + 194u8, 180u8, 96u8, 129u8, 7u8, 138u8, 110u8, 14u8, 229u8, + 98u8, 71u8, 22u8, 229u8, 247u8, + ], + ) } #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] pub fn set_hrmp_sender_deposit( &self, new: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpSenderDeposit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 250u8, 23u8, 196u8, 206u8, 34u8, 86u8, 28u8, 14u8, 110u8, - 189u8, 38u8, 39u8, 2u8, 16u8, 212u8, 32u8, 65u8, 249u8, - 120u8, 163u8, 89u8, 232u8, 3u8, 49u8, 155u8, 174u8, 96u8, - 21u8, 240u8, 185u8, 140u8, 243u8, - ] - { - let call = SetHrmpSenderDeposit { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_sender_deposit", + SetHrmpSenderDeposit { new }, + [ + 49u8, 38u8, 173u8, 114u8, 66u8, 140u8, 15u8, 151u8, 193u8, + 54u8, 128u8, 108u8, 72u8, 71u8, 28u8, 65u8, 129u8, 199u8, + 105u8, 61u8, 96u8, 119u8, 16u8, 53u8, 115u8, 120u8, 152u8, + 122u8, 182u8, 171u8, 233u8, 48u8, + ], + ) } #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] #[doc = "channel."] pub fn set_hrmp_recipient_deposit( &self, new: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpRecipientDeposit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 104u8, 35u8, 129u8, 31u8, 111u8, 57u8, 190u8, 42u8, 159u8, - 220u8, 86u8, 136u8, 200u8, 4u8, 62u8, 241u8, 141u8, 90u8, - 200u8, 132u8, 141u8, 154u8, 117u8, 206u8, 79u8, 160u8, 124u8, - 186u8, 231u8, 250u8, 86u8, 87u8, - ] - { - let call = SetHrmpRecipientDeposit { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_recipient_deposit", + SetHrmpRecipientDeposit { new }, + [ + 209u8, 212u8, 164u8, 56u8, 71u8, 215u8, 98u8, 250u8, 202u8, + 150u8, 228u8, 6u8, 166u8, 94u8, 171u8, 142u8, 10u8, 253u8, + 89u8, 43u8, 6u8, 173u8, 8u8, 235u8, 52u8, 18u8, 78u8, 129u8, + 227u8, 61u8, 74u8, 83u8, + ], + ) } #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] pub fn set_hrmp_channel_max_capacity( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxCapacity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 211u8, 49u8, 82u8, 59u8, 16u8, 97u8, 253u8, 64u8, 185u8, - 216u8, 235u8, 10u8, 84u8, 194u8, 231u8, 115u8, 153u8, 20u8, - 31u8, 86u8, 47u8, 226u8, 245u8, 214u8, 134u8, 194u8, 13u8, - 254u8, 230u8, 66u8, 54u8, 240u8, - ] - { - let call = SetHrmpChannelMaxCapacity { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_channel_max_capacity", + SetHrmpChannelMaxCapacity { new }, + [ + 148u8, 109u8, 67u8, 220u8, 1u8, 115u8, 70u8, 93u8, 138u8, + 190u8, 60u8, 220u8, 80u8, 137u8, 246u8, 230u8, 115u8, 162u8, + 30u8, 197u8, 11u8, 33u8, 211u8, 224u8, 49u8, 165u8, 149u8, + 155u8, 197u8, 44u8, 6u8, 167u8, + ], + ) } #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] pub fn set_hrmp_channel_max_total_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxTotalSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 254u8, 196u8, 171u8, 29u8, 208u8, 179u8, 204u8, 58u8, 64u8, - 41u8, 52u8, 73u8, 153u8, 245u8, 29u8, 132u8, 129u8, 29u8, - 94u8, 241u8, 136u8, 20u8, 12u8, 20u8, 255u8, 244u8, 252u8, - 98u8, 136u8, 222u8, 7u8, 19u8, - ] - { - let call = SetHrmpChannelMaxTotalSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_channel_max_total_size", + SetHrmpChannelMaxTotalSize { new }, + [ + 79u8, 40u8, 207u8, 173u8, 168u8, 143u8, 130u8, 240u8, 205u8, + 34u8, 61u8, 217u8, 215u8, 106u8, 61u8, 181u8, 8u8, 21u8, + 105u8, 64u8, 183u8, 235u8, 39u8, 133u8, 70u8, 77u8, 233u8, + 201u8, 222u8, 8u8, 43u8, 159u8, + ], + ) } #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] pub fn set_hrmp_max_parachain_inbound_channels( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParachainInboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 219u8, 88u8, 3u8, 249u8, 16u8, 182u8, 182u8, 233u8, 152u8, - 24u8, 29u8, 96u8, 227u8, 50u8, 156u8, 98u8, 71u8, 196u8, - 158u8, 103u8, 114u8, 55u8, 65u8, 199u8, 211u8, 225u8, 235u8, - 172u8, 218u8, 123u8, 158u8, 57u8, - ] - { - let call = SetHrmpMaxParachainInboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_max_parachain_inbound_channels", + SetHrmpMaxParachainInboundChannels { new }, + [ + 91u8, 215u8, 212u8, 131u8, 140u8, 185u8, 119u8, 184u8, 61u8, + 121u8, 120u8, 73u8, 202u8, 98u8, 124u8, 187u8, 171u8, 84u8, + 136u8, 77u8, 103u8, 169u8, 185u8, 8u8, 214u8, 214u8, 23u8, + 195u8, 100u8, 72u8, 45u8, 12u8, + ], + ) } #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] pub fn set_hrmp_max_parathread_inbound_channels( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParathreadInboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 169u8, 153u8, 141u8, 45u8, 21u8, 26u8, 33u8, 207u8, - 234u8, 186u8, 154u8, 12u8, 148u8, 2u8, 226u8, 55u8, 125u8, - 58u8, 127u8, 154u8, 176u8, 3u8, 47u8, 164u8, 63u8, 25u8, - 42u8, 66u8, 131u8, 143u8, 254u8, - ] - { - let call = SetHrmpMaxParathreadInboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_max_parathread_inbound_channels", + SetHrmpMaxParathreadInboundChannels { new }, + [ + 209u8, 66u8, 180u8, 20u8, 87u8, 242u8, 219u8, 71u8, 22u8, + 145u8, 220u8, 48u8, 44u8, 42u8, 77u8, 69u8, 255u8, 82u8, + 27u8, 125u8, 231u8, 111u8, 23u8, 32u8, 239u8, 28u8, 200u8, + 255u8, 91u8, 207u8, 99u8, 107u8, + ], + ) } #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] pub fn set_hrmp_channel_max_message_size( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 237u8, 103u8, 126u8, 197u8, 164u8, 247u8, 67u8, 144u8, 30u8, - 192u8, 161u8, 243u8, 254u8, 26u8, 254u8, 33u8, 59u8, 216u8, - 159u8, 105u8, 166u8, 138u8, 38u8, 124u8, 248u8, 81u8, 11u8, - 223u8, 120u8, 75u8, 176u8, 177u8, - ] - { - let call = SetHrmpChannelMaxMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_channel_max_message_size", + SetHrmpChannelMaxMessageSize { new }, + [ + 17u8, 224u8, 230u8, 9u8, 114u8, 221u8, 138u8, 46u8, 234u8, + 151u8, 27u8, 34u8, 179u8, 67u8, 113u8, 228u8, 128u8, 212u8, + 209u8, 125u8, 122u8, 1u8, 79u8, 28u8, 10u8, 14u8, 83u8, 65u8, + 253u8, 173u8, 116u8, 209u8, + ], + ) } #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] pub fn set_hrmp_max_parachain_outbound_channels( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParachainOutboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 173u8, 184u8, 49u8, 66u8, 158u8, 142u8, 95u8, 225u8, 90u8, - 171u8, 4u8, 20u8, 210u8, 180u8, 54u8, 236u8, 60u8, 5u8, 76u8, - 173u8, 226u8, 203u8, 7u8, 156u8, 54u8, 9u8, 198u8, 171u8, - 250u8, 1u8, 120u8, 240u8, - ] - { - let call = SetHrmpMaxParachainOutboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_max_parachain_outbound_channels", + SetHrmpMaxParachainOutboundChannels { new }, + [ + 26u8, 146u8, 150u8, 88u8, 236u8, 8u8, 63u8, 103u8, 71u8, + 11u8, 20u8, 210u8, 205u8, 106u8, 101u8, 112u8, 116u8, 73u8, + 116u8, 136u8, 149u8, 181u8, 207u8, 95u8, 151u8, 7u8, 98u8, + 17u8, 224u8, 157u8, 117u8, 88u8, + ], + ) } #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] pub fn set_hrmp_max_parathread_outbound_channels( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParathreadOutboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 166u8, 73u8, 121u8, 53u8, 27u8, 77u8, 150u8, 115u8, 29u8, - 202u8, 34u8, 4u8, 35u8, 161u8, 113u8, 15u8, 66u8, 60u8, - 214u8, 129u8, 157u8, 143u8, 227u8, 134u8, 213u8, 9u8, 231u8, - 224u8, 187u8, 36u8, 16u8, 68u8, - ] - { - let call = SetHrmpMaxParathreadOutboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_max_parathread_outbound_channels", + SetHrmpMaxParathreadOutboundChannels { new }, + [ + 31u8, 72u8, 93u8, 21u8, 180u8, 156u8, 101u8, 24u8, 145u8, + 220u8, 194u8, 93u8, 176u8, 164u8, 53u8, 123u8, 36u8, 113u8, + 152u8, 13u8, 222u8, 54u8, 175u8, 170u8, 235u8, 68u8, 236u8, + 130u8, 178u8, 56u8, 140u8, 31u8, + ], + ) } #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] pub fn set_hrmp_max_message_num_per_candidate( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxMessageNumPerCandidate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 47u8, 114u8, 29u8, 87u8, 198u8, 62u8, 200u8, 235u8, - 184u8, 204u8, 35u8, 251u8, 210u8, 88u8, 150u8, 22u8, 61u8, - 242u8, 196u8, 240u8, 76u8, 45u8, 54u8, 155u8, 111u8, 244u8, - 31u8, 158u8, 48u8, 68u8, 233u8, - ] - { - let call = SetHrmpMaxMessageNumPerCandidate { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_hrmp_max_message_num_per_candidate", + SetHrmpMaxMessageNumPerCandidate { new }, + [ + 244u8, 94u8, 225u8, 194u8, 133u8, 116u8, 202u8, 238u8, 8u8, + 57u8, 122u8, 125u8, 6u8, 131u8, 84u8, 102u8, 180u8, 67u8, + 250u8, 136u8, 30u8, 29u8, 110u8, 105u8, 219u8, 166u8, 91u8, + 140u8, 44u8, 192u8, 37u8, 185u8, + ], + ) } #[doc = "Sets the maximum amount of weight any individual upward message may consume."] pub fn set_ump_max_individual_weight( &self, new: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUmpMaxIndividualWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 61u8, 174u8, 42u8, 53u8, 120u8, 56u8, 252u8, 117u8, 173u8, - 223u8, 100u8, 141u8, 209u8, 29u8, 173u8, 240u8, 180u8, 113u8, - 27u8, 24u8, 4u8, 157u8, 107u8, 247u8, 235u8, 121u8, 152u8, - 6u8, 176u8, 254u8, 18u8, 70u8, - ] - { - let call = SetUmpMaxIndividualWeight { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_ump_max_individual_weight", + SetUmpMaxIndividualWeight { new }, + [ + 122u8, 12u8, 77u8, 188u8, 26u8, 100u8, 16u8, 182u8, 66u8, + 159u8, 127u8, 111u8, 193u8, 204u8, 119u8, 102u8, 186u8, 12u8, + 25u8, 193u8, 178u8, 253u8, 85u8, 171u8, 199u8, 161u8, 167u8, + 242u8, 104u8, 242u8, 149u8, 161u8, + ], + ) } #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] pub fn set_pvf_checking_enabled( &self, new: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPvfCheckingEnabled, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 224u8, 199u8, 197u8, 208u8, 178u8, 211u8, 14u8, 102u8, 174u8, - 205u8, 207u8, 181u8, 75u8, 125u8, 209u8, 69u8, 85u8, 1u8, - 98u8, 251u8, 17u8, 42u8, 73u8, 9u8, 252u8, 184u8, 81u8, - 202u8, 132u8, 236u8, 97u8, 121u8, - ] - { - let call = SetPvfCheckingEnabled { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_pvf_checking_enabled", + SetPvfCheckingEnabled { new }, + [ + 123u8, 76u8, 1u8, 112u8, 174u8, 245u8, 18u8, 67u8, 13u8, + 29u8, 219u8, 197u8, 201u8, 112u8, 230u8, 191u8, 37u8, 148u8, + 73u8, 125u8, 54u8, 236u8, 3u8, 80u8, 114u8, 155u8, 244u8, + 132u8, 57u8, 63u8, 158u8, 248u8, + ], + ) } #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] pub fn set_pvf_voting_ttl( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPvfVotingTtl, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 179u8, 71u8, 42u8, 140u8, 187u8, 43u8, 138u8, 16u8, 104u8, - 41u8, 30u8, 220u8, 131u8, 179u8, 200u8, 184u8, 105u8, 58u8, - 131u8, 225u8, 169u8, 253u8, 46u8, 186u8, 102u8, 52u8, 147u8, - 244u8, 22u8, 255u8, 41u8, 6u8, - ] - { - let call = SetPvfVotingTtl { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_pvf_voting_ttl", + SetPvfVotingTtl { new }, + [ + 17u8, 11u8, 98u8, 217u8, 208u8, 102u8, 238u8, 83u8, 118u8, + 123u8, 20u8, 18u8, 46u8, 212u8, 21u8, 164u8, 61u8, 104u8, + 208u8, 204u8, 91u8, 210u8, 40u8, 6u8, 201u8, 147u8, 46u8, + 166u8, 219u8, 227u8, 121u8, 187u8, + ], + ) } #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] #[doc = "upgrade taking place."] @@ -31368,134 +21126,57 @@ pub mod api { pub fn set_minimum_validation_upgrade_delay( &self, new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMinimumValidationUpgradeDelay, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 225u8, 178u8, 41u8, 194u8, 154u8, 222u8, 247u8, 129u8, 35u8, - 102u8, 248u8, 144u8, 21u8, 74u8, 42u8, 239u8, 135u8, 205u8, - 173u8, 190u8, 112u8, 30u8, 240u8, 106u8, 10u8, 217u8, 208u8, - 11u8, 79u8, 47u8, 198u8, 37u8, - ] - { - let call = SetMinimumValidationUpgradeDelay { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_minimum_validation_upgrade_delay", + SetMinimumValidationUpgradeDelay { new }, + [ + 205u8, 188u8, 75u8, 136u8, 228u8, 26u8, 112u8, 27u8, 119u8, + 37u8, 252u8, 109u8, 23u8, 145u8, 21u8, 212u8, 7u8, 28u8, + 242u8, 210u8, 182u8, 111u8, 121u8, 109u8, 50u8, 130u8, 46u8, + 127u8, 122u8, 40u8, 141u8, 242u8, + ], + ) } #[doc = "Setting this to true will disable consistency checks for the configuration setters."] #[doc = "Use with caution."] pub fn set_bypass_consistency_check( &self, new: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetBypassConsistencyCheck, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 54u8, 178u8, 218u8, 46u8, 61u8, 99u8, 23u8, 227u8, - 202u8, 201u8, 164u8, 121u8, 226u8, 65u8, 253u8, 29u8, 164u8, - 170u8, 130u8, 32u8, 85u8, 222u8, 10u8, 232u8, 252u8, 73u8, - 23u8, 69u8, 30u8, 1u8, 87u8, - ] - { - let call = SetBypassConsistencyCheck { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Configuration", + "set_bypass_consistency_check", + SetBypassConsistencyCheck { new }, + [ + 80u8, 66u8, 200u8, 98u8, 54u8, 207u8, 64u8, 99u8, 162u8, + 121u8, 26u8, 173u8, 113u8, 224u8, 240u8, 106u8, 69u8, 191u8, + 177u8, 107u8, 34u8, 74u8, 103u8, 128u8, 252u8, 160u8, 169u8, + 246u8, 125u8, 127u8, 153u8, 129u8, + ], + ) } } } pub mod storage { use super::runtime_types; - pub struct ActiveConfig; - impl ::subxt::StorageEntry for ActiveConfig { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "ActiveConfig"; - type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingConfigs; - impl ::subxt::StorageEntry for PendingConfigs { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "PendingConfigs"; - type Value = :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BypassConsistencyCheck; - impl ::subxt::StorageEntry for BypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "BypassConsistencyCheck"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The active configuration for the current session."] pub fn active_config (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 6u8, 31u8, 218u8, 51u8, 202u8, 166u8, 183u8, 192u8, - 151u8, 184u8, 103u8, 73u8, 239u8, 78u8, 183u8, 38u8, - 192u8, 201u8, 27u8, 128u8, 59u8, 48u8, 197u8, 23u8, 43u8, - 39u8, 158u8, 35u8, 194u8, 23u8, 151u8, 145u8, - ] - { - let entry = ActiveConfig; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub struct StorageApi; + impl StorageApi { + #[doc = " The active configuration for the current session."] pub fn active_config (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Configuration", + "ActiveConfig", + vec![], + [ + 159u8, 121u8, 140u8, 88u8, 122u8, 8u8, 91u8, 46u8, 13u8, + 126u8, 128u8, 7u8, 29u8, 95u8, 160u8, 50u8, 194u8, 59u8, + 249u8, 41u8, 224u8, 158u8, 251u8, 44u8, 146u8, 17u8, 34u8, + 244u8, 18u8, 0u8, 156u8, 17u8, + ], + ) } #[doc = " Pending configuration changes."] #[doc = ""] @@ -31503,597 +21184,339 @@ pub mod api { #[doc = " be applied."] #[doc = ""] #[doc = " The list is sorted ascending by session index. Also, this list can only contain at most"] - #[doc = " 2 items: for the next session and for the `scheduled_session`."] pub fn pending_configs (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 198u8, 168u8, 227u8, 228u8, 110u8, 98u8, 34u8, 21u8, - 159u8, 114u8, 202u8, 135u8, 39u8, 190u8, 40u8, 214u8, - 170u8, 126u8, 203u8, 10u8, 44u8, 114u8, 254u8, 208u8, - 133u8, 129u8, 8u8, 112u8, 168u8, 135u8, 196u8, 43u8, - ] - { - let entry = PendingConfigs; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " 2 items: for the next session and for the `scheduled_session`."] pub fn pending_configs (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Configuration", + "PendingConfigs", + vec![], + [ + 143u8, 101u8, 164u8, 41u8, 30u8, 112u8, 74u8, 127u8, 88u8, + 27u8, 144u8, 27u8, 134u8, 253u8, 172u8, 17u8, 247u8, 247u8, + 75u8, 186u8, 137u8, 195u8, 91u8, 37u8, 148u8, 77u8, 29u8, + 45u8, 131u8, 28u8, 208u8, 241u8, + ], + ) } #[doc = " If this is set, then the configuration setters will bypass the consistency checks. This"] #[doc = " is meant to be used only as the last resort."] pub fn bypass_consistency_check( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::bool, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 42u8, 191u8, 122u8, 163u8, 112u8, 2u8, 148u8, 59u8, 79u8, - 219u8, 184u8, 172u8, 246u8, 136u8, 185u8, 251u8, 189u8, - 226u8, 83u8, 129u8, 162u8, 109u8, 148u8, 75u8, 120u8, - 216u8, 44u8, 28u8, 221u8, 78u8, 177u8, 94u8, - ] - { - let entry = BypassConsistencyCheck; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Configuration", + "BypassConsistencyCheck", + vec![], + [ + 42u8, 191u8, 122u8, 163u8, 112u8, 2u8, 148u8, 59u8, 79u8, + 219u8, 184u8, 172u8, 246u8, 136u8, 185u8, 251u8, 189u8, + 226u8, 83u8, 129u8, 162u8, 109u8, 148u8, 75u8, 120u8, 216u8, + 44u8, 28u8, 221u8, 78u8, 177u8, 94u8, + ], + ) } } } } pub mod paras_shared { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } + pub struct TransactionApi; + impl TransactionApi {} } pub mod storage { use super::runtime_types; - pub struct CurrentSessionIndex; - impl ::subxt::StorageEntry for CurrentSessionIndex { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "CurrentSessionIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveValidatorIndices; - impl ::subxt::StorageEntry for ActiveValidatorIndices { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "ActiveValidatorIndices"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveValidatorKeys; - impl ::subxt::StorageEntry for ActiveValidatorKeys { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "ActiveValidatorKeys"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The current session index."] pub fn current_session_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 83u8, 15u8, 20u8, 55u8, 103u8, 65u8, 76u8, 202u8, 69u8, - 14u8, 221u8, 93u8, 38u8, 163u8, 167u8, 83u8, 18u8, 245u8, - 33u8, 175u8, 7u8, 97u8, 67u8, 186u8, 96u8, 57u8, 147u8, - 120u8, 107u8, 91u8, 147u8, 64u8, - ] - { - let entry = CurrentSessionIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasShared", + "CurrentSessionIndex", + vec![], + [ + 83u8, 15u8, 20u8, 55u8, 103u8, 65u8, 76u8, 202u8, 69u8, 14u8, + 221u8, 93u8, 38u8, 163u8, 167u8, 83u8, 18u8, 245u8, 33u8, + 175u8, 7u8, 97u8, 67u8, 186u8, 96u8, 57u8, 147u8, 120u8, + 107u8, 91u8, 147u8, 64u8, + ], + ) } #[doc = " All the validators actively participating in parachain consensus."] #[doc = " Indices are into the broader validator set."] pub fn active_validator_indices( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_primitives::v2::ValidatorIndex, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 128u8, 98u8, 186u8, 22u8, 178u8, 51u8, 151u8, 235u8, - 201u8, 2u8, 245u8, 177u8, 4u8, 125u8, 1u8, 245u8, 56u8, - 102u8, 166u8, 129u8, 211u8, 189u8, 137u8, 149u8, 234u8, - 252u8, 97u8, 139u8, 151u8, 16u8, 129u8, 24u8, - ] - { - let entry = ActiveValidatorIndices; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasShared", + "ActiveValidatorIndices", + vec![], + [ + 123u8, 26u8, 202u8, 53u8, 219u8, 42u8, 54u8, 92u8, 144u8, + 74u8, 228u8, 234u8, 129u8, 216u8, 161u8, 98u8, 199u8, 12u8, + 13u8, 231u8, 23u8, 166u8, 185u8, 209u8, 191u8, 33u8, 231u8, + 252u8, 232u8, 44u8, 213u8, 221u8, + ], + ) } #[doc = " The parachain attestation keys of the validators actively participating in parachain consensus."] #[doc = " This should be the same length as `ActiveValidatorIndices`."] pub fn active_validator_keys( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_primitives::v2::validator_app::Public, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 130u8, 19u8, 46u8, 117u8, 211u8, 113u8, 90u8, 42u8, - 173u8, 87u8, 209u8, 185u8, 102u8, 142u8, 161u8, 60u8, - 118u8, 246u8, 161u8, 183u8, 103u8, 255u8, 75u8, 180u8, - 250u8, 35u8, 235u8, 102u8, 216u8, 196u8, 190u8, 129u8, - ] - { - let entry = ActiveValidatorKeys; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasShared", + "ActiveValidatorKeys", + vec![], + [ + 33u8, 14u8, 54u8, 86u8, 184u8, 171u8, 194u8, 35u8, 187u8, + 252u8, 181u8, 79u8, 229u8, 134u8, 50u8, 235u8, 162u8, 216u8, + 108u8, 160u8, 175u8, 172u8, 239u8, 114u8, 57u8, 238u8, 9u8, + 54u8, 57u8, 196u8, 105u8, 15u8, + ], + ) } } } } pub mod para_inclusion { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } + pub struct TransactionApi; + impl TransactionApi {} } #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A candidate was backed. `[candidate, head_data]`"] pub struct CandidateBacked( pub runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, pub runtime_types::polkadot_parachain::primitives::HeadData, pub runtime_types::polkadot_primitives::v2::CoreIndex, pub runtime_types::polkadot_primitives::v2::GroupIndex, ); - impl ::subxt::Event for CandidateBacked { + impl ::subxt::events::StaticEvent for CandidateBacked { const PALLET: &'static str = "ParaInclusion"; const EVENT: &'static str = "CandidateBacked"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A candidate was included. `[candidate, head_data]`"] pub struct CandidateIncluded( pub runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, pub runtime_types::polkadot_parachain::primitives::HeadData, pub runtime_types::polkadot_primitives::v2::CoreIndex, pub runtime_types::polkadot_primitives::v2::GroupIndex, ); - impl ::subxt::Event for CandidateIncluded { + impl ::subxt::events::StaticEvent for CandidateIncluded { const PALLET: &'static str = "ParaInclusion"; const EVENT: &'static str = "CandidateIncluded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A candidate timed out. `[candidate, head_data]`"] pub struct CandidateTimedOut( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - ); - impl ::subxt::Event for CandidateTimedOut { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateTimedOut"; - } - } - pub mod storage { - use super::runtime_types; - pub struct AvailabilityBitfields<'a>( - pub &'a runtime_types::polkadot_primitives::v2::ValidatorIndex, - ); - impl ::subxt::StorageEntry for AvailabilityBitfields<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "AvailabilityBitfields"; - type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailability<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingAvailability<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "PendingAvailability"; - type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailabilityCommitments<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingAvailabilityCommitments<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "PendingAvailabilityCommitments"; - type Value = runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] pub fn availability_bitfields (& self , _0 : & 'a runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 223u8, 74u8, 17u8, 152u8, 136u8, 20u8, 241u8, 47u8, - 169u8, 34u8, 128u8, 78u8, 121u8, 47u8, 165u8, 35u8, - 222u8, 15u8, 236u8, 90u8, 215u8, 160u8, 10u8, 18u8, - 152u8, 69u8, 38u8, 97u8, 122u8, 247u8, 241u8, 255u8, - ] - { - let entry = AvailabilityBitfields(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] - pub fn availability_bitfields_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, AvailabilityBitfields<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 223u8, 74u8, 17u8, 152u8, 136u8, 20u8, 241u8, 47u8, - 169u8, 34u8, 128u8, 78u8, 121u8, 47u8, 165u8, 35u8, - 222u8, 15u8, 236u8, 90u8, 215u8, 160u8, 10u8, 18u8, - 152u8, 69u8, 38u8, 97u8, 122u8, 247u8, 241u8, 255u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Candidates pending availability by `ParaId`."] pub fn pending_availability (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 201u8, 235u8, 244u8, 21u8, 107u8, 106u8, 50u8, 211u8, - 165u8, 102u8, 113u8, 3u8, 54u8, 155u8, 159u8, 255u8, - 117u8, 107u8, 68u8, 174u8, 86u8, 90u8, 172u8, 181u8, - 164u8, 171u8, 215u8, 238u8, 118u8, 111u8, 25u8, 111u8, - ] - { - let entry = PendingAvailability(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " Candidates pending availability by `ParaId`."] - pub fn pending_availability_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailability<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 201u8, 235u8, 244u8, 21u8, 107u8, 106u8, 50u8, 211u8, - 165u8, 102u8, 113u8, 3u8, 54u8, 155u8, 159u8, 255u8, - 117u8, 107u8, 68u8, 174u8, 86u8, 90u8, 172u8, 181u8, - 164u8, 171u8, 215u8, 238u8, 118u8, 111u8, 25u8, 111u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::ext::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v2::CoreIndex, + ); + impl ::subxt::events::StaticEvent for CandidateTimedOut { + const PALLET: &'static str = "ParaInclusion"; + const EVENT: &'static str = "CandidateTimedOut"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] pub fn availability_bitfields (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInclusion", + "AvailabilityBitfields", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 149u8, 215u8, 123u8, 226u8, 73u8, 240u8, 102u8, 39u8, 243u8, + 232u8, 226u8, 116u8, 65u8, 180u8, 110u8, 4u8, 194u8, 50u8, + 60u8, 193u8, 142u8, 62u8, 20u8, 148u8, 106u8, 162u8, 96u8, + 114u8, 215u8, 250u8, 111u8, 225u8, + ], + ) + } + #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] pub fn availability_bitfields_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , () , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInclusion", + "AvailabilityBitfields", + Vec::new(), + [ + 149u8, 215u8, 123u8, 226u8, 73u8, 240u8, 102u8, 39u8, 243u8, + 232u8, 226u8, 116u8, 65u8, 180u8, 110u8, 4u8, 194u8, 50u8, + 60u8, 193u8, 142u8, 62u8, 20u8, 148u8, 106u8, 162u8, 96u8, + 114u8, 215u8, 250u8, 111u8, 225u8, + ], + ) + } + #[doc = " Candidates pending availability by `ParaId`."] pub fn pending_availability (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_parachain :: primitives :: Id > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: ext :: sp_core :: H256 , :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInclusion", + "PendingAvailability", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 54u8, 166u8, 18u8, 56u8, 51u8, 241u8, 31u8, 165u8, 220u8, + 138u8, 67u8, 171u8, 23u8, 101u8, 109u8, 26u8, 211u8, 237u8, + 81u8, 143u8, 192u8, 214u8, 49u8, 42u8, 69u8, 30u8, 168u8, + 113u8, 72u8, 12u8, 140u8, 242u8, + ], + ) + } + #[doc = " Candidates pending availability by `ParaId`."] pub fn pending_availability_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: ext :: sp_core :: H256 , :: core :: primitive :: u32 > > , () , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInclusion", + "PendingAvailability", + Vec::new(), + [ + 54u8, 166u8, 18u8, 56u8, 51u8, 241u8, 31u8, 165u8, 220u8, + 138u8, 67u8, 171u8, 23u8, 101u8, 109u8, 26u8, 211u8, 237u8, + 81u8, 143u8, 192u8, 214u8, 49u8, 42u8, 69u8, 30u8, 168u8, + 113u8, 72u8, 12u8, 140u8, 242u8, + ], + ) } #[doc = " The commitments of candidates pending availability, by `ParaId`."] pub fn pending_availability_commitments( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::CandidateCommitments< + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata - .storage_hash::() - { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 164u8, 245u8, 130u8, 208u8, 141u8, 88u8, 99u8, 247u8, - 90u8, 215u8, 40u8, 99u8, 239u8, 7u8, 231u8, 13u8, 233u8, - 204u8, 223u8, 137u8, 158u8, 250u8, 24u8, 107u8, 152u8, - 240u8, 195u8, 28u8, 170u8, 219u8, 174u8, 213u8, - ] - { - let entry = PendingAvailabilityCommitments(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInclusion", + "PendingAvailabilityCommitments", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 146u8, 206u8, 148u8, 102u8, 55u8, 101u8, 144u8, 33u8, 197u8, + 232u8, 64u8, 205u8, 216u8, 21u8, 247u8, 170u8, 237u8, 115u8, + 144u8, 43u8, 106u8, 87u8, 82u8, 39u8, 11u8, 87u8, 149u8, + 195u8, 56u8, 59u8, 54u8, 8u8, + ], + ) } #[doc = " The commitments of candidates pending availability, by `ParaId`."] - pub fn pending_availability_commitments_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailabilityCommitments<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata - .storage_hash::() - { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 164u8, 245u8, 130u8, 208u8, 141u8, 88u8, 99u8, 247u8, - 90u8, 215u8, 40u8, 99u8, 239u8, 7u8, 231u8, 13u8, 233u8, - 204u8, 223u8, 137u8, 158u8, 250u8, 24u8, 107u8, 152u8, - 240u8, 195u8, 28u8, 170u8, 219u8, 174u8, 213u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn pending_availability_commitments_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::CandidateCommitments< + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInclusion", + "PendingAvailabilityCommitments", + Vec::new(), + [ + 146u8, 206u8, 148u8, 102u8, 55u8, 101u8, 144u8, 33u8, 197u8, + 232u8, 64u8, 205u8, 216u8, 21u8, 247u8, 170u8, 237u8, 115u8, + 144u8, 43u8, 106u8, 87u8, 82u8, 39u8, 11u8, 87u8, 149u8, + 195u8, 56u8, 59u8, 54u8, 8u8, + ], + ) } } } } pub mod para_inherent { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Enter { pub data: runtime_types::polkadot_primitives::v2::InherentData< runtime_types::sp_runtime::generic::header::Header< @@ -32102,25 +21525,8 @@ pub mod api { >, >, } - impl ::subxt::Call for Enter { - const PALLET: &'static str = "ParaInherent"; - const FUNCTION: &'static str = "enter"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] pub fn enter( &self, @@ -32130,67 +21536,25 @@ pub mod api { runtime_types::sp_runtime::traits::BlakeTwo256, >, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Enter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 208u8, 134u8, 126u8, 30u8, 50u8, 219u8, 225u8, 133u8, 3u8, - 2u8, 121u8, 154u8, 133u8, 141u8, 159u8, 193u8, 66u8, 252u8, - 236u8, 234u8, 38u8, 169u8, 202u8, 154u8, 28u8, 171u8, 248u8, - 77u8, 31u8, 114u8, 21u8, 215u8, - ] - { - let call = Enter { data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ParaInherent", + "enter", + Enter { data }, + [ + 92u8, 247u8, 59u8, 6u8, 2u8, 102u8, 76u8, 147u8, 46u8, 232u8, + 38u8, 191u8, 145u8, 155u8, 23u8, 39u8, 228u8, 95u8, 57u8, + 249u8, 247u8, 20u8, 9u8, 189u8, 156u8, 187u8, 207u8, 107u8, + 0u8, 13u8, 228u8, 6u8, + ], + ) } } } pub mod storage { use super::runtime_types; - pub struct Included; - impl ::subxt::StorageEntry for Included { - const PALLET: &'static str = "ParaInherent"; - const STORAGE: &'static str = "Included"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct OnChainVotes; - impl ::subxt::StorageEntry for OnChainVotes { - const PALLET: &'static str = "ParaInherent"; - const STORAGE: &'static str = "OnChainVotes"; - type Value = runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Whether the paras inherent was included within this block."] #[doc = ""] #[doc = " The `Option<()>` is effectively a `bool`, but it never hits storage in the `None` variant"] @@ -32199,159 +21563,59 @@ pub mod api { #[doc = " If this is `None` at the end of the block, we panic and render the block invalid."] pub fn included( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<()>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 208u8, 213u8, 76u8, 64u8, 90u8, 141u8, 144u8, 52u8, - 220u8, 35u8, 143u8, 171u8, 45u8, 59u8, 9u8, 218u8, 29u8, - 186u8, 139u8, 203u8, 205u8, 12u8, 10u8, 2u8, 27u8, 167u8, - 182u8, 244u8, 167u8, 220u8, 44u8, 16u8, - ] - { - let entry = Included; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<()>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInherent", + "Included", + vec![], + [ + 208u8, 213u8, 76u8, 64u8, 90u8, 141u8, 144u8, 52u8, 220u8, + 35u8, 143u8, 171u8, 45u8, 59u8, 9u8, 218u8, 29u8, 186u8, + 139u8, 203u8, 205u8, 12u8, 10u8, 2u8, 27u8, 167u8, 182u8, + 244u8, 167u8, 220u8, 44u8, 16u8, + ], + ) } #[doc = " Scraped on chain data for extracting resolved disputes as well as backing votes."] pub fn on_chain_votes( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< - ::subxt::sp_core::H256, - >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< + ::subxt::ext::sp_core::H256, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 163u8, 22u8, 172u8, 81u8, 10u8, 19u8, 149u8, 111u8, 22u8, - 92u8, 203u8, 33u8, 225u8, 124u8, 69u8, 70u8, 66u8, 188u8, - 33u8, 24u8, 132u8, 234u8, 106u8, 51u8, 248u8, 57u8, - 169u8, 115u8, 164u8, 253u8, 112u8, 235u8, - ] - { - let entry = OnChainVotes; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaInherent", + "OnChainVotes", + vec![], + [ + 187u8, 34u8, 219u8, 197u8, 202u8, 214u8, 140u8, 152u8, 253u8, + 65u8, 206u8, 217u8, 36u8, 40u8, 107u8, 215u8, 135u8, 115u8, + 35u8, 61u8, 180u8, 131u8, 0u8, 184u8, 193u8, 76u8, 165u8, + 63u8, 106u8, 222u8, 126u8, 113u8, + ], + ) } } } } pub mod para_scheduler { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; pub mod storage { use super::runtime_types; - pub struct ValidatorGroups; - impl ::subxt::StorageEntry for ValidatorGroups { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ValidatorGroups"; - type Value = ::std::vec::Vec< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParathreadQueue; - impl ::subxt::StorageEntry for ParathreadQueue { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadQueue"; - type Value = runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AvailabilityCores; - impl ::subxt::StorageEntry for AvailabilityCores { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "AvailabilityCores"; - type Value = ::std::vec::Vec< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CoreOccupied, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParathreadClaimIndex; - impl ::subxt::StorageEntry for ParathreadClaimIndex { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadClaimIndex"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SessionStartBlock; - impl ::subxt::StorageEntry for SessionStartBlock { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "SessionStartBlock"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Scheduled; - impl ::subxt::StorageEntry for Scheduled { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "Scheduled"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " All the validator groups. One for each core. Indices are into `ActiveValidators` - not the"] #[doc = " broader set of Polkadot validators, but instead just the subset used for parachains during"] #[doc = " this session."] @@ -32360,70 +21624,45 @@ pub mod api { #[doc = " Reasonably, 100-1000. The dominant factor is the number of validators: safe upper bound at 10k."] pub fn validator_groups( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< ::std::vec::Vec< runtime_types::polkadot_primitives::v2::ValidatorIndex, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 84u8, 195u8, 53u8, 111u8, 186u8, 61u8, 3u8, 36u8, 10u8, - 9u8, 66u8, 119u8, 116u8, 213u8, 86u8, 153u8, 18u8, 149u8, - 83u8, 92u8, 232u8, 212u8, 175u8, 52u8, 74u8, 135u8, - 137u8, 34u8, 123u8, 232u8, 131u8, 22u8, - ] - { - let entry = ValidatorGroups; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaScheduler", + "ValidatorGroups", + vec![], + [ + 175u8, 187u8, 69u8, 76u8, 211u8, 36u8, 162u8, 147u8, 83u8, + 65u8, 83u8, 44u8, 241u8, 112u8, 246u8, 14u8, 237u8, 255u8, + 248u8, 58u8, 44u8, 207u8, 159u8, 112u8, 31u8, 90u8, 15u8, + 85u8, 4u8, 212u8, 215u8, 211u8, + ], + ) } #[doc = " A queue of upcoming claims and which core they should be mapped onto."] #[doc = ""] #[doc = " The number of queued claims is bounded at the `scheduling_lookahead`"] - #[doc = " multiplied by the number of parathread multiplexer cores. Reasonably, 10 * 50 = 500."] pub fn parathread_queue (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 55u8, 142u8, 211u8, 227u8, 167u8, 35u8, 168u8, 23u8, - 227u8, 185u8, 5u8, 154u8, 147u8, 237u8, 137u8, 133u8, - 81u8, 121u8, 70u8, 159u8, 206u8, 56u8, 20u8, 17u8, 79u8, - 19u8, 238u8, 114u8, 60u8, 96u8, 1u8, 20u8, - ] - { - let entry = ParathreadQueue; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " multiplied by the number of parathread multiplexer cores. Reasonably, 10 * 50 = 500."] pub fn parathread_queue (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaScheduler", + "ParathreadQueue", + vec![], + [ + 79u8, 144u8, 191u8, 114u8, 235u8, 55u8, 133u8, 208u8, 73u8, + 97u8, 73u8, 148u8, 96u8, 185u8, 110u8, 95u8, 132u8, 54u8, + 244u8, 86u8, 50u8, 218u8, 121u8, 226u8, 153u8, 58u8, 232u8, + 202u8, 132u8, 147u8, 168u8, 48u8, + ], + ) } #[doc = " One entry for each availability core. Entries are `None` if the core is not currently occupied. Can be"] #[doc = " temporarily `Some` if scheduled but not occupied."] @@ -32435,41 +21674,29 @@ pub mod api { #[doc = " * The number of validators divided by `configuration.max_validators_per_core`."] pub fn availability_cores( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< ::core::option::Option< runtime_types::polkadot_primitives::v2::CoreOccupied, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 170u8, 116u8, 249u8, 112u8, 156u8, 147u8, 94u8, 44u8, - 114u8, 10u8, 32u8, 91u8, 229u8, 56u8, 60u8, 222u8, 212u8, - 176u8, 107u8, 159u8, 143u8, 217u8, 200u8, 158u8, 86u8, - 88u8, 220u8, 204u8, 162u8, 148u8, 207u8, 150u8, - ] - { - let entry = AvailabilityCores; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaScheduler", + "AvailabilityCores", + vec![], + [ + 103u8, 94u8, 52u8, 17u8, 118u8, 25u8, 254u8, 190u8, 74u8, + 91u8, 64u8, 205u8, 243u8, 113u8, 143u8, 166u8, 193u8, 110u8, + 214u8, 151u8, 24u8, 112u8, 69u8, 131u8, 235u8, 78u8, 240u8, + 120u8, 240u8, 68u8, 56u8, 215u8, + ], + ) } #[doc = " An index used to ensure that only one claim on a parathread exists in the queue or is"] #[doc = " currently being handled by an occupied core."] @@ -32477,39 +21704,27 @@ pub mod api { #[doc = " Bounded by the number of parathread cores and scheduling lookahead. Reasonably, 10 * 50 = 500."] pub fn parathread_claim_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 187u8, 105u8, 221u8, 0u8, 103u8, 9u8, 52u8, 127u8, 47u8, - 155u8, 147u8, 84u8, 249u8, 213u8, 140u8, 75u8, 99u8, - 238u8, 220u8, 242u8, 220u8, 99u8, 204u8, 178u8, 153u8, - 170u8, 72u8, 34u8, 83u8, 238u8, 211u8, 150u8, - ] - { - let entry = ParathreadClaimIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaScheduler", + "ParathreadClaimIndex", + vec![], + [ + 64u8, 17u8, 173u8, 35u8, 14u8, 16u8, 149u8, 200u8, 118u8, + 211u8, 130u8, 15u8, 124u8, 112u8, 44u8, 220u8, 156u8, 132u8, + 119u8, 148u8, 24u8, 120u8, 252u8, 246u8, 204u8, 119u8, 206u8, + 85u8, 44u8, 210u8, 135u8, 83u8, + ], + ) } #[doc = " The block number where the session start occurred. Used to track how many group rotations have occurred."] #[doc = ""] @@ -32519,243 +21734,165 @@ pub mod api { #[doc = " block following the session change, block number of which we save in this storage value."] pub fn session_start_block( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 122u8, 37u8, 150u8, 1u8, 185u8, 201u8, 168u8, 67u8, 55u8, - 17u8, 101u8, 18u8, 133u8, 212u8, 6u8, 73u8, 191u8, 204u8, - 229u8, 22u8, 185u8, 120u8, 24u8, 245u8, 121u8, 215u8, - 124u8, 210u8, 49u8, 28u8, 26u8, 80u8, - ] - { - let entry = SessionStartBlock; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaScheduler", + "SessionStartBlock", + vec![], + [ + 122u8, 37u8, 150u8, 1u8, 185u8, 201u8, 168u8, 67u8, 55u8, + 17u8, 101u8, 18u8, 133u8, 212u8, 6u8, 73u8, 191u8, 204u8, + 229u8, 22u8, 185u8, 120u8, 24u8, 245u8, 121u8, 215u8, 124u8, + 210u8, 49u8, 28u8, 26u8, 80u8, + ], + ) } #[doc = " Currently scheduled cores - free but up to be occupied."] #[doc = ""] #[doc = " Bounded by the number of cores: one for each parachain and parathread multiplexer."] #[doc = ""] #[doc = " The value contained here will not be valid after the end of a block. Runtime APIs should be used to determine scheduled cores/"] - #[doc = " for the upcoming block."] pub fn scheduled (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 29u8, 43u8, 158u8, 142u8, 50u8, 67u8, 4u8, 30u8, 158u8, - 99u8, 47u8, 13u8, 151u8, 141u8, 163u8, 63u8, 140u8, - 179u8, 247u8, 106u8, 53u8, 66u8, 90u8, 107u8, 95u8, - 174u8, 63u8, 123u8, 176u8, 68u8, 90u8, 232u8, - ] - { - let entry = Scheduled; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " for the upcoming block."] pub fn scheduled (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaScheduler", + "Scheduled", + vec![], + [ + 246u8, 105u8, 102u8, 107u8, 143u8, 92u8, 220u8, 69u8, 71u8, + 102u8, 212u8, 157u8, 56u8, 112u8, 42u8, 179u8, 183u8, 139u8, + 128u8, 81u8, 239u8, 84u8, 103u8, 126u8, 82u8, 247u8, 39u8, + 39u8, 231u8, 218u8, 131u8, 53u8, + ], + ) } } } } pub mod paras { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceSetCurrentCode { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, } - impl ::subxt::Call for ForceSetCurrentCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_set_current_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceSetCurrentHead { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, } - impl ::subxt::Call for ForceSetCurrentHead { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_set_current_head"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceScheduleCodeUpgrade { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, pub relay_parent_number: ::core::primitive::u32, } - impl ::subxt::Call for ForceScheduleCodeUpgrade { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_schedule_code_upgrade"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceNoteNewHead { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, } - impl ::subxt::Call for ForceNoteNewHead { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_note_new_head"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceQueueAction { pub para: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for ForceQueueAction { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_queue_action"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddTrustedValidationCode { pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, } - impl ::subxt::Call for AddTrustedValidationCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "add_trusted_validation_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct PokeUnusedValidationCode { pub validation_code_hash: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, } - impl ::subxt::Call for PokeUnusedValidationCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "poke_unused_validation_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct IncludePvfCheckStatement { pub stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, pub signature: runtime_types::polkadot_primitives::v2::validator_app::Signature, } - impl ::subxt::Call for IncludePvfCheckStatement { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "include_pvf_check_statement"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Set the storage for the parachain validation code immediately."] pub fn force_set_current_code( &self, para: runtime_types::polkadot_parachain::primitives::Id, new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSetCurrentCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 100u8, 36u8, 105u8, 246u8, 77u8, 252u8, 162u8, 139u8, 60u8, - 37u8, 12u8, 148u8, 206u8, 160u8, 134u8, 105u8, 50u8, 52u8, - 156u8, 252u8, 217u8, 174u8, 211u8, 208u8, 88u8, 81u8, 236u8, - 66u8, 27u8, 59u8, 126u8, 5u8, - ] - { - let call = ForceSetCurrentCode { para, new_code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "force_set_current_code", + ForceSetCurrentCode { para, new_code }, + [ + 56u8, 59u8, 48u8, 185u8, 106u8, 99u8, 250u8, 32u8, 207u8, + 2u8, 4u8, 110u8, 165u8, 131u8, 22u8, 33u8, 248u8, 175u8, + 186u8, 6u8, 118u8, 51u8, 74u8, 239u8, 68u8, 122u8, 148u8, + 242u8, 193u8, 131u8, 6u8, 135u8, + ], + ) } #[doc = "Set the storage for the current parachain head data immediately."] pub fn force_set_current_head( &self, para: runtime_types::polkadot_parachain::primitives::Id, new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSetCurrentHead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 119u8, 46u8, 120u8, 202u8, 138u8, 190u8, 179u8, 78u8, 155u8, - 167u8, 220u8, 233u8, 170u8, 248u8, 202u8, 92u8, 73u8, 246u8, - 224u8, 56u8, 208u8, 124u8, 215u8, 19u8, 235u8, 246u8, 89u8, - 189u8, 19u8, 205u8, 22u8, 70u8, - ] - { - let call = ForceSetCurrentHead { para, new_head }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "force_set_current_head", + ForceSetCurrentHead { para, new_head }, + [ + 203u8, 70u8, 33u8, 168u8, 133u8, 64u8, 146u8, 137u8, 156u8, + 104u8, 183u8, 26u8, 74u8, 227u8, 154u8, 224u8, 75u8, 85u8, + 143u8, 51u8, 60u8, 194u8, 59u8, 94u8, 100u8, 84u8, 194u8, + 100u8, 153u8, 9u8, 222u8, 63u8, + ], + ) } #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] pub fn force_schedule_code_upgrade( @@ -32763,74 +21900,41 @@ pub mod api { para: runtime_types::polkadot_parachain::primitives::Id, new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, relay_parent_number: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceScheduleCodeUpgrade, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 254u8, 60u8, 105u8, 37u8, 116u8, 190u8, 30u8, 255u8, 210u8, - 24u8, 120u8, 99u8, 174u8, 215u8, 233u8, 83u8, 57u8, 200u8, - 24u8, 49u8, 220u8, 12u8, 103u8, 30u8, 165u8, 10u8, 125u8, - 255u8, 88u8, 134u8, 199u8, 3u8, - ] - { - let call = ForceScheduleCodeUpgrade { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "force_schedule_code_upgrade", + ForceScheduleCodeUpgrade { para, new_code, relay_parent_number, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 30u8, 210u8, 178u8, 31u8, 48u8, 144u8, 167u8, 117u8, 220u8, + 36u8, 175u8, 220u8, 145u8, 193u8, 20u8, 98u8, 149u8, 130u8, + 66u8, 54u8, 20u8, 204u8, 231u8, 116u8, 203u8, 179u8, 253u8, + 106u8, 55u8, 58u8, 116u8, 109u8, + ], + ) } #[doc = "Note a new block head for para within the context of the current block."] pub fn force_note_new_head( &self, para: runtime_types::polkadot_parachain::primitives::Id, new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNoteNewHead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 203u8, 31u8, 68u8, 125u8, 105u8, 218u8, 177u8, 205u8, 248u8, - 131u8, 25u8, 170u8, 140u8, 56u8, 183u8, 106u8, 2u8, 118u8, - 79u8, 22u8, 228u8, 91u8, 33u8, 66u8, 245u8, 144u8, 147u8, - 142u8, 14u8, 171u8, 125u8, 233u8, - ] - { - let call = ForceNoteNewHead { para, new_head }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "force_note_new_head", + ForceNoteNewHead { para, new_head }, + [ + 83u8, 93u8, 166u8, 142u8, 213u8, 1u8, 243u8, 73u8, 192u8, + 164u8, 104u8, 206u8, 99u8, 250u8, 31u8, 222u8, 231u8, 54u8, + 12u8, 45u8, 92u8, 74u8, 248u8, 50u8, 180u8, 86u8, 251u8, + 172u8, 227u8, 88u8, 45u8, 127u8, + ], + ) } #[doc = "Put a parachain directly into the next session's action queue."] #[doc = "We can't queue it any sooner than this without going into the"] @@ -32838,35 +21942,18 @@ pub mod api { pub fn force_queue_action( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceQueueAction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 141u8, 235u8, 245u8, 93u8, 24u8, 155u8, 106u8, 136u8, 190u8, - 236u8, 216u8, 131u8, 245u8, 5u8, 186u8, 131u8, 159u8, 240u8, - 95u8, 139u8, 231u8, 12u8, 255u8, 74u8, 194u8, 13u8, 112u8, - 78u8, 110u8, 95u8, 26u8, 133u8, - ] - { - let call = ForceQueueAction { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "force_queue_action", + ForceQueueAction { para }, + [ + 195u8, 243u8, 79u8, 34u8, 111u8, 246u8, 109u8, 90u8, 251u8, + 137u8, 48u8, 23u8, 117u8, 29u8, 26u8, 200u8, 37u8, 64u8, + 36u8, 254u8, 224u8, 99u8, 165u8, 246u8, 8u8, 76u8, 250u8, + 36u8, 141u8, 67u8, 185u8, 17u8, + ], + ) } #[doc = "Adds the validation code to the storage."] #[doc = ""] @@ -32884,35 +21971,19 @@ pub mod api { pub fn add_trusted_validation_code( &self, validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddTrustedValidationCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 110u8, 255u8, 249u8, 176u8, 109u8, 54u8, 87u8, 19u8, 7u8, - 62u8, 220u8, 143u8, 196u8, 99u8, 66u8, 49u8, 18u8, 225u8, - 14u8, 42u8, 243u8, 228u8, 232u8, 207u8, 246u8, 34u8, 179u8, - 127u8, 246u8, 239u8, 30u8, 214u8, - ] - { - let call = AddTrustedValidationCode { validation_code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "add_trusted_validation_code", + AddTrustedValidationCode { validation_code }, + [ + 160u8, 199u8, 245u8, 178u8, 58u8, 65u8, 79u8, 199u8, 53u8, + 60u8, 84u8, 225u8, 2u8, 145u8, 154u8, 204u8, 165u8, 171u8, + 173u8, 223u8, 59u8, 196u8, 37u8, 12u8, 243u8, 158u8, 77u8, + 184u8, 58u8, 64u8, 133u8, 71u8, + ], + ) } #[doc = "Remove the validation code from the storage iff the reference count is 0."] #[doc = ""] @@ -32922,37 +21993,21 @@ pub mod api { pub fn poke_unused_validation_code( &self, validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PokeUnusedValidationCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 142u8, 14u8, 7u8, 29u8, 74u8, 213u8, 165u8, 206u8, - 45u8, 135u8, 121u8, 0u8, 146u8, 217u8, 59u8, 189u8, 120u8, - 169u8, 227u8, 225u8, 135u8, 15u8, 45u8, 197u8, 201u8, 29u8, - 128u8, 49u8, 165u8, 106u8, 80u8, - ] - { - let call = PokeUnusedValidationCode { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "poke_unused_validation_code", + PokeUnusedValidationCode { validation_code_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 98u8, 9u8, 24u8, 180u8, 8u8, 144u8, 36u8, 28u8, 111u8, 83u8, + 162u8, 160u8, 66u8, 119u8, 177u8, 117u8, 143u8, 233u8, 241u8, + 128u8, 189u8, 118u8, 241u8, 30u8, 74u8, 171u8, 193u8, 177u8, + 233u8, 12u8, 254u8, 146u8, + ], + ) } #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] #[doc = "enacts the results if that was the last vote before achieving the supermajority."] @@ -32960,35 +22015,19 @@ pub mod api { &self, stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncludePvfCheckStatement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 187u8, 231u8, 113u8, 29u8, 177u8, 92u8, 2u8, 116u8, 88u8, - 114u8, 19u8, 170u8, 167u8, 254u8, 149u8, 142u8, 24u8, 57u8, - 187u8, 210u8, 72u8, 239u8, 32u8, 75u8, 39u8, 47u8, 158u8, - 205u8, 82u8, 50u8, 175u8, 31u8, - ] - { - let call = IncludePvfCheckStatement { stmt, signature }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "Paras", + "include_pvf_check_statement", + IncludePvfCheckStatement { stmt, signature }, + [ + 22u8, 136u8, 241u8, 59u8, 36u8, 249u8, 239u8, 255u8, 169u8, + 117u8, 19u8, 58u8, 214u8, 16u8, 135u8, 65u8, 13u8, 250u8, + 5u8, 41u8, 144u8, 29u8, 207u8, 73u8, 215u8, 221u8, 1u8, + 253u8, 123u8, 110u8, 6u8, 196u8, + ], + ) } } } @@ -32996,813 +22035,448 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Current code has been updated for a Para. `para_id`"] pub struct CurrentCodeUpdated( pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::Event for CurrentCodeUpdated { + impl ::subxt::events::StaticEvent for CurrentCodeUpdated { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "CurrentCodeUpdated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Current head has been updated for a Para. `para_id`"] pub struct CurrentHeadUpdated( pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::Event for CurrentHeadUpdated { + impl ::subxt::events::StaticEvent for CurrentHeadUpdated { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "CurrentHeadUpdated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A code upgrade has been scheduled for a Para. `para_id`"] pub struct CodeUpgradeScheduled( pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::Event for CodeUpgradeScheduled { + impl ::subxt::events::StaticEvent for CodeUpgradeScheduled { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "CodeUpgradeScheduled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new head has been noted for a Para. `para_id`"] pub struct NewHeadNoted( pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::Event for NewHeadNoted { + impl ::subxt::events::StaticEvent for NewHeadNoted { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "NewHeadNoted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A para has been queued to execute pending actions. `para_id`"] - pub struct ActionQueued( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for ActionQueued { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "ActionQueued"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] - #[doc = "code. `code_hash` `para_id`"] - pub struct PvfCheckStarted( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckStarted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckStarted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given validation code was accepted by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - pub struct PvfCheckAccepted( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckAccepted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given validation code was rejected by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - pub struct PvfCheckRejected( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckRejected { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckRejected"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PvfActiveVoteMap<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for PvfActiveVoteMap<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PvfActiveVoteMap"; - type Value = runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PvfActiveVoteList; - impl ::subxt::StorageEntry for PvfActiveVoteList { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PvfActiveVoteList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Parachains; - impl ::subxt::StorageEntry for Parachains { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Parachains"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParaLifecycles<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ParaLifecycles<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ParaLifecycles"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Heads<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Heads<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Heads"; - type Value = runtime_types::polkadot_parachain::primitives::HeadData; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CurrentCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for CurrentCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CurrentCodeHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for PastCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodeHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeMeta<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PastCodeMeta<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodeMeta"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodePruning; - impl ::subxt::StorageEntry for PastCodePruning { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodePruning"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct FutureCodeUpgrades<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeUpgrades<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeUpgrades"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct FutureCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeGoAheadSignal<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpgradeGoAheadSignal<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeGoAheadSignal"; - type Value = runtime_types::polkadot_primitives::v2::UpgradeGoAhead; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeRestrictionSignal<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpgradeRestrictionSignal<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeRestrictionSignal"; - type Value = runtime_types::polkadot_primitives::v2::UpgradeRestriction; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeCooldowns; - impl ::subxt::StorageEntry for UpgradeCooldowns { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeCooldowns"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpcomingUpgrades; - impl ::subxt::StorageEntry for UpcomingUpgrades { + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "A para has been queued to execute pending actions. `para_id`"] + pub struct ActionQueued( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::core::primitive::u32, + ); + impl ::subxt::events::StaticEvent for ActionQueued { const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpcomingUpgrades"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + const EVENT: &'static str = "ActionQueued"; } - pub struct ActionsQueue<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ActionsQueue<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ActionsQueue"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpcomingParasGenesis<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] + #[doc = "code. `code_hash` `para_id`"] + pub struct PvfCheckStarted( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::StorageEntry for UpcomingParasGenesis<'_> { + impl ::subxt::events::StaticEvent for PvfCheckStarted { const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpcomingParasGenesis"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CodeByHashRefs<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + const EVENT: &'static str = "PvfCheckStarted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "The given validation code was accepted by the PVF pre-checking vote."] + #[doc = "`code_hash` `para_id`"] + pub struct PvfCheckAccepted( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::StorageEntry for CodeByHashRefs<'_> { + impl ::subxt::events::StaticEvent for PvfCheckAccepted { const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHashRefs"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } + const EVENT: &'static str = "PvfCheckAccepted"; } - pub struct CodeByHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "The given validation code was rejected by the PVF pre-checking vote."] + #[doc = "`code_hash` `para_id`"] + pub struct PvfCheckRejected( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::StorageEntry for CodeByHash<'_> { + impl ::subxt::events::StaticEvent for PvfCheckRejected { const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCode; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + const EVENT: &'static str = "PvfCheckRejected"; } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { #[doc = " All currently active PVF pre-checking votes."] #[doc = ""] #[doc = " Invariant:"] - #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] pub fn pvf_active_vote_map (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 113u8, 142u8, 66u8, 141u8, 249u8, 227u8, 84u8, 128u8, - 137u8, 111u8, 215u8, 93u8, 246u8, 49u8, 126u8, 213u8, - 77u8, 139u8, 7u8, 19u8, 254u8, 84u8, 72u8, 96u8, 89u8, - 114u8, 199u8, 150u8, 122u8, 160u8, 222u8, 181u8, - ] - { - let entry = PvfActiveVoteMap(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] pub fn pvf_active_vote_map (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PvfActiveVoteMap", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 84u8, 214u8, 221u8, 221u8, 244u8, 56u8, 135u8, 87u8, 252u8, + 39u8, 188u8, 13u8, 196u8, 25u8, 214u8, 186u8, 152u8, 181u8, + 190u8, 39u8, 235u8, 211u8, 236u8, 114u8, 67u8, 85u8, 138u8, + 43u8, 248u8, 134u8, 124u8, 73u8, + ], + ) } #[doc = " All currently active PVF pre-checking votes."] #[doc = ""] #[doc = " Invariant:"] - #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] - pub fn pvf_active_vote_map_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PvfActiveVoteMap<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 113u8, 142u8, 66u8, 141u8, 249u8, 227u8, 84u8, 128u8, - 137u8, 111u8, 215u8, 93u8, 246u8, 49u8, 126u8, 213u8, - 77u8, 139u8, 7u8, 19u8, 254u8, 84u8, 72u8, 96u8, 89u8, - 114u8, 199u8, 150u8, 122u8, 160u8, 222u8, 181u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " The list of all currently active PVF votes. Auxiliary to `PvfActiveVoteMap`."] pub fn pvf_active_vote_list (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 30u8, 117u8, 174u8, 227u8, 251u8, 95u8, 176u8, 153u8, - 151u8, 188u8, 89u8, 252u8, 168u8, 203u8, 174u8, 241u8, - 209u8, 45u8, 96u8, 77u8, 117u8, 159u8, 33u8, 1u8, 55u8, - 111u8, 50u8, 189u8, 246u8, 209u8, 42u8, 155u8, - ] - { - let entry = PvfActiveVoteList; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] pub fn pvf_active_vote_map_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > > , () , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PvfActiveVoteMap", + Vec::new(), + [ + 84u8, 214u8, 221u8, 221u8, 244u8, 56u8, 135u8, 87u8, 252u8, + 39u8, 188u8, 13u8, 196u8, 25u8, 214u8, 186u8, 152u8, 181u8, + 190u8, 39u8, 235u8, 211u8, 236u8, 114u8, 67u8, 85u8, 138u8, + 43u8, 248u8, 134u8, 124u8, 73u8, + ], + ) + } + #[doc = " The list of all currently active PVF votes. Auxiliary to `PvfActiveVoteMap`."] pub fn pvf_active_vote_list (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PvfActiveVoteList", + vec![], + [ + 196u8, 23u8, 108u8, 162u8, 29u8, 33u8, 49u8, 219u8, 127u8, + 26u8, 241u8, 58u8, 102u8, 43u8, 156u8, 3u8, 87u8, 153u8, + 195u8, 96u8, 68u8, 132u8, 170u8, 162u8, 18u8, 156u8, 121u8, + 63u8, 53u8, 91u8, 68u8, 69u8, + ], + ) } #[doc = " All parachains. Ordered ascending by `ParaId`. Parathreads are not included."] #[doc = ""] #[doc = " Consider using the [`ParachainsCache`] type of modifying."] pub fn parachains( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 174u8, 146u8, 170u8, 102u8, 125u8, 176u8, 74u8, 177u8, - 28u8, 54u8, 13u8, 73u8, 188u8, 248u8, 78u8, 144u8, 88u8, - 183u8, 224u8, 69u8, 224u8, 31u8, 30u8, 115u8, 191u8, - 166u8, 252u8, 218u8, 114u8, 241u8, 110u8, 39u8, - ] - { - let entry = Parachains; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "Parachains", + vec![], + [ + 85u8, 234u8, 218u8, 69u8, 20u8, 169u8, 235u8, 6u8, 69u8, + 126u8, 28u8, 18u8, 57u8, 93u8, 238u8, 7u8, 167u8, 221u8, + 75u8, 35u8, 36u8, 4u8, 46u8, 55u8, 234u8, 123u8, 122u8, + 173u8, 13u8, 205u8, 58u8, 226u8, + ], + ) } - #[doc = " The current lifecycle of a all known Para IDs."] pub fn para_lifecycles (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaLifecycle > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 38u8, 31u8, 0u8, 253u8, 63u8, 27u8, 13u8, 12u8, 247u8, - 34u8, 21u8, 166u8, 166u8, 236u8, 178u8, 217u8, 230u8, - 117u8, 215u8, 8u8, 149u8, 37u8, 231u8, 160u8, 226u8, - 89u8, 12u8, 162u8, 197u8, 237u8, 235u8, 127u8, - ] - { - let entry = ParaLifecycles(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " The current lifecycle of a all known Para IDs."] + pub fn para_lifecycles( + &self, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "ParaLifecycles", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 221u8, 103u8, 112u8, 222u8, 86u8, 2u8, 172u8, 187u8, 174u8, + 106u8, 4u8, 253u8, 35u8, 73u8, 18u8, 78u8, 25u8, 31u8, 124u8, + 110u8, 81u8, 62u8, 215u8, 228u8, 183u8, 132u8, 138u8, 213u8, + 186u8, 209u8, 191u8, 186u8, + ], + ) } #[doc = " The current lifecycle of a all known Para IDs."] - pub fn para_lifecycles_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ParaLifecycles<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 38u8, 31u8, 0u8, 253u8, 63u8, 27u8, 13u8, 12u8, 247u8, - 34u8, 21u8, 166u8, 166u8, 236u8, 178u8, 217u8, 230u8, - 117u8, 215u8, 8u8, 149u8, 37u8, 231u8, 160u8, 226u8, - 89u8, 12u8, 162u8, 197u8, 237u8, 235u8, 127u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn para_lifecycles_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "ParaLifecycles", + Vec::new(), + [ + 221u8, 103u8, 112u8, 222u8, 86u8, 2u8, 172u8, 187u8, 174u8, + 106u8, 4u8, 253u8, 35u8, 73u8, 18u8, 78u8, 25u8, 31u8, 124u8, + 110u8, 81u8, 62u8, 215u8, 228u8, 183u8, 132u8, 138u8, 213u8, + 186u8, 209u8, 191u8, 186u8, + ], + ) } #[doc = " The head-data of every registered para."] pub fn heads( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::HeadData, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 242u8, 145u8, 237u8, 33u8, 204u8, 183u8, 18u8, 135u8, - 182u8, 47u8, 220u8, 187u8, 118u8, 79u8, 163u8, 122u8, - 227u8, 215u8, 43u8, 70u8, 24u8, 33u8, 74u8, 113u8, 67u8, - 25u8, 47u8, 210u8, 136u8, 236u8, 83u8, 148u8, - ] - { - let entry = Heads(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::HeadData, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "Heads", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 122u8, 38u8, 181u8, 121u8, 245u8, 100u8, 136u8, 233u8, 237u8, + 248u8, 127u8, 2u8, 147u8, 41u8, 202u8, 242u8, 238u8, 70u8, + 55u8, 200u8, 15u8, 106u8, 138u8, 108u8, 192u8, 61u8, 158u8, + 134u8, 131u8, 142u8, 70u8, 3u8, + ], + ) } #[doc = " The head-data of every registered para."] - pub fn heads_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Heads<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 242u8, 145u8, 237u8, 33u8, 204u8, 183u8, 18u8, 135u8, - 182u8, 47u8, 220u8, 187u8, 118u8, 79u8, 163u8, 122u8, - 227u8, 215u8, 43u8, 70u8, 24u8, 33u8, 74u8, 113u8, 67u8, - 25u8, 47u8, 210u8, 136u8, 236u8, 83u8, 148u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn heads_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::HeadData, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "Heads", + Vec::new(), + [ + 122u8, 38u8, 181u8, 121u8, 245u8, 100u8, 136u8, 233u8, 237u8, + 248u8, 127u8, 2u8, 147u8, 41u8, 202u8, 242u8, 238u8, 70u8, + 55u8, 200u8, 15u8, 106u8, 138u8, 108u8, 192u8, 61u8, 158u8, + 134u8, 131u8, 142u8, 70u8, 3u8, + ], + ) } #[doc = " The validation code hash of every live para."] #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn current_code_hash (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 146u8, 139u8, 159u8, 78u8, 13u8, 151u8, 18u8, 117u8, - 15u8, 107u8, 251u8, 200u8, 100u8, 200u8, 170u8, 50u8, - 250u8, 189u8, 162u8, 128u8, 253u8, 51u8, 192u8, 174u8, - 190u8, 48u8, 96u8, 214u8, 33u8, 117u8, 82u8, 247u8, - ] - { - let entry = CurrentCodeHash(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] + pub fn current_code_hash( + &self, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "CurrentCodeHash", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 179u8, 145u8, 45u8, 44u8, 130u8, 240u8, 50u8, 128u8, 190u8, + 133u8, 66u8, 85u8, 47u8, 141u8, 56u8, 87u8, 131u8, 99u8, + 170u8, 203u8, 8u8, 51u8, 123u8, 73u8, 206u8, 30u8, 173u8, + 35u8, 157u8, 195u8, 104u8, 236u8, + ], + ) } #[doc = " The validation code hash of every live para."] #[doc = ""] #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn current_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, CurrentCodeHash<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 146u8, 139u8, 159u8, 78u8, 13u8, 151u8, 18u8, 117u8, - 15u8, 107u8, 251u8, 200u8, 100u8, 200u8, 170u8, 50u8, - 250u8, 189u8, 162u8, 128u8, 253u8, 51u8, 192u8, 174u8, - 190u8, 48u8, 96u8, 214u8, 33u8, 117u8, 82u8, 247u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn current_code_hash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "CurrentCodeHash", + Vec::new(), + [ + 179u8, 145u8, 45u8, 44u8, 130u8, 240u8, 50u8, 128u8, 190u8, + 133u8, 66u8, 85u8, 47u8, 141u8, 56u8, 87u8, 131u8, 99u8, + 170u8, 203u8, 8u8, 51u8, 123u8, 73u8, 206u8, 30u8, 173u8, + 35u8, 157u8, 195u8, 104u8, 236u8, + ], + ) } #[doc = " Actual past code hash, indicated by the para id as well as the block number at which it"] #[doc = " became outdated."] #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn past_code_hash (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , _1 : & 'a :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 158u8, 40u8, 107u8, 17u8, 201u8, 114u8, 104u8, 4u8, 50u8, - 4u8, 245u8, 186u8, 104u8, 25u8, 142u8, 118u8, 196u8, - 165u8, 252u8, 88u8, 251u8, 92u8, 41u8, 51u8, 222u8, - 217u8, 213u8, 18u8, 114u8, 245u8, 247u8, 188u8, - ] - { - let entry = PastCodeHash(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] + pub fn past_code_hash( + &self, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PastCodeHash", + vec![::subxt::storage::address::StorageMapKey::new( + &(_0.borrow(), _1.borrow()), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 241u8, 112u8, 128u8, 226u8, 163u8, 193u8, 77u8, 78u8, 177u8, + 146u8, 31u8, 143u8, 44u8, 140u8, 159u8, 134u8, 221u8, 129u8, + 36u8, 224u8, 46u8, 119u8, 245u8, 253u8, 55u8, 22u8, 137u8, + 187u8, 71u8, 94u8, 88u8, 124u8, + ], + ) } #[doc = " Actual past code hash, indicated by the para id as well as the block number at which it"] #[doc = " became outdated."] #[doc = ""] #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn past_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PastCodeHash<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 158u8, 40u8, 107u8, 17u8, 201u8, 114u8, 104u8, 4u8, 50u8, - 4u8, 245u8, 186u8, 104u8, 25u8, 142u8, 118u8, 196u8, - 165u8, 252u8, 88u8, 251u8, 92u8, 41u8, 51u8, 222u8, - 217u8, 213u8, 18u8, 114u8, 245u8, 247u8, 188u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn past_code_hash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PastCodeHash", + Vec::new(), + [ + 241u8, 112u8, 128u8, 226u8, 163u8, 193u8, 77u8, 78u8, 177u8, + 146u8, 31u8, 143u8, 44u8, 140u8, 159u8, 134u8, 221u8, 129u8, + 36u8, 224u8, 46u8, 119u8, 245u8, 253u8, 55u8, 22u8, 137u8, + 187u8, 71u8, 94u8, 88u8, 124u8, + ], + ) } #[doc = " Past code of parachains. The parachains themselves may not be registered anymore,"] #[doc = " but we also keep their code on-chain for the same amount of time as outdated code"] - #[doc = " to keep it available for secondary checkers."] pub fn past_code_meta (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: paras :: ParaPastCodeMeta < :: core :: primitive :: u32 > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 121u8, 14u8, 91u8, 135u8, 231u8, 67u8, 189u8, 66u8, - 108u8, 27u8, 241u8, 117u8, 101u8, 34u8, 24u8, 16u8, 52u8, - 198u8, 205u8, 155u8, 138u8, 9u8, 140u8, 207u8, 27u8, - 172u8, 212u8, 217u8, 47u8, 134u8, 122u8, 162u8, - ] - { - let entry = PastCodeMeta(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " to keep it available for secondary checkers."] pub fn past_code_meta (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_parachain :: primitives :: Id > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: paras :: ParaPastCodeMeta < :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PastCodeMeta", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 251u8, 52u8, 126u8, 12u8, 21u8, 178u8, 151u8, 195u8, 153u8, + 17u8, 215u8, 242u8, 118u8, 192u8, 86u8, 72u8, 36u8, 97u8, + 245u8, 134u8, 155u8, 117u8, 85u8, 93u8, 225u8, 209u8, 63u8, + 164u8, 168u8, 72u8, 171u8, 228u8, + ], + ) } #[doc = " Past code of parachains. The parachains themselves may not be registered anymore,"] #[doc = " but we also keep their code on-chain for the same amount of time as outdated code"] - #[doc = " to keep it available for secondary checkers."] - pub fn past_code_meta_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PastCodeMeta<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 121u8, 14u8, 91u8, 135u8, 231u8, 67u8, 189u8, 66u8, - 108u8, 27u8, 241u8, 117u8, 101u8, 34u8, 24u8, 16u8, 52u8, - 198u8, 205u8, 155u8, 138u8, 9u8, 140u8, 207u8, 27u8, - 172u8, 212u8, 217u8, 47u8, 134u8, 122u8, 162u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " to keep it available for secondary checkers."] pub fn past_code_meta_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: paras :: ParaPastCodeMeta < :: core :: primitive :: u32 > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PastCodeMeta", + Vec::new(), + [ + 251u8, 52u8, 126u8, 12u8, 21u8, 178u8, 151u8, 195u8, 153u8, + 17u8, 215u8, 242u8, 118u8, 192u8, 86u8, 72u8, 36u8, 97u8, + 245u8, 134u8, 155u8, 117u8, 85u8, 93u8, 225u8, 209u8, 63u8, + 164u8, 168u8, 72u8, 171u8, 228u8, + ], + ) } #[doc = " Which paras have past code that needs pruning and the relay-chain block at which the code was replaced."] #[doc = " Note that this is the actual height of the included block, not the expected height at which the"] @@ -33812,178 +22486,136 @@ pub mod api { #[doc = " Multiple entries for a single para are permitted. Ordered ascending by block number."] pub fn past_code_pruning( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( runtime_types::polkadot_parachain::primitives::Id, ::core::primitive::u32, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 142u8, 32u8, 134u8, 51u8, 34u8, 214u8, 75u8, 69u8, 77u8, - 178u8, 103u8, 117u8, 180u8, 105u8, 249u8, 178u8, 143u8, - 25u8, 212u8, 207u8, 28u8, 28u8, 175u8, 193u8, 43u8, 58u8, - 51u8, 149u8, 155u8, 204u8, 37u8, 153u8, - ] - { - let entry = PastCodePruning; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "PastCodePruning", + vec![], + [ + 59u8, 26u8, 175u8, 129u8, 174u8, 27u8, 239u8, 77u8, 38u8, + 130u8, 37u8, 134u8, 62u8, 28u8, 218u8, 176u8, 16u8, 137u8, + 175u8, 90u8, 248u8, 44u8, 248u8, 172u8, 231u8, 6u8, 36u8, + 190u8, 109u8, 237u8, 228u8, 135u8, + ], + ) } #[doc = " The block number at which the planned code change is expected for a para."] #[doc = " The change will be applied after the first parablock for this ID included which executes"] #[doc = " in the context of a relay chain block with a number >= `expected_at`."] pub fn future_code_upgrades( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 211u8, 254u8, 201u8, 63u8, 89u8, 112u8, 57u8, 82u8, - 255u8, 163u8, 49u8, 246u8, 197u8, 154u8, 55u8, 10u8, - 65u8, 188u8, 172u8, 110u8, 194u8, 155u8, 37u8, 44u8, - 250u8, 154u8, 4u8, 184u8, 225u8, 79u8, 248u8, 80u8, - ] - { - let entry = FutureCodeUpgrades(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "FutureCodeUpgrades", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 40u8, 134u8, 185u8, 28u8, 48u8, 105u8, 152u8, 229u8, 166u8, + 235u8, 32u8, 173u8, 64u8, 63u8, 151u8, 157u8, 190u8, 214u8, + 7u8, 8u8, 6u8, 128u8, 21u8, 104u8, 175u8, 71u8, 130u8, 207u8, + 158u8, 115u8, 172u8, 149u8, + ], + ) } #[doc = " The block number at which the planned code change is expected for a para."] #[doc = " The change will be applied after the first parablock for this ID included which executes"] #[doc = " in the context of a relay chain block with a number >= `expected_at`."] - pub fn future_code_upgrades_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, FutureCodeUpgrades<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 211u8, 254u8, 201u8, 63u8, 89u8, 112u8, 57u8, 82u8, - 255u8, 163u8, 49u8, 246u8, 197u8, 154u8, 55u8, 10u8, - 65u8, 188u8, 172u8, 110u8, 194u8, 155u8, 37u8, 44u8, - 250u8, 154u8, 4u8, 184u8, 225u8, 79u8, 248u8, 80u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn future_code_upgrades_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "FutureCodeUpgrades", + Vec::new(), + [ + 40u8, 134u8, 185u8, 28u8, 48u8, 105u8, 152u8, 229u8, 166u8, + 235u8, 32u8, 173u8, 64u8, 63u8, 151u8, 157u8, 190u8, 214u8, + 7u8, 8u8, 6u8, 128u8, 21u8, 104u8, 175u8, 71u8, 130u8, 207u8, + 158u8, 115u8, 172u8, 149u8, + ], + ) } #[doc = " The actual future code hash of a para."] #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn future_code_hash (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 221u8, 2u8, 237u8, 170u8, 64u8, 60u8, 98u8, 146u8, 135u8, - 69u8, 6u8, 38u8, 2u8, 239u8, 22u8, 94u8, 180u8, 163u8, - 76u8, 137u8, 143u8, 124u8, 5u8, 210u8, 129u8, 207u8, - 78u8, 192u8, 144u8, 39u8, 206u8, 195u8, - ] - { - let entry = FutureCodeHash(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] + pub fn future_code_hash( + &self, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "FutureCodeHash", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 252u8, 24u8, 95u8, 200u8, 207u8, 91u8, 66u8, 103u8, 54u8, + 171u8, 191u8, 187u8, 73u8, 170u8, 132u8, 59u8, 205u8, 125u8, + 68u8, 194u8, 122u8, 124u8, 190u8, 53u8, 241u8, 225u8, 131u8, + 53u8, 44u8, 145u8, 244u8, 216u8, + ], + ) } #[doc = " The actual future code hash of a para."] #[doc = ""] #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn future_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, FutureCodeHash<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 221u8, 2u8, 237u8, 170u8, 64u8, 60u8, 98u8, 146u8, 135u8, - 69u8, 6u8, 38u8, 2u8, 239u8, 22u8, 94u8, 180u8, 163u8, - 76u8, 137u8, 143u8, 124u8, 5u8, 210u8, 129u8, 207u8, - 78u8, 192u8, 144u8, 39u8, 206u8, 195u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn future_code_hash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "FutureCodeHash", + Vec::new(), + [ + 252u8, 24u8, 95u8, 200u8, 207u8, 91u8, 66u8, 103u8, 54u8, + 171u8, 191u8, 187u8, 73u8, 170u8, 132u8, 59u8, 205u8, 125u8, + 68u8, 194u8, 122u8, 124u8, 190u8, 53u8, 241u8, 225u8, 131u8, + 53u8, 44u8, 145u8, 244u8, 216u8, + ], + ) } #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] #[doc = ""] @@ -33996,40 +22628,31 @@ pub mod api { #[doc = " the format will require migration of parachains."] pub fn upgrade_go_ahead_signal( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::UpgradeGoAhead, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 100u8, 87u8, 135u8, 185u8, 95u8, 13u8, 74u8, 134u8, 19u8, - 97u8, 80u8, 104u8, 177u8, 30u8, 82u8, 145u8, 171u8, - 250u8, 99u8, 214u8, 26u8, 243u8, 118u8, 118u8, 19u8, - 188u8, 187u8, 142u8, 138u8, 68u8, 54u8, 114u8, - ] - { - let entry = UpgradeGoAheadSignal(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::UpgradeGoAhead, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpgradeGoAheadSignal", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 159u8, 47u8, 247u8, 154u8, 54u8, 20u8, 235u8, 49u8, 74u8, + 41u8, 65u8, 51u8, 52u8, 187u8, 242u8, 6u8, 84u8, 144u8, + 200u8, 176u8, 222u8, 232u8, 70u8, 50u8, 70u8, 97u8, 61u8, + 249u8, 245u8, 120u8, 98u8, 183u8, + ], + ) } #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] #[doc = ""] @@ -34040,38 +22663,27 @@ pub mod api { #[doc = ""] #[doc = " NOTE that this field is used by parachains via merkle storage proofs, therefore changing"] #[doc = " the format will require migration of parachains."] - pub fn upgrade_go_ahead_signal_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, UpgradeGoAheadSignal<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 100u8, 87u8, 135u8, 185u8, 95u8, 13u8, 74u8, 134u8, 19u8, - 97u8, 80u8, 104u8, 177u8, 30u8, 82u8, 145u8, 171u8, - 250u8, 99u8, 214u8, 26u8, 243u8, 118u8, 118u8, 19u8, - 188u8, 187u8, 142u8, 138u8, 68u8, 54u8, 114u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn upgrade_go_ahead_signal_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::UpgradeGoAhead, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpgradeGoAheadSignal", + Vec::new(), + [ + 159u8, 47u8, 247u8, 154u8, 54u8, 20u8, 235u8, 49u8, 74u8, + 41u8, 65u8, 51u8, 52u8, 187u8, 242u8, 6u8, 84u8, 144u8, + 200u8, 176u8, 222u8, 232u8, 70u8, 50u8, 70u8, 97u8, 61u8, + 249u8, 245u8, 120u8, 98u8, 183u8, + ], + ) } #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] #[doc = " an upgrade for this parachain."] @@ -34084,40 +22696,31 @@ pub mod api { #[doc = " the format will require migration of parachains."] pub fn upgrade_restriction_signal( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::UpgradeRestriction, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 173u8, 198u8, 89u8, 108u8, 43u8, 93u8, 143u8, 224u8, - 141u8, 248u8, 238u8, 221u8, 237u8, 220u8, 140u8, 24u8, - 7u8, 14u8, 136u8, 251u8, 159u8, 190u8, 70u8, 98u8, 100u8, - 118u8, 24u8, 212u8, 82u8, 96u8, 120u8, 206u8, - ] - { - let entry = UpgradeRestrictionSignal(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::UpgradeRestriction, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpgradeRestrictionSignal", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 86u8, 190u8, 41u8, 79u8, 66u8, 68u8, 46u8, 87u8, 212u8, + 176u8, 255u8, 134u8, 104u8, 121u8, 44u8, 143u8, 248u8, 100u8, + 35u8, 157u8, 91u8, 165u8, 118u8, 38u8, 49u8, 171u8, 158u8, + 163u8, 45u8, 92u8, 44u8, 11u8, + ], + ) } #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] #[doc = " an upgrade for this parachain."] @@ -34128,78 +22731,55 @@ pub mod api { #[doc = ""] #[doc = " NOTE that this field is used by parachains via merkle storage proofs, therefore changing"] #[doc = " the format will require migration of parachains."] - pub fn upgrade_restriction_signal_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, UpgradeRestrictionSignal<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 173u8, 198u8, 89u8, 108u8, 43u8, 93u8, 143u8, 224u8, - 141u8, 248u8, 238u8, 221u8, 237u8, 220u8, 140u8, 24u8, - 7u8, 14u8, 136u8, 251u8, 159u8, 190u8, 70u8, 98u8, 100u8, - 118u8, 24u8, 212u8, 82u8, 96u8, 120u8, 206u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn upgrade_restriction_signal_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::UpgradeRestriction, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpgradeRestrictionSignal", + Vec::new(), + [ + 86u8, 190u8, 41u8, 79u8, 66u8, 68u8, 46u8, 87u8, 212u8, + 176u8, 255u8, 134u8, 104u8, 121u8, 44u8, 143u8, 248u8, 100u8, + 35u8, 157u8, 91u8, 165u8, 118u8, 38u8, 49u8, 171u8, 158u8, + 163u8, 45u8, 92u8, 44u8, 11u8, + ], + ) } #[doc = " The list of parachains that are awaiting for their upgrade restriction to cooldown."] #[doc = ""] #[doc = " Ordered ascending by block number."] pub fn upgrade_cooldowns( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( runtime_types::polkadot_parachain::primitives::Id, ::core::primitive::u32, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 120u8, 214u8, 165u8, 35u8, 125u8, 56u8, 152u8, 76u8, - 124u8, 159u8, 160u8, 93u8, 16u8, 30u8, 208u8, 199u8, - 162u8, 74u8, 124u8, 141u8, 137u8, 237u8, 229u8, 61u8, - 62u8, 71u8, 54u8, 92u8, 243u8, 208u8, 114u8, 19u8, - ] - { - let entry = UpgradeCooldowns; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpgradeCooldowns", + vec![], + [ + 205u8, 236u8, 140u8, 145u8, 241u8, 245u8, 60u8, 68u8, 23u8, + 175u8, 226u8, 174u8, 154u8, 107u8, 243u8, 197u8, 61u8, 218u8, + 7u8, 24u8, 109u8, 221u8, 178u8, 80u8, 242u8, 123u8, 33u8, + 119u8, 5u8, 241u8, 179u8, 13u8, + ], + ) } #[doc = " The list of upcoming code upgrades. Each item is a pair of which para performs a code"] #[doc = " upgrade and at which relay-chain block it is expected at."] @@ -34207,248 +22787,165 @@ pub mod api { #[doc = " Ordered ascending by block number."] pub fn upcoming_upgrades( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( runtime_types::polkadot_parachain::primitives::Id, ::core::primitive::u32, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 16u8, 74u8, 254u8, 39u8, 241u8, 98u8, 106u8, 203u8, - 189u8, 157u8, 66u8, 99u8, 164u8, 176u8, 20u8, 206u8, - 15u8, 212u8, 229u8, 9u8, 117u8, 214u8, 250u8, 8u8, 51u8, - 80u8, 35u8, 236u8, 120u8, 4u8, 246u8, 62u8, - ] - { - let entry = UpcomingUpgrades; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpcomingUpgrades", + vec![], + [ + 165u8, 112u8, 215u8, 149u8, 125u8, 175u8, 206u8, 195u8, + 214u8, 173u8, 0u8, 144u8, 46u8, 197u8, 55u8, 204u8, 144u8, + 68u8, 158u8, 156u8, 145u8, 230u8, 173u8, 101u8, 255u8, 108u8, + 52u8, 199u8, 142u8, 37u8, 55u8, 32u8, + ], + ) } #[doc = " The actions to perform during the start of a specific session index."] pub fn actions_queue( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 197u8, 76u8, 84u8, 133u8, 3u8, 67u8, 57u8, 107u8, - 31u8, 87u8, 33u8, 196u8, 130u8, 119u8, 93u8, 171u8, - 173u8, 76u8, 242u8, 22u8, 15u8, 133u8, 193u8, 122u8, 0u8, - 112u8, 121u8, 233u8, 29u8, 17u8, 185u8, - ] - { - let entry = ActionsQueue(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "ActionsQueue", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 209u8, 106u8, 198u8, 228u8, 148u8, 75u8, 246u8, 248u8, 12u8, + 143u8, 175u8, 56u8, 168u8, 243u8, 67u8, 166u8, 59u8, 92u8, + 219u8, 184u8, 1u8, 34u8, 241u8, 66u8, 245u8, 48u8, 174u8, + 41u8, 123u8, 16u8, 178u8, 161u8, + ], + ) } #[doc = " The actions to perform during the start of a specific session index."] - pub fn actions_queue_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ActionsQueue<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 197u8, 76u8, 84u8, 133u8, 3u8, 67u8, 57u8, 107u8, - 31u8, 87u8, 33u8, 196u8, 130u8, 119u8, 93u8, 171u8, - 173u8, 76u8, 242u8, 22u8, 15u8, 133u8, 193u8, 122u8, 0u8, - 112u8, 121u8, 233u8, 29u8, 17u8, 185u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn actions_queue_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::Id, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "ActionsQueue", + Vec::new(), + [ + 209u8, 106u8, 198u8, 228u8, 148u8, 75u8, 246u8, 248u8, 12u8, + 143u8, 175u8, 56u8, 168u8, 243u8, 67u8, 166u8, 59u8, 92u8, + 219u8, 184u8, 1u8, 34u8, 241u8, 66u8, 245u8, 48u8, 174u8, + 41u8, 123u8, 16u8, 178u8, 161u8, + ], + ) } #[doc = " Upcoming paras instantiation arguments."] #[doc = ""] #[doc = " NOTE that after PVF pre-checking is enabled the para genesis arg will have it's code set"] - #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] pub fn upcoming_paras_genesis (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 98u8, 249u8, 92u8, 177u8, 21u8, 84u8, 199u8, 194u8, - 150u8, 213u8, 143u8, 107u8, 99u8, 194u8, 141u8, 225u8, - 55u8, 94u8, 44u8, 147u8, 209u8, 144u8, 118u8, 66u8, - 139u8, 170u8, 68u8, 62u8, 45u8, 137u8, 91u8, 8u8, - ] - { - let entry = UpcomingParasGenesis(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] pub fn upcoming_paras_genesis (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_parachain :: primitives :: Id > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: storage :: address :: Yes , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpcomingParasGenesis", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 84u8, 41u8, 210u8, 81u8, 237u8, 249u8, 162u8, 208u8, 247u8, + 223u8, 208u8, 201u8, 54u8, 43u8, 222u8, 187u8, 8u8, 116u8, + 184u8, 221u8, 107u8, 243u8, 48u8, 168u8, 108u8, 47u8, 133u8, + 236u8, 184u8, 174u8, 130u8, 145u8, + ], + ) } #[doc = " Upcoming paras instantiation arguments."] #[doc = ""] #[doc = " NOTE that after PVF pre-checking is enabled the para genesis arg will have it's code set"] - #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] - pub fn upcoming_paras_genesis_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, UpcomingParasGenesis<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 98u8, 249u8, 92u8, 177u8, 21u8, 84u8, 199u8, 194u8, - 150u8, 213u8, 143u8, 107u8, 99u8, 194u8, 141u8, 225u8, - 55u8, 94u8, 44u8, 147u8, 209u8, 144u8, 118u8, 66u8, - 139u8, 170u8, 68u8, 62u8, 45u8, 137u8, 91u8, 8u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] pub fn upcoming_paras_genesis_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , () , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "UpcomingParasGenesis", + Vec::new(), + [ + 84u8, 41u8, 210u8, 81u8, 237u8, 249u8, 162u8, 208u8, 247u8, + 223u8, 208u8, 201u8, 54u8, 43u8, 222u8, 187u8, 8u8, 116u8, + 184u8, 221u8, 107u8, 243u8, 48u8, 168u8, 108u8, 47u8, 133u8, + 236u8, 184u8, 174u8, 130u8, 145u8, + ], + ) } #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] pub fn code_by_hash_refs( &self, - _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 194u8, 100u8, 213u8, 115u8, 143u8, 181u8, 255u8, 227u8, - 232u8, 163u8, 209u8, 99u8, 2u8, 138u8, 118u8, 169u8, - 210u8, 202u8, 190u8, 194u8, 221u8, 145u8, 171u8, 78u8, - 212u8, 17u8, 245u8, 107u8, 99u8, 5u8, 54u8, 118u8, - ] - { - let entry = CodeByHashRefs(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "CodeByHashRefs", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 24u8, 6u8, 23u8, 50u8, 105u8, 203u8, 126u8, 161u8, 0u8, 5u8, + 121u8, 165u8, 204u8, 106u8, 68u8, 91u8, 84u8, 126u8, 29u8, + 239u8, 236u8, 138u8, 32u8, 237u8, 241u8, 226u8, 190u8, 233u8, + 160u8, 143u8, 88u8, 168u8, + ], + ) } #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub fn code_by_hash_refs_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeByHashRefs<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 194u8, 100u8, 213u8, 115u8, 143u8, 181u8, 255u8, 227u8, - 232u8, 163u8, 209u8, 99u8, 2u8, 138u8, 118u8, 169u8, - 210u8, 202u8, 190u8, 194u8, 221u8, 145u8, 171u8, 78u8, - 212u8, 17u8, 245u8, 107u8, 99u8, 5u8, 54u8, 118u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn code_by_hash_refs_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "CodeByHashRefs", + Vec::new(), + [ + 24u8, 6u8, 23u8, 50u8, 105u8, 203u8, 126u8, 161u8, 0u8, 5u8, + 121u8, 165u8, 204u8, 106u8, 68u8, 91u8, 84u8, 126u8, 29u8, + 239u8, 236u8, 138u8, 32u8, 237u8, 241u8, 226u8, 190u8, 233u8, + 160u8, 143u8, 88u8, 168u8, + ], + ) } #[doc = " Validation code stored by its hash."] #[doc = ""] @@ -34456,220 +22953,127 @@ pub mod api { #[doc = " [`PastCodeHash`]."] pub fn code_by_hash( &self, - _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCode, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 41u8, 242u8, 100u8, 156u8, 32u8, 20u8, 72u8, 228u8, - 143u8, 3u8, 169u8, 169u8, 27u8, 111u8, 119u8, 135u8, - 155u8, 17u8, 222u8, 146u8, 43u8, 243u8, 2u8, 32u8, 102u8, - 143u8, 143u8, 55u8, 191u8, 129u8, 128u8, 35u8, - ] - { - let entry = CodeByHash(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCode, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "CodeByHash", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 58u8, 104u8, 36u8, 34u8, 226u8, 210u8, 253u8, 90u8, 23u8, + 3u8, 6u8, 202u8, 9u8, 44u8, 107u8, 108u8, 41u8, 149u8, 255u8, + 173u8, 119u8, 206u8, 201u8, 180u8, 32u8, 193u8, 44u8, 232u8, + 73u8, 15u8, 210u8, 226u8, + ], + ) } #[doc = " Validation code stored by its hash."] #[doc = ""] #[doc = " This storage is consistent with [`FutureCodeHash`], [`CurrentCodeHash`] and"] #[doc = " [`PastCodeHash`]."] - pub fn code_by_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeByHash<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 41u8, 242u8, 100u8, 156u8, 32u8, 20u8, 72u8, 228u8, - 143u8, 3u8, 169u8, 169u8, 27u8, 111u8, 119u8, 135u8, - 155u8, 17u8, 222u8, 146u8, 43u8, 243u8, 2u8, 32u8, 102u8, - 143u8, 143u8, 55u8, 191u8, 129u8, 128u8, 35u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn code_by_hash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::ValidationCode, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Paras", + "CodeByHash", + Vec::new(), + [ + 58u8, 104u8, 36u8, 34u8, 226u8, 210u8, 253u8, 90u8, 23u8, + 3u8, 6u8, 202u8, 9u8, 44u8, 107u8, 108u8, 41u8, 149u8, 255u8, + 173u8, 119u8, 206u8, 201u8, 180u8, 32u8, 193u8, 44u8, 232u8, + 73u8, 15u8, 210u8, 226u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { pub fn unsigned_priority( &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Paras", "UnsignedPriority")? - == [ - 78u8, 226u8, 84u8, 70u8, 162u8, 23u8, 167u8, 100u8, 156u8, - 228u8, 119u8, 16u8, 28u8, 202u8, 21u8, 71u8, 72u8, 244u8, - 3u8, 255u8, 243u8, 55u8, 109u8, 238u8, 26u8, 180u8, 207u8, - 175u8, 221u8, 27u8, 213u8, 217u8, - ] - { - let pallet = metadata.pallet("Paras")?; - let constant = pallet.constant("UnsignedPriority")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Paras", + "UnsignedPriority", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ], + ) } } } } pub mod initializer { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct ForceApprove { pub up_to: ::core::primitive::u32, } - impl ::subxt::Call for ForceApprove { - const PALLET: &'static str = "Initializer"; - const FUNCTION: &'static str = "force_approve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] #[doc = "chain are valid and should be finalized."] pub fn force_approve( &self, up_to: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceApprove, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 61u8, 29u8, 75u8, 222u8, 82u8, 250u8, 124u8, 164u8, 70u8, - 114u8, 150u8, 28u8, 103u8, 53u8, 185u8, 147u8, 168u8, 239u8, - 207u8, 197u8, 23u8, 158u8, 16u8, 255u8, 139u8, 18u8, 214u8, - 174u8, 53u8, 191u8, 49u8, 73u8, - ] - { - let call = ForceApprove { up_to }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct HasInitialized; - impl ::subxt::StorageEntry for HasInitialized { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "HasInitialized"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Initializer", + "force_approve", + ForceApprove { up_to }, + [ + 28u8, 117u8, 86u8, 182u8, 19u8, 127u8, 43u8, 17u8, 153u8, + 80u8, 193u8, 53u8, 120u8, 41u8, 205u8, 23u8, 252u8, 148u8, + 77u8, 227u8, 138u8, 35u8, 182u8, 122u8, 112u8, 232u8, 246u8, + 69u8, 173u8, 97u8, 42u8, 103u8, + ], + ) } } - pub struct BufferedSessionChanges; - impl ::subxt::StorageEntry for BufferedSessionChanges { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "BufferedSessionChanges"; - type Value = :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { #[doc = " Whether the parachains modules have been initialized within this block."] #[doc = ""] #[doc = " Semantically a `bool`, but this guarantees it should never hit the trie,"] @@ -34680,37 +23084,23 @@ pub mod api { #[doc = " the semantics of this variable."] pub fn has_initialized( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<()>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 251u8, 135u8, 247u8, 61u8, 139u8, 102u8, 12u8, 122u8, - 227u8, 123u8, 11u8, 232u8, 120u8, 80u8, 81u8, 48u8, - 216u8, 115u8, 159u8, 131u8, 133u8, 105u8, 200u8, 122u8, - 114u8, 6u8, 109u8, 4u8, 164u8, 204u8, 214u8, 111u8, - ] - { - let entry = HasInitialized; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<()>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Initializer", + "HasInitialized", + vec![], + [ + 251u8, 135u8, 247u8, 61u8, 139u8, 102u8, 12u8, 122u8, 227u8, + 123u8, 11u8, 232u8, 120u8, 80u8, 81u8, 48u8, 216u8, 115u8, + 159u8, 131u8, 133u8, 105u8, 200u8, 122u8, 114u8, 6u8, 109u8, + 4u8, 164u8, 204u8, 214u8, 111u8, + ], + ) } #[doc = " Buffered session changes along with the block number at which they should be applied."] #[doc = ""] @@ -34718,164 +23108,65 @@ pub mod api { #[doc = " the storage."] #[doc = ""] #[doc = " However this is a `Vec` regardless to handle various edge cases that may occur at runtime"] - #[doc = " upgrade boundaries or if governance intervenes."] pub fn buffered_session_changes (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 79u8, 184u8, 104u8, 7u8, 11u8, 216u8, 205u8, 95u8, 155u8, - 51u8, 17u8, 160u8, 239u8, 14u8, 38u8, 99u8, 206u8, 87u8, - 87u8, 67u8, 207u8, 142u8, 1u8, 159u8, 54u8, 36u8, 194u8, - 77u8, 86u8, 124u8, 164u8, 251u8, - ] - { - let entry = BufferedSessionChanges; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " upgrade boundaries or if governance intervenes."] pub fn buffered_session_changes (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Initializer", + "BufferedSessionChanges", + vec![], + [ + 176u8, 60u8, 165u8, 138u8, 99u8, 140u8, 22u8, 169u8, 121u8, + 65u8, 203u8, 85u8, 39u8, 198u8, 91u8, 167u8, 118u8, 49u8, + 129u8, 128u8, 171u8, 232u8, 249u8, 39u8, 6u8, 101u8, 57u8, + 193u8, 85u8, 143u8, 105u8, 29u8, + ], + ) } } } } pub mod dmp { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } + pub struct TransactionApi; + impl TransactionApi {} } pub mod storage { use super::runtime_types; - pub struct DownwardMessageQueues<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueues<'_> { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueues"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct DownwardMessageQueueHeads<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueueHeads<'_> { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueueHeads"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The downward messages addressed for a certain para."] pub fn downward_message_queues (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_core_primitives :: InboundDownwardMessage < :: core :: primitive :: u32 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 104u8, 117u8, 177u8, 125u8, 208u8, 212u8, 216u8, 171u8, - 212u8, 235u8, 43u8, 255u8, 146u8, 230u8, 243u8, 27u8, - 133u8, 109u8, 129u8, 162u8, 247u8, 23u8, 195u8, 9u8, - 219u8, 235u8, 119u8, 220u8, 179u8, 198u8, 130u8, 4u8, - ] - { - let entry = DownwardMessageQueues(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - #[doc = " The downward messages addressed for a certain para."] - pub fn downward_message_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueues<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 104u8, 117u8, 177u8, 125u8, 208u8, 212u8, 216u8, 171u8, - 212u8, 235u8, 43u8, 255u8, 146u8, 230u8, 243u8, 27u8, - 133u8, 109u8, 129u8, 162u8, 247u8, 23u8, 195u8, 9u8, - 219u8, 235u8, 119u8, 220u8, 179u8, 198u8, 130u8, 4u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub struct StorageApi; + impl StorageApi { + #[doc = " The downward messages addressed for a certain para."] pub fn downward_message_queues (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_parachain :: primitives :: Id > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < runtime_types :: polkadot_core_primitives :: InboundDownwardMessage < :: core :: primitive :: u32 > > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Dmp", + "DownwardMessageQueues", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 57u8, 115u8, 112u8, 195u8, 25u8, 43u8, 104u8, 199u8, 107u8, + 238u8, 93u8, 129u8, 141u8, 167u8, 167u8, 9u8, 85u8, 34u8, + 53u8, 117u8, 148u8, 246u8, 196u8, 46u8, 96u8, 114u8, 15u8, + 88u8, 94u8, 40u8, 18u8, 31u8, + ], + ) + } + #[doc = " The downward messages addressed for a certain para."] pub fn downward_message_queues_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < runtime_types :: polkadot_core_primitives :: InboundDownwardMessage < :: core :: primitive :: u32 > > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Dmp", + "DownwardMessageQueues", + Vec::new(), + [ + 57u8, 115u8, 112u8, 195u8, 25u8, 43u8, 104u8, 199u8, 107u8, + 238u8, 93u8, 129u8, 141u8, 167u8, 167u8, 9u8, 85u8, 34u8, + 53u8, 117u8, 148u8, 246u8, 196u8, 46u8, 96u8, 114u8, 15u8, + 88u8, 94u8, 40u8, 18u8, 31u8, + ], + ) } #[doc = " A mapping that stores the downward message queue MQC head for each para."] #[doc = ""] @@ -34886,38 +23177,29 @@ pub mod api { #[doc = " - `H(M)`: is the hash of the message being appended."] pub fn downward_message_queue_heads( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::sp_core::H256, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 88u8, 45u8, 62u8, 250u8, 186u8, 97u8, 121u8, 56u8, 136u8, - 216u8, 73u8, 65u8, 253u8, 81u8, 94u8, 162u8, 132u8, - 217u8, 78u8, 126u8, 179u8, 188u8, 167u8, 220u8, 184u8, - 217u8, 138u8, 244u8, 98u8, 158u8, 25u8, 118u8, - ] - { - let entry = DownwardMessageQueueHeads(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Dmp", + "DownwardMessageQueueHeads", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 137u8, 70u8, 108u8, 184u8, 177u8, 204u8, 17u8, 187u8, 250u8, + 134u8, 85u8, 18u8, 239u8, 185u8, 167u8, 224u8, 70u8, 18u8, + 38u8, 245u8, 176u8, 122u8, 254u8, 251u8, 204u8, 126u8, 34u8, + 207u8, 163u8, 104u8, 103u8, 38u8, + ], + ) } #[doc = " A mapping that stores the downward message queue MQC head for each para."] #[doc = ""] @@ -34926,78 +23208,48 @@ pub mod api { #[doc = " - `prev_head`: is the previous head hash or zero if none."] #[doc = " - `B`: is the relay-chain block number in which a message was appended."] #[doc = " - `H(M)`: is the hash of the message being appended."] - pub fn downward_message_queue_heads_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueueHeads<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 88u8, 45u8, 62u8, 250u8, 186u8, 97u8, 121u8, 56u8, 136u8, - 216u8, 73u8, 65u8, 253u8, 81u8, 94u8, 162u8, 132u8, - 217u8, 78u8, 126u8, 179u8, 188u8, 167u8, 220u8, 184u8, - 217u8, 138u8, 244u8, 98u8, 158u8, 25u8, 118u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn downward_message_queue_heads_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Dmp", + "DownwardMessageQueueHeads", + Vec::new(), + [ + 137u8, 70u8, 108u8, 184u8, 177u8, 204u8, 17u8, 187u8, 250u8, + 134u8, 85u8, 18u8, 239u8, 185u8, 167u8, 224u8, 70u8, 18u8, + 38u8, 245u8, 176u8, 122u8, 254u8, 251u8, 204u8, 126u8, 34u8, + 207u8, 163u8, 104u8, 103u8, 38u8, + ], + ) } } } } pub mod ump { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ServiceOverweight { pub index: ::core::primitive::u64, pub weight_limit: ::core::primitive::u64, } - impl ::subxt::Call for ServiceOverweight { - const PALLET: &'static str = "Ump"; - const FUNCTION: &'static str = "service_overweight"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Service a single overweight upward message."] #[doc = ""] #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] @@ -35014,38 +23266,21 @@ pub mod api { &self, index: ::core::primitive::u64, weight_limit: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ServiceOverweight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 229u8, 167u8, 106u8, 63u8, 141u8, 80u8, 8u8, 201u8, 156u8, - 34u8, 47u8, 104u8, 116u8, 57u8, 35u8, 216u8, 132u8, 3u8, - 201u8, 169u8, 38u8, 107u8, 149u8, 120u8, 42u8, 130u8, 100u8, - 133u8, 214u8, 48u8, 99u8, 146u8, - ] - { - let call = ServiceOverweight { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Ump", + "service_overweight", + ServiceOverweight { index, weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 225u8, 41u8, 132u8, 91u8, 28u8, 116u8, 89u8, 197u8, 194u8, + 131u8, 28u8, 217u8, 102u8, 241u8, 122u8, 230u8, 242u8, 75u8, + 83u8, 67u8, 104u8, 55u8, 133u8, 129u8, 91u8, 25u8, 185u8, + 131u8, 22u8, 253u8, 84u8, 221u8, + ], + ) } } } @@ -35053,34 +23288,50 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Upward message is invalid XCM."] #[doc = "\\[ id \\]"] pub struct InvalidFormat(pub [::core::primitive::u8; 32usize]); - impl ::subxt::Event for InvalidFormat { + impl ::subxt::events::StaticEvent for InvalidFormat { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "InvalidFormat"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Upward message is unsupported version of XCM."] #[doc = "\\[ id \\]"] pub struct UnsupportedVersion(pub [::core::primitive::u8; 32usize]); - impl ::subxt::Event for UnsupportedVersion { + impl ::subxt::events::StaticEvent for UnsupportedVersion { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "UnsupportedVersion"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Upward message executed with the given outcome."] #[doc = "\\[ id, outcome \\]"] pub struct ExecutedUpward( pub [::core::primitive::u8; 32usize], pub runtime_types::xcm::v2::traits::Outcome, ); - impl ::subxt::Event for ExecutedUpward { + impl ::subxt::events::StaticEvent for ExecutedUpward { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "ExecutedUpward"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The weight limit for handling upward messages was reached."] #[doc = "\\[ id, remaining, required \\]"] pub struct WeightExhausted( @@ -35088,11 +23339,15 @@ pub mod api { pub ::core::primitive::u64, pub ::core::primitive::u64, ); - impl ::subxt::Event for WeightExhausted { + impl ::subxt::events::StaticEvent for WeightExhausted { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "WeightExhausted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some upward messages have been received and will be processed."] #[doc = "\\[ para, count, size \\]"] pub struct UpwardMessagesReceived( @@ -35100,11 +23355,15 @@ pub mod api { pub ::core::primitive::u32, pub ::core::primitive::u32, ); - impl ::subxt::Event for UpwardMessagesReceived { + impl ::subxt::events::StaticEvent for UpwardMessagesReceived { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "UpwardMessagesReceived"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The weight budget was exceeded for an individual upward message."] #[doc = ""] #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] @@ -35117,11 +23376,15 @@ pub mod api { pub ::core::primitive::u64, pub ::core::primitive::u64, ); - impl ::subxt::Event for OverweightEnqueued { + impl ::subxt::events::StaticEvent for OverweightEnqueued { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "OverweightEnqueued"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Upward message from the overweight queue was executed with the given actual weight"] #[doc = "used."] #[doc = ""] @@ -35130,91 +23393,15 @@ pub mod api { pub ::core::primitive::u64, pub ::core::primitive::u64, ); - impl ::subxt::Event for OverweightServiced { + impl ::subxt::events::StaticEvent for OverweightServiced { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "OverweightServiced"; } } pub mod storage { use super::runtime_types; - pub struct RelayDispatchQueues<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueues<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueues"; - type Value = ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct RelayDispatchQueueSize<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueueSize<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueueSize"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NeedsDispatch; - impl ::subxt::StorageEntry for NeedsDispatch { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NeedsDispatch"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextDispatchRoundStartWith; - impl ::subxt::StorageEntry for NextDispatchRoundStartWith { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NextDispatchRoundStartWith"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Overweight<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Overweight<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "Overweight"; - type Value = ( - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct OverweightCount; - impl ::subxt::StorageEntry for OverweightCount { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "OverweightCount"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] #[doc = ""] #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] @@ -35223,38 +23410,31 @@ pub mod api { #[doc = " The messages are processed in FIFO order."] pub fn relay_dispatch_queues( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 48u8, 215u8, 37u8, 42u8, 115u8, 27u8, 8u8, 249u8, - 65u8, 47u8, 61u8, 96u8, 1u8, 196u8, 143u8, 53u8, 7u8, - 241u8, 126u8, 4u8, 242u8, 42u8, 171u8, 66u8, 162u8, - 203u8, 200u8, 239u8, 50u8, 87u8, 72u8, - ] - { - let entry = RelayDispatchQueues(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "RelayDispatchQueues", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 237u8, 72u8, 167u8, 6u8, 67u8, 106u8, 186u8, 191u8, 160u8, + 9u8, 62u8, 102u8, 229u8, 164u8, 100u8, 24u8, 202u8, 109u8, + 90u8, 24u8, 192u8, 233u8, 26u8, 239u8, 23u8, 127u8, 77u8, + 191u8, 144u8, 14u8, 3u8, 141u8, + ], + ) } #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] #[doc = ""] @@ -35262,38 +23442,27 @@ pub mod api { #[doc = " channel management messages."] #[doc = ""] #[doc = " The messages are processed in FIFO order."] - pub fn relay_dispatch_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, RelayDispatchQueues<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 22u8, 48u8, 215u8, 37u8, 42u8, 115u8, 27u8, 8u8, 249u8, - 65u8, 47u8, 61u8, 96u8, 1u8, 196u8, 143u8, 53u8, 7u8, - 241u8, 126u8, 4u8, 242u8, 42u8, 171u8, 66u8, 162u8, - 203u8, 200u8, 239u8, 50u8, 87u8, 72u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn relay_dispatch_queues_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "RelayDispatchQueues", + Vec::new(), + [ + 237u8, 72u8, 167u8, 6u8, 67u8, 106u8, 186u8, 191u8, 160u8, + 9u8, 62u8, 102u8, 229u8, 164u8, 100u8, 24u8, 202u8, 109u8, + 90u8, 24u8, 192u8, 233u8, 26u8, 239u8, 23u8, 127u8, 77u8, + 191u8, 144u8, 14u8, 3u8, 141u8, + ], + ) } #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] #[doc = ""] @@ -35308,38 +23477,32 @@ pub mod api { #[doc = " - The set of keys should exactly match the set of keys of `RelayDispatchQueues`."] pub fn relay_dispatch_queue_size( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 8u8, 0u8, 54u8, 33u8, 185u8, 112u8, 21u8, 174u8, 15u8, - 147u8, 134u8, 184u8, 108u8, 144u8, 55u8, 138u8, 24u8, - 66u8, 255u8, 197u8, 131u8, 229u8, 35u8, 107u8, 251u8, - 226u8, 78u8, 218u8, 41u8, 251u8, 155u8, 79u8, - ] - { - let entry = RelayDispatchQueueSize(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "RelayDispatchQueueSize", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 243u8, 120u8, 70u8, 2u8, 208u8, 105u8, 180u8, 25u8, 86u8, + 219u8, 151u8, 227u8, 233u8, 53u8, 151u8, 29u8, 231u8, 40u8, + 84u8, 163u8, 71u8, 254u8, 19u8, 47u8, 174u8, 63u8, 200u8, + 173u8, 86u8, 199u8, 207u8, 138u8, + ], + ) } #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] #[doc = ""] @@ -35352,38 +23515,28 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - The set of keys should exactly match the set of keys of `RelayDispatchQueues`."] - pub fn relay_dispatch_queue_size_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, RelayDispatchQueueSize<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 8u8, 0u8, 54u8, 33u8, 185u8, 112u8, 21u8, 174u8, 15u8, - 147u8, 134u8, 184u8, 108u8, 144u8, 55u8, 138u8, 24u8, - 66u8, 255u8, 197u8, 131u8, 229u8, 35u8, 107u8, 251u8, - 226u8, 78u8, 218u8, 41u8, 251u8, 155u8, 79u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn relay_dispatch_queue_size_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "RelayDispatchQueueSize", + Vec::new(), + [ + 243u8, 120u8, 70u8, 2u8, 208u8, 105u8, 180u8, 25u8, 86u8, + 219u8, 151u8, 227u8, 233u8, 53u8, 151u8, 29u8, 231u8, 40u8, + 84u8, 163u8, 71u8, 254u8, 19u8, 47u8, 174u8, 63u8, 200u8, + 173u8, 86u8, 199u8, 207u8, 138u8, + ], + ) } #[doc = " The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry."] #[doc = ""] @@ -35392,39 +23545,27 @@ pub mod api { #[doc = " `RelayDispatchQueues` and `RelayDispatchQueueSize`."] pub fn needs_dispatch( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 75u8, 38u8, 232u8, 83u8, 71u8, 101u8, 248u8, 170u8, 5u8, - 32u8, 209u8, 97u8, 190u8, 31u8, 241u8, 1u8, 98u8, 87u8, - 64u8, 208u8, 26u8, 100u8, 93u8, 79u8, 61u8, 114u8, 11u8, - 172u8, 112u8, 164u8, 171u8, 237u8, - ] - { - let entry = NeedsDispatch; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "NeedsDispatch", + vec![], + [ + 176u8, 94u8, 152u8, 112u8, 46u8, 124u8, 89u8, 29u8, 92u8, + 104u8, 192u8, 58u8, 59u8, 186u8, 81u8, 150u8, 157u8, 61u8, + 235u8, 182u8, 222u8, 127u8, 109u8, 11u8, 104u8, 175u8, 141u8, + 219u8, 15u8, 152u8, 255u8, 40u8, + ], + ) } #[doc = " This is the para that gets will get dispatched first during the next upward dispatchable queue"] #[doc = " execution round."] @@ -35433,256 +23574,182 @@ pub mod api { #[doc = " - If `Some(para)`, then `para` must be present in `NeedsDispatch`."] pub fn next_dispatch_round_start_with( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::Id, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 102u8, 165u8, 118u8, 140u8, 84u8, 122u8, 91u8, 169u8, - 232u8, 125u8, 52u8, 228u8, 15u8, 228u8, 91u8, 79u8, - 218u8, 62u8, 93u8, 42u8, 204u8, 6u8, 34u8, 185u8, 218u8, - 150u8, 7u8, 250u8, 79u8, 142u8, 211u8, 0u8, - ] - { - let entry = NextDispatchRoundStartWith; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::Id, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "NextDispatchRoundStartWith", + vec![], + [ + 157u8, 221u8, 6u8, 175u8, 61u8, 99u8, 250u8, 30u8, 177u8, + 53u8, 37u8, 191u8, 138u8, 65u8, 251u8, 216u8, 37u8, 84u8, + 246u8, 76u8, 8u8, 29u8, 18u8, 253u8, 143u8, 75u8, 129u8, + 141u8, 48u8, 178u8, 135u8, 197u8, + ], + ) } #[doc = " The messages that exceeded max individual message weight budget."] #[doc = ""] #[doc = " These messages stay there until manually dispatched."] pub fn overweight( &self, - _0: &'a ::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 223u8, 155u8, 1u8, 100u8, 77u8, 13u8, 92u8, 235u8, 64u8, - 30u8, 199u8, 178u8, 149u8, 66u8, 155u8, 201u8, 84u8, - 26u8, 81u8, 183u8, 0u8, 113u8, 182u8, 37u8, 69u8, 66u8, - 240u8, 151u8, 254u8, 249u8, 134u8, 51u8, - ] - { - let entry = Overweight(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::polkadot_parachain::primitives::Id, + ::std::vec::Vec<::core::primitive::u8>, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "Overweight", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 49u8, 4u8, 221u8, 218u8, 249u8, 183u8, 49u8, 198u8, 48u8, + 42u8, 110u8, 67u8, 47u8, 50u8, 181u8, 141u8, 184u8, 47u8, + 114u8, 3u8, 232u8, 132u8, 32u8, 201u8, 13u8, 213u8, 175u8, + 236u8, 111u8, 87u8, 146u8, 212u8, + ], + ) } #[doc = " The messages that exceeded max individual message weight budget."] #[doc = ""] #[doc = " These messages stay there until manually dispatched."] - pub fn overweight_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Overweight<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 223u8, 155u8, 1u8, 100u8, 77u8, 13u8, 92u8, 235u8, 64u8, - 30u8, 199u8, 178u8, 149u8, 66u8, 155u8, 201u8, 84u8, - 26u8, 81u8, 183u8, 0u8, 113u8, 182u8, 37u8, 69u8, 66u8, - 240u8, 151u8, 254u8, 249u8, 134u8, 51u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn overweight_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::polkadot_parachain::primitives::Id, + ::std::vec::Vec<::core::primitive::u8>, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "Overweight", + Vec::new(), + [ + 49u8, 4u8, 221u8, 218u8, 249u8, 183u8, 49u8, 198u8, 48u8, + 42u8, 110u8, 67u8, 47u8, 50u8, 181u8, 141u8, 184u8, 47u8, + 114u8, 3u8, 232u8, 132u8, 32u8, 201u8, 13u8, 213u8, 175u8, + 236u8, 111u8, 87u8, 146u8, 212u8, + ], + ) } #[doc = " The number of overweight messages ever recorded in `Overweight` (and thus the lowest free"] #[doc = " index)."] pub fn overweight_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u64, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 102u8, 180u8, 196u8, 148u8, 115u8, 62u8, 46u8, 238u8, - 97u8, 116u8, 117u8, 42u8, 14u8, 5u8, 72u8, 237u8, 230u8, - 46u8, 150u8, 126u8, 89u8, 64u8, 233u8, 166u8, 180u8, - 137u8, 52u8, 233u8, 252u8, 255u8, 36u8, 20u8, - ] - { - let entry = OverweightCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Ump", + "OverweightCount", + vec![], + [ + 102u8, 180u8, 196u8, 148u8, 115u8, 62u8, 46u8, 238u8, 97u8, + 116u8, 117u8, 42u8, 14u8, 5u8, 72u8, 237u8, 230u8, 46u8, + 150u8, 126u8, 89u8, 64u8, 233u8, 166u8, 180u8, 137u8, 52u8, + 233u8, 252u8, 255u8, 36u8, 20u8, + ], + ) } } } } pub mod hrmp { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct HrmpInitOpenChannel { pub recipient: runtime_types::polkadot_parachain::primitives::Id, pub proposed_max_capacity: ::core::primitive::u32, pub proposed_max_message_size: ::core::primitive::u32, } - impl ::subxt::Call for HrmpInitOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_init_open_channel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct HrmpAcceptOpenChannel { pub sender: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for HrmpAcceptOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_accept_open_channel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct HrmpCloseChannel { pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, } - impl ::subxt::Call for HrmpCloseChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_close_channel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceCleanHrmp { pub para: runtime_types::polkadot_parachain::primitives::Id, pub inbound: ::core::primitive::u32, pub outbound: ::core::primitive::u32, } - impl ::subxt::Call for ForceCleanHrmp { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_clean_hrmp"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct ForceProcessHrmpOpen { pub channels: ::core::primitive::u32, } - impl ::subxt::Call for ForceProcessHrmpOpen { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_open"; - } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct ForceProcessHrmpClose { pub channels: ::core::primitive::u32, } - impl ::subxt::Call for ForceProcessHrmpClose { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_close"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct HrmpCancelOpenRequest { pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, pub open_requests: ::core::primitive::u32, } - impl ::subxt::Call for HrmpCancelOpenRequest { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_cancel_open_request"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] #[doc = "parameters."] #[doc = ""] @@ -35698,39 +23765,22 @@ pub mod api { recipient: runtime_types::polkadot_parachain::primitives::Id, proposed_max_capacity: ::core::primitive::u32, proposed_max_message_size: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpInitOpenChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 244u8, 142u8, 161u8, 144u8, 109u8, 104u8, 164u8, 198u8, - 201u8, 79u8, 178u8, 136u8, 107u8, 104u8, 83u8, 11u8, 167u8, - 164u8, 223u8, 147u8, 135u8, 35u8, 133u8, 176u8, 236u8, 112u8, - 107u8, 131u8, 184u8, 105u8, 174u8, 12u8, - ] - { - let call = HrmpInitOpenChannel { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "hrmp_init_open_channel", + HrmpInitOpenChannel { recipient, proposed_max_capacity, proposed_max_message_size, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 170u8, 72u8, 58u8, 42u8, 38u8, 11u8, 110u8, 229u8, 239u8, + 136u8, 99u8, 230u8, 223u8, 225u8, 126u8, 61u8, 234u8, 185u8, + 101u8, 156u8, 40u8, 102u8, 253u8, 123u8, 77u8, 204u8, 217u8, + 86u8, 162u8, 66u8, 25u8, 214u8, + ], + ) } #[doc = "Accept a pending open channel request from the given sender."] #[doc = ""] @@ -35738,35 +23788,18 @@ pub mod api { pub fn hrmp_accept_open_channel( &self, sender: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpAcceptOpenChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 95u8, 196u8, 155u8, 220u8, 235u8, 120u8, 67u8, 247u8, 245u8, - 20u8, 162u8, 41u8, 4u8, 204u8, 125u8, 16u8, 224u8, 72u8, - 198u8, 237u8, 84u8, 46u8, 201u8, 17u8, 172u8, 55u8, 115u8, - 51u8, 16u8, 140u8, 4u8, 253u8, - ] - { - let call = HrmpAcceptOpenChannel { sender }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "hrmp_accept_open_channel", + HrmpAcceptOpenChannel { sender }, + [ + 75u8, 111u8, 52u8, 164u8, 204u8, 100u8, 204u8, 111u8, 127u8, + 84u8, 60u8, 136u8, 95u8, 255u8, 48u8, 157u8, 189u8, 76u8, + 33u8, 177u8, 223u8, 27u8, 74u8, 221u8, 139u8, 1u8, 12u8, + 128u8, 242u8, 7u8, 3u8, 53u8, + ], + ) } #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] #[doc = "recipient in the channel being closed."] @@ -35775,35 +23808,18 @@ pub mod api { pub fn hrmp_close_channel( &self, channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpCloseChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 199u8, 9u8, 55u8, 184u8, 196u8, 45u8, 46u8, 251u8, 48u8, - 23u8, 132u8, 74u8, 188u8, 121u8, 41u8, 18u8, 71u8, 65u8, - 129u8, 14u8, 38u8, 48u8, 253u8, 119u8, 171u8, 202u8, 9u8, - 65u8, 250u8, 98u8, 185u8, 220u8, - ] - { - let call = HrmpCloseChannel { channel_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "hrmp_close_channel", + HrmpCloseChannel { channel_id }, + [ + 11u8, 202u8, 76u8, 107u8, 213u8, 21u8, 191u8, 190u8, 40u8, + 229u8, 60u8, 115u8, 232u8, 136u8, 41u8, 114u8, 21u8, 19u8, + 238u8, 236u8, 202u8, 56u8, 212u8, 232u8, 34u8, 84u8, 27u8, + 70u8, 176u8, 252u8, 218u8, 52u8, + ], + ) } #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] #[doc = "a para may have. Normally this happens once per session, but this allows"] @@ -35817,39 +23833,22 @@ pub mod api { para: runtime_types::polkadot_parachain::primitives::Id, inbound: ::core::primitive::u32, outbound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceCleanHrmp, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 182u8, 231u8, 99u8, 129u8, 130u8, 109u8, 97u8, 108u8, 37u8, - 107u8, 203u8, 70u8, 133u8, 106u8, 226u8, 77u8, 110u8, 189u8, - 227u8, 26u8, 129u8, 189u8, 234u8, 215u8, 112u8, 22u8, 127u8, - 185u8, 152u8, 157u8, 14u8, 66u8, - ] - { - let call = ForceCleanHrmp { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "force_clean_hrmp", + ForceCleanHrmp { para, inbound, outbound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 171u8, 109u8, 147u8, 49u8, 163u8, 107u8, 36u8, 169u8, 117u8, + 193u8, 231u8, 114u8, 207u8, 38u8, 240u8, 195u8, 155u8, 222u8, + 244u8, 142u8, 93u8, 79u8, 111u8, 43u8, 5u8, 33u8, 190u8, + 30u8, 200u8, 225u8, 173u8, 64u8, + ], + ) } #[doc = "Force process HRMP open channel requests."] #[doc = ""] @@ -35860,35 +23859,18 @@ pub mod api { pub fn force_process_hrmp_open( &self, channels: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceProcessHrmpOpen, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 162u8, 53u8, 194u8, 175u8, 117u8, 32u8, 217u8, 177u8, 9u8, - 255u8, 88u8, 40u8, 8u8, 174u8, 8u8, 11u8, 26u8, 82u8, 213u8, - 40u8, 20u8, 89u8, 227u8, 209u8, 95u8, 162u8, 221u8, 97u8, - 230u8, 98u8, 110u8, 85u8, - ] - { - let call = ForceProcessHrmpOpen { channels }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "force_process_hrmp_open", + ForceProcessHrmpOpen { channels }, + [ + 231u8, 80u8, 233u8, 15u8, 131u8, 167u8, 223u8, 28u8, 182u8, + 185u8, 213u8, 24u8, 154u8, 160u8, 68u8, 94u8, 160u8, 59u8, + 78u8, 85u8, 85u8, 149u8, 130u8, 131u8, 9u8, 162u8, 169u8, + 119u8, 165u8, 44u8, 150u8, 50u8, + ], + ) } #[doc = "Force process HRMP close channel requests."] #[doc = ""] @@ -35899,35 +23881,18 @@ pub mod api { pub fn force_process_hrmp_close( &self, channels: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceProcessHrmpClose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 128u8, 141u8, 191u8, 255u8, 204u8, 137u8, 27u8, 170u8, 180u8, - 166u8, 93u8, 144u8, 70u8, 56u8, 132u8, 100u8, 5u8, 114u8, - 252u8, 163u8, 164u8, 246u8, 234u8, 152u8, 193u8, 79u8, 89u8, - 137u8, 46u8, 171u8, 32u8, 119u8, - ] - { - let call = ForceProcessHrmpClose { channels }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "force_process_hrmp_close", + ForceProcessHrmpClose { channels }, + [ + 248u8, 138u8, 30u8, 151u8, 53u8, 16u8, 44u8, 116u8, 51u8, + 194u8, 173u8, 252u8, 143u8, 53u8, 184u8, 129u8, 80u8, 80u8, + 25u8, 118u8, 47u8, 183u8, 249u8, 130u8, 8u8, 221u8, 56u8, + 106u8, 182u8, 114u8, 186u8, 161u8, + ], + ) } #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] #[doc = "or the recipient for that request. The origin must be either of those."] @@ -35941,38 +23906,21 @@ pub mod api { &self, channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, open_requests: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpCancelOpenRequest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 8u8, 83u8, 32u8, 187u8, 220u8, 1u8, 212u8, 226u8, 72u8, 61u8, - 110u8, 211u8, 238u8, 119u8, 95u8, 48u8, 150u8, 51u8, 177u8, - 182u8, 209u8, 174u8, 245u8, 25u8, 194u8, 199u8, 212u8, 131u8, - 77u8, 72u8, 9u8, 120u8, - ] - { - let call = HrmpCancelOpenRequest { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "hrmp_cancel_open_request", + HrmpCancelOpenRequest { channel_id, open_requests, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 136u8, 217u8, 56u8, 138u8, 227u8, 37u8, 120u8, 83u8, 116u8, + 228u8, 42u8, 111u8, 206u8, 210u8, 177u8, 235u8, 225u8, 98u8, + 172u8, 184u8, 87u8, 65u8, 77u8, 129u8, 7u8, 0u8, 232u8, + 139u8, 134u8, 1u8, 59u8, 19u8, + ], + ) } } } @@ -35980,7 +23928,11 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Open HRMP channel requested."] #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] pub struct OpenChannelRequested( @@ -35989,480 +23941,224 @@ pub mod api { pub ::core::primitive::u32, pub ::core::primitive::u32, ); - impl ::subxt::Event for OpenChannelRequested { + impl ::subxt::events::StaticEvent for OpenChannelRequested { const PALLET: &'static str = "Hrmp"; const EVENT: &'static str = "OpenChannelRequested"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] #[doc = "`[by_parachain, channel_id]`"] pub struct OpenChannelCanceled( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, ); - impl ::subxt::Event for OpenChannelCanceled { + impl ::subxt::events::StaticEvent for OpenChannelCanceled { const PALLET: &'static str = "Hrmp"; const EVENT: &'static str = "OpenChannelCanceled"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] pub struct OpenChannelAccepted( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_parachain::primitives::Id, ); - impl ::subxt::Event for OpenChannelAccepted { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] - pub struct ChannelClosed( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::Event for ChannelClosed { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "ChannelClosed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct HrmpOpenChannelRequests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequests"; - type Value = runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpOpenChannelRequestsList; - impl ::subxt::StorageEntry for HrmpOpenChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestsList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct HrmpOpenChannelRequestCount<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequestCount<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpAcceptedChannelRequestCount<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpAcceptedChannelRequestCount<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpAcceptedChannelRequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpCloseChannelRequests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpCloseChannelRequests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequests"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpCloseChannelRequestsList; - impl ::subxt::StorageEntry for HrmpCloseChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequestsList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct HrmpWatermarks<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpWatermarks<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpWatermarks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannels<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpChannels<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannels"; - type Value = - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpIngressChannelsIndex<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpIngressChannelsIndex<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpIngressChannelsIndex"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpEgressChannelsIndex<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpEgressChannelsIndex<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpEgressChannelsIndex"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannelContents<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpChannelContents<'_> { + impl ::subxt::events::StaticEvent for OpenChannelAccepted { const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelContents"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + const EVENT: &'static str = "OpenChannelAccepted"; } - pub struct HrmpChannelDigests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] + pub struct ChannelClosed( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, ); - impl ::subxt::StorageEntry for HrmpChannelDigests<'_> { + impl ::subxt::events::StaticEvent for ChannelClosed { const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelDigests"; - type Value = ::std::vec::Vec<( - ::core::primitive::u32, - ::std::vec::Vec, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + const EVENT: &'static str = "ChannelClosed"; } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { #[doc = " The set of pending HRMP open channel requests."] #[doc = ""] #[doc = " The set is accompanied by a list for iteration."] #[doc = ""] #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_open_channel_requests (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 58u8, 216u8, 106u8, 4u8, 117u8, 77u8, 168u8, 230u8, 50u8, - 6u8, 175u8, 26u8, 110u8, 45u8, 143u8, 207u8, 174u8, 77u8, - 5u8, 245u8, 172u8, 114u8, 20u8, 229u8, 153u8, 137u8, - 220u8, 189u8, 155u8, 5u8, 116u8, 236u8, - ] - { - let entry = HrmpOpenChannelRequests(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_open_channel_requests (& self , _0 : impl :: std :: borrow :: Borrow < runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: storage :: address :: Yes , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpOpenChannelRequests", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 226u8, 115u8, 207u8, 13u8, 5u8, 81u8, 64u8, 161u8, 246u8, + 4u8, 17u8, 207u8, 210u8, 109u8, 91u8, 54u8, 28u8, 53u8, 35u8, + 74u8, 62u8, 91u8, 196u8, 236u8, 18u8, 70u8, 13u8, 86u8, + 235u8, 74u8, 181u8, 169u8, + ], + ) } #[doc = " The set of pending HRMP open channel requests."] #[doc = ""] #[doc = " The set is accompanied by a list for iteration."] #[doc = ""] #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub fn hrmp_open_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequests<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 58u8, 216u8, 106u8, 4u8, 117u8, 77u8, 168u8, 230u8, 50u8, - 6u8, 175u8, 26u8, 110u8, 45u8, 143u8, 207u8, 174u8, 77u8, - 5u8, 245u8, 172u8, 114u8, 20u8, 229u8, 153u8, 137u8, - 220u8, 189u8, 155u8, 5u8, 116u8, 236u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_open_channel_requests_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , () , () , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpOpenChannelRequests", + Vec::new(), + [ + 226u8, 115u8, 207u8, 13u8, 5u8, 81u8, 64u8, 161u8, 246u8, + 4u8, 17u8, 207u8, 210u8, 109u8, 91u8, 54u8, 28u8, 53u8, 35u8, + 74u8, 62u8, 91u8, 196u8, 236u8, 18u8, 70u8, 13u8, 86u8, + 235u8, 74u8, 181u8, 169u8, + ], + ) } pub fn hrmp_open_channel_requests_list( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::HrmpChannelId, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 176u8, 22u8, 136u8, 206u8, 243u8, 208u8, 67u8, 150u8, - 187u8, 163u8, 141u8, 37u8, 235u8, 84u8, 176u8, 63u8, - 55u8, 38u8, 215u8, 185u8, 206u8, 127u8, 37u8, 108u8, - 245u8, 237u8, 154u8, 151u8, 111u8, 33u8, 39u8, 102u8, - ] - { - let entry = HrmpOpenChannelRequestsList; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpOpenChannelRequestsList", + vec![], + [ + 187u8, 157u8, 7u8, 183u8, 88u8, 215u8, 128u8, 174u8, 244u8, + 130u8, 137u8, 13u8, 110u8, 126u8, 181u8, 165u8, 142u8, 69u8, + 75u8, 37u8, 37u8, 149u8, 46u8, 100u8, 140u8, 69u8, 234u8, + 171u8, 103u8, 136u8, 223u8, 193u8, + ], + ) } #[doc = " This mapping tracks how many open channel requests are initiated by a given sender para."] #[doc = " Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has"] #[doc = " `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`."] pub fn hrmp_open_channel_request_count( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 47u8, 152u8, 1u8, 119u8, 244u8, 62u8, 249u8, - 141u8, 194u8, 157u8, 149u8, 58u8, 208u8, 113u8, 77u8, - 4u8, 248u8, 114u8, 94u8, 153u8, 20u8, 179u8, 4u8, 43u8, - 32u8, 248u8, 118u8, 115u8, 206u8, 228u8, 28u8, - ] - { - let entry = HrmpOpenChannelRequestCount(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpOpenChannelRequestCount", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 156u8, 87u8, 232u8, 34u8, 30u8, 237u8, 159u8, 78u8, 212u8, + 138u8, 140u8, 206u8, 191u8, 117u8, 209u8, 218u8, 251u8, + 146u8, 217u8, 56u8, 93u8, 15u8, 131u8, 64u8, 126u8, 253u8, + 126u8, 1u8, 12u8, 242u8, 176u8, 217u8, + ], + ) } #[doc = " This mapping tracks how many open channel requests are initiated by a given sender para."] #[doc = " Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has"] #[doc = " `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`."] - pub fn hrmp_open_channel_request_count_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequestCount<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 103u8, 47u8, 152u8, 1u8, 119u8, 244u8, 62u8, 249u8, - 141u8, 194u8, 157u8, 149u8, 58u8, 208u8, 113u8, 77u8, - 4u8, 248u8, 114u8, 94u8, 153u8, 20u8, 179u8, 4u8, 43u8, - 32u8, 248u8, 118u8, 115u8, 206u8, 228u8, 28u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_open_channel_request_count_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpOpenChannelRequestCount", + Vec::new(), + [ + 156u8, 87u8, 232u8, 34u8, 30u8, 237u8, 159u8, 78u8, 212u8, + 138u8, 140u8, 206u8, 191u8, 117u8, 209u8, 218u8, 251u8, + 146u8, 217u8, 56u8, 93u8, 15u8, 131u8, 64u8, 126u8, 253u8, + 126u8, 1u8, 12u8, 242u8, 176u8, 217u8, + ], + ) } #[doc = " This mapping tracks how many open channel requests were accepted by a given recipient para."] #[doc = " Invariant: `HrmpOpenChannelRequests` should contain the same number of items `(_, X)` with"] #[doc = " `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`."] pub fn hrmp_accepted_channel_request_count( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata - .storage_hash::() - { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 166u8, 207u8, 97u8, 222u8, 30u8, 204u8, 203u8, 122u8, - 72u8, 66u8, 247u8, 169u8, 128u8, 122u8, 145u8, 124u8, - 214u8, 183u8, 251u8, 85u8, 93u8, 37u8, 143u8, 71u8, 45u8, - 61u8, 168u8, 211u8, 222u8, 58u8, 91u8, 202u8, - ] - { - let entry = HrmpAcceptedChannelRequestCount(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpAcceptedChannelRequestCount", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 93u8, 183u8, 17u8, 253u8, 119u8, 213u8, 106u8, 205u8, 17u8, + 10u8, 230u8, 242u8, 5u8, 223u8, 49u8, 235u8, 41u8, 221u8, + 80u8, 51u8, 153u8, 62u8, 191u8, 3u8, 120u8, 224u8, 46u8, + 164u8, 161u8, 6u8, 15u8, 15u8, + ], + ) } #[doc = " This mapping tracks how many open channel requests were accepted by a given recipient para."] #[doc = " Invariant: `HrmpOpenChannelRequests` should contain the same number of items `(_, X)` with"] #[doc = " `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`."] - pub fn hrmp_accepted_channel_request_count_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpAcceptedChannelRequestCount<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata - .storage_hash::() - { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 166u8, 207u8, 97u8, 222u8, 30u8, 204u8, 203u8, 122u8, - 72u8, 66u8, 247u8, 169u8, 128u8, 122u8, 145u8, 124u8, - 214u8, 183u8, 251u8, 85u8, 93u8, 37u8, 143u8, 71u8, 45u8, - 61u8, 168u8, 211u8, 222u8, 58u8, 91u8, 202u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_accepted_channel_request_count_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpAcceptedChannelRequestCount", + Vec::new(), + [ + 93u8, 183u8, 17u8, 253u8, 119u8, 213u8, 106u8, 205u8, 17u8, + 10u8, 230u8, 242u8, 5u8, 223u8, 49u8, 235u8, 41u8, 221u8, + 80u8, 51u8, 153u8, 62u8, 191u8, 3u8, 120u8, 224u8, 46u8, + 164u8, 161u8, 6u8, 15u8, 15u8, + ], + ) } #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] #[doc = " change. Used for checking if a given channel is registered for closure."] @@ -36473,38 +24169,29 @@ pub mod api { #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_close_channel_requests( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<()>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 118u8, 8u8, 142u8, 158u8, 184u8, 200u8, 38u8, 112u8, - 217u8, 69u8, 161u8, 255u8, 116u8, 143u8, 94u8, 185u8, - 95u8, 247u8, 227u8, 101u8, 107u8, 55u8, 172u8, 164u8, - 58u8, 182u8, 193u8, 140u8, 142u8, 118u8, 223u8, 240u8, - ] - { - let entry = HrmpCloseChannelRequests(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<()>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpCloseChannelRequests", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 125u8, 131u8, 1u8, 231u8, 19u8, 207u8, 229u8, 72u8, 150u8, + 100u8, 165u8, 215u8, 241u8, 165u8, 91u8, 35u8, 230u8, 148u8, + 127u8, 249u8, 128u8, 221u8, 167u8, 172u8, 67u8, 30u8, 177u8, + 176u8, 134u8, 223u8, 39u8, 87u8, + ], + ) } #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] #[doc = " change. Used for checking if a given channel is registered for closure."] @@ -36513,225 +24200,157 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub fn hrmp_close_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 118u8, 8u8, 142u8, 158u8, 184u8, 200u8, 38u8, 112u8, - 217u8, 69u8, 161u8, 255u8, 116u8, 143u8, 94u8, 185u8, - 95u8, 247u8, 227u8, 101u8, 107u8, 55u8, 172u8, 164u8, - 58u8, 182u8, 193u8, 140u8, 142u8, 118u8, 223u8, 240u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_close_channel_requests_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<()>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpCloseChannelRequests", + Vec::new(), + [ + 125u8, 131u8, 1u8, 231u8, 19u8, 207u8, 229u8, 72u8, 150u8, + 100u8, 165u8, 215u8, 241u8, 165u8, 91u8, 35u8, 230u8, 148u8, + 127u8, 249u8, 128u8, 221u8, 167u8, 172u8, 67u8, 30u8, 177u8, + 176u8, 134u8, 223u8, 39u8, 87u8, + ], + ) } pub fn hrmp_close_channel_requests_list( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::HrmpChannelId, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() - { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 203u8, 46u8, 200u8, 63u8, 120u8, 238u8, 88u8, 170u8, - 239u8, 27u8, 99u8, 104u8, 254u8, 194u8, 152u8, 221u8, - 126u8, 188u8, 2u8, 153u8, 79u8, 183u8, 236u8, 145u8, - 120u8, 151u8, 235u8, 56u8, 130u8, 240u8, 74u8, 211u8, - ] - { - let entry = HrmpCloseChannelRequestsList; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpCloseChannelRequestsList", + vec![], + [ + 192u8, 165u8, 71u8, 70u8, 211u8, 233u8, 155u8, 146u8, 160u8, + 58u8, 103u8, 64u8, 123u8, 232u8, 157u8, 71u8, 199u8, 223u8, + 158u8, 5u8, 164u8, 93u8, 231u8, 153u8, 1u8, 63u8, 155u8, 4u8, + 138u8, 89u8, 178u8, 116u8, + ], + ) } #[doc = " The HRMP watermark associated with each para."] #[doc = " Invariant:"] #[doc = " - each para `P` used here as a key should satisfy `Paras::is_valid_para(P)` within a session."] pub fn hrmp_watermarks( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 28u8, 187u8, 5u8, 0u8, 130u8, 11u8, 241u8, 171u8, 141u8, - 109u8, 236u8, 151u8, 194u8, 124u8, 172u8, 180u8, 36u8, - 144u8, 134u8, 53u8, 162u8, 247u8, 138u8, 209u8, 99u8, - 194u8, 213u8, 100u8, 254u8, 15u8, 51u8, 94u8, - ] - { - let entry = HrmpWatermarks(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpWatermarks", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 231u8, 195u8, 117u8, 35u8, 235u8, 18u8, 80u8, 28u8, 212u8, + 37u8, 253u8, 204u8, 71u8, 217u8, 12u8, 35u8, 219u8, 250u8, + 45u8, 83u8, 102u8, 236u8, 186u8, 149u8, 54u8, 31u8, 83u8, + 19u8, 129u8, 51u8, 103u8, 155u8, + ], + ) } #[doc = " The HRMP watermark associated with each para."] #[doc = " Invariant:"] #[doc = " - each para `P` used here as a key should satisfy `Paras::is_valid_para(P)` within a session."] - pub fn hrmp_watermarks_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpWatermarks<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 28u8, 187u8, 5u8, 0u8, 130u8, 11u8, 241u8, 171u8, 141u8, - 109u8, 236u8, 151u8, 194u8, 124u8, 172u8, 180u8, 36u8, - 144u8, 134u8, 53u8, 162u8, 247u8, 138u8, 209u8, 99u8, - 194u8, 213u8, 100u8, 254u8, 15u8, 51u8, 94u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_watermarks_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpWatermarks", + Vec::new(), + [ + 231u8, 195u8, 117u8, 35u8, 235u8, 18u8, 80u8, 28u8, 212u8, + 37u8, 253u8, 204u8, 71u8, 217u8, 12u8, 35u8, 219u8, 250u8, + 45u8, 83u8, 102u8, 236u8, 186u8, 149u8, 54u8, 31u8, 83u8, + 19u8, 129u8, 51u8, 103u8, 155u8, + ], + ) } #[doc = " HRMP channel data associated with each para."] #[doc = " Invariant:"] #[doc = " - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session."] pub fn hrmp_channels( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 241u8, 160u8, 242u8, 167u8, 251u8, 8u8, 131u8, 194u8, - 179u8, 216u8, 231u8, 125u8, 58u8, 118u8, 61u8, 113u8, - 46u8, 47u8, 6u8, 71u8, 46u8, 113u8, 192u8, 1u8, 199u8, - 207u8, 179u8, 253u8, 144u8, 146u8, 19u8, 1u8, - ] - { - let entry = HrmpChannels(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpChannels", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 224u8, 252u8, 187u8, 122u8, 179u8, 193u8, 227u8, 250u8, + 255u8, 216u8, 107u8, 26u8, 224u8, 16u8, 178u8, 111u8, 77u8, + 237u8, 177u8, 148u8, 22u8, 17u8, 213u8, 99u8, 194u8, 140u8, + 217u8, 211u8, 151u8, 51u8, 66u8, 169u8, + ], + ) } #[doc = " HRMP channel data associated with each para."] #[doc = " Invariant:"] #[doc = " - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session."] - pub fn hrmp_channels_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannels<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 241u8, 160u8, 242u8, 167u8, 251u8, 8u8, 131u8, 194u8, - 179u8, 216u8, 231u8, 125u8, 58u8, 118u8, 61u8, 113u8, - 46u8, 47u8, 6u8, 71u8, 46u8, 113u8, 192u8, 1u8, 199u8, - 207u8, 179u8, 253u8, 144u8, 146u8, 19u8, 1u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_channels_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpChannels", + Vec::new(), + [ + 224u8, 252u8, 187u8, 122u8, 179u8, 193u8, 227u8, 250u8, + 255u8, 216u8, 107u8, 26u8, 224u8, 16u8, 178u8, 111u8, 77u8, + 237u8, 177u8, 148u8, 22u8, 17u8, 213u8, 99u8, 194u8, 140u8, + 217u8, 211u8, 151u8, 51u8, 66u8, 169u8, + ], + ) } #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] #[doc = " I.e."] @@ -36748,40 +24367,33 @@ pub mod api { #[doc = " - the vectors are sorted."] pub fn hrmp_ingress_channels_index( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 193u8, 185u8, 164u8, 194u8, 89u8, 218u8, 214u8, 184u8, - 100u8, 238u8, 232u8, 90u8, 243u8, 230u8, 93u8, 191u8, - 197u8, 182u8, 215u8, 254u8, 192u8, 11u8, 171u8, 211u8, - 150u8, 210u8, 75u8, 216u8, 149u8, 60u8, 49u8, 166u8, - ] - { - let entry = HrmpIngressChannelsIndex(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpIngressChannelsIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 58u8, 193u8, 212u8, 225u8, 48u8, 195u8, 119u8, 15u8, 61u8, + 166u8, 249u8, 1u8, 118u8, 67u8, 253u8, 40u8, 58u8, 220u8, + 124u8, 152u8, 4u8, 16u8, 155u8, 151u8, 195u8, 15u8, 205u8, + 175u8, 234u8, 0u8, 101u8, 99u8, + ], + ) } #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] #[doc = " I.e."] @@ -36796,184 +24408,145 @@ pub mod api { #[doc = " `HrmpChannels` as `(P, E)`."] #[doc = " - there should be no other dangling channels in `HrmpChannels`."] #[doc = " - the vectors are sorted."] - pub fn hrmp_ingress_channels_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpIngressChannelsIndex<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 193u8, 185u8, 164u8, 194u8, 89u8, 218u8, 214u8, 184u8, - 100u8, 238u8, 232u8, 90u8, 243u8, 230u8, 93u8, 191u8, - 197u8, 182u8, 215u8, 254u8, 192u8, 11u8, 171u8, 211u8, - 150u8, 210u8, 75u8, 216u8, 149u8, 60u8, 49u8, 166u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_ingress_channels_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::Id, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpIngressChannelsIndex", + Vec::new(), + [ + 58u8, 193u8, 212u8, 225u8, 48u8, 195u8, 119u8, 15u8, 61u8, + 166u8, 249u8, 1u8, 118u8, 67u8, 253u8, 40u8, 58u8, 220u8, + 124u8, 152u8, 4u8, 16u8, 155u8, 151u8, 195u8, 15u8, 205u8, + 175u8, 234u8, 0u8, 101u8, 99u8, + ], + ) } pub fn hrmp_egress_channels_index( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 242u8, 138u8, 89u8, 201u8, 60u8, 216u8, 73u8, 66u8, - 167u8, 82u8, 225u8, 42u8, 61u8, 50u8, 54u8, 187u8, 212u8, - 8u8, 255u8, 183u8, 85u8, 180u8, 176u8, 0u8, 226u8, 173u8, - 45u8, 155u8, 172u8, 28u8, 229u8, 157u8, - ] - { - let entry = HrmpEgressChannelsIndex(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - pub fn hrmp_egress_channels_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 242u8, 138u8, 89u8, 201u8, 60u8, 216u8, 73u8, 66u8, - 167u8, 82u8, 225u8, 42u8, 61u8, 50u8, 54u8, 187u8, 212u8, - 8u8, 255u8, 183u8, 85u8, 180u8, 176u8, 0u8, 226u8, 173u8, - 45u8, 155u8, 172u8, 28u8, 229u8, 157u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpEgressChannelsIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 9u8, 242u8, 41u8, 234u8, 85u8, 193u8, 232u8, 245u8, 254u8, + 26u8, 240u8, 113u8, 184u8, 151u8, 150u8, 44u8, 43u8, 98u8, + 84u8, 209u8, 145u8, 175u8, 128u8, 68u8, 183u8, 112u8, 171u8, + 236u8, 211u8, 32u8, 177u8, 88u8, + ], + ) + } + pub fn hrmp_egress_channels_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::Id, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpEgressChannelsIndex", + Vec::new(), + [ + 9u8, 242u8, 41u8, 234u8, 85u8, 193u8, 232u8, 245u8, 254u8, + 26u8, 240u8, 113u8, 184u8, 151u8, 150u8, 44u8, 43u8, 98u8, + 84u8, 209u8, 145u8, 175u8, 128u8, 68u8, 183u8, 112u8, 171u8, + 236u8, 211u8, 32u8, 177u8, 88u8, + ], + ) } #[doc = " Storage for the messages for each channel."] #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] pub fn hrmp_channel_contents( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_core_primitives::InboundHrmpMessage< ::core::primitive::u32, >, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 71u8, 246u8, 41u8, 12u8, 125u8, 10u8, 60u8, 209u8, 14u8, - 254u8, 125u8, 217u8, 251u8, 172u8, 243u8, 73u8, 33u8, - 230u8, 242u8, 16u8, 207u8, 165u8, 33u8, 136u8, 78u8, - 83u8, 206u8, 134u8, 65u8, 115u8, 166u8, 192u8, - ] - { - let entry = HrmpChannelContents(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpChannelContents", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 114u8, 86u8, 172u8, 88u8, 118u8, 243u8, 133u8, 147u8, 108u8, + 60u8, 128u8, 235u8, 45u8, 80u8, 225u8, 130u8, 89u8, 50u8, + 40u8, 118u8, 63u8, 3u8, 83u8, 222u8, 75u8, 167u8, 148u8, + 150u8, 193u8, 90u8, 196u8, 225u8, + ], + ) } #[doc = " Storage for the messages for each channel."] #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] - pub fn hrmp_channel_contents_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelContents<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 71u8, 246u8, 41u8, 12u8, 125u8, 10u8, 60u8, 209u8, 14u8, - 254u8, 125u8, 217u8, 251u8, 172u8, 243u8, 73u8, 33u8, - 230u8, 242u8, 16u8, 207u8, 165u8, 33u8, 136u8, 78u8, - 83u8, 206u8, 134u8, 65u8, 115u8, 166u8, 192u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_channel_contents_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpChannelContents", + Vec::new(), + [ + 114u8, 86u8, 172u8, 88u8, 118u8, 243u8, 133u8, 147u8, 108u8, + 60u8, 128u8, 235u8, 45u8, 80u8, 225u8, 130u8, 89u8, 50u8, + 40u8, 118u8, 63u8, 3u8, 83u8, 222u8, 75u8, 167u8, 148u8, + 150u8, 193u8, 90u8, 196u8, 225u8, + ], + ) } #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] #[doc = " the given block number for a given receiver. Invariants:"] @@ -36983,43 +24556,36 @@ pub mod api { #[doc = " same block number."] pub fn hrmp_channel_digests( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec<( ::core::primitive::u32, ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 54u8, 106u8, 76u8, 21u8, 18u8, 49u8, 1u8, 34u8, 247u8, - 101u8, 150u8, 142u8, 214u8, 137u8, 193u8, 100u8, 208u8, - 162u8, 55u8, 229u8, 203u8, 36u8, 154u8, 138u8, 48u8, - 204u8, 114u8, 243u8, 54u8, 185u8, 27u8, 173u8, - ] - { - let entry = HrmpChannelDigests(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpChannelDigests", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 205u8, 18u8, 60u8, 54u8, 123u8, 40u8, 160u8, 149u8, 174u8, + 45u8, 135u8, 213u8, 83u8, 44u8, 97u8, 243u8, 47u8, 200u8, + 156u8, 131u8, 15u8, 63u8, 170u8, 206u8, 101u8, 17u8, 244u8, + 132u8, 73u8, 133u8, 79u8, 104u8, + ], + ) } #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] #[doc = " the given block number for a given receiver. Invariants:"] @@ -37027,378 +24593,216 @@ pub mod api { #[doc = " - The inner `Vec` cannot store two same `ParaId`."] #[doc = " - The outer vector is sorted ascending by block number and cannot store two items with the"] #[doc = " same block number."] - pub fn hrmp_channel_digests_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelDigests<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 54u8, 106u8, 76u8, 21u8, 18u8, 49u8, 1u8, 34u8, 247u8, - 101u8, 150u8, 142u8, 214u8, 137u8, 193u8, 100u8, 208u8, - 162u8, 55u8, 229u8, 203u8, 36u8, 154u8, 138u8, 48u8, - 204u8, 114u8, 243u8, 54u8, 185u8, 27u8, 173u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn hrmp_channel_digests_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<( + ::core::primitive::u32, + ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::Id, + >, + )>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Hrmp", + "HrmpChannelDigests", + Vec::new(), + [ + 205u8, 18u8, 60u8, 54u8, 123u8, 40u8, 160u8, 149u8, 174u8, + 45u8, 135u8, 213u8, 83u8, 44u8, 97u8, 243u8, 47u8, 200u8, + 156u8, 131u8, 15u8, 63u8, 170u8, 206u8, 101u8, 17u8, 244u8, + 132u8, 73u8, 133u8, 79u8, 104u8, + ], + ) } } } } pub mod para_session_info { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; pub mod storage { use super::runtime_types; - pub struct AssignmentKeysUnsafe; - impl ::subxt::StorageEntry for AssignmentKeysUnsafe { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "AssignmentKeysUnsafe"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::assignment_app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EarliestStoredSession; - impl ::subxt::StorageEntry for EarliestStoredSession { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "EarliestStoredSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Sessions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Sessions<'_> { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "Sessions"; - type Value = runtime_types::polkadot_primitives::v2::SessionInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct AccountKeys<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for AccountKeys<'_> { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "AccountKeys"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Assignment keys for the current session."] #[doc = " Note that this API is private due to it being prone to 'off-by-one' at session boundaries."] - #[doc = " When in doubt, use `Sessions` API instead."] pub fn assignment_keys_unsafe (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_primitives :: v2 :: assignment_app :: Public > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 243u8, 5u8, 37u8, 167u8, 29u8, 59u8, 87u8, 66u8, 53u8, - 91u8, 181u8, 9u8, 144u8, 248u8, 225u8, 121u8, 130u8, - 111u8, 140u8, 35u8, 79u8, 187u8, 159u8, 22u8, 192u8, - 166u8, 144u8, 161u8, 239u8, 98u8, 255u8, 108u8, - ] - { - let entry = AssignmentKeysUnsafe; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " When in doubt, use `Sessions` API instead."] pub fn assignment_keys_unsafe (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < runtime_types :: polkadot_primitives :: v2 :: assignment_app :: Public > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ParaSessionInfo", + "AssignmentKeysUnsafe", + vec![], + [ + 80u8, 24u8, 61u8, 132u8, 118u8, 225u8, 207u8, 75u8, 35u8, + 240u8, 209u8, 255u8, 19u8, 240u8, 114u8, 174u8, 86u8, 65u8, + 65u8, 52u8, 135u8, 232u8, 59u8, 208u8, 3u8, 107u8, 114u8, + 241u8, 14u8, 98u8, 40u8, 226u8, + ], + ) } #[doc = " The earliest session for which previous session info is stored."] pub fn earliest_stored_session( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 25u8, 143u8, 246u8, 184u8, 35u8, 166u8, 140u8, 147u8, - 171u8, 5u8, 164u8, 159u8, 228u8, 21u8, 248u8, 236u8, - 48u8, 210u8, 133u8, 140u8, 171u8, 3u8, 85u8, 250u8, - 160u8, 102u8, 95u8, 46u8, 33u8, 81u8, 102u8, 241u8, - ] - { - let entry = EarliestStoredSession; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaSessionInfo", + "EarliestStoredSession", + vec![], + [ + 25u8, 143u8, 246u8, 184u8, 35u8, 166u8, 140u8, 147u8, 171u8, + 5u8, 164u8, 159u8, 228u8, 21u8, 248u8, 236u8, 48u8, 210u8, + 133u8, 140u8, 171u8, 3u8, 85u8, 250u8, 160u8, 102u8, 95u8, + 46u8, 33u8, 81u8, 102u8, 241u8, + ], + ) } #[doc = " Session information in a rolling window."] #[doc = " Should have an entry in range `EarliestStoredSession..=CurrentSessionIndex`."] #[doc = " Does not have any entries before the session index in the first session change notification."] pub fn sessions( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::SessionInfo, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 95u8, 222u8, 240u8, 96u8, 203u8, 233u8, 100u8, 160u8, - 180u8, 161u8, 180u8, 123u8, 168u8, 102u8, 93u8, 172u8, - 93u8, 174u8, 103u8, 211u8, 254u8, 30u8, 207u8, 199u8, - 148u8, 200u8, 100u8, 155u8, 149u8, 48u8, 238u8, 51u8, - ] - { - let entry = Sessions(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::SessionInfo, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaSessionInfo", + "Sessions", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 33u8, 46u8, 71u8, 15u8, 195u8, 14u8, 107u8, 223u8, 112u8, + 69u8, 249u8, 233u8, 86u8, 249u8, 79u8, 164u8, 20u8, 71u8, + 191u8, 32u8, 67u8, 195u8, 128u8, 61u8, 67u8, 84u8, 79u8, + 137u8, 248u8, 85u8, 253u8, 21u8, + ], + ) } #[doc = " Session information in a rolling window."] #[doc = " Should have an entry in range `EarliestStoredSession..=CurrentSessionIndex`."] #[doc = " Does not have any entries before the session index in the first session change notification."] - pub fn sessions_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Sessions<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 95u8, 222u8, 240u8, 96u8, 203u8, 233u8, 100u8, 160u8, - 180u8, 161u8, 180u8, 123u8, 168u8, 102u8, 93u8, 172u8, - 93u8, 174u8, 103u8, 211u8, 254u8, 30u8, 207u8, 199u8, - 148u8, 200u8, 100u8, 155u8, 149u8, 48u8, 238u8, 51u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn sessions_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::SessionInfo, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaSessionInfo", + "Sessions", + Vec::new(), + [ + 33u8, 46u8, 71u8, 15u8, 195u8, 14u8, 107u8, 223u8, 112u8, + 69u8, 249u8, 233u8, 86u8, 249u8, 79u8, 164u8, 20u8, 71u8, + 191u8, 32u8, 67u8, 195u8, 128u8, 61u8, 67u8, 84u8, 79u8, + 137u8, 248u8, 85u8, 253u8, 21u8, + ], + ) } #[doc = " The validator account keys of the validators actively participating in parachain consensus."] pub fn account_keys( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 26u8, 160u8, 169u8, 110u8, 242u8, 243u8, 149u8, 148u8, - 213u8, 251u8, 111u8, 52u8, 105u8, 157u8, 144u8, 245u8, - 114u8, 150u8, 192u8, 204u8, 123u8, 91u8, 123u8, 244u8, - 165u8, 82u8, 238u8, 155u8, 224u8, 182u8, 190u8, 27u8, - ] - { - let entry = AccountKeys(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaSessionInfo", + "AccountKeys", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 48u8, 179u8, 139u8, 15u8, 144u8, 71u8, 92u8, 160u8, 254u8, + 237u8, 98u8, 60u8, 254u8, 208u8, 201u8, 32u8, 79u8, 55u8, + 3u8, 33u8, 188u8, 134u8, 18u8, 151u8, 132u8, 40u8, 192u8, + 215u8, 94u8, 124u8, 148u8, 142u8, + ], + ) } #[doc = " The validator account keys of the validators actively participating in parachain consensus."] - pub fn account_keys_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, AccountKeys<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 26u8, 160u8, 169u8, 110u8, 242u8, 243u8, 149u8, 148u8, - 213u8, 251u8, 111u8, 52u8, 105u8, 157u8, 144u8, 245u8, - 114u8, 150u8, 192u8, 204u8, 123u8, 91u8, 123u8, 244u8, - 165u8, 82u8, 238u8, 155u8, 224u8, 182u8, 190u8, 27u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn account_keys_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParaSessionInfo", + "AccountKeys", + Vec::new(), + [ + 48u8, 179u8, 139u8, 15u8, 144u8, 71u8, 92u8, 160u8, 254u8, + 237u8, 98u8, 60u8, 254u8, 208u8, 201u8, 32u8, 79u8, 55u8, + 3u8, 33u8, 188u8, 134u8, 18u8, 151u8, 132u8, 40u8, 192u8, + 215u8, 94u8, 124u8, 148u8, 142u8, + ], + ) } } } } pub mod paras_disputes { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceUnfreeze; - impl ::subxt::Call for ForceUnfreeze { - const PALLET: &'static str = "ParasDisputes"; - const FUNCTION: &'static str = "force_unfreeze"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { pub fn force_unfreeze( &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnfreeze, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ParasDisputes", + "force_unfreeze", + ForceUnfreeze {}, + [ 212u8, 211u8, 58u8, 159u8, 23u8, 220u8, 64u8, 175u8, 65u8, 50u8, 192u8, 122u8, 113u8, 189u8, 74u8, 191u8, 48u8, 93u8, 251u8, 50u8, 237u8, 240u8, 91u8, 139u8, 193u8, 114u8, 131u8, 125u8, 124u8, 236u8, 191u8, 190u8, - ] - { - let call = ForceUnfreeze {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } } } @@ -37407,41 +24811,53 @@ pub mod api { runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] pub struct DisputeInitiated( pub runtime_types::polkadot_core_primitives::CandidateHash, pub runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation, ); - impl ::subxt::Event for DisputeInitiated { + impl ::subxt::events::StaticEvent for DisputeInitiated { const PALLET: &'static str = "ParasDisputes"; const EVENT: &'static str = "DisputeInitiated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A dispute has concluded for or against a candidate."] #[doc = "`\\[para id, candidate hash, dispute result\\]`"] pub struct DisputeConcluded( pub runtime_types::polkadot_core_primitives::CandidateHash, pub runtime_types::polkadot_runtime_parachains::disputes::DisputeResult, ); - impl ::subxt::Event for DisputeConcluded { + impl ::subxt::events::StaticEvent for DisputeConcluded { const PALLET: &'static str = "ParasDisputes"; const EVENT: &'static str = "DisputeConcluded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A dispute has timed out due to insufficient participation."] #[doc = "`\\[para id, candidate hash\\]`"] pub struct DisputeTimedOut( pub runtime_types::polkadot_core_primitives::CandidateHash, ); - impl ::subxt::Event for DisputeTimedOut { + impl ::subxt::events::StaticEvent for DisputeTimedOut { const PALLET: &'static str = "ParasDisputes"; const EVENT: &'static str = "DisputeTimedOut"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A dispute has concluded with supermajority against a candidate."] @@ -37449,277 +24865,118 @@ pub mod api { #[doc = "instead revert the block at the given height. This should be the"] #[doc = "number of the child of the last known valid block in the chain."] pub struct Revert(pub ::core::primitive::u32); - impl ::subxt::Event for Revert { + impl ::subxt::events::StaticEvent for Revert { const PALLET: &'static str = "ParasDisputes"; const EVENT: &'static str = "Revert"; } } pub mod storage { use super::runtime_types; - pub struct LastPrunedSession; - impl ::subxt::StorageEntry for LastPrunedSession { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "LastPrunedSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Disputes<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::StorageEntry for Disputes<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Disputes"; - type Value = runtime_types::polkadot_primitives::v2::DisputeState< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Included<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::StorageEntry for Included<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Included"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct SpamSlots<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for SpamSlots<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "SpamSlots"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Frozen; - impl ::subxt::StorageEntry for Frozen { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Frozen"; - type Value = ::core::option::Option<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The last pruned session, if any. All data stored by this module"] #[doc = " references sessions."] pub fn last_pruned_session( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 125u8, 138u8, 99u8, 242u8, 9u8, 246u8, 215u8, 246u8, - 141u8, 6u8, 129u8, 87u8, 27u8, 58u8, 53u8, 121u8, 61u8, - 119u8, 35u8, 104u8, 33u8, 43u8, 179u8, 82u8, 244u8, - 121u8, 174u8, 135u8, 87u8, 119u8, 236u8, 105u8, - ] - { - let entry = LastPrunedSession; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasDisputes", + "LastPrunedSession", + vec![], + [ + 125u8, 138u8, 99u8, 242u8, 9u8, 246u8, 215u8, 246u8, 141u8, + 6u8, 129u8, 87u8, 27u8, 58u8, 53u8, 121u8, 61u8, 119u8, 35u8, + 104u8, 33u8, 43u8, 179u8, 82u8, 244u8, 121u8, 174u8, 135u8, + 87u8, 119u8, 236u8, 105u8, + ], + ) } #[doc = " All ongoing or concluded disputes for the last several sessions."] pub fn disputes( &self, - _0: &'a ::core::primitive::u32, - _1: &'a runtime_types::polkadot_core_primitives::CandidateHash, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::DisputeState< - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow< + runtime_types::polkadot_core_primitives::CandidateHash, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::DisputeState< + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 37u8, 50u8, 243u8, 127u8, 8u8, 137u8, 232u8, 140u8, - 200u8, 76u8, 211u8, 245u8, 26u8, 63u8, 113u8, 31u8, - 169u8, 92u8, 165u8, 143u8, 11u8, 29u8, 2u8, 25u8, 55u8, - 250u8, 173u8, 237u8, 153u8, 4u8, 235u8, 10u8, - ] - { - let entry = Disputes(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + :: subxt :: storage :: address :: StaticStorageAddress :: new ("ParasDisputes" , "Disputes" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [192u8 , 238u8 , 255u8 , 67u8 , 169u8 , 86u8 , 99u8 , 243u8 , 228u8 , 88u8 , 142u8 , 138u8 , 183u8 , 117u8 , 82u8 , 22u8 , 163u8 , 30u8 , 175u8 , 247u8 , 50u8 , 204u8 , 12u8 , 171u8 , 57u8 , 189u8 , 151u8 , 191u8 , 196u8 , 89u8 , 94u8 , 165u8 ,]) } #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub fn disputes_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Disputes<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 37u8, 50u8, 243u8, 127u8, 8u8, 137u8, 232u8, 140u8, - 200u8, 76u8, 211u8, 245u8, 26u8, 63u8, 113u8, 31u8, - 169u8, 92u8, 165u8, 143u8, 11u8, 29u8, 2u8, 25u8, 55u8, - 250u8, 173u8, 237u8, 153u8, 4u8, 235u8, 10u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn disputes_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_primitives::v2::DisputeState< + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasDisputes", + "Disputes", + Vec::new(), + [ + 192u8, 238u8, 255u8, 67u8, 169u8, 86u8, 99u8, 243u8, 228u8, + 88u8, 142u8, 138u8, 183u8, 117u8, 82u8, 22u8, 163u8, 30u8, + 175u8, 247u8, 50u8, 204u8, 12u8, 171u8, 57u8, 189u8, 151u8, + 191u8, 196u8, 89u8, 94u8, 165u8, + ], + ) } #[doc = " All included blocks on the chain, as well as the block number in this chain that"] #[doc = " should be reverted back to if the candidate is disputed and determined to be invalid."] pub fn included( &self, - _0: &'a ::core::primitive::u32, - _1: &'a runtime_types::polkadot_core_primitives::CandidateHash, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 32u8, 107u8, 8u8, 112u8, 201u8, 81u8, 66u8, 223u8, 120u8, - 51u8, 166u8, 240u8, 229u8, 141u8, 231u8, 132u8, 114u8, - 36u8, 213u8, 48u8, 249u8, 153u8, 143u8, 157u8, 93u8, - 204u8, 207u8, 144u8, 52u8, 36u8, 46u8, 12u8, - ] - { - let entry = Included(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow< + runtime_types::polkadot_core_primitives::CandidateHash, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + :: subxt :: storage :: address :: StaticStorageAddress :: new ("ParasDisputes" , "Included" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [129u8 , 50u8 , 76u8 , 60u8 , 82u8 , 106u8 , 248u8 , 164u8 , 152u8 , 80u8 , 58u8 , 185u8 , 211u8 , 225u8 , 122u8 , 100u8 , 234u8 , 241u8 , 123u8 , 205u8 , 4u8 , 8u8 , 193u8 , 116u8 , 167u8 , 158u8 , 252u8 , 223u8 , 204u8 , 226u8 , 74u8 , 195u8 ,]) } #[doc = " All included blocks on the chain, as well as the block number in this chain that"] #[doc = " should be reverted back to if the candidate is disputed and determined to be invalid."] - pub fn included_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Included<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 32u8, 107u8, 8u8, 112u8, 201u8, 81u8, 66u8, 223u8, 120u8, - 51u8, 166u8, 240u8, 229u8, 141u8, 231u8, 132u8, 114u8, - 36u8, 213u8, 48u8, 249u8, 153u8, 143u8, 157u8, 93u8, - 204u8, 207u8, 144u8, 52u8, 36u8, 46u8, 12u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn included_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasDisputes", + "Included", + Vec::new(), + [ + 129u8, 50u8, 76u8, 60u8, 82u8, 106u8, 248u8, 164u8, 152u8, + 80u8, 58u8, 185u8, 211u8, 225u8, 122u8, 100u8, 234u8, 241u8, + 123u8, 205u8, 4u8, 8u8, 193u8, 116u8, 167u8, 158u8, 252u8, + 223u8, 204u8, 226u8, 74u8, 195u8, + ], + ) } #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] @@ -37728,76 +24985,56 @@ pub mod api { #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] pub fn spam_slots( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u32>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 172u8, 23u8, 120u8, 188u8, 71u8, 248u8, 252u8, 41u8, - 132u8, 221u8, 98u8, 215u8, 33u8, 242u8, 168u8, 196u8, - 90u8, 123u8, 190u8, 27u8, 147u8, 6u8, 196u8, 175u8, - 198u8, 216u8, 50u8, 74u8, 138u8, 122u8, 251u8, 238u8, - ] - { - let entry = SpamSlots(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u32>, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasDisputes", + "SpamSlots", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 172u8, 23u8, 120u8, 188u8, 71u8, 248u8, 252u8, 41u8, 132u8, + 221u8, 98u8, 215u8, 33u8, 242u8, 168u8, 196u8, 90u8, 123u8, + 190u8, 27u8, 147u8, 6u8, 196u8, 175u8, 198u8, 216u8, 50u8, + 74u8, 138u8, 122u8, 251u8, 238u8, + ], + ) } #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] #[doc = " fewer than `byzantine_threshold + 1` validators."] #[doc = ""] #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] - pub fn spam_slots_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SpamSlots<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 172u8, 23u8, 120u8, 188u8, 71u8, 248u8, 252u8, 41u8, - 132u8, 221u8, 98u8, 215u8, 33u8, 242u8, 168u8, 196u8, - 90u8, 123u8, 190u8, 27u8, 147u8, 6u8, 196u8, 175u8, - 198u8, 216u8, 50u8, 74u8, 138u8, 122u8, 251u8, 238u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn spam_slots_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::core::primitive::u32>, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasDisputes", + "SpamSlots", + Vec::new(), + [ + 172u8, 23u8, 120u8, 188u8, 71u8, 248u8, 252u8, 41u8, 132u8, + 221u8, 98u8, 215u8, 33u8, 242u8, 168u8, 196u8, 90u8, 123u8, + 190u8, 27u8, 147u8, 6u8, 196u8, 175u8, 198u8, 216u8, 50u8, + 74u8, 138u8, 122u8, 251u8, 238u8, + ], + ) } #[doc = " Whether the chain is frozen. Starts as `None`. When this is `Some`,"] #[doc = " the chain will not accept any new parachain blocks for backing or inclusion,"] @@ -37805,123 +25042,94 @@ pub mod api { #[doc = " It can only be set back to `None` by governance intervention."] pub fn frozen( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 133u8, 100u8, 86u8, 220u8, 180u8, 189u8, 65u8, 131u8, - 64u8, 56u8, 219u8, 47u8, 130u8, 167u8, 210u8, 125u8, - 49u8, 7u8, 153u8, 254u8, 20u8, 53u8, 218u8, 177u8, 122u8, - 148u8, 16u8, 198u8, 251u8, 50u8, 194u8, 128u8, - ] - { - let entry = Frozen; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ParasDisputes", + "Frozen", + vec![], + [ + 133u8, 100u8, 86u8, 220u8, 180u8, 189u8, 65u8, 131u8, 64u8, + 56u8, 219u8, 47u8, 130u8, 167u8, 210u8, 125u8, 49u8, 7u8, + 153u8, 254u8, 20u8, 53u8, 218u8, 177u8, 122u8, 148u8, 16u8, + 198u8, 251u8, 50u8, 194u8, 128u8, + ], + ) } } } } pub mod registrar { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Register { pub id: runtime_types::polkadot_parachain::primitives::Id, pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, } - impl ::subxt::Call for Register { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "register"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceRegister { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, pub id: runtime_types::polkadot_parachain::primitives::Id, pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, } - impl ::subxt::Call for ForceRegister { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "force_register"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Deregister { pub id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for Deregister { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "deregister"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Swap { pub id: runtime_types::polkadot_parachain::primitives::Id, pub other: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for Swap { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "swap"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceRemoveLock { pub para: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for ForceRemoveLock { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "force_remove_lock"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Reserve; - impl ::subxt::Call for Reserve { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "reserve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Register head data and validation code for a reserved Para Id."] #[doc = ""] #[doc = "## Arguments"] @@ -37941,39 +25149,22 @@ pub mod api { id: runtime_types::polkadot_parachain::primitives::Id, genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Register, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 180u8, 21u8, 142u8, 73u8, 21u8, 31u8, 64u8, 210u8, 196u8, - 4u8, 142u8, 153u8, 172u8, 207u8, 95u8, 209u8, 177u8, 75u8, - 202u8, 85u8, 95u8, 208u8, 123u8, 237u8, 190u8, 148u8, 5u8, - 64u8, 65u8, 191u8, 221u8, 203u8, - ] - { - let call = Register { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "register", + Register { id, genesis_head, validation_code, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 154u8, 84u8, 201u8, 125u8, 72u8, 69u8, 188u8, 42u8, 225u8, + 14u8, 136u8, 48u8, 78u8, 86u8, 99u8, 238u8, 252u8, 255u8, + 226u8, 219u8, 214u8, 17u8, 19u8, 9u8, 12u8, 13u8, 174u8, + 243u8, 37u8, 134u8, 76u8, 23u8, + ], + ) } #[doc = "Force the registration of a Para Id on the relay chain."] #[doc = ""] @@ -37983,46 +25174,29 @@ pub mod api { #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] pub fn force_register( &self, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, id: runtime_types::polkadot_parachain::primitives::Id, genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceRegister, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 191u8, 198u8, 172u8, 68u8, 118u8, 126u8, 110u8, 47u8, 193u8, - 147u8, 61u8, 27u8, 122u8, 107u8, 49u8, 222u8, 87u8, 199u8, - 184u8, 247u8, 153u8, 137u8, 205u8, 153u8, 6u8, 15u8, 246u8, - 8u8, 36u8, 76u8, 54u8, 63u8, - ] - { - let call = ForceRegister { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "force_register", + ForceRegister { who, deposit, id, genesis_head, validation_code, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 59u8, 24u8, 236u8, 163u8, 53u8, 49u8, 92u8, 199u8, 38u8, + 76u8, 101u8, 73u8, 166u8, 105u8, 145u8, 55u8, 89u8, 30u8, + 30u8, 137u8, 151u8, 219u8, 116u8, 226u8, 168u8, 220u8, 222u8, + 6u8, 105u8, 91u8, 254u8, 216u8, + ], + ) } #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] #[doc = ""] @@ -38030,35 +25204,18 @@ pub mod api { pub fn deregister( &self, id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Deregister, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 147u8, 4u8, 172u8, 215u8, 67u8, 142u8, 93u8, 245u8, 108u8, - 83u8, 5u8, 250u8, 87u8, 138u8, 231u8, 10u8, 159u8, 216u8, - 85u8, 233u8, 244u8, 200u8, 37u8, 33u8, 160u8, 143u8, 119u8, - 11u8, 70u8, 177u8, 8u8, 123u8, - ] - { - let call = Deregister { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "deregister", + Deregister { id }, + [ + 137u8, 9u8, 146u8, 11u8, 126u8, 125u8, 186u8, 222u8, 246u8, + 199u8, 94u8, 229u8, 147u8, 245u8, 213u8, 51u8, 203u8, 181u8, + 78u8, 87u8, 18u8, 255u8, 79u8, 107u8, 234u8, 2u8, 21u8, + 212u8, 1u8, 73u8, 173u8, 253u8, + ], + ) } #[doc = "Swap a parachain with another parachain or parathread."] #[doc = ""] @@ -38075,35 +25232,18 @@ pub mod api { &self, id: runtime_types::polkadot_parachain::primitives::Id, other: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Swap, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 145u8, 163u8, 246u8, 239u8, 241u8, 209u8, 58u8, 241u8, 63u8, - 134u8, 102u8, 55u8, 217u8, 125u8, 176u8, 91u8, 27u8, 32u8, - 220u8, 236u8, 18u8, 20u8, 7u8, 187u8, 100u8, 116u8, 161u8, - 133u8, 127u8, 187u8, 86u8, 109u8, - ] - { - let call = Swap { id, other }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "swap", + Swap { id, other }, + [ + 238u8, 154u8, 249u8, 250u8, 57u8, 242u8, 47u8, 17u8, 50u8, + 70u8, 124u8, 189u8, 193u8, 137u8, 107u8, 138u8, 216u8, 137u8, + 160u8, 103u8, 192u8, 133u8, 7u8, 130u8, 41u8, 39u8, 47u8, + 139u8, 202u8, 7u8, 84u8, 214u8, + ], + ) } #[doc = "Remove a manager lock from a para. This will allow the manager of a"] #[doc = "previously locked para to deregister or swap a para without using governance."] @@ -38112,35 +25252,18 @@ pub mod api { pub fn force_remove_lock( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceRemoveLock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 205u8, 174u8, 132u8, 188u8, 1u8, 59u8, 82u8, 135u8, 123u8, - 55u8, 144u8, 39u8, 205u8, 171u8, 13u8, 252u8, 65u8, 56u8, - 98u8, 216u8, 23u8, 175u8, 16u8, 200u8, 198u8, 252u8, 133u8, - 238u8, 81u8, 142u8, 254u8, 124u8, - ] - { - let call = ForceRemoveLock { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "force_remove_lock", + ForceRemoveLock { para }, + [ + 161u8, 77u8, 236u8, 143u8, 243u8, 159u8, 88u8, 61u8, 217u8, + 140u8, 161u8, 61u8, 20u8, 76u8, 130u8, 59u8, 85u8, 219u8, + 105u8, 234u8, 146u8, 142u8, 121u8, 154u8, 170u8, 210u8, + 204u8, 175u8, 160u8, 86u8, 249u8, 150u8, + ], + ) } #[doc = "Reserve a Para Id on the relay chain."] #[doc = ""] @@ -38156,37 +25279,18 @@ pub mod api { #[doc = ""] #[doc = "## Events"] #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] - pub fn reserve( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Reserve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + pub fn reserve(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "reserve", + Reserve {}, + [ 22u8, 210u8, 13u8, 54u8, 253u8, 13u8, 89u8, 174u8, 232u8, 119u8, 148u8, 206u8, 130u8, 133u8, 199u8, 127u8, 201u8, 205u8, 8u8, 213u8, 108u8, 93u8, 135u8, 88u8, 238u8, 171u8, 31u8, 193u8, 23u8, 113u8, 106u8, 135u8, - ] - { - let call = Reserve {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } } } @@ -38195,374 +25299,270 @@ pub mod api { runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Registered { pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub manager: ::subxt::sp_core::crypto::AccountId32, + pub manager: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Registered { + impl ::subxt::events::StaticEvent for Registered { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Registered"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Deregistered { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for Deregistered { + impl ::subxt::events::StaticEvent for Deregistered { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Deregistered"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Reserved { pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, } - impl ::subxt::Event for Reserved { + impl ::subxt::events::StaticEvent for Reserved { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Reserved"; } } pub mod storage { use super::runtime_types; - pub struct PendingSwap<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingSwap<'_> { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "PendingSwap"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Paras<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Paras<'_> { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "Paras"; - type Value = - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NextFreeParaId; - impl ::subxt::StorageEntry for NextFreeParaId { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "NextFreeParaId"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Pending swap operations."] pub fn pending_swap( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::Id, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 130u8, 4u8, 116u8, 91u8, 196u8, 41u8, 66u8, 48u8, 17u8, - 2u8, 255u8, 189u8, 132u8, 10u8, 129u8, 102u8, 117u8, - 56u8, 114u8, 231u8, 78u8, 112u8, 11u8, 76u8, 152u8, 41u8, - 70u8, 232u8, 212u8, 71u8, 193u8, 107u8, - ] - { - let entry = PendingSwap(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::Id, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Registrar", + "PendingSwap", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 121u8, 124u8, 4u8, 120u8, 173u8, 48u8, 227u8, 135u8, 72u8, + 74u8, 238u8, 230u8, 1u8, 175u8, 33u8, 241u8, 138u8, 82u8, + 217u8, 129u8, 138u8, 107u8, 59u8, 8u8, 205u8, 244u8, 192u8, + 159u8, 171u8, 123u8, 149u8, 174u8, + ], + ) } #[doc = " Pending swap operations."] - pub fn pending_swap_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingSwap<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 130u8, 4u8, 116u8, 91u8, 196u8, 41u8, 66u8, 48u8, 17u8, - 2u8, 255u8, 189u8, 132u8, 10u8, 129u8, 102u8, 117u8, - 56u8, 114u8, 231u8, 78u8, 112u8, 11u8, 76u8, 152u8, 41u8, - 70u8, 232u8, 212u8, 71u8, 193u8, 107u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn pending_swap_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_parachain::primitives::Id, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Registrar", + "PendingSwap", + Vec::new(), + [ + 121u8, 124u8, 4u8, 120u8, 173u8, 48u8, 227u8, 135u8, 72u8, + 74u8, 238u8, 230u8, 1u8, 175u8, 33u8, 241u8, 138u8, 82u8, + 217u8, 129u8, 138u8, 107u8, 59u8, 8u8, 205u8, 244u8, 192u8, + 159u8, 171u8, 123u8, 149u8, 174u8, + ], + ) } #[doc = " Amount held on deposit for each para and the original depositor."] #[doc = ""] #[doc = " The given account ID is responsible for registering the code and initial head data, but may only do"] - #[doc = " so if it isn't yet registered. (After that, it's up to governance to do so.)"] pub fn paras (& self , _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: paras_registrar :: ParaInfo < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 > > , :: subxt :: BasicError > > + 'a{ - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 180u8, 146u8, 122u8, 242u8, 222u8, 203u8, 19u8, 110u8, - 22u8, 53u8, 147u8, 127u8, 165u8, 158u8, 113u8, 196u8, - 105u8, 209u8, 45u8, 250u8, 163u8, 78u8, 120u8, 129u8, - 180u8, 128u8, 63u8, 195u8, 71u8, 176u8, 247u8, 206u8, - ] - { - let entry = Paras(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + #[doc = " so if it isn't yet registered. (After that, it's up to governance to do so.)"] + pub fn paras( + &self, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Registrar", + "Paras", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 149u8, 3u8, 25u8, 145u8, 60u8, 126u8, 219u8, 71u8, 88u8, + 241u8, 122u8, 99u8, 134u8, 191u8, 60u8, 172u8, 230u8, 230u8, + 110u8, 31u8, 43u8, 6u8, 146u8, 161u8, 51u8, 21u8, 169u8, + 220u8, 240u8, 218u8, 124u8, 56u8, + ], + ) } #[doc = " Amount held on deposit for each para and the original depositor."] #[doc = ""] #[doc = " The given account ID is responsible for registering the code and initial head data, but may only do"] #[doc = " so if it isn't yet registered. (After that, it's up to governance to do so.)"] - pub fn paras_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Paras<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 180u8, 146u8, 122u8, 242u8, 222u8, 203u8, 19u8, 110u8, - 22u8, 53u8, 147u8, 127u8, 165u8, 158u8, 113u8, 196u8, - 105u8, 209u8, 45u8, 250u8, 163u8, 78u8, 120u8, 129u8, - 180u8, 128u8, 63u8, 195u8, 71u8, 176u8, 247u8, 206u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn paras_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Registrar", + "Paras", + Vec::new(), + [ + 149u8, 3u8, 25u8, 145u8, 60u8, 126u8, 219u8, 71u8, 88u8, + 241u8, 122u8, 99u8, 134u8, 191u8, 60u8, 172u8, 230u8, 230u8, + 110u8, 31u8, 43u8, 6u8, 146u8, 161u8, 51u8, 21u8, 169u8, + 220u8, 240u8, 218u8, 124u8, 56u8, + ], + ) } #[doc = " The next free `ParaId`."] pub fn next_free_para_id( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::polkadot_parachain::primitives::Id, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 112u8, 52u8, 84u8, 181u8, 132u8, 61u8, 46u8, 69u8, 165u8, - 85u8, 253u8, 243u8, 228u8, 151u8, 15u8, 239u8, 172u8, - 28u8, 102u8, 38u8, 155u8, 90u8, 55u8, 162u8, 254u8, - 139u8, 59u8, 186u8, 152u8, 239u8, 53u8, 216u8, - ] - { - let entry = NextFreeParaId; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Registrar", + "NextFreeParaId", + vec![], + [ + 139u8, 76u8, 36u8, 150u8, 237u8, 36u8, 143u8, 242u8, 252u8, + 29u8, 236u8, 168u8, 97u8, 50u8, 175u8, 120u8, 83u8, 118u8, + 205u8, 64u8, 95u8, 65u8, 7u8, 230u8, 171u8, 86u8, 189u8, + 205u8, 231u8, 211u8, 97u8, 29u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The deposit to be paid to run a parathread."] #[doc = " This should include the cost for storing the genesis head and validation code."] pub fn para_deposit( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Registrar", "ParaDeposit")? - == [ - 18u8, 109u8, 161u8, 161u8, 151u8, 174u8, 243u8, 90u8, 220u8, - 82u8, 192u8, 60u8, 26u8, 123u8, 90u8, 99u8, 36u8, 86u8, - 106u8, 101u8, 215u8, 154u8, 136u8, 220u8, 246u8, 185u8, - 126u8, 229u8, 205u8, 246u8, 61u8, 50u8, - ] - { - let pallet = metadata.pallet("Registrar")?; - let constant = pallet.constant("ParaDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Registrar", + "ParaDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The deposit to be paid per byte stored on chain."] pub fn data_deposit_per_byte( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Registrar", "DataDepositPerByte")? - == [ - 112u8, 186u8, 158u8, 252u8, 99u8, 4u8, 201u8, 234u8, 99u8, - 14u8, 248u8, 198u8, 79u8, 107u8, 41u8, 32u8, 63u8, 205u8, - 85u8, 30u8, 30u8, 105u8, 250u8, 248u8, 106u8, 75u8, 74u8, - 175u8, 224u8, 115u8, 236u8, 99u8, - ] - { - let pallet = metadata.pallet("Registrar")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Registrar", + "DataDepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } } pub mod slots { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceLease { pub para: runtime_types::polkadot_parachain::primitives::Id, - pub leaser: ::subxt::sp_core::crypto::AccountId32, + pub leaser: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, pub period_begin: ::core::primitive::u32, pub period_count: ::core::primitive::u32, } - impl ::subxt::Call for ForceLease { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "force_lease"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ClearAllLeases { pub para: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for ClearAllLeases { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "clear_all_leases"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct TriggerOnboard { pub para: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for TriggerOnboard { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "trigger_onboard"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] #[doc = "independently of any other on-chain mechanism to use it."] #[doc = ""] @@ -38570,45 +25570,28 @@ pub mod api { pub fn force_lease( &self, para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, + leaser: ::subxt::ext::sp_core::crypto::AccountId32, amount: ::core::primitive::u128, period_begin: ::core::primitive::u32, period_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceLease, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 110u8, 205u8, 106u8, 226u8, 3u8, 177u8, 198u8, 116u8, 52u8, - 161u8, 90u8, 240u8, 43u8, 160u8, 144u8, 63u8, 97u8, 231u8, - 232u8, 176u8, 92u8, 253u8, 16u8, 243u8, 187u8, 94u8, 20u8, - 114u8, 23u8, 46u8, 231u8, 249u8, - ] - { - let call = ForceLease { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Slots", + "force_lease", + ForceLease { para, leaser, amount, period_begin, period_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 196u8, 2u8, 63u8, 229u8, 18u8, 134u8, 48u8, 4u8, 165u8, 46u8, + 173u8, 0u8, 189u8, 35u8, 99u8, 84u8, 103u8, 124u8, 233u8, + 246u8, 60u8, 172u8, 181u8, 205u8, 154u8, 164u8, 36u8, 178u8, + 60u8, 164u8, 166u8, 21u8, + ], + ) } #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] #[doc = ""] @@ -38616,35 +25599,18 @@ pub mod api { pub fn clear_all_leases( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearAllLeases, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 101u8, 225u8, 10u8, 139u8, 34u8, 12u8, 48u8, 76u8, 97u8, - 178u8, 5u8, 110u8, 19u8, 3u8, 237u8, 183u8, 54u8, 113u8, 7u8, - 138u8, 180u8, 201u8, 245u8, 151u8, 61u8, 40u8, 69u8, 31u8, - 28u8, 172u8, 253u8, 227u8, - ] - { - let call = ClearAllLeases { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Slots", + "clear_all_leases", + ClearAllLeases { para }, + [ + 16u8, 14u8, 185u8, 45u8, 149u8, 70u8, 177u8, 133u8, 130u8, + 173u8, 196u8, 244u8, 77u8, 63u8, 218u8, 64u8, 108u8, 83u8, + 84u8, 184u8, 175u8, 122u8, 36u8, 115u8, 146u8, 117u8, 132u8, + 82u8, 2u8, 144u8, 62u8, 179u8, + ], + ) } #[doc = "Try to onboard a parachain that has a lease for the current lease period."] #[doc = ""] @@ -38656,35 +25622,18 @@ pub mod api { pub fn trigger_onboard( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TriggerOnboard, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 85u8, 246u8, 247u8, 252u8, 46u8, 143u8, 200u8, 102u8, 105u8, - 51u8, 148u8, 164u8, 27u8, 25u8, 139u8, 167u8, 150u8, 129u8, - 131u8, 187u8, 153u8, 6u8, 169u8, 153u8, 192u8, 116u8, 130u8, - 12u8, 22u8, 199u8, 52u8, 8u8, - ] - { - let call = TriggerOnboard { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Slots", + "trigger_onboard", + TriggerOnboard { para }, + [ + 74u8, 158u8, 122u8, 37u8, 34u8, 62u8, 61u8, 218u8, 94u8, + 222u8, 1u8, 153u8, 131u8, 215u8, 157u8, 180u8, 98u8, 130u8, + 151u8, 179u8, 22u8, 120u8, 32u8, 207u8, 208u8, 46u8, 248u8, + 43u8, 154u8, 118u8, 106u8, 2u8, + ], + ) } } } @@ -38693,64 +25642,44 @@ pub mod api { pub mod events { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "A new `[lease_period]` is beginning."] pub struct NewLeasePeriod { pub lease_period: ::core::primitive::u32, } - impl ::subxt::Event for NewLeasePeriod { + impl ::subxt::events::StaticEvent for NewLeasePeriod { const PALLET: &'static str = "Slots"; const EVENT: &'static str = "NewLeasePeriod"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A para has won the right to a continuous set of lease periods as a parachain."] #[doc = "First balance is any extra amount reserved on top of the para's existing deposit."] #[doc = "Second balance is the total amount reserved."] pub struct Leased { pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub leaser: ::subxt::sp_core::crypto::AccountId32, + pub leaser: ::subxt::ext::sp_core::crypto::AccountId32, pub period_begin: ::core::primitive::u32, pub period_count: ::core::primitive::u32, pub extra_reserved: ::core::primitive::u128, pub total_amount: ::core::primitive::u128, } - impl ::subxt::Event for Leased { + impl ::subxt::events::StaticEvent for Leased { const PALLET: &'static str = "Slots"; const EVENT: &'static str = "Leased"; } } pub mod storage { use super::runtime_types; - pub struct Leases<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Leases<'_> { - const PALLET: &'static str = "Slots"; - const STORAGE: &'static str = "Leases"; - type Value = ::std::vec::Vec< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] #[doc = ""] #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the second values"] @@ -38769,43 +25698,36 @@ pub mod api { #[doc = " It is illegal for a `None` value to trail in the list."] pub fn leases( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 83u8, 145u8, 119u8, 74u8, 166u8, 90u8, 141u8, 47u8, - 125u8, 250u8, 173u8, 63u8, 193u8, 78u8, 96u8, 119u8, - 111u8, 126u8, 83u8, 83u8, 80u8, 32u8, 43u8, 173u8, 123u8, - 126u8, 132u8, 166u8, 252u8, 39u8, 18u8, 39u8, - ] - { - let entry = Leases(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Slots", + "Leases", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 7u8, 104u8, 17u8, 66u8, 157u8, 89u8, 238u8, 38u8, 233u8, + 241u8, 110u8, 67u8, 132u8, 101u8, 243u8, 62u8, 73u8, 7u8, + 9u8, 172u8, 22u8, 51u8, 118u8, 87u8, 3u8, 224u8, 120u8, 88u8, + 139u8, 11u8, 96u8, 147u8, + ], + ) } #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] #[doc = ""] @@ -38823,125 +25745,100 @@ pub mod api { #[doc = " deposit for the non-existent chain currently, but is held at some point in the future."] #[doc = ""] #[doc = " It is illegal for a `None` value to trail in the list."] - pub fn leases_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Leases<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 83u8, 145u8, 119u8, 74u8, 166u8, 90u8, 141u8, 47u8, - 125u8, 250u8, 173u8, 63u8, 193u8, 78u8, 96u8, 119u8, - 111u8, 126u8, 83u8, 83u8, 80u8, 32u8, 43u8, 173u8, 123u8, - 126u8, 132u8, 166u8, 252u8, 39u8, 18u8, 39u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn leases_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + ::core::option::Option<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Slots", + "Leases", + Vec::new(), + [ + 7u8, 104u8, 17u8, 66u8, 157u8, 89u8, 238u8, 38u8, 233u8, + 241u8, 110u8, 67u8, 132u8, 101u8, 243u8, 62u8, 73u8, 7u8, + 9u8, 172u8, 22u8, 51u8, 118u8, 87u8, 3u8, 224u8, 120u8, 88u8, + 139u8, 11u8, 96u8, 147u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The number of blocks over which a single period lasts."] pub fn lease_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Slots", "LeasePeriod")? - == [ - 203u8, 21u8, 3u8, 22u8, 25u8, 46u8, 2u8, 223u8, 51u8, 234u8, - 160u8, 236u8, 54u8, 225u8, 52u8, 36u8, 60u8, 150u8, 37u8, - 13u8, 215u8, 134u8, 181u8, 100u8, 254u8, 3u8, 173u8, 154u8, - 74u8, 103u8, 124u8, 100u8, - ] - { - let pallet = metadata.pallet("Slots")?; - let constant = pallet.constant("LeasePeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Slots", + "LeasePeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The number of blocks to offset each lease period by."] pub fn lease_offset( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Slots", "LeaseOffset")? - == [ - 7u8, 48u8, 194u8, 175u8, 129u8, 96u8, 39u8, 178u8, 104u8, - 157u8, 176u8, 78u8, 10u8, 5u8, 196u8, 122u8, 210u8, 168u8, - 167u8, 128u8, 21u8, 134u8, 90u8, 3u8, 108u8, 207u8, 62u8, - 81u8, 246u8, 70u8, 49u8, 68u8, - ] - { - let pallet = metadata.pallet("Slots")?; - let constant = pallet.constant("LeaseOffset")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Slots", + "LeaseOffset", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod auctions { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NewAuction { #[codec(compact)] pub duration: ::core::primitive::u32, #[codec(compact)] pub lease_period_index: ::core::primitive::u32, } - impl ::subxt::Call for NewAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "new_auction"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Bid { #[codec(compact)] pub para: runtime_types::polkadot_parachain::primitives::Id, @@ -38954,31 +25851,14 @@ pub mod api { #[codec(compact)] pub amount: ::core::primitive::u128, } - impl ::subxt::Call for Bid { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "bid"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct CancelAuction; - impl ::subxt::Call for CancelAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "cancel_auction"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Create a new auction."] #[doc = ""] #[doc = "This can only happen when there isn't already an auction in progress and may only be"] @@ -38988,38 +25868,21 @@ pub mod api { &self, duration: ::core::primitive::u32, lease_period_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NewAuction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 12u8, 43u8, 152u8, 0u8, 229u8, 15u8, 32u8, 205u8, 208u8, - 71u8, 57u8, 169u8, 201u8, 177u8, 52u8, 10u8, 93u8, 183u8, - 5u8, 156u8, 231u8, 188u8, 77u8, 238u8, 119u8, 238u8, 87u8, - 251u8, 121u8, 199u8, 18u8, 129u8, - ] - { - let call = NewAuction { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Auctions", + "new_auction", + NewAuction { duration, lease_period_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 171u8, 40u8, 200u8, 164u8, 213u8, 10u8, 145u8, 164u8, 212u8, + 14u8, 117u8, 215u8, 248u8, 59u8, 34u8, 79u8, 50u8, 176u8, + 164u8, 143u8, 92u8, 82u8, 207u8, 37u8, 103u8, 252u8, 255u8, + 142u8, 239u8, 134u8, 114u8, 151u8, + ], + ) } #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] #[doc = "parachain."] @@ -39044,76 +25907,42 @@ pub mod api { first_slot: ::core::primitive::u32, last_slot: ::core::primitive::u32, amount: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Bid, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 206u8, 22u8, 15u8, 251u8, 222u8, 193u8, 192u8, 125u8, 160u8, - 131u8, 209u8, 129u8, 105u8, 46u8, 77u8, 204u8, 107u8, 112u8, - 13u8, 188u8, 193u8, 73u8, 225u8, 232u8, 179u8, 205u8, 39u8, - 69u8, 242u8, 79u8, 36u8, 121u8, - ] - { - let call = Bid { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Auctions", + "bid", + Bid { para, auction_index, first_slot, last_slot, amount, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 243u8, 233u8, 248u8, 221u8, 239u8, 59u8, 65u8, 63u8, 125u8, + 129u8, 202u8, 165u8, 30u8, 228u8, 32u8, 73u8, 225u8, 38u8, + 128u8, 98u8, 102u8, 46u8, 203u8, 32u8, 70u8, 74u8, 136u8, + 163u8, 83u8, 211u8, 227u8, 139u8, + ], + ) } #[doc = "Cancel an in-progress auction."] #[doc = ""] #[doc = "Can only be called by Root origin."] pub fn cancel_auction( &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelAuction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Auctions", + "cancel_auction", + CancelAuction {}, + [ 182u8, 223u8, 178u8, 136u8, 1u8, 115u8, 229u8, 78u8, 166u8, 128u8, 28u8, 106u8, 6u8, 248u8, 46u8, 55u8, 110u8, 120u8, 213u8, 11u8, 90u8, 217u8, 42u8, 120u8, 47u8, 83u8, 126u8, 216u8, 236u8, 251u8, 255u8, 50u8, - ] - { - let call = CancelAuction {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ], + ) } } } @@ -39121,7 +25950,11 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An auction started. Provides its index and the block number where it will begin to"] #[doc = "close and the first lease period of the quadruplet that is auctioned."] pub struct AuctionStarted { @@ -39129,174 +25962,126 @@ pub mod api { pub lease_period: ::core::primitive::u32, pub ending: ::core::primitive::u32, } - impl ::subxt::Event for AuctionStarted { + impl ::subxt::events::StaticEvent for AuctionStarted { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "AuctionStarted"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "An auction ended. All funds become unreserved."] pub struct AuctionClosed { pub auction_index: ::core::primitive::u32, } - impl ::subxt::Event for AuctionClosed { + impl ::subxt::events::StaticEvent for AuctionClosed { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "AuctionClosed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] #[doc = "Second is the total."] pub struct Reserved { - pub bidder: ::subxt::sp_core::crypto::AccountId32, + pub bidder: ::subxt::ext::sp_core::crypto::AccountId32, pub extra_reserved: ::core::primitive::u128, pub total_amount: ::core::primitive::u128, } - impl ::subxt::Event for Reserved { + impl ::subxt::events::StaticEvent for Reserved { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "Reserved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] pub struct Unreserved { - pub bidder: ::subxt::sp_core::crypto::AccountId32, + pub bidder: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Unreserved { + impl ::subxt::events::StaticEvent for Unreserved { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "Unreserved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Someone attempted to lease the same slot twice for a parachain. The amount is held in reserve"] #[doc = "but no parachain slot has been leased."] pub struct ReserveConfiscated { pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub leaser: ::subxt::sp_core::crypto::AccountId32, + pub leaser: ::subxt::ext::sp_core::crypto::AccountId32, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for ReserveConfiscated { + impl ::subxt::events::StaticEvent for ReserveConfiscated { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "ReserveConfiscated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A new bid has been accepted as the current winner."] pub struct BidAccepted { - pub bidder: ::subxt::sp_core::crypto::AccountId32, + pub bidder: ::subxt::ext::sp_core::crypto::AccountId32, pub para_id: runtime_types::polkadot_parachain::primitives::Id, pub amount: ::core::primitive::u128, pub first_slot: ::core::primitive::u32, pub last_slot: ::core::primitive::u32, } - impl ::subxt::Event for BidAccepted { + impl ::subxt::events::StaticEvent for BidAccepted { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "BidAccepted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The winning offset was chosen for an auction. This will map into the `Winning` storage map."] pub struct WinningOffset { pub auction_index: ::core::primitive::u32, pub block_number: ::core::primitive::u32, } - impl ::subxt::Event for WinningOffset { + impl ::subxt::events::StaticEvent for WinningOffset { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "WinningOffset"; } } pub mod storage { use super::runtime_types; - pub struct AuctionCounter; - impl ::subxt::StorageEntry for AuctionCounter { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionCounter"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AuctionInfo; - impl ::subxt::StorageEntry for AuctionInfo { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionInfo"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReservedAmounts<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ReservedAmounts<'_> { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "ReservedAmounts"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Winning<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Winning<'_> { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "Winning"; - type Value = [::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - )>; 36usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Number of auctions started so far."] pub fn auction_counter( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 67u8, 247u8, 96u8, 152u8, 0u8, 224u8, 230u8, 98u8, 194u8, - 107u8, 3u8, 203u8, 51u8, 201u8, 149u8, 22u8, 184u8, 80u8, - 251u8, 239u8, 253u8, 19u8, 58u8, 192u8, 65u8, 96u8, - 189u8, 54u8, 175u8, 130u8, 143u8, 181u8, - ] - { - let entry = AuctionCounter; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Auctions", + "AuctionCounter", + vec![], + [ + 67u8, 247u8, 96u8, 152u8, 0u8, 224u8, 230u8, 98u8, 194u8, + 107u8, 3u8, 203u8, 51u8, 201u8, 149u8, 22u8, 184u8, 80u8, + 251u8, 239u8, 253u8, 19u8, 58u8, 192u8, 65u8, 96u8, 189u8, + 54u8, 175u8, 130u8, 143u8, 181u8, + ], + ) } #[doc = " Information relating to the current auction, if there is one."] #[doc = ""] @@ -39305,317 +26090,230 @@ pub mod api { #[doc = " auction will \"begin to end\", i.e. the first block of the Ending Period of the auction."] pub fn auction_info( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 73u8, 216u8, 173u8, 230u8, 132u8, 78u8, 83u8, 62u8, - 200u8, 69u8, 17u8, 73u8, 57u8, 107u8, 160u8, 90u8, 147u8, - 84u8, 29u8, 110u8, 144u8, 215u8, 169u8, 110u8, 217u8, - 77u8, 109u8, 204u8, 1u8, 164u8, 95u8, 83u8, - ] - { - let entry = AuctionInfo; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Auctions", + "AuctionInfo", + vec![], + [ + 73u8, 216u8, 173u8, 230u8, 132u8, 78u8, 83u8, 62u8, 200u8, + 69u8, 17u8, 73u8, 57u8, 107u8, 160u8, 90u8, 147u8, 84u8, + 29u8, 110u8, 144u8, 215u8, 169u8, 110u8, 217u8, 77u8, 109u8, + 204u8, 1u8, 164u8, 95u8, 83u8, + ], + ) } #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] #[doc = " (sub-)ranges."] pub fn reserved_amounts( &self, - _0: &'a ::subxt::sp_core::crypto::AccountId32, - _1: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 195u8, 56u8, 142u8, 154u8, 193u8, 115u8, 13u8, 64u8, - 101u8, 179u8, 69u8, 175u8, 185u8, 12u8, 31u8, 65u8, - 147u8, 211u8, 74u8, 40u8, 190u8, 254u8, 190u8, 176u8, - 117u8, 159u8, 234u8, 214u8, 157u8, 83u8, 56u8, 192u8, - ] - { - let entry = ReservedAmounts(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + _1: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Auctions", + "ReservedAmounts", + vec![::subxt::storage::address::StorageMapKey::new( + &(_0.borrow(), _1.borrow()), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 120u8, 85u8, 180u8, 244u8, 154u8, 135u8, 87u8, 79u8, 75u8, + 169u8, 220u8, 117u8, 227u8, 85u8, 198u8, 214u8, 28u8, 126u8, + 66u8, 188u8, 137u8, 111u8, 110u8, 152u8, 18u8, 233u8, 76u8, + 166u8, 55u8, 233u8, 93u8, 62u8, + ], + ) } #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] #[doc = " (sub-)ranges."] - pub fn reserved_amounts_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, ReservedAmounts<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 195u8, 56u8, 142u8, 154u8, 193u8, 115u8, 13u8, 64u8, - 101u8, 179u8, 69u8, 175u8, 185u8, 12u8, 31u8, 65u8, - 147u8, 211u8, 74u8, 40u8, 190u8, 254u8, 190u8, 176u8, - 117u8, 159u8, 234u8, 214u8, 157u8, 83u8, 56u8, 192u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn reserved_amounts_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Auctions", + "ReservedAmounts", + Vec::new(), + [ + 120u8, 85u8, 180u8, 244u8, 154u8, 135u8, 87u8, 79u8, 75u8, + 169u8, 220u8, 117u8, 227u8, 85u8, 198u8, 214u8, 28u8, 126u8, + 66u8, 188u8, 137u8, 111u8, 110u8, 152u8, 18u8, 233u8, 76u8, + 166u8, 55u8, 233u8, 93u8, 62u8, + ], + ) } #[doc = " The winning bids for each of the 10 ranges at each sample in the final Ending Period of"] #[doc = " the current auction. The map's key is the 0-based index into the Sample Size. The"] #[doc = " first sample of the ending period is 0; the last is `Sample Size - 1`."] pub fn winning( &self, - _0: &'a ::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - [::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - )>; 36usize], - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 152u8, 246u8, 158u8, 193u8, 21u8, 56u8, 204u8, 29u8, - 146u8, 90u8, 133u8, 246u8, 75u8, 111u8, 157u8, 150u8, - 175u8, 33u8, 127u8, 215u8, 158u8, 55u8, 231u8, 78u8, - 143u8, 128u8, 92u8, 70u8, 61u8, 23u8, 43u8, 68u8, - ] - { - let entry = Winning(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + [::core::option::Option<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u128, + )>; 36usize], + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Auctions", + "Winning", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 63u8, 56u8, 143u8, 200u8, 12u8, 71u8, 187u8, 73u8, 215u8, + 93u8, 222u8, 102u8, 5u8, 113u8, 6u8, 170u8, 95u8, 228u8, + 28u8, 58u8, 109u8, 62u8, 3u8, 125u8, 211u8, 139u8, 194u8, + 30u8, 151u8, 147u8, 47u8, 205u8, + ], + ) } #[doc = " The winning bids for each of the 10 ranges at each sample in the final Ending Period of"] #[doc = " the current auction. The map's key is the 0-based index into the Sample Size. The"] #[doc = " first sample of the ending period is 0; the last is `Sample Size - 1`."] - pub fn winning_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Winning<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 152u8, 246u8, 158u8, 193u8, 21u8, 56u8, 204u8, 29u8, - 146u8, 90u8, 133u8, 246u8, 75u8, 111u8, 157u8, 150u8, - 175u8, 33u8, 127u8, 215u8, 158u8, 55u8, 231u8, 78u8, - 143u8, 128u8, 92u8, 70u8, 61u8, 23u8, 43u8, 68u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn winning_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + [::core::option::Option<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u128, + )>; 36usize], + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Auctions", + "Winning", + Vec::new(), + [ + 63u8, 56u8, 143u8, 200u8, 12u8, 71u8, 187u8, 73u8, 215u8, + 93u8, 222u8, 102u8, 5u8, 113u8, 6u8, 170u8, 95u8, 228u8, + 28u8, 58u8, 109u8, 62u8, 3u8, 125u8, 211u8, 139u8, 194u8, + 30u8, 151u8, 147u8, 47u8, 205u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " The number of blocks over which an auction may be retroactively ended."] pub fn ending_period( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Auctions", "EndingPeriod")? - == [ - 36u8, 136u8, 230u8, 163u8, 145u8, 185u8, 224u8, 85u8, 228u8, - 249u8, 226u8, 140u8, 117u8, 32u8, 173u8, 235u8, 99u8, 200u8, - 48u8, 233u8, 15u8, 68u8, 24u8, 246u8, 90u8, 108u8, 91u8, - 242u8, 48u8, 102u8, 65u8, 252u8, - ] - { - let pallet = metadata.pallet("Auctions")?; - let constant = pallet.constant("EndingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Auctions", + "EndingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } #[doc = " The length of each sample to take during the ending period."] #[doc = ""] #[doc = " `EndingPeriod` / `SampleLength` = Total # of Samples"] pub fn sample_length( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Auctions", "SampleLength")? - == [ - 54u8, 145u8, 242u8, 8u8, 50u8, 152u8, 192u8, 64u8, 134u8, - 155u8, 104u8, 48u8, 117u8, 6u8, 58u8, 223u8, 15u8, 161u8, - 54u8, 22u8, 193u8, 71u8, 47u8, 70u8, 119u8, 122u8, 98u8, - 138u8, 117u8, 164u8, 144u8, 16u8, - ] - { - let pallet = metadata.pallet("Auctions")?; - let constant = pallet.constant("SampleLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Auctions", + "SampleLength", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } pub fn slot_range_count( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Auctions", "SlotRangeCount")? - == [ - 32u8, 147u8, 38u8, 54u8, 172u8, 189u8, 240u8, 136u8, 216u8, - 182u8, 191u8, 129u8, 122u8, 1u8, 129u8, 244u8, 180u8, 210u8, - 219u8, 142u8, 224u8, 151u8, 237u8, 192u8, 103u8, 206u8, - 101u8, 131u8, 78u8, 181u8, 163u8, 44u8, - ] - { - let pallet = metadata.pallet("Auctions")?; - let constant = pallet.constant("SlotRangeCount")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Auctions", + "SlotRangeCount", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } pub fn lease_periods_per_slot( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Auctions", "LeasePeriodsPerSlot")? - == [ - 174u8, 18u8, 150u8, 44u8, 219u8, 36u8, 218u8, 28u8, 34u8, - 132u8, 235u8, 161u8, 23u8, 173u8, 80u8, 175u8, 93u8, 163u8, - 6u8, 226u8, 11u8, 212u8, 186u8, 119u8, 185u8, 85u8, 111u8, - 216u8, 214u8, 111u8, 148u8, 28u8, - ] - { - let pallet = metadata.pallet("Auctions")?; - let constant = pallet.constant("LeasePeriodsPerSlot")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Auctions", + "LeasePeriodsPerSlot", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod crowdloan { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Create { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -39630,11 +26328,11 @@ pub mod api { pub verifier: ::core::option::Option, } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Contribute { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -39643,39 +26341,39 @@ pub mod api { pub signature: ::core::option::Option, } - impl ::subxt::Call for Contribute { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for Withdraw { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "withdraw"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Refund { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for Refund { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "refund"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Dissolve { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for Dissolve { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "dissolve"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Edit { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -39690,53 +26388,36 @@ pub mod api { pub verifier: ::core::option::Option, } - impl ::subxt::Call for Edit { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "edit"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AddMemo { pub index: runtime_types::polkadot_parachain::primitives::Id, pub memo: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for AddMemo { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "add_memo"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Poke { pub index: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Call for Poke { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "poke"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ContributeAll { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, pub signature: ::core::option::Option, } - impl ::subxt::Call for ContributeAll { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute_all"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] #[doc = ""] #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] @@ -39751,42 +26432,25 @@ pub mod api { verifier: ::core::option::Option< runtime_types::sp_runtime::MultiSigner, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Create, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 94u8, 115u8, 154u8, 239u8, 215u8, 180u8, 175u8, 240u8, 137u8, - 240u8, 74u8, 159u8, 67u8, 54u8, 69u8, 199u8, 161u8, 155u8, - 243u8, 222u8, 205u8, 163u8, 142u8, 251u8, 156u8, 94u8, 65u8, - 153u8, 39u8, 226u8, 79u8, 195u8, - ] - { - let call = Create { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "create", + Create { index, cap, first_period, last_period, end, verifier, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 78u8, 52u8, 156u8, 23u8, 104u8, 251u8, 20u8, 233u8, 42u8, + 231u8, 16u8, 192u8, 164u8, 68u8, 98u8, 129u8, 88u8, 126u8, + 123u8, 4u8, 210u8, 161u8, 190u8, 90u8, 67u8, 235u8, 74u8, + 184u8, 180u8, 197u8, 248u8, 238u8, + ], + ) } #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] @@ -39797,39 +26461,22 @@ pub mod api { signature: ::core::option::Option< runtime_types::sp_runtime::MultiSignature, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Contribute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 95u8, 255u8, 35u8, 30u8, 44u8, 150u8, 10u8, 166u8, 0u8, - 204u8, 106u8, 59u8, 150u8, 254u8, 216u8, 128u8, 232u8, 129u8, - 30u8, 101u8, 196u8, 198u8, 180u8, 156u8, 122u8, 252u8, 139u8, - 28u8, 164u8, 115u8, 153u8, 109u8, - ] - { - let call = Contribute { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "contribute", + Contribute { index, value, signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 159u8, 180u8, 248u8, 203u8, 128u8, 231u8, 28u8, 84u8, 14u8, + 214u8, 69u8, 217u8, 62u8, 201u8, 169u8, 160u8, 45u8, 160u8, + 125u8, 255u8, 95u8, 140u8, 58u8, 3u8, 224u8, 157u8, 199u8, + 229u8, 72u8, 40u8, 218u8, 55u8, + ], + ) } #[doc = "Withdraw full balance of a specific contributor."] #[doc = ""] @@ -39850,37 +26497,20 @@ pub mod api { #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] pub fn withdraw( &self, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Withdraw, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 67u8, 65u8, 89u8, 108u8, 193u8, 99u8, 74u8, 32u8, 163u8, - 13u8, 81u8, 131u8, 64u8, 107u8, 72u8, 23u8, 35u8, 177u8, - 130u8, 171u8, 70u8, 232u8, 246u8, 254u8, 67u8, 219u8, 84u8, - 96u8, 165u8, 20u8, 183u8, 209u8, - ] - { - let call = Withdraw { who, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "withdraw", + Withdraw { who, index }, + [ + 147u8, 177u8, 116u8, 152u8, 9u8, 102u8, 4u8, 201u8, 204u8, + 145u8, 104u8, 226u8, 86u8, 211u8, 66u8, 109u8, 109u8, 139u8, + 229u8, 97u8, 215u8, 101u8, 255u8, 181u8, 121u8, 139u8, 165u8, + 169u8, 112u8, 173u8, 213u8, 121u8, + ], + ) } #[doc = "Automatically refund contributors of an ended crowdloan."] #[doc = "Due to weight restrictions, this function may need to be called multiple"] @@ -39890,69 +26520,35 @@ pub mod api { pub fn refund( &self, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Refund, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 202u8, 206u8, 79u8, 226u8, 114u8, 228u8, 110u8, 18u8, 178u8, - 173u8, 23u8, 83u8, 64u8, 11u8, 201u8, 19u8, 57u8, 75u8, - 181u8, 241u8, 231u8, 189u8, 211u8, 48u8, 82u8, 64u8, 220u8, - 22u8, 247u8, 7u8, 68u8, 211u8, - ] - { - let call = Refund { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "refund", + Refund { index }, + [ + 223u8, 64u8, 5u8, 135u8, 15u8, 234u8, 60u8, 114u8, 199u8, + 216u8, 73u8, 165u8, 198u8, 34u8, 140u8, 142u8, 214u8, 254u8, + 203u8, 163u8, 224u8, 120u8, 104u8, 54u8, 12u8, 126u8, 72u8, + 147u8, 20u8, 180u8, 251u8, 208u8, + ], + ) } #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] pub fn dissolve( &self, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Dissolve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 210u8, 3u8, 221u8, 185u8, 64u8, 178u8, 56u8, 132u8, 72u8, - 127u8, 105u8, 31u8, 167u8, 107u8, 127u8, 224u8, 174u8, 221u8, - 111u8, 105u8, 47u8, 247u8, 10u8, 5u8, 37u8, 180u8, 61u8, - 180u8, 3u8, 164u8, 196u8, 194u8, - ] - { - let call = Dissolve { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "dissolve", + Dissolve { index }, + [ + 100u8, 67u8, 105u8, 3u8, 213u8, 149u8, 201u8, 146u8, 241u8, + 62u8, 31u8, 108u8, 58u8, 30u8, 241u8, 141u8, 134u8, 115u8, + 56u8, 131u8, 60u8, 75u8, 143u8, 227u8, 11u8, 32u8, 31u8, + 230u8, 165u8, 227u8, 170u8, 126u8, + ], + ) } #[doc = "Edit the configuration for an in-progress crowdloan."] #[doc = ""] @@ -39967,42 +26563,25 @@ pub mod api { verifier: ::core::option::Option< runtime_types::sp_runtime::MultiSigner, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Edit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 34u8, 43u8, 47u8, 39u8, 106u8, 245u8, 49u8, 40u8, 191u8, - 195u8, 202u8, 113u8, 137u8, 98u8, 143u8, 172u8, 191u8, 55u8, - 240u8, 75u8, 234u8, 180u8, 90u8, 206u8, 93u8, 214u8, 115u8, - 215u8, 140u8, 144u8, 105u8, 89u8, - ] - { - let call = Edit { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "edit", + Edit { index, cap, first_period, last_period, end, verifier, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 222u8, 124u8, 94u8, 221u8, 36u8, 183u8, 67u8, 114u8, 198u8, + 107u8, 154u8, 174u8, 142u8, 47u8, 3u8, 181u8, 72u8, 29u8, + 2u8, 83u8, 81u8, 47u8, 168u8, 142u8, 139u8, 63u8, 136u8, + 191u8, 41u8, 252u8, 221u8, 56u8, + ], + ) } #[doc = "Add an optional memo to an existing crowdloan contribution."] #[doc = ""] @@ -40011,35 +26590,18 @@ pub mod api { &self, index: runtime_types::polkadot_parachain::primitives::Id, memo: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddMemo, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 97u8, 218u8, 115u8, 187u8, 167u8, 70u8, 229u8, 231u8, 148u8, - 77u8, 169u8, 139u8, 16u8, 15u8, 116u8, 128u8, 32u8, 59u8, - 154u8, 146u8, 12u8, 65u8, 36u8, 36u8, 69u8, 19u8, 74u8, 79u8, - 66u8, 25u8, 215u8, 57u8, - ] - { - let call = AddMemo { index, memo }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "add_memo", + AddMemo { index, memo }, + [ + 104u8, 199u8, 143u8, 251u8, 28u8, 49u8, 144u8, 186u8, 83u8, + 108u8, 26u8, 127u8, 22u8, 141u8, 48u8, 62u8, 194u8, 193u8, + 97u8, 10u8, 84u8, 89u8, 236u8, 191u8, 40u8, 8u8, 1u8, 250u8, + 112u8, 165u8, 221u8, 112u8, + ], + ) } #[doc = "Poke the fund into `NewRaise`"] #[doc = ""] @@ -40047,35 +26609,18 @@ pub mod api { pub fn poke( &self, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Poke, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 99u8, 158u8, 48u8, 3u8, 228u8, 210u8, 249u8, 42u8, 44u8, - 49u8, 24u8, 212u8, 69u8, 69u8, 189u8, 194u8, 124u8, 251u8, - 25u8, 123u8, 234u8, 3u8, 184u8, 227u8, 1u8, 195u8, 219u8, - 118u8, 235u8, 237u8, 11u8, 159u8, - ] - { - let call = Poke { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "poke", + Poke { index }, + [ + 118u8, 60u8, 131u8, 17u8, 27u8, 153u8, 57u8, 24u8, 191u8, + 211u8, 101u8, 123u8, 34u8, 145u8, 193u8, 113u8, 244u8, 162u8, + 148u8, 143u8, 81u8, 86u8, 136u8, 23u8, 48u8, 185u8, 52u8, + 60u8, 216u8, 243u8, 63u8, 102u8, + ], + ) } #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] @@ -40085,35 +26630,18 @@ pub mod api { signature: ::core::option::Option< runtime_types::sp_runtime::MultiSignature, >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ContributeAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 64u8, 224u8, 233u8, 196u8, 182u8, 109u8, 69u8, 220u8, 46u8, - 60u8, 189u8, 125u8, 17u8, 28u8, 207u8, 63u8, 129u8, 56u8, - 32u8, 239u8, 182u8, 214u8, 237u8, 95u8, 228u8, 171u8, 209u8, - 233u8, 205u8, 212u8, 147u8, 176u8, - ] - { - let call = ContributeAll { index, signature }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Crowdloan", + "contribute_all", + ContributeAll { index, signature }, + [ + 94u8, 61u8, 105u8, 107u8, 204u8, 18u8, 223u8, 242u8, 19u8, + 162u8, 205u8, 130u8, 203u8, 73u8, 42u8, 85u8, 208u8, 157u8, + 115u8, 112u8, 168u8, 10u8, 163u8, 80u8, 222u8, 71u8, 23u8, + 194u8, 142u8, 4u8, 82u8, 253u8, + ], + ) } } } @@ -40121,458 +26649,365 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Create a new crowdloaning campaign."] pub struct Created { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for Created { + impl ::subxt::events::StaticEvent for Created { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Created"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Contributed to a crowd sale."] pub struct Contributed { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub fund_index: runtime_types::polkadot_parachain::primitives::Id, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Contributed { + impl ::subxt::events::StaticEvent for Contributed { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Contributed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Withdrew full balance of a contributor."] pub struct Withdrew { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub fund_index: runtime_types::polkadot_parachain::primitives::Id, pub amount: ::core::primitive::u128, } - impl ::subxt::Event for Withdrew { + impl ::subxt::events::StaticEvent for Withdrew { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Withdrew"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The loans in a fund have been partially dissolved, i.e. there are some left"] #[doc = "over child keys that still need to be killed."] pub struct PartiallyRefunded { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for PartiallyRefunded { + impl ::subxt::events::StaticEvent for PartiallyRefunded { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "PartiallyRefunded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "All loans in a fund have been refunded."] pub struct AllRefunded { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for AllRefunded { + impl ::subxt::events::StaticEvent for AllRefunded { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "AllRefunded"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Fund is dissolved."] pub struct Dissolved { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for Dissolved { + impl ::subxt::events::StaticEvent for Dissolved { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Dissolved"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The result of trying to submit a new bid to the Slots pallet."] pub struct HandleBidResult { pub para_id: runtime_types::polkadot_parachain::primitives::Id, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } - impl ::subxt::Event for HandleBidResult { + impl ::subxt::events::StaticEvent for HandleBidResult { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "HandleBidResult"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The configuration to a crowdloan has been edited."] pub struct Edited { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for Edited { + impl ::subxt::events::StaticEvent for Edited { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Edited"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A memo has been updated."] pub struct MemoUpdated { - pub who: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub para_id: runtime_types::polkadot_parachain::primitives::Id, pub memo: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Event for MemoUpdated { + impl ::subxt::events::StaticEvent for MemoUpdated { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "MemoUpdated"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A parachain has been moved to `NewRaise`"] pub struct AddedToNewRaise { pub para_id: runtime_types::polkadot_parachain::primitives::Id, } - impl ::subxt::Event for AddedToNewRaise { + impl ::subxt::events::StaticEvent for AddedToNewRaise { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "AddedToNewRaise"; } } pub mod storage { use super::runtime_types; - pub struct Funds<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Funds<'_> { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "Funds"; - type Value = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NewRaise; - impl ::subxt::StorageEntry for NewRaise { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NewRaise"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EndingsCount; - impl ::subxt::StorageEntry for EndingsCount { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "EndingsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextFundIndex; - impl ::subxt::StorageEntry for NextFundIndex { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NextFundIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " Info on all of the funds."] pub fn funds( &self, - _0: &'a runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow< + runtime_types::polkadot_parachain::primitives::Id, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 13u8, 211u8, 240u8, 138u8, 231u8, 78u8, 123u8, 252u8, - 210u8, 27u8, 202u8, 82u8, 157u8, 118u8, 209u8, 218u8, - 160u8, 183u8, 225u8, 77u8, 230u8, 131u8, 180u8, 238u8, - 83u8, 202u8, 29u8, 106u8, 114u8, 223u8, 250u8, 3u8, - ] - { - let entry = Funds(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Crowdloan", + "Funds", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 231u8, 126u8, 89u8, 84u8, 167u8, 23u8, 211u8, 70u8, 203u8, + 124u8, 20u8, 162u8, 112u8, 38u8, 201u8, 207u8, 82u8, 202u8, + 80u8, 228u8, 4u8, 41u8, 95u8, 190u8, 193u8, 185u8, 178u8, + 85u8, 179u8, 102u8, 53u8, 63u8, + ], + ) } #[doc = " Info on all of the funds."] - pub fn funds_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Funds<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 13u8, 211u8, 240u8, 138u8, 231u8, 78u8, 123u8, 252u8, - 210u8, 27u8, 202u8, 82u8, 157u8, 118u8, 209u8, 218u8, - 160u8, 183u8, 225u8, 77u8, 230u8, 131u8, 180u8, 238u8, - 83u8, 202u8, 29u8, 106u8, 114u8, 223u8, 250u8, 3u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn funds_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Crowdloan", + "Funds", + Vec::new(), + [ + 231u8, 126u8, 89u8, 84u8, 167u8, 23u8, 211u8, 70u8, 203u8, + 124u8, 20u8, 162u8, 112u8, 38u8, 201u8, 207u8, 82u8, 202u8, + 80u8, 228u8, 4u8, 41u8, 95u8, 190u8, 193u8, 185u8, 178u8, + 85u8, 179u8, 102u8, 53u8, 63u8, + ], + ) } #[doc = " The funds that have had additional contributions during the last block. This is used"] #[doc = " in order to determine which funds should submit new or updated bids."] pub fn new_raise( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 243u8, 204u8, 121u8, 230u8, 151u8, 223u8, 248u8, 199u8, - 68u8, 209u8, 226u8, 159u8, 217u8, 105u8, 39u8, 127u8, - 162u8, 133u8, 56u8, 1u8, 70u8, 7u8, 176u8, 56u8, 81u8, - 49u8, 155u8, 143u8, 100u8, 153u8, 59u8, 86u8, - ] - { - let entry = NewRaise; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Crowdloan", + "NewRaise", + vec![], + [ + 8u8, 180u8, 9u8, 197u8, 254u8, 198u8, 89u8, 112u8, 29u8, + 153u8, 243u8, 196u8, 92u8, 204u8, 135u8, 232u8, 93u8, 239u8, + 147u8, 103u8, 130u8, 28u8, 128u8, 124u8, 4u8, 236u8, 29u8, + 248u8, 27u8, 165u8, 111u8, 147u8, + ], + ) } #[doc = " The number of auctions that have entered into their ending period so far."] pub fn endings_count( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 12u8, 159u8, 166u8, 75u8, 192u8, 33u8, 21u8, 244u8, - 149u8, 200u8, 49u8, 54u8, 191u8, 174u8, 202u8, 86u8, - 76u8, 115u8, 189u8, 35u8, 192u8, 175u8, 156u8, 188u8, - 41u8, 23u8, 92u8, 36u8, 141u8, 235u8, 248u8, 143u8, - ] - { - let entry = EndingsCount; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Crowdloan", + "EndingsCount", + vec![], + [ + 12u8, 159u8, 166u8, 75u8, 192u8, 33u8, 21u8, 244u8, 149u8, + 200u8, 49u8, 54u8, 191u8, 174u8, 202u8, 86u8, 76u8, 115u8, + 189u8, 35u8, 192u8, 175u8, 156u8, 188u8, 41u8, 23u8, 92u8, + 36u8, 141u8, 235u8, 248u8, 143u8, + ], + ) } #[doc = " Tracker for the next available fund index"] pub fn next_fund_index( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 1u8, 215u8, 164u8, 194u8, 231u8, 34u8, 207u8, 19u8, - 149u8, 187u8, 3u8, 176u8, 194u8, 240u8, 180u8, 169u8, - 214u8, 194u8, 202u8, 240u8, 209u8, 6u8, 244u8, 46u8, - 54u8, 142u8, 61u8, 220u8, 240u8, 96u8, 10u8, 168u8, - ] - { - let entry = NextFundIndex; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Crowdloan", + "NextFundIndex", + vec![], + [ + 1u8, 215u8, 164u8, 194u8, 231u8, 34u8, 207u8, 19u8, 149u8, + 187u8, 3u8, 176u8, 194u8, 240u8, 180u8, 169u8, 214u8, 194u8, + 202u8, 240u8, 209u8, 6u8, 244u8, 46u8, 54u8, 142u8, 61u8, + 220u8, 240u8, 96u8, 10u8, 168u8, + ], + ) } } } pub mod constants { use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct ConstantsApi; + impl ConstantsApi { #[doc = " `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b\"py/cfund\")`"] pub fn pallet_id( &self, - ) -> ::core::result::Result< - runtime_types::frame_support::PalletId, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Crowdloan", "PalletId")? - == [ - 190u8, 62u8, 112u8, 88u8, 48u8, 222u8, 234u8, 76u8, 230u8, - 81u8, 205u8, 113u8, 202u8, 11u8, 184u8, 229u8, 189u8, 124u8, - 132u8, 255u8, 46u8, 202u8, 80u8, 86u8, 182u8, 212u8, 149u8, - 200u8, 57u8, 215u8, 195u8, 132u8, - ] - { - let pallet = metadata.pallet("Crowdloan")?; - let constant = pallet.constant("PalletId")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::PalletId, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Crowdloan", + "PalletId", + [ + 139u8, 109u8, 228u8, 151u8, 252u8, 32u8, 130u8, 69u8, 112u8, + 154u8, 174u8, 45u8, 83u8, 245u8, 51u8, 132u8, 173u8, 5u8, + 186u8, 24u8, 243u8, 9u8, 12u8, 214u8, 80u8, 74u8, 69u8, + 189u8, 30u8, 94u8, 22u8, 39u8, + ], + ) } #[doc = " The minimum amount that may be contributed into a crowdloan. Should almost certainly be at"] #[doc = " least `ExistentialDeposit`."] pub fn min_contribution( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Crowdloan", "MinContribution")? - == [ - 7u8, 98u8, 163u8, 178u8, 130u8, 130u8, 228u8, 145u8, 98u8, - 96u8, 213u8, 70u8, 87u8, 202u8, 203u8, 65u8, 162u8, 93u8, - 70u8, 3u8, 109u8, 155u8, 86u8, 11u8, 164u8, 164u8, 232u8, - 201u8, 25u8, 0u8, 129u8, 24u8, - ] - { - let pallet = metadata.pallet("Crowdloan")?; - let constant = pallet.constant("MinContribution")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Crowdloan", + "MinContribution", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Max number of storage keys to remove per extrinsic call."] pub fn remove_keys_limit( &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("Crowdloan", "RemoveKeysLimit")? - == [ - 112u8, 103u8, 77u8, 231u8, 192u8, 202u8, 113u8, 241u8, 178u8, - 158u8, 219u8, 21u8, 177u8, 140u8, 48u8, 133u8, 143u8, 170u8, - 91u8, 126u8, 180u8, 6u8, 222u8, 68u8, 236u8, 92u8, 215u8, - 100u8, 85u8, 155u8, 212u8, 224u8, - ] - { - let pallet = metadata.pallet("Crowdloan")?; - let constant = pallet.constant("RemoveKeysLimit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Crowdloan", + "RemoveKeysLimit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) } } } } pub mod xcm_pallet { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Send { pub dest: ::std::boxed::Box, pub message: ::std::boxed::Box, } - impl ::subxt::Call for Send { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "send"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct TeleportAssets { pub dest: ::std::boxed::Box, pub beneficiary: @@ -40580,11 +27015,11 @@ pub mod api { pub assets: ::std::boxed::Box, pub fee_asset_item: ::core::primitive::u32, } - impl ::subxt::Call for TeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "teleport_assets"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReserveTransferAssets { pub dest: ::std::boxed::Box, pub beneficiary: @@ -40592,57 +27027,57 @@ pub mod api { pub assets: ::std::boxed::Box, pub fee_asset_item: ::core::primitive::u32, } - impl ::subxt::Call for ReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "reserve_transfer_assets"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Execute { pub message: ::std::boxed::Box, pub max_weight: ::core::primitive::u64, } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceXcmVersion { pub location: ::std::boxed::Box< runtime_types::xcm::v1::multilocation::MultiLocation, >, pub xcm_version: ::core::primitive::u32, } - impl ::subxt::Call for ForceXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_xcm_version"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceDefaultXcmVersion { pub maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, } - impl ::subxt::Call for ForceDefaultXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_default_xcm_version"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceSubscribeVersionNotify { pub location: ::std::boxed::Box, } - impl ::subxt::Call for ForceSubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_subscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ForceUnsubscribeVersionNotify { pub location: ::std::boxed::Box, } - impl ::subxt::Call for ForceUnsubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_unsubscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct LimitedReserveTransferAssets { pub dest: ::std::boxed::Box, pub beneficiary: @@ -40651,11 +27086,11 @@ pub mod api { pub fee_asset_item: ::core::primitive::u32, pub weight_limit: runtime_types::xcm::v2::WeightLimit, } - impl ::subxt::Call for LimitedReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "limited_reserve_transfer_assets"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct LimitedTeleportAssets { pub dest: ::std::boxed::Box, pub beneficiary: @@ -40664,61 +27099,27 @@ pub mod api { pub fee_asset_item: ::core::primitive::u32, pub weight_limit: runtime_types::xcm::v2::WeightLimit, } - impl ::subxt::Call for LimitedTeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "limited_teleport_assets"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } + pub struct TransactionApi; + impl TransactionApi { pub fn send( &self, dest: runtime_types::xcm::VersionedMultiLocation, message: runtime_types::xcm::VersionedXcm, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Send, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 54u8, 36u8, 195u8, 69u8, 232u8, 104u8, 16u8, 255u8, 209u8, - 151u8, 189u8, 229u8, 222u8, 59u8, 61u8, 23u8, 59u8, 75u8, - 110u8, 215u8, 20u8, 147u8, 2u8, 154u8, 64u8, 12u8, 22u8, - 30u8, 81u8, 3u8, 116u8, 21u8, - ] - { - let call = Send { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "send", + Send { dest: ::std::boxed::Box::new(dest), message: ::std::boxed::Box::new(message), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 62u8, 5u8, 58u8, 216u8, 236u8, 6u8, 23u8, 64u8, 52u8, 141u8, + 132u8, 102u8, 79u8, 80u8, 126u8, 78u8, 222u8, 197u8, 94u8, + 119u8, 26u8, 93u8, 153u8, 155u8, 204u8, 164u8, 167u8, 242u8, + 7u8, 131u8, 125u8, 181u8, + ], + ) } #[doc = "Teleport some assets from the local chain to some destination chain."] #[doc = ""] @@ -40741,40 +27142,23 @@ pub mod api { beneficiary: runtime_types::xcm::VersionedMultiLocation, assets: runtime_types::xcm::VersionedMultiAssets, fee_asset_item: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TeleportAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 137u8, 5u8, 131u8, 103u8, 172u8, 184u8, 160u8, 75u8, 59u8, - 219u8, 132u8, 196u8, 182u8, 130u8, 131u8, 6u8, 60u8, 89u8, - 168u8, 251u8, 2u8, 105u8, 128u8, 182u8, 99u8, 214u8, 245u8, - 130u8, 135u8, 115u8, 67u8, 42u8, - ] - { - let call = TeleportAssets { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "teleport_assets", + TeleportAssets { dest: ::std::boxed::Box::new(dest), beneficiary: ::std::boxed::Box::new(beneficiary), assets: ::std::boxed::Box::new(assets), fee_asset_item, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 10u8, 218u8, 192u8, 242u8, 222u8, 140u8, 137u8, 249u8, 15u8, + 210u8, 143u8, 134u8, 134u8, 9u8, 128u8, 185u8, 12u8, 188u8, + 6u8, 19u8, 123u8, 102u8, 49u8, 38u8, 220u8, 149u8, 33u8, + 149u8, 243u8, 85u8, 195u8, 194u8, + ], + ) } #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] #[doc = "chain and forward a notification XCM."] @@ -40798,40 +27182,23 @@ pub mod api { beneficiary: runtime_types::xcm::VersionedMultiLocation, assets: runtime_types::xcm::VersionedMultiAssets, fee_asset_item: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReserveTransferAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 253u8, 39u8, 212u8, 206u8, 89u8, 22u8, 69u8, 211u8, 159u8, - 124u8, 160u8, 233u8, 242u8, 106u8, 68u8, 163u8, 152u8, 3u8, - 142u8, 112u8, 68u8, 70u8, 99u8, 37u8, 209u8, 79u8, 85u8, - 161u8, 112u8, 216u8, 191u8, 42u8, - ] - { - let call = ReserveTransferAssets { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "reserve_transfer_assets", + ReserveTransferAssets { dest: ::std::boxed::Box::new(dest), beneficiary: ::std::boxed::Box::new(beneficiary), assets: ::std::boxed::Box::new(assets), fee_asset_item, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 99u8, 57u8, 160u8, 112u8, 160u8, 82u8, 240u8, 74u8, 105u8, + 221u8, 29u8, 196u8, 187u8, 190u8, 165u8, 44u8, 198u8, 92u8, + 12u8, 116u8, 106u8, 211u8, 104u8, 14u8, 120u8, 194u8, 216u8, + 202u8, 221u8, 174u8, 77u8, 167u8, + ], + ) } #[doc = "Execute an XCM message from a local, signed, origin."] #[doc = ""] @@ -40848,38 +27215,21 @@ pub mod api { &self, message: runtime_types::xcm::VersionedXcm, max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 81u8, 205u8, 245u8, 196u8, 78u8, 82u8, 247u8, 53u8, 52u8, - 16u8, 28u8, 226u8, 213u8, 143u8, 94u8, 174u8, 25u8, 120u8, - 170u8, 194u8, 249u8, 96u8, 38u8, 169u8, 74u8, 142u8, 175u8, - 3u8, 118u8, 55u8, 251u8, 109u8, - ] - { - let call = Execute { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "execute", + Execute { message: ::std::boxed::Box::new(message), max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 234u8, 145u8, 40u8, 18u8, 224u8, 25u8, 249u8, 87u8, 214u8, + 25u8, 227u8, 148u8, 222u8, 226u8, 104u8, 79u8, 221u8, 123u8, + 212u8, 78u8, 42u8, 249u8, 150u8, 86u8, 60u8, 63u8, 22u8, + 155u8, 219u8, 216u8, 241u8, 189u8, + ], + ) } #[doc = "Extoll that a particular destination can be communicated with through a particular"] #[doc = "version of XCM."] @@ -40891,38 +27241,21 @@ pub mod api { &self, location: runtime_types::xcm::v1::multilocation::MultiLocation, xcm_version: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceXcmVersion, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 201u8, 56u8, 53u8, 67u8, 99u8, 195u8, 192u8, 69u8, 123u8, - 66u8, 102u8, 94u8, 122u8, 160u8, 219u8, 128u8, 21u8, 105u8, - 71u8, 254u8, 10u8, 66u8, 60u8, 186u8, 104u8, 46u8, 96u8, - 168u8, 3u8, 141u8, 124u8, 51u8, - ] - { - let call = ForceXcmVersion { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "force_xcm_version", + ForceXcmVersion { location: ::std::boxed::Box::new(location), xcm_version, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 222u8, 53u8, 133u8, 159u8, 195u8, 147u8, 113u8, 8u8, 157u8, + 2u8, 18u8, 232u8, 235u8, 55u8, 169u8, 13u8, 254u8, 133u8, + 50u8, 52u8, 117u8, 182u8, 176u8, 60u8, 74u8, 53u8, 191u8, + 130u8, 149u8, 74u8, 77u8, 129u8, + ], + ) } #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] #[doc = "version a destination can accept is unknown)."] @@ -40932,35 +27265,19 @@ pub mod api { pub fn force_default_xcm_version( &self, maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceDefaultXcmVersion, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 44u8, 161u8, 28u8, 189u8, 162u8, 221u8, 14u8, 31u8, 8u8, - 211u8, 181u8, 51u8, 197u8, 14u8, 87u8, 198u8, 3u8, 240u8, - 90u8, 78u8, 141u8, 131u8, 205u8, 250u8, 211u8, 150u8, 237u8, - 160u8, 239u8, 226u8, 233u8, 29u8, - ] - { - let call = ForceDefaultXcmVersion { maybe_xcm_version }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "force_default_xcm_version", + ForceDefaultXcmVersion { maybe_xcm_version }, + [ + 38u8, 36u8, 59u8, 231u8, 18u8, 79u8, 76u8, 9u8, 200u8, 125u8, + 214u8, 166u8, 37u8, 99u8, 111u8, 161u8, 135u8, 2u8, 133u8, + 157u8, 165u8, 18u8, 152u8, 81u8, 209u8, 255u8, 137u8, 237u8, + 28u8, 126u8, 224u8, 141u8, + ], + ) } #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] #[doc = ""] @@ -40969,37 +27286,21 @@ pub mod api { pub fn force_subscribe_version_notify( &self, location: runtime_types::xcm::VersionedMultiLocation, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSubscribeVersionNotify, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 10u8, 43u8, 242u8, 36u8, 241u8, 223u8, 208u8, 103u8, 190u8, - 204u8, 185u8, 151u8, 153u8, 191u8, 174u8, 57u8, 49u8, 90u8, - 1u8, 113u8, 219u8, 243u8, 210u8, 152u8, 184u8, 42u8, 219u8, - 237u8, 175u8, 58u8, 136u8, 167u8, - ] - { - let call = ForceSubscribeVersionNotify { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "force_subscribe_version_notify", + ForceSubscribeVersionNotify { location: ::std::boxed::Box::new(location), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 248u8, 225u8, 152u8, 123u8, 25u8, 248u8, 170u8, 97u8, 88u8, + 14u8, 39u8, 181u8, 95u8, 210u8, 27u8, 229u8, 11u8, 158u8, + 138u8, 63u8, 29u8, 166u8, 64u8, 171u8, 98u8, 219u8, 83u8, + 110u8, 123u8, 15u8, 148u8, 130u8, + ], + ) } #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] #[doc = "version changes."] @@ -41010,37 +27311,21 @@ pub mod api { pub fn force_unsubscribe_version_notify( &self, location: runtime_types::xcm::VersionedMultiLocation, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnsubscribeVersionNotify, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 214u8, 24u8, 33u8, 141u8, 239u8, 87u8, 177u8, 28u8, 187u8, - 103u8, 149u8, 206u8, 20u8, 68u8, 62u8, 87u8, 166u8, 68u8, - 70u8, 110u8, 76u8, 113u8, 145u8, 197u8, 168u8, 193u8, 107u8, - 118u8, 30u8, 81u8, 45u8, 177u8, - ] - { - let call = ForceUnsubscribeVersionNotify { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "force_unsubscribe_version_notify", + ForceUnsubscribeVersionNotify { location: ::std::boxed::Box::new(location), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 136u8, 187u8, 225u8, 130u8, 146u8, 74u8, 93u8, 240u8, 184u8, + 43u8, 140u8, 183u8, 155u8, 61u8, 240u8, 203u8, 255u8, 134u8, + 227u8, 1u8, 132u8, 48u8, 115u8, 30u8, 214u8, 178u8, 161u8, + 139u8, 56u8, 237u8, 234u8, 225u8, + ], + ) } #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] #[doc = "chain and forward a notification XCM."] @@ -41067,41 +27352,25 @@ pub mod api { assets: runtime_types::xcm::VersionedMultiAssets, fee_asset_item: ::core::primitive::u32, weight_limit: runtime_types::xcm::v2::WeightLimit, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - LimitedReserveTransferAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 243u8, 50u8, 32u8, 26u8, 100u8, 20u8, 223u8, 168u8, 200u8, - 123u8, 188u8, 218u8, 29u8, 244u8, 163u8, 167u8, 207u8, 99u8, - 137u8, 93u8, 117u8, 43u8, 15u8, 210u8, 242u8, 70u8, 178u8, - 220u8, 33u8, 81u8, 113u8, 3u8, - ] - { - let call = LimitedReserveTransferAssets { + ) -> ::subxt::tx::StaticTxPayload + { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "limited_reserve_transfer_assets", + LimitedReserveTransferAssets { dest: ::std::boxed::Box::new(dest), beneficiary: ::std::boxed::Box::new(beneficiary), assets: ::std::boxed::Box::new(assets), fee_asset_item, weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 221u8, 220u8, 116u8, 79u8, 10u8, 95u8, 250u8, 251u8, 252u8, + 110u8, 190u8, 72u8, 123u8, 235u8, 191u8, 39u8, 36u8, 123u8, + 175u8, 155u8, 232u8, 209u8, 216u8, 102u8, 169u8, 2u8, 167u8, + 68u8, 135u8, 20u8, 124u8, 251u8, + ], + ) } #[doc = "Teleport some assets from the local chain to some destination chain."] #[doc = ""] @@ -41127,41 +27396,24 @@ pub mod api { assets: runtime_types::xcm::VersionedMultiAssets, fee_asset_item: ::core::primitive::u32, weight_limit: runtime_types::xcm::v2::WeightLimit, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - LimitedTeleportAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 36u8, 151u8, 127u8, 249u8, 71u8, 203u8, 161u8, 159u8, 186u8, - 144u8, 116u8, 118u8, 216u8, 42u8, 69u8, 255u8, 208u8, 231u8, - 58u8, 26u8, 37u8, 87u8, 184u8, 244u8, 114u8, 7u8, 200u8, - 29u8, 42u8, 20u8, 93u8, 125u8, - ] - { - let call = LimitedTeleportAssets { + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "XcmPallet", + "limited_teleport_assets", + LimitedTeleportAssets { dest: ::std::boxed::Box::new(dest), beneficiary: ::std::boxed::Box::new(beneficiary), assets: ::std::boxed::Box::new(assets), fee_asset_item, weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } + }, + [ + 82u8, 234u8, 41u8, 231u8, 90u8, 49u8, 150u8, 217u8, 51u8, + 185u8, 83u8, 29u8, 184u8, 201u8, 135u8, 232u8, 227u8, 239u8, + 226u8, 224u8, 24u8, 123u8, 251u8, 193u8, 177u8, 170u8, 173u8, + 114u8, 40u8, 150u8, 140u8, 142u8, + ], + ) } } } @@ -41169,16 +27421,24 @@ pub mod api { pub type Event = runtime_types::pallet_xcm::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Execution of an XCM message was attempted."] #[doc = ""] #[doc = "\\[ outcome \\]"] pub struct Attempted(pub runtime_types::xcm::v2::traits::Outcome); - impl ::subxt::Event for Attempted { + impl ::subxt::events::StaticEvent for Attempted { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "Attempted"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A XCM message was sent."] #[doc = ""] #[doc = "\\[ origin, destination, message \\]"] @@ -41187,11 +27447,15 @@ pub mod api { pub runtime_types::xcm::v1::multilocation::MultiLocation, pub runtime_types::xcm::v2::Xcm, ); - impl ::subxt::Event for Sent { + impl ::subxt::events::StaticEvent for Sent { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "Sent"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Query response received which does not match a registered query. This may be because a"] #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] #[doc = "because the query timed out."] @@ -41201,11 +27465,15 @@ pub mod api { pub runtime_types::xcm::v1::multilocation::MultiLocation, pub ::core::primitive::u64, ); - impl ::subxt::Event for UnexpectedResponse { + impl ::subxt::events::StaticEvent for UnexpectedResponse { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "UnexpectedResponse"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] #[doc = "no registered notification call."] #[doc = ""] @@ -41214,11 +27482,15 @@ pub mod api { pub ::core::primitive::u64, pub runtime_types::xcm::v2::Response, ); - impl ::subxt::Event for ResponseReady { + impl ::subxt::events::StaticEvent for ResponseReady { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "ResponseReady"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Query response has been received and query is removed. The registered notification has"] #[doc = "been dispatched and executed successfully."] #[doc = ""] @@ -41228,11 +27500,15 @@ pub mod api { pub ::core::primitive::u8, pub ::core::primitive::u8, ); - impl ::subxt::Event for Notified { + impl ::subxt::events::StaticEvent for Notified { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "Notified"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Query response has been received and query is removed. The registered notification could"] #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] #[doc = "originally budgeted by this runtime for the query result."] @@ -41245,11 +27521,15 @@ pub mod api { pub ::core::primitive::u64, pub ::core::primitive::u64, ); - impl ::subxt::Event for NotifyOverweight { + impl ::subxt::events::StaticEvent for NotifyOverweight { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "NotifyOverweight"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Query response has been received and query is removed. There was a general error with"] #[doc = "dispatching the notification call."] #[doc = ""] @@ -41259,11 +27539,15 @@ pub mod api { pub ::core::primitive::u8, pub ::core::primitive::u8, ); - impl ::subxt::Event for NotifyDispatchError { + impl ::subxt::events::StaticEvent for NotifyDispatchError { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "NotifyDispatchError"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] #[doc = "is not `(origin, QueryId, Response)`."] @@ -41274,11 +27558,15 @@ pub mod api { pub ::core::primitive::u8, pub ::core::primitive::u8, ); - impl ::subxt::Event for NotifyDecodeFailed { + impl ::subxt::events::StaticEvent for NotifyDecodeFailed { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "NotifyDecodeFailed"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Expected query response has been received but the origin location of the response does"] #[doc = "not match that expected. The query remains registered for a later, valid, response to"] #[doc = "be received and acted upon."] @@ -41291,11 +27579,15 @@ pub mod api { runtime_types::xcm::v1::multilocation::MultiLocation, >, ); - impl ::subxt::Event for InvalidResponder { + impl ::subxt::events::StaticEvent for InvalidResponder { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "InvalidResponder"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Expected query response has been received but the expected origin location placed in"] #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] #[doc = ""] @@ -41309,38 +27601,46 @@ pub mod api { pub runtime_types::xcm::v1::multilocation::MultiLocation, pub ::core::primitive::u64, ); - impl ::subxt::Event for InvalidResponderVersion { + impl ::subxt::events::StaticEvent for InvalidResponderVersion { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "InvalidResponderVersion"; } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] #[doc = "Received query response has been read and removed."] #[doc = ""] #[doc = "\\[ id \\]"] pub struct ResponseTaken(pub ::core::primitive::u64); - impl ::subxt::Event for ResponseTaken { + impl ::subxt::events::StaticEvent for ResponseTaken { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "ResponseTaken"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "Some assets have been placed in an asset trap."] #[doc = ""] #[doc = "\\[ hash, origin, assets \\]"] pub struct AssetsTrapped( - pub ::subxt::sp_core::H256, + pub ::subxt::ext::sp_core::H256, pub runtime_types::xcm::v1::multilocation::MultiLocation, pub runtime_types::xcm::VersionedMultiAssets, ); - impl ::subxt::Event for AssetsTrapped { + impl ::subxt::events::StaticEvent for AssetsTrapped { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "AssetsTrapped"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "An XCM version change notification message has been attempted to be sent."] #[doc = ""] #[doc = "\\[ destination, result \\]"] @@ -41348,11 +27648,15 @@ pub mod api { pub runtime_types::xcm::v1::multilocation::MultiLocation, pub ::core::primitive::u32, ); - impl ::subxt::Event for VersionChangeNotified { + impl ::subxt::events::StaticEvent for VersionChangeNotified { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "VersionChangeNotified"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "The supported version of a location has been changed. This might be through an"] #[doc = "automatic notification or a manual intervention."] #[doc = ""] @@ -41361,11 +27665,15 @@ pub mod api { pub runtime_types::xcm::v1::multilocation::MultiLocation, pub ::core::primitive::u32, ); - impl ::subxt::Event for SupportedVersionChanged { + impl ::subxt::events::StaticEvent for SupportedVersionChanged { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "SupportedVersionChanged"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A given location which had a version change subscription was dropped owing to an error"] #[doc = "sending the notification to it."] #[doc = ""] @@ -41375,11 +27683,15 @@ pub mod api { pub ::core::primitive::u64, pub runtime_types::xcm::v2::traits::Error, ); - impl ::subxt::Event for NotifyTargetSendFail { + impl ::subxt::events::StaticEvent for NotifyTargetSendFail { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "NotifyTargetSendFail"; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] #[doc = "A given location which had a version change subscription was dropped owing to an error"] #[doc = "migrating the location to our new XCM format."] #[doc = ""] @@ -41388,261 +27700,89 @@ pub mod api { pub runtime_types::xcm::VersionedMultiLocation, pub ::core::primitive::u64, ); - impl ::subxt::Event for NotifyTargetMigrationFail { + impl ::subxt::events::StaticEvent for NotifyTargetMigrationFail { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "NotifyTargetMigrationFail"; } } pub mod storage { use super::runtime_types; - pub struct QueryCounter; - impl ::subxt::StorageEntry for QueryCounter { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "QueryCounter"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Queries<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Queries<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "Queries"; - type Value = runtime_types::pallet_xcm::pallet::QueryStatus< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct AssetTraps<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for AssetTraps<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "AssetTraps"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct SafeXcmVersion; - impl ::subxt::StorageEntry for SafeXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "SafeXcmVersion"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SupportedVersion<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for SupportedVersion<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "SupportedVersion"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionNotifiers<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for VersionNotifiers<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionNotifiers"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionNotifyTargets<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for VersionNotifyTargets<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionNotifyTargets"; - type Value = ( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionDiscoveryQueue; - impl ::subxt::StorageEntry for VersionDiscoveryQueue { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionDiscoveryQueue"; - type Value = - runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentMigration; - impl ::subxt::StorageEntry for CurrentMigration { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "CurrentMigration"; - type Value = runtime_types::pallet_xcm::pallet::VersionMigrationStage; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi; + impl StorageApi { #[doc = " The latest available query index."] pub fn query_counter( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u64, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 137u8, 58u8, 184u8, 88u8, 247u8, 22u8, 151u8, 64u8, 50u8, - 77u8, 49u8, 10u8, 234u8, 84u8, 213u8, 156u8, 26u8, 200u8, - 214u8, 225u8, 125u8, 231u8, 42u8, 93u8, 159u8, 168u8, - 86u8, 201u8, 116u8, 153u8, 41u8, 127u8, - ] - { - let entry = QueryCounter; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "QueryCounter", + vec![], + [ + 137u8, 58u8, 184u8, 88u8, 247u8, 22u8, 151u8, 64u8, 50u8, + 77u8, 49u8, 10u8, 234u8, 84u8, 213u8, 156u8, 26u8, 200u8, + 214u8, 225u8, 125u8, 231u8, 42u8, 93u8, 159u8, 168u8, 86u8, + 201u8, 116u8, 153u8, 41u8, 127u8, + ], + ) } #[doc = " The ongoing queries."] pub fn queries( &self, - _0: &'a ::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::QueryStatus< - ::core::primitive::u32, - >, + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_xcm::pallet::QueryStatus< + ::core::primitive::u32, >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 157u8, 143u8, 122u8, 154u8, 219u8, 84u8, 81u8, 28u8, - 55u8, 250u8, 47u8, 198u8, 98u8, 80u8, 195u8, 4u8, 242u8, - 170u8, 58u8, 51u8, 55u8, 134u8, 206u8, 79u8, 200u8, - 204u8, 188u8, 213u8, 155u8, 252u8, 64u8, 147u8, - ] - { - let entry = Queries(_0); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "Queries", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 148u8, 119u8, 44u8, 186u8, 73u8, 248u8, 67u8, 20u8, 165u8, + 97u8, 238u8, 150u8, 176u8, 66u8, 220u8, 145u8, 198u8, 244u8, + 52u8, 181u8, 205u8, 186u8, 173u8, 197u8, 220u8, 36u8, 15u8, + 19u8, 115u8, 1u8, 45u8, 3u8, + ], + ) } #[doc = " The ongoing queries."] - pub fn queries_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, Queries<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 157u8, 143u8, 122u8, 154u8, 219u8, 84u8, 81u8, 28u8, - 55u8, 250u8, 47u8, 198u8, 98u8, 80u8, 195u8, 4u8, 242u8, - 170u8, 58u8, 51u8, 55u8, 134u8, 206u8, 79u8, 200u8, - 204u8, 188u8, 213u8, 155u8, 252u8, 64u8, 147u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn queries_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_xcm::pallet::QueryStatus< + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "Queries", + Vec::new(), + [ + 148u8, 119u8, 44u8, 186u8, 73u8, 248u8, 67u8, 20u8, 165u8, + 97u8, 238u8, 150u8, 176u8, 66u8, 220u8, 145u8, 198u8, 244u8, + 52u8, 181u8, 205u8, 186u8, 173u8, 197u8, 220u8, 36u8, 15u8, + 19u8, 115u8, 1u8, 45u8, 3u8, + ], + ) } #[doc = " The existing asset traps."] #[doc = ""] @@ -41650,407 +27790,236 @@ pub mod api { #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] pub fn asset_traps( &self, - _0: &'a ::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::primitive::u32, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 170u8, 126u8, 101u8, 101u8, 243u8, 31u8, 53u8, - 166u8, 45u8, 90u8, 63u8, 2u8, 87u8, 36u8, 221u8, 101u8, - 190u8, 51u8, 103u8, 66u8, 193u8, 76u8, 224u8, 74u8, - 160u8, 120u8, 212u8, 45u8, 230u8, 57u8, 122u8, - ] - { - let entry = AssetTraps(_0); - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "AssetTraps", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 4u8, 185u8, 92u8, 4u8, 7u8, 71u8, 214u8, 1u8, 141u8, 59u8, + 87u8, 55u8, 149u8, 26u8, 125u8, 8u8, 88u8, 31u8, 240u8, + 138u8, 133u8, 28u8, 37u8, 131u8, 107u8, 218u8, 86u8, 152u8, + 147u8, 44u8, 19u8, 239u8, + ], + ) } #[doc = " The existing asset traps."] #[doc = ""] #[doc = " Key is the blake2 256 hash of (origin, versioned `MultiAssets`) pair. Value is the number of"] #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] - pub fn asset_traps_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, AssetTraps<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 170u8, 126u8, 101u8, 101u8, 243u8, 31u8, 53u8, - 166u8, 45u8, 90u8, 63u8, 2u8, 87u8, 36u8, 221u8, 101u8, - 190u8, 51u8, 103u8, 66u8, 193u8, 76u8, 224u8, 74u8, - 160u8, 120u8, 212u8, 45u8, 230u8, 57u8, 122u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn asset_traps_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "AssetTraps", + Vec::new(), + [ + 4u8, 185u8, 92u8, 4u8, 7u8, 71u8, 214u8, 1u8, 141u8, 59u8, + 87u8, 55u8, 149u8, 26u8, 125u8, 8u8, 88u8, 31u8, 240u8, + 138u8, 133u8, 28u8, 37u8, 131u8, 107u8, 218u8, 86u8, 152u8, + 147u8, 44u8, 19u8, 239u8, + ], + ) } #[doc = " Default version to encode XCM when latest version of destination is unknown. If `None`,"] #[doc = " then the destinations whose XCM version is unknown are considered unreachable."] pub fn safe_xcm_version( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 1u8, 223u8, 218u8, 204u8, 222u8, 129u8, 137u8, 237u8, - 197u8, 142u8, 233u8, 66u8, 229u8, 153u8, 138u8, 222u8, - 113u8, 164u8, 135u8, 213u8, 233u8, 34u8, 24u8, 23u8, - 215u8, 59u8, 40u8, 188u8, 45u8, 244u8, 205u8, 199u8, - ] - { - let entry = SafeXcmVersion; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "SafeXcmVersion", + vec![], + [ + 1u8, 223u8, 218u8, 204u8, 222u8, 129u8, 137u8, 237u8, 197u8, + 142u8, 233u8, 66u8, 229u8, 153u8, 138u8, 222u8, 113u8, 164u8, + 135u8, 213u8, 233u8, 34u8, 24u8, 23u8, 215u8, 59u8, 40u8, + 188u8, 45u8, 244u8, 205u8, 199u8, + ], + ) } #[doc = " The Latest versions that we know various locations support."] pub fn supported_version( &self, - _0: &'a ::core::primitive::u32, - _1: &'a runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 183u8, 179u8, 209u8, 179u8, 132u8, 48u8, 235u8, 28u8, - 229u8, 231u8, 14u8, 144u8, 233u8, 9u8, 65u8, 225u8, - 218u8, 173u8, 164u8, 47u8, 196u8, 253u8, 228u8, 218u8, - 104u8, 59u8, 176u8, 206u8, 76u8, 168u8, 195u8, 43u8, - ] - { - let entry = SupportedVersion(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + :: subxt :: storage :: address :: StaticStorageAddress :: new ("XcmPallet" , "SupportedVersion" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [227u8 , 149u8 , 251u8 , 204u8 , 40u8 , 150u8 , 151u8 , 177u8 , 154u8 , 187u8 , 9u8 , 205u8 , 174u8 , 137u8 , 228u8 , 128u8 , 18u8 , 244u8 , 151u8 , 120u8 , 6u8 , 44u8 , 5u8 , 167u8 , 56u8 , 35u8 , 192u8 , 141u8 , 108u8 , 169u8 , 91u8 , 7u8 ,]) } #[doc = " The Latest versions that we know various locations support."] - pub fn supported_version_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, SupportedVersion<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 183u8, 179u8, 209u8, 179u8, 132u8, 48u8, 235u8, 28u8, - 229u8, 231u8, 14u8, 144u8, 233u8, 9u8, 65u8, 225u8, - 218u8, 173u8, 164u8, 47u8, 196u8, 253u8, 228u8, 218u8, - 104u8, 59u8, 176u8, 206u8, 76u8, 168u8, 195u8, 43u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn supported_version_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "SupportedVersion", + Vec::new(), + [ + 227u8, 149u8, 251u8, 204u8, 40u8, 150u8, 151u8, 177u8, 154u8, + 187u8, 9u8, 205u8, 174u8, 137u8, 228u8, 128u8, 18u8, 244u8, + 151u8, 120u8, 6u8, 44u8, 5u8, 167u8, 56u8, 35u8, 192u8, + 141u8, 108u8, 169u8, 91u8, 7u8, + ], + ) } #[doc = " All locations that we have requested version notifications from."] pub fn version_notifiers( &self, - _0: &'a ::core::primitive::u32, - _1: &'a runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<::core::primitive::u64>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 72u8, 93u8, 102u8, 116u8, 75u8, 80u8, 246u8, 250u8, - 249u8, 74u8, 11u8, 175u8, 197u8, 203u8, 24u8, 34u8, - 233u8, 227u8, 105u8, 237u8, 21u8, 118u8, 188u8, 149u8, - 49u8, 187u8, 103u8, 179u8, 219u8, 135u8, 235u8, - ] - { - let entry = VersionNotifiers(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + :: subxt :: storage :: address :: StaticStorageAddress :: new ("XcmPallet" , "VersionNotifiers" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [122u8 , 110u8 , 119u8 , 25u8 , 216u8 , 237u8 , 44u8 , 91u8 , 133u8 , 165u8 , 77u8 , 86u8 , 232u8 , 69u8 , 110u8 , 121u8 , 234u8 , 176u8 , 208u8 , 62u8 , 47u8 , 196u8 , 151u8 , 193u8 , 197u8 , 41u8 , 203u8 , 36u8 , 147u8 , 218u8 , 31u8 , 199u8 ,]) } #[doc = " All locations that we have requested version notifications from."] - pub fn version_notifiers_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifiers<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 46u8, 72u8, 93u8, 102u8, 116u8, 75u8, 80u8, 246u8, 250u8, - 249u8, 74u8, 11u8, 175u8, 197u8, 203u8, 24u8, 34u8, - 233u8, 227u8, 105u8, 237u8, 21u8, 118u8, 188u8, 149u8, - 49u8, 187u8, 103u8, 179u8, 219u8, 135u8, 235u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn version_notifiers_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "VersionNotifiers", + Vec::new(), + [ + 122u8, 110u8, 119u8, 25u8, 216u8, 237u8, 44u8, 91u8, 133u8, + 165u8, 77u8, 86u8, 232u8, 69u8, 110u8, 121u8, 234u8, 176u8, + 208u8, 62u8, 47u8, 196u8, 151u8, 193u8, 197u8, 41u8, 203u8, + 36u8, 147u8, 218u8, 31u8, 199u8, + ], + ) } #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] #[doc = " of our versions we informed them of."] pub fn version_notify_targets( &self, - _0: &'a ::core::primitive::u32, - _1: &'a runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 171u8, 249u8, 163u8, 191u8, 95u8, 4u8, 102u8, 64u8, - 123u8, 65u8, 180u8, 22u8, 66u8, 17u8, 174u8, 244u8, - 108u8, 147u8, 61u8, 69u8, 54u8, 245u8, 48u8, 124u8, 69u8, - 24u8, 207u8, 12u8, 94u8, 161u8, 13u8, 22u8, - ] - { - let entry = VersionNotifyTargets(_0, _1); - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u64, + ::core::primitive::u64, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + :: subxt :: storage :: address :: StaticStorageAddress :: new ("XcmPallet" , "VersionNotifyTargets" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [255u8 , 223u8 , 137u8 , 192u8 , 243u8 , 162u8 , 26u8 , 237u8 , 4u8 , 29u8 , 179u8 , 75u8 , 5u8 , 145u8 , 11u8 , 149u8 , 164u8 , 202u8 , 14u8 , 18u8 , 244u8 , 36u8 , 209u8 , 1u8 , 21u8 , 0u8 , 191u8 , 79u8 , 126u8 , 160u8 , 149u8 , 58u8 ,]) } #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] #[doc = " of our versions we informed them of."] - pub fn version_notify_targets_iter( - &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifyTargets<'a>>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 171u8, 249u8, 163u8, 191u8, 95u8, 4u8, 102u8, 64u8, - 123u8, 65u8, 180u8, 22u8, 66u8, 17u8, 174u8, 244u8, - 108u8, 147u8, 61u8, 69u8, 54u8, 245u8, 48u8, 124u8, 69u8, - 24u8, 207u8, 12u8, 94u8, 161u8, 13u8, 22u8, - ] - { - client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + pub fn version_notify_targets_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u64, + ::core::primitive::u64, + ::core::primitive::u32, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "VersionNotifyTargets", + Vec::new(), + [ + 255u8, 223u8, 137u8, 192u8, 243u8, 162u8, 26u8, 237u8, 4u8, + 29u8, 179u8, 75u8, 5u8, 145u8, 11u8, 149u8, 164u8, 202u8, + 14u8, 18u8, 244u8, 36u8, 209u8, 1u8, 21u8, 0u8, 191u8, 79u8, + 126u8, 160u8, 149u8, 58u8, + ], + ) } #[doc = " Destinations whose latest XCM version we would like to know. Duplicates not allowed, and"] #[doc = " the `u32` counter is the number of times that a send to the destination has been attempted,"] #[doc = " which is used as a prioritization."] pub fn version_discovery_queue( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( runtime_types::xcm::VersionedMultiLocation, ::core::primitive::u32, )>, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 225u8, 172u8, 89u8, 78u8, 70u8, 88u8, 171u8, 197u8, 81u8, - 64u8, 6u8, 59u8, 62u8, 41u8, 174u8, 180u8, 172u8, 129u8, - 120u8, 253u8, 71u8, 149u8, 124u8, 252u8, 6u8, 136u8, - 25u8, 24u8, 57u8, 15u8, 123u8, 66u8, - ] - { - let entry = VersionDiscoveryQueue; - client.storage().fetch_or_default(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "VersionDiscoveryQueue", + vec![], + [ + 129u8, 154u8, 130u8, 118u8, 66u8, 165u8, 29u8, 41u8, 197u8, + 122u8, 110u8, 198u8, 149u8, 157u8, 99u8, 30u8, 253u8, 99u8, + 180u8, 18u8, 182u8, 187u8, 14u8, 116u8, 12u8, 172u8, 225u8, + 198u8, 5u8, 103u8, 167u8, 159u8, + ], + ) } #[doc = " The current migration's stage, if any."] pub fn current_migration( &self, - block_hash: ::core::option::Option, - ) -> impl ::core::future::Future< - Output = ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::VersionMigrationStage, - >, - ::subxt::BasicError, - >, - > + 'a { - let client = self.client; - async move { - let runtime_storage_hash = { - let locked_metadata = client.metadata(); - let metadata = locked_metadata.read(); - match metadata.storage_hash::() { - Ok(hash) => hash, - Err(e) => return Err(e.into()), - } - }; - if runtime_storage_hash - == [ - 228u8, 254u8, 240u8, 20u8, 92u8, 79u8, 40u8, 65u8, 176u8, - 111u8, 243u8, 168u8, 238u8, 147u8, 247u8, 170u8, 185u8, - 107u8, 58u8, 54u8, 224u8, 222u8, 141u8, 113u8, 95u8, - 92u8, 17u8, 69u8, 162u8, 242u8, 245u8, 95u8, - ] - { - let entry = CurrentMigration; - client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_xcm::pallet::VersionMigrationStage, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "XcmPallet", + "CurrentMigration", + vec![], + [ + 137u8, 144u8, 168u8, 185u8, 158u8, 90u8, 127u8, 243u8, 227u8, + 134u8, 150u8, 73u8, 15u8, 99u8, 23u8, 47u8, 68u8, 18u8, 39u8, + 16u8, 24u8, 43u8, 161u8, 56u8, 66u8, 111u8, 16u8, 7u8, 252u8, + 125u8, 100u8, 225u8, + ], + ) } } } @@ -42062,26 +28031,40 @@ pub mod api { pub mod order { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Lsb0; } } pub mod finality_grandpa { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Equivocation<_0, _1, _2> { pub round_number: ::core::primitive::u64, pub identity: _0, pub first: (_1, _2), pub second: (_1, _2), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Precommit<_0, _1> { pub target_hash: _0, pub target_number: _1, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Prevote<_0, _1> { pub target_hash: _0, pub target_number: _1, @@ -42092,7 +28075,9 @@ pub mod api { pub mod dispatch { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum RawOrigin<_0> { #[codec(index = 0)] @@ -42108,14 +28093,18 @@ pub mod api { pub mod misc { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct WrapperKeepOpaque<_0>( #[codec(compact)] pub ::core::primitive::u32, pub _0, ); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct WrapperOpaque<_0>( #[codec(compact)] pub ::core::primitive::u32, @@ -42125,7 +28114,9 @@ pub mod api { pub mod schedule { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum LookupError { #[codec(index = 0)] @@ -42134,7 +28125,9 @@ pub mod api { BadFormat, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum MaybeHashed<_0, _1> { #[codec(index = 0)] @@ -42148,8 +28141,8 @@ pub mod api { pub mod misc { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub enum BalanceStatus { @@ -42164,7 +28157,9 @@ pub mod api { pub mod weights { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum DispatchClass { #[codec(index = 0)] @@ -42175,7 +28170,9 @@ pub mod api { Mandatory, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct DispatchInfo { pub weight: ::core::primitive::u64, @@ -42183,7 +28180,9 @@ pub mod api { pub pays_fee: runtime_types::frame_support::weights::Pays, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Pays { #[codec(index = 0)] @@ -42192,7 +28191,9 @@ pub mod api { No, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct PerDispatchClass<_0> { pub normal: _0, @@ -42200,14 +28201,20 @@ pub mod api { pub mandatory: _0, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct RuntimeDbWeight { pub read: ::core::primitive::u64, pub write: ::core::primitive::u64, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct PalletId(pub [::core::primitive::u8; 8usize]); } pub mod frame_system { @@ -42217,14 +28224,18 @@ pub mod api { pub mod check_genesis { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckGenesis; } pub mod check_mortality { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckMortality( pub runtime_types::sp_runtime::generic::era::Era, @@ -42233,35 +28244,45 @@ pub mod api { pub mod check_non_zero_sender { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckNonZeroSender; } pub mod check_nonce { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); } pub mod check_spec_version { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckSpecVersion; } pub mod check_tx_version { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckTxVersion; } pub mod check_weight { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CheckWeight; } @@ -42269,7 +28290,9 @@ pub mod api { pub mod limits { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct BlockLength { pub max: runtime_types::frame_support::weights::PerDispatchClass< @@ -42277,7 +28300,9 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct BlockWeights { pub base_block: ::core::primitive::u64, @@ -42288,7 +28313,9 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct WeightsPerClass { pub base_extrinsic: ::core::primitive::u64, @@ -42300,7 +28327,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -42379,7 +28408,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Error for the System pallet"] pub enum Error { @@ -42407,7 +28438,9 @@ pub mod api { CallFiltered, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Event for the System pallet."] pub enum Event { @@ -42430,22 +28463,26 @@ pub mod api { #[codec(index = 3)] #[doc = "A new account was created."] NewAccount { - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 4)] #[doc = "An account was reaped."] KilledAccount { - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 5)] #[doc = "On on-chain remark happened."] Remarked { - sender: ::subxt::sp_core::crypto::AccountId32, - hash: ::subxt::sp_core::H256, + sender: ::subxt::ext::sp_core::crypto::AccountId32, + hash: ::subxt::ext::sp_core::H256, }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AccountInfo<_0, _1> { pub nonce: _0, pub consumers: _0, @@ -42453,19 +28490,31 @@ pub mod api { pub sufficients: _0, pub data: _1, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct EventRecord<_0, _1> { pub phase: runtime_types::frame_system::Phase, pub event: _0, pub topics: ::std::vec::Vec<_1>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct LastRuntimeUpgradeInfo { #[codec(compact)] pub spec_version: ::core::primitive::u32, pub spec_name: ::std::string::String, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Phase { #[codec(index = 0)] ApplyExtrinsic(::core::primitive::u32), @@ -42480,7 +28529,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -42496,7 +28547,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -42523,7 +28576,11 @@ pub mod api { OldUncle, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum UncleEntryItem<_0, _1, _2> { #[codec(index = 0)] InclusionHeight(_0), @@ -42536,13 +28593,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] report_equivocation { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 1)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] # [doc = "This extrinsic must be called unsigned and it is expected that only"] # [doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] # [doc = "if the block author is defined it will be defined as the equivocation"] # [doc = "reporter."] report_equivocation_unsigned { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 2)] # [doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] # [doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] # [doc = "Multiple calls to this method will replace any existing planned config change that had"] # [doc = "not been enacted yet."] plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -42566,16 +28627,22 @@ pub mod api { pub mod list { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Bag { - pub head: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub tail: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub head: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + pub tail: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum ListError { #[codec(index = 0)] @@ -42588,14 +28655,18 @@ pub mod api { NodeNotFound, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Node { - pub id: ::subxt::sp_core::crypto::AccountId32, - pub prev: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub next: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub id: ::subxt::ext::sp_core::crypto::AccountId32, + pub prev: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + pub next: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, pub bag_upper: ::core::primitive::u64, pub score: ::core::primitive::u64, } @@ -42603,7 +28674,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -42619,7 +28692,7 @@ pub mod api { #[doc = ""] #[doc = "If `dislocated` does not exists, it returns an error."] rebag { - dislocated: ::subxt::sp_core::crypto::AccountId32, + dislocated: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 1)] #[doc = "Move the caller's Id directly in front of `lighter`."] @@ -42631,11 +28704,13 @@ pub mod api { #[doc = "- both nodes are within the same bag,"] #[doc = "- and `origin` has a greater `Score` than `lighter`."] put_in_front_of { - lighter: ::subxt::sp_core::crypto::AccountId32, + lighter: ::subxt::ext::sp_core::crypto::AccountId32, }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -42644,21 +28719,23 @@ pub mod api { List(runtime_types::pallet_bags_list::list::ListError), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Moved an account from one bag to another."] Rebagged { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, from: ::core::primitive::u64, to: ::core::primitive::u64, }, #[codec(index = 1)] #[doc = "Updated the score of some account to the given amount."] ScoreUpdated { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, new_score: ::core::primitive::u64, }, } @@ -42669,7 +28746,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -42700,8 +28779,8 @@ pub mod api { #[doc = "- Origin account is already in memory, so no DB operations for them."] #[doc = "# "] transfer { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -42717,8 +28796,8 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call is `root`."] set_balance { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -42734,12 +28813,12 @@ pub mod api { #[doc = " assumed to be in the overlay."] #[doc = "# "] force_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -42753,8 +28832,8 @@ pub mod api { #[doc = ""] #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] transfer_keep_alive { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -42779,8 +28858,8 @@ pub mod api { #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] #[doc = " #"] transfer_all { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, keep_alive: ::core::primitive::bool, @@ -42790,15 +28869,17 @@ pub mod api { #[doc = ""] #[doc = "Can only be called by ROOT."] force_unreserve { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, amount: ::core::primitive::u128, }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -42828,26 +28909,40 @@ pub mod api { TooManyReserves, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { - # [codec (index = 0)] # [doc = "An account was created with some free balance."] Endowed { account : :: subxt :: sp_core :: crypto :: AccountId32 , free_balance : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] # [doc = "resulting in an outright loss."] DustLost { account : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 2)] # [doc = "Transfer succeeded."] Transfer { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "A balance was set by root."] BalanceSet { who : :: subxt :: sp_core :: crypto :: AccountId32 , free : :: core :: primitive :: u128 , reserved : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Some balance was reserved (moved from free to reserved)."] Reserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 5)] # [doc = "Some balance was unreserved (moved from reserved to free)."] Unreserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 6)] # [doc = "Some balance was moved from the reserve of the first account to the second account."] # [doc = "Final argument indicates the destination balance type."] ReserveRepatriated { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , destination_status : runtime_types :: frame_support :: traits :: tokens :: misc :: BalanceStatus , } , # [codec (index = 7)] # [doc = "Some amount was deposited (e.g. for transaction fees)."] Deposit { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 8)] # [doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] Withdraw { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 9)] # [doc = "Some amount was removed from the account (e.g. for misbehavior)."] Slashed { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , } + # [codec (index = 0)] # [doc = "An account was created with some free balance."] Endowed { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , free_balance : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] # [doc = "resulting in an outright loss."] DustLost { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 2)] # [doc = "Transfer succeeded."] Transfer { from : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , to : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "A balance was set by root."] BalanceSet { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , free : :: core :: primitive :: u128 , reserved : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Some balance was reserved (moved from free to reserved)."] Reserved { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 5)] # [doc = "Some balance was unreserved (moved from reserved to free)."] Unreserved { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 6)] # [doc = "Some balance was moved from the reserve of the first account to the second account."] # [doc = "Final argument indicates the destination balance type."] ReserveRepatriated { from : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , to : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , destination_status : runtime_types :: frame_support :: traits :: tokens :: misc :: BalanceStatus , } , # [codec (index = 7)] # [doc = "Some amount was deposited (e.g. for transaction fees)."] Deposit { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 8)] # [doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] Withdraw { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 9)] # [doc = "Some amount was removed from the account (e.g. for misbehavior)."] Slashed { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct AccountData<_0> { pub free: _0, pub reserved: _0, pub misc_frozen: _0, pub fee_frozen: _0, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct BalanceLock<_0> { pub id: [::core::primitive::u8; 8usize], pub amount: _0, pub reasons: runtime_types::pallet_balances::Reasons, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Reasons { #[codec(index = 0)] Fee, @@ -42856,14 +28951,22 @@ pub mod api { #[codec(index = 2)] All, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Releases { #[codec(index = 0)] V1_0_0, #[codec(index = 1)] V2_0_0, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReserveData<_0, _1> { pub id: _0, pub amount: _1, @@ -42874,7 +28977,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -42920,8 +29025,8 @@ pub mod api { propose_curator { #[codec(compact)] bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -42978,8 +29083,8 @@ pub mod api { award_bounty { #[codec(compact)] bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -43030,7 +29135,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -43070,7 +29177,9 @@ pub mod api { TooManyQueued, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -43090,14 +29199,14 @@ pub mod api { #[doc = "A bounty is awarded to a beneficiary."] BountyAwarded { index: ::core::primitive::u32, - beneficiary: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 4)] #[doc = "A bounty is claimed by beneficiary."] BountyClaimed { index: ::core::primitive::u32, payout: ::core::primitive::u128, - beneficiary: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 5)] #[doc = "A bounty is cancelled."] @@ -43107,7 +29216,11 @@ pub mod api { BountyExtended { index: ::core::primitive::u32 }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Bounty<_0, _1, _2> { pub proposer: _0, pub value: _1, @@ -43116,7 +29229,11 @@ pub mod api { pub bond: _1, pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum BountyStatus<_0, _1> { #[codec(index = 0)] Proposed, @@ -43141,7 +29258,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -43193,8 +29312,8 @@ pub mod api { parent_bounty_id: ::core::primitive::u32, #[codec(compact)] child_bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] @@ -43290,8 +29409,8 @@ pub mod api { parent_bounty_id: ::core::primitive::u32, #[codec(compact)] child_bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -43349,7 +29468,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -43364,7 +29485,9 @@ pub mod api { TooManyChildBounties, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -43379,7 +29502,7 @@ pub mod api { Awarded { index: ::core::primitive::u32, child_index: ::core::primitive::u32, - beneficiary: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 2)] #[doc = "A child-bounty is claimed by beneficiary."] @@ -43387,7 +29510,7 @@ pub mod api { index: ::core::primitive::u32, child_index: ::core::primitive::u32, payout: ::core::primitive::u128, - beneficiary: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 3)] #[doc = "A child-bounty is cancelled."] @@ -43397,7 +29520,11 @@ pub mod api { }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ChildBounty<_0, _1, _2> { pub parent_bounty: _2, pub value: _1, @@ -43406,7 +29533,11 @@ pub mod api { pub status: runtime_types::pallet_child_bounties::ChildBountyStatus<_0, _2>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum ChildBountyStatus<_0, _1> { #[codec(index = 0)] Added, @@ -43427,7 +29558,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -43466,9 +29599,10 @@ pub mod api { #[doc = "# "] set_members { new_members: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + prime: ::core::option::Option< + ::subxt::ext::sp_core::crypto::AccountId32, + >, old_count: ::core::primitive::u32, }, #[codec(index = 1)] @@ -43542,7 +29676,7 @@ pub mod api { #[doc = "- 1 event"] #[doc = "# "] vote { - proposal: ::subxt::sp_core::H256, + proposal: ::subxt::ext::sp_core::H256, #[codec(compact)] index: ::core::primitive::u32, approve: ::core::primitive::bool, @@ -43581,7 +29715,7 @@ pub mod api { #[doc = "- up to 3 events"] #[doc = "# "] close { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] index: ::core::primitive::u32, #[codec(compact)] @@ -43605,11 +29739,13 @@ pub mod api { #[doc = "* Writes: Voting, Proposals, ProposalOf"] #[doc = "# "] disapprove_proposal { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -43645,7 +29781,9 @@ pub mod api { WrongProposalLength, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -43653,17 +29791,17 @@ pub mod api { #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] #[doc = "`MemberCount`)."] Proposed { - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, proposal_index: ::core::primitive::u32, - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, threshold: ::core::primitive::u32, }, #[codec(index = 1)] #[doc = "A motion (given hash) has been voted on by given account, leaving"] #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] Voted { - account: ::subxt::sp_core::crypto::AccountId32, - proposal_hash: ::subxt::sp_core::H256, + account: ::subxt::ext::sp_core::crypto::AccountId32, + proposal_hash: ::subxt::ext::sp_core::H256, voted: ::core::primitive::bool, yes: ::core::primitive::u32, no: ::core::primitive::u32, @@ -43671,17 +29809,17 @@ pub mod api { #[codec(index = 2)] #[doc = "A motion was approved by the required threshold."] Approved { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 3)] #[doc = "A motion was not approved by the required threshold."] Disapproved { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 4)] #[doc = "A motion was executed; result will be `Ok` if it returned without error."] Executed { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, result: ::core::result::Result< (), runtime_types::sp_runtime::DispatchError, @@ -43690,7 +29828,7 @@ pub mod api { #[codec(index = 5)] #[doc = "A single member did some action; result will be `Ok` if it returned without error."] MemberExecuted { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, result: ::core::result::Result< (), runtime_types::sp_runtime::DispatchError, @@ -43699,13 +29837,17 @@ pub mod api { #[codec(index = 6)] #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] Closed { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, yes: ::core::primitive::u32, no: ::core::primitive::u32, }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum RawOrigin<_0> { #[codec(index = 0)] Members(::core::primitive::u32, ::core::primitive::u32), @@ -43714,7 +29856,11 @@ pub mod api { #[codec(index = 2)] _Phantom, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Votes<_0, _1> { pub index: _1, pub threshold: _1, @@ -43728,7 +29874,9 @@ pub mod api { pub mod conviction { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Conviction { #[codec(index = 0)] @@ -43750,7 +29898,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -43767,7 +29917,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(p)`"] propose { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] value: ::core::primitive::u128, }, @@ -43826,7 +29976,7 @@ pub mod api { #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] #[doc = " Decoding vec of length V. Charged as maximum"] external_propose { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 5)] #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] @@ -43841,7 +29991,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] external_propose_majority { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 6)] #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] @@ -43856,7 +30006,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] external_propose_default { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 7)] #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] @@ -43875,7 +30025,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] fast_track { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, voting_period: ::core::primitive::u32, delay: ::core::primitive::u32, }, @@ -43890,7 +30040,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] veto_external { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 9)] #[doc = "Remove a referendum."] @@ -43935,7 +30085,7 @@ pub mod api { #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] #[doc = " voted on. Weight is charged as if maximum votes."] delegate { - to: ::subxt::sp_core::crypto::AccountId32, + to: ::subxt::ext::sp_core::crypto::AccountId32, conviction: runtime_types::pallet_democracy::conviction::Conviction, balance: ::core::primitive::u128, @@ -44018,7 +30168,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(D)` where D is length of proposal."] reap_preimage { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] proposal_len_upper_bound: ::core::primitive::u32, }, @@ -44031,7 +30181,7 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(R)` with R number of vote of target."] unlock { - target: ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 20)] #[doc = "Remove a vote for a referendum."] @@ -44079,13 +30229,13 @@ pub mod api { #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] #[doc = " Weight is calculated for the maximum number of vote."] remove_other_vote { - target: ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, }, #[codec(index = 22)] #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] enact_proposal { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, }, #[codec(index = 23)] @@ -44105,7 +30255,7 @@ pub mod api { #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] #[doc = " reasonable value)."] blacklist { - proposal_hash: ::subxt::sp_core::H256, + proposal_hash: ::subxt::ext::sp_core::H256, maybe_ref_index: ::core::option::Option<::core::primitive::u32>, }, #[codec(index = 24)] @@ -44122,7 +30272,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -44213,23 +30365,29 @@ pub mod api { TooManyProposals, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { - # [codec (index = 0)] # [doc = "A motion has been proposed by a public account."] Proposed { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "A public proposal has been tabled for referendum vote."] Tabled { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , depositors : :: std :: vec :: Vec < :: subxt :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 2)] # [doc = "An external proposal has been tabled."] ExternalTabled , # [codec (index = 3)] # [doc = "A referendum has begun."] Started { ref_index : :: core :: primitive :: u32 , threshold : runtime_types :: pallet_democracy :: vote_threshold :: VoteThreshold , } , # [codec (index = 4)] # [doc = "A proposal has been approved by referendum."] Passed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "A proposal has been rejected by referendum."] NotPassed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "A referendum has been cancelled."] Cancelled { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "A proposal has been enacted."] Executed { ref_index : :: core :: primitive :: u32 , result : :: core :: result :: Result < () , runtime_types :: sp_runtime :: DispatchError > , } , # [codec (index = 8)] # [doc = "An account has delegated their vote to another account."] Delegated { who : :: subxt :: sp_core :: crypto :: AccountId32 , target : :: subxt :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 9)] # [doc = "An account has cancelled a previous delegation operation."] Undelegated { account : :: subxt :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 10)] # [doc = "An external proposal has been vetoed."] Vetoed { who : :: subxt :: sp_core :: crypto :: AccountId32 , proposal_hash : :: subxt :: sp_core :: H256 , until : :: core :: primitive :: u32 , } , # [codec (index = 11)] # [doc = "A proposal's preimage was noted, and the deposit taken."] PreimageNoted { proposal_hash : :: subxt :: sp_core :: H256 , who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 12)] # [doc = "A proposal preimage was removed and used (the deposit was returned)."] PreimageUsed { proposal_hash : :: subxt :: sp_core :: H256 , provider : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 13)] # [doc = "A proposal could not be executed because its preimage was invalid."] PreimageInvalid { proposal_hash : :: subxt :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 14)] # [doc = "A proposal could not be executed because its preimage was missing."] PreimageMissing { proposal_hash : :: subxt :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 15)] # [doc = "A registered preimage was removed and the deposit collected by the reaper."] PreimageReaped { proposal_hash : :: subxt :: sp_core :: H256 , provider : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , reaper : :: subxt :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 16)] # [doc = "A proposal_hash has been blacklisted permanently."] Blacklisted { proposal_hash : :: subxt :: sp_core :: H256 , } , # [codec (index = 17)] # [doc = "An account has voted in a referendum"] Voted { voter : :: subxt :: sp_core :: crypto :: AccountId32 , ref_index : :: core :: primitive :: u32 , vote : runtime_types :: pallet_democracy :: vote :: AccountVote < :: core :: primitive :: u128 > , } , # [codec (index = 18)] # [doc = "An account has secconded a proposal"] Seconded { seconder : :: subxt :: sp_core :: crypto :: AccountId32 , prop_index : :: core :: primitive :: u32 , } , # [codec (index = 19)] # [doc = "A proposal got canceled."] ProposalCanceled { prop_index : :: core :: primitive :: u32 , } , } + # [codec (index = 0)] # [doc = "A motion has been proposed by a public account."] Proposed { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "A public proposal has been tabled for referendum vote."] Tabled { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , depositors : :: std :: vec :: Vec < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 2)] # [doc = "An external proposal has been tabled."] ExternalTabled , # [codec (index = 3)] # [doc = "A referendum has begun."] Started { ref_index : :: core :: primitive :: u32 , threshold : runtime_types :: pallet_democracy :: vote_threshold :: VoteThreshold , } , # [codec (index = 4)] # [doc = "A proposal has been approved by referendum."] Passed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "A proposal has been rejected by referendum."] NotPassed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "A referendum has been cancelled."] Cancelled { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "A proposal has been enacted."] Executed { ref_index : :: core :: primitive :: u32 , result : :: core :: result :: Result < () , runtime_types :: sp_runtime :: DispatchError > , } , # [codec (index = 8)] # [doc = "An account has delegated their vote to another account."] Delegated { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , target : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 9)] # [doc = "An account has cancelled a previous delegation operation."] Undelegated { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 10)] # [doc = "An external proposal has been vetoed."] Vetoed { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , proposal_hash : :: subxt :: ext :: sp_core :: H256 , until : :: core :: primitive :: u32 , } , # [codec (index = 11)] # [doc = "A proposal's preimage was noted, and the deposit taken."] PreimageNoted { proposal_hash : :: subxt :: ext :: sp_core :: H256 , who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 12)] # [doc = "A proposal preimage was removed and used (the deposit was returned)."] PreimageUsed { proposal_hash : :: subxt :: ext :: sp_core :: H256 , provider : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 13)] # [doc = "A proposal could not be executed because its preimage was invalid."] PreimageInvalid { proposal_hash : :: subxt :: ext :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 14)] # [doc = "A proposal could not be executed because its preimage was missing."] PreimageMissing { proposal_hash : :: subxt :: ext :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 15)] # [doc = "A registered preimage was removed and the deposit collected by the reaper."] PreimageReaped { proposal_hash : :: subxt :: ext :: sp_core :: H256 , provider : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , reaper : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 16)] # [doc = "A proposal_hash has been blacklisted permanently."] Blacklisted { proposal_hash : :: subxt :: ext :: sp_core :: H256 , } , # [codec (index = 17)] # [doc = "An account has voted in a referendum"] Voted { voter : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , ref_index : :: core :: primitive :: u32 , vote : runtime_types :: pallet_democracy :: vote :: AccountVote < :: core :: primitive :: u128 > , } , # [codec (index = 18)] # [doc = "An account has secconded a proposal"] Seconded { seconder : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , prop_index : :: core :: primitive :: u32 , } , # [codec (index = 19)] # [doc = "A proposal got canceled."] ProposalCanceled { prop_index : :: core :: primitive :: u32 , } , } } pub mod types { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Delegations<_0> { pub votes: _0, pub capital: _0, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum ReferendumInfo<_0, _1, _2> { #[codec(index = 0)] @@ -44247,7 +30405,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ReferendumStatus<_0, _1, _2> { pub end: _0, @@ -44258,7 +30418,9 @@ pub mod api { pub tally: runtime_types::pallet_democracy::types::Tally<_2>, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Tally<_0> { pub ayes: _0, @@ -44269,7 +30431,9 @@ pub mod api { pub mod vote { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum AccountVote<_0> { #[codec(index = 0)] @@ -44281,18 +30445,22 @@ pub mod api { Split { aye: _0, nay: _0 }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct PriorLock<_0, _1>(pub _0, pub _1); #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Vote(pub ::core::primitive::u8); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Voting<_0, _1, _2> { #[codec(index = 0)] @@ -44320,7 +30488,9 @@ pub mod api { pub mod vote_threshold { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum VoteThreshold { #[codec(index = 0)] @@ -44331,7 +30501,11 @@ pub mod api { SimpleMajority, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum PreimageStatus<_0, _1, _2> { #[codec(index = 0)] Missing(_2), @@ -44344,7 +30518,11 @@ pub mod api { expiry: ::core::option::Option<_2>, }, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Releases { #[codec(index = 0)] V1, @@ -44355,13 +30533,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { - # [codec (index = 0)] # [doc = "Submit a solution for the unsigned phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __none__."] # [doc = ""] # [doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] # [doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] # [doc = "that only active validators can submit this transaction when authoring a block (similar"] # [doc = "to an inherent)."] # [doc = ""] # [doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] # [doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] # [doc = "putting their authoring reward at risk."] # [doc = ""] # [doc = "No deposit or reward is associated with this submission."] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] # [doc = "Set a new value for `MinimumUntrustedScore`."] # [doc = ""] # [doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] # [doc = ""] # [doc = "This check can be turned off by setting the value to `None`."] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < runtime_types :: sp_npos_elections :: ElectionScore > , } , # [codec (index = 2)] # [doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] # [doc = "call to `ElectionProvider::elect`."] # [doc = ""] # [doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] # [doc = ""] # [doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] # [doc = "feasibility check itself can in principle cause the election process to fail (due to"] # [doc = "memory/weight constrains)."] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] # [doc = "Submit a solution for the signed phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __signed__."] # [doc = ""] # [doc = "The solution is potentially queued, based on the claimed score and processed at the end"] # [doc = "of the signed phase."] # [doc = ""] # [doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] # [doc = "might be rewarded, slashed, or get all or a part of the deposit back."] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , } , # [codec (index = 4)] # [doc = "Trigger the governance fallback."] # [doc = ""] # [doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] # [doc = "calling [`Call::set_emergency_election_result`]."] governance_fallback { maybe_max_voters : :: core :: option :: Option < :: core :: primitive :: u32 > , maybe_max_targets : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } + # [codec (index = 0)] # [doc = "Submit a solution for the unsigned phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __none__."] # [doc = ""] # [doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] # [doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] # [doc = "that only active validators can submit this transaction when authoring a block (similar"] # [doc = "to an inherent)."] # [doc = ""] # [doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] # [doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] # [doc = "putting their authoring reward at risk."] # [doc = ""] # [doc = "No deposit or reward is associated with this submission."] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] # [doc = "Set a new value for `MinimumUntrustedScore`."] # [doc = ""] # [doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] # [doc = ""] # [doc = "This check can be turned off by setting the value to `None`."] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < runtime_types :: sp_npos_elections :: ElectionScore > , } , # [codec (index = 2)] # [doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] # [doc = "call to `ElectionProvider::elect`."] # [doc = ""] # [doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] # [doc = ""] # [doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] # [doc = "feasibility check itself can in principle cause the election process to fail (due to"] # [doc = "memory/weight constrains)."] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: ext :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] # [doc = "Submit a solution for the signed phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __signed__."] # [doc = ""] # [doc = "The solution is potentially queued, based on the claimed score and processed at the end"] # [doc = "of the signed phase."] # [doc = ""] # [doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] # [doc = "might be rewarded, slashed, or get all or a part of the deposit back."] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , } , # [codec (index = 4)] # [doc = "Trigger the governance fallback."] # [doc = ""] # [doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] # [doc = "calling [`Call::set_emergency_election_result`]."] governance_fallback { maybe_max_voters : :: core :: option :: Option < :: core :: primitive :: u32 > , maybe_max_targets : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Error of the pallet that can be returned in response to dispatches."] pub enum Error { @@ -44403,16 +30585,20 @@ pub mod api { FallbackFailed, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { - # [codec (index = 0)] # [doc = "A solution was stored with the given compute."] # [doc = ""] # [doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] # [doc = "solution is unsigned, this means that it has also been processed."] # [doc = ""] # [doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] SolutionStored { election_compute : runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , prev_ejected : :: core :: primitive :: bool , } , # [codec (index = 1)] # [doc = "The election has been finalized, with `Some` of the given computation, or else if the"] # [doc = "election failed, `None`."] ElectionFinalized { election_compute : :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > , } , # [codec (index = 2)] # [doc = "An account has been rewarded for their signed submission being finalized."] Rewarded { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "An account has been slashed for submitting an invalid signed submission."] Slashed { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "The signed phase of the given round has started."] SignedPhaseStarted { round : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "The unsigned phase of the given round has started."] UnsignedPhaseStarted { round : :: core :: primitive :: u32 , } , } + # [codec (index = 0)] # [doc = "A solution was stored with the given compute."] # [doc = ""] # [doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] # [doc = "solution is unsigned, this means that it has also been processed."] # [doc = ""] # [doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] SolutionStored { election_compute : runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , prev_ejected : :: core :: primitive :: bool , } , # [codec (index = 1)] # [doc = "The election has been finalized, with `Some` of the given computation, or else if the"] # [doc = "election failed, `None`."] ElectionFinalized { election_compute : :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > , } , # [codec (index = 2)] # [doc = "An account has been rewarded for their signed submission being finalized."] Rewarded { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "An account has been slashed for submitting an invalid signed submission."] Slashed { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "The signed phase of the given round has started."] SignedPhaseStarted { round : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "The unsigned phase of the given round has started."] UnsignedPhaseStarted { round : :: core :: primitive :: u32 , } , } } pub mod signed { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct SignedSubmission<_0, _1, _2> { pub who: _0, @@ -44424,7 +30610,11 @@ pub mod api { pub call_fee: _1, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum ElectionCompute { #[codec(index = 0)] OnChain, @@ -44437,7 +30627,11 @@ pub mod api { #[codec(index = 4)] Emergency, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Phase<_0> { #[codec(index = 0)] Off, @@ -44448,13 +30642,21 @@ pub mod api { #[codec(index = 3)] Emergency, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RawSolution<_0> { pub solution: _0, pub score: runtime_types::sp_npos_elections::ElectionScore, pub round: ::core::primitive::u32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ReadySolution<_0> { pub supports: ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, @@ -44462,18 +30664,26 @@ pub mod api { pub compute: runtime_types::pallet_election_provider_multi_phase::ElectionCompute, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RoundSnapshot { pub voters: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u64, runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, )>, - pub targets: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub targets: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SolutionOrSnapshotSize { #[codec(compact)] pub voters: ::core::primitive::u32, @@ -44486,7 +30696,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -44515,7 +30727,8 @@ pub mod api { #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] #[doc = "# "] vote { - votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + votes: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, #[codec(compact)] value: ::core::primitive::u128, }, @@ -44584,8 +30797,8 @@ pub mod api { #[doc = "will go into phragmen, we assume full block for now."] #[doc = "# "] remove_member { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, has_replacement: ::core::primitive::bool, @@ -44607,7 +30820,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -44664,7 +30879,9 @@ pub mod api { InvalidReplacement, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -44676,7 +30893,7 @@ pub mod api { #[doc = "begin with."] NewTerm { new_members: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, }, @@ -44691,12 +30908,12 @@ pub mod api { #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] #[doc = "`EmptyTerm`."] MemberKicked { - member: ::subxt::sp_core::crypto::AccountId32, + member: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 4)] #[doc = "Someone has renounced their candidacy."] Renounced { - candidate: ::subxt::sp_core::crypto::AccountId32, + candidate: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 5)] #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] @@ -44704,18 +30921,22 @@ pub mod api { #[doc = ""] #[doc = "Note that old members and runners-up are also candidates."] CandidateSlashed { - candidate: ::subxt::sp_core::crypto::AccountId32, + candidate: ::subxt::ext::sp_core::crypto::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 6)] #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] SeatHolderSlashed { - seat_holder: ::subxt::sp_core::crypto::AccountId32, + seat_holder: ::subxt::ext::sp_core::crypto::AccountId32, amount: ::core::primitive::u128, }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Renouncing { #[codec(index = 0)] Member, @@ -44724,13 +30945,21 @@ pub mod api { #[codec(index = 2)] Candidate(#[codec(compact)] ::core::primitive::u32), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SeatHolder<_0, _1> { pub who: _0, pub stake: _1, pub deposit: _1, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Voter<_0, _1> { pub votes: ::std::vec::Vec<_0>, pub stake: _1, @@ -44742,7 +30971,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -44754,7 +30985,7 @@ pub mod api { report_equivocation { equivocation_proof: ::std::boxed::Box< runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, ::core::primitive::u32, >, >, @@ -44773,7 +31004,7 @@ pub mod api { report_equivocation_unsigned { equivocation_proof: ::std::boxed::Box< runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, ::core::primitive::u32, >, >, @@ -44798,7 +31029,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -44827,7 +31060,9 @@ pub mod api { DuplicateOffenceReport, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -44847,7 +31082,11 @@ pub mod api { Resumed, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct StoredPendingChange<_0> { pub scheduled_at: _0, pub delay: _0, @@ -44860,7 +31099,11 @@ pub mod api { >, pub forced: ::core::option::Option<_0>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum StoredState<_0> { #[codec(index = 0)] Live, @@ -44877,7 +31120,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Identity pallet declaration."] pub enum Call { @@ -44896,7 +31141,7 @@ pub mod api { #[doc = "- One event."] #[doc = "# "] add_registrar { - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 1)] #[doc = "Set an account's identity information and reserve the appropriate deposit."] @@ -44947,7 +31192,7 @@ pub mod api { #[doc = "# "] set_subs { subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::pallet_identity::types::Data, )>, }, @@ -45057,7 +31302,7 @@ pub mod api { set_account_id { #[codec(compact)] index: ::core::primitive::u32, - new: ::subxt::sp_core::crypto::AccountId32, + new: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 8)] #[doc = "Set the field information for a registrar."] @@ -45103,8 +31348,8 @@ pub mod api { provide_judgement { #[codec(compact)] reg_index: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, judgement: runtime_types::pallet_identity::types::Judgement< @@ -45132,8 +31377,8 @@ pub mod api { #[doc = "- One event."] #[doc = "# "] kill_identity { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -45146,8 +31391,8 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] #[doc = "sub identity of `sub`."] add_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, data: runtime_types::pallet_identity::types::Data, @@ -45158,8 +31403,8 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] #[doc = "sub identity of `sub`."] rename_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, data: runtime_types::pallet_identity::types::Data, @@ -45173,8 +31418,8 @@ pub mod api { #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] #[doc = "sub identity of `sub`."] remove_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -45192,7 +31437,9 @@ pub mod api { quit_sub, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -45246,43 +31493,45 @@ pub mod api { NotOwned, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A name was set or reset (which will remove all judgements)."] IdentitySet { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 1)] #[doc = "A name was cleared, and the given balance returned."] IdentityCleared { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "A name was removed and the given balance slashed."] IdentityKilled { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "A judgement was asked from a registrar."] JudgementRequested { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, registrar_index: ::core::primitive::u32, }, #[codec(index = 4)] #[doc = "A judgement request was retracted."] JudgementUnrequested { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, registrar_index: ::core::primitive::u32, }, #[codec(index = 5)] #[doc = "A judgement was given by a registrar."] JudgementGiven { - target: ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_core::crypto::AccountId32, registrar_index: ::core::primitive::u32, }, #[codec(index = 6)] @@ -45293,23 +31542,23 @@ pub mod api { #[codec(index = 7)] #[doc = "A sub-identity was added to an identity and the deposit paid."] SubIdentityAdded { - sub: ::subxt::sp_core::crypto::AccountId32, - main: ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_core::crypto::AccountId32, + main: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 8)] #[doc = "A sub-identity was removed from an identity and the deposit freed."] SubIdentityRemoved { - sub: ::subxt::sp_core::crypto::AccountId32, - main: ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_core::crypto::AccountId32, + main: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, }, #[codec(index = 9)] #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] #[doc = "main identity account to the sub-identity account."] SubIdentityRevoked { - sub: ::subxt::sp_core::crypto::AccountId32, - main: ::subxt::sp_core::crypto::AccountId32, + sub: ::subxt::ext::sp_core::crypto::AccountId32, + main: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, }, } @@ -45317,9 +31566,9 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct BitFlags<_0>( @@ -45327,7 +31576,9 @@ pub mod api { #[codec(skip)] pub ::core::marker::PhantomData<_0>, ); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Data { #[codec(index = 0)] @@ -45408,7 +31659,9 @@ pub mod api { ShaThree256([::core::primitive::u8; 32usize]), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum IdentityField { #[codec(index = 1)] @@ -45429,7 +31682,9 @@ pub mod api { Twitter, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct IdentityInfo { pub additional: @@ -45448,7 +31703,9 @@ pub mod api { pub twitter: runtime_types::pallet_identity::types::Data, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Judgement<_0> { #[codec(index = 0)] @@ -45467,7 +31724,9 @@ pub mod api { Erroneous, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct RegistrarInfo<_0, _1> { pub account: _1, @@ -45477,7 +31736,9 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Registration<_0> { pub judgements: @@ -45495,13 +31756,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "# "] # [doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] # [doc = " length of `heartbeat.network_state.external_address`"] # [doc = " - `O(K)`: decoding of length `K`"] # [doc = " - `O(E)`: decoding/encoding of length `E`"] # [doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] # [doc = " `ReceivedHeartbeats`"] # [doc = "- DbWrites: `ReceivedHeartbeats`"] # [doc = "# "] heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < :: core :: primitive :: u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -45513,7 +31778,9 @@ pub mod api { DuplicatedHeartbeat, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -45530,9 +31797,9 @@ pub mod api { #[doc = "At the end of the session, at least one validator was found to be offline."] SomeOffline { offline: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, >, )>, @@ -45544,18 +31811,30 @@ pub mod api { pub mod app_sr25519 { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct BoundedOpaqueNetworkState { pub peer_id : runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > , pub external_addresses : runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > > , } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Heartbeat<_0> { pub block_number: _0, pub network_state: runtime_types::sp_core::offchain::OpaqueNetworkState, @@ -45569,7 +31848,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -45615,7 +31896,7 @@ pub mod api { #[doc = " - Writes: Indices Accounts, System Account (recipient)"] #[doc = "# "] transfer { - new: ::subxt::sp_core::crypto::AccountId32, + new: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, }, #[codec(index = 2)] @@ -45661,7 +31942,7 @@ pub mod api { #[doc = " - Writes: Indices Accounts, System Account (original owner)"] #[doc = "# "] force_transfer { - new: ::subxt::sp_core::crypto::AccountId32, + new: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, freeze: ::core::primitive::bool, }, @@ -45687,7 +31968,9 @@ pub mod api { freeze { index: ::core::primitive::u32 }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -45708,14 +31991,16 @@ pub mod api { Permanent, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A account index was assigned."] IndexAssigned { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, index: ::core::primitive::u32, }, #[codec(index = 1)] @@ -45725,7 +32010,7 @@ pub mod api { #[doc = "A account index has been frozen to its current account ID."] IndexFrozen { index: ::core::primitive::u32, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, } } @@ -45735,7 +32020,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -45744,14 +32031,14 @@ pub mod api { #[doc = ""] #[doc = "May only be called from `T::AddOrigin`."] add_member { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 1)] #[doc = "Remove a member `who` from the set."] #[doc = ""] #[doc = "May only be called from `T::RemoveOrigin`."] remove_member { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 2)] #[doc = "Swap out one member `remove` for another `add`."] @@ -45760,8 +32047,8 @@ pub mod api { #[doc = ""] #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] swap_member { - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, + remove: ::subxt::ext::sp_core::crypto::AccountId32, + add: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 3)] #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] @@ -45769,7 +32056,8 @@ pub mod api { #[doc = ""] #[doc = "May only be called from `T::ResetOrigin`."] reset_members { - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + members: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, }, #[codec(index = 4)] #[doc = "Swap out the sending member for some other key `new`."] @@ -45778,14 +32066,14 @@ pub mod api { #[doc = ""] #[doc = "Prime membership is passed from the origin account to `new`, if extant."] change_key { - new: ::subxt::sp_core::crypto::AccountId32, + new: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 5)] #[doc = "Set the prime member. Must be a current member."] #[doc = ""] #[doc = "May only be called from `T::PrimeOrigin`."] set_prime { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 6)] #[doc = "Remove the prime member if it exists."] @@ -45794,7 +32082,9 @@ pub mod api { clear_prime, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -45809,7 +32099,9 @@ pub mod api { TooManyMembers, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -45839,7 +32131,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -45862,7 +32156,7 @@ pub mod api { #[doc = "# "] as_multi_threshold_1 { other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, call: ::std::boxed::Box, }, #[codec(index = 1)] @@ -45914,13 +32208,13 @@ pub mod api { as_multi { threshold: ::core::primitive::u16, other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, >, - call: ::subxt::WrapperKeepOpaque< + call: ::subxt::utils::WrapperKeepOpaque< runtime_types::polkadot_runtime::Call, >, store_call: ::core::primitive::bool, @@ -45965,7 +32259,7 @@ pub mod api { approve_as_multi { threshold: ::core::primitive::u16, other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, @@ -46004,7 +32298,7 @@ pub mod api { cancel_as_multi { threshold: ::core::primitive::u16, other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, @@ -46012,7 +32306,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -46060,35 +32356,37 @@ pub mod api { AlreadyStored, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new multisig operation has begun."] NewMultisig { - approving: ::subxt::sp_core::crypto::AccountId32, - multisig: ::subxt::sp_core::crypto::AccountId32, + approving: ::subxt::ext::sp_core::crypto::AccountId32, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, call_hash: [::core::primitive::u8; 32usize], }, #[codec(index = 1)] #[doc = "A multisig operation has been approved by someone."] MultisigApproval { - approving: ::subxt::sp_core::crypto::AccountId32, + approving: ::subxt::ext::sp_core::crypto::AccountId32, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, - multisig: ::subxt::sp_core::crypto::AccountId32, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, call_hash: [::core::primitive::u8; 32usize], }, #[codec(index = 2)] #[doc = "A multisig operation has been executed."] MultisigExecuted { - approving: ::subxt::sp_core::crypto::AccountId32, + approving: ::subxt::ext::sp_core::crypto::AccountId32, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, - multisig: ::subxt::sp_core::crypto::AccountId32, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, call_hash: [::core::primitive::u8; 32usize], result: ::core::result::Result< (), @@ -46098,23 +32396,31 @@ pub mod api { #[codec(index = 3)] #[doc = "A multisig operation has been cancelled."] MultisigCancelled { - cancelling: ::subxt::sp_core::crypto::AccountId32, + cancelling: ::subxt::ext::sp_core::crypto::AccountId32, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, - multisig: ::subxt::sp_core::crypto::AccountId32, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, call_hash: [::core::primitive::u8; 32usize], }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Multisig<_0, _1, _2> { pub when: runtime_types::pallet_multisig::Timepoint<_0>, pub deposit: _1, pub depositor: _2, pub approvals: ::std::vec::Vec<_2>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Timepoint<_0> { pub height: _0, pub index: _0, @@ -46125,7 +32431,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Events type."] pub enum Event { @@ -46145,7 +32453,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -46159,21 +32469,23 @@ pub mod api { }, #[codec(index = 1)] #[doc = "Clear an unrequested preimage from the runtime storage."] - unnote_preimage { hash: ::subxt::sp_core::H256 }, + unnote_preimage { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 2)] #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - request_preimage { hash: ::subxt::sp_core::H256 }, + request_preimage { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 3)] #[doc = "Clear a previously made request for a preimage."] #[doc = ""] #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - unrequest_preimage { hash: ::subxt::sp_core::H256 }, + unrequest_preimage { hash: ::subxt::ext::sp_core::H256 }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -46197,22 +32509,28 @@ pub mod api { NotRequested, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A preimage has been noted."] - Noted { hash: ::subxt::sp_core::H256 }, + Noted { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 1)] #[doc = "A preimage has been requested."] - Requested { hash: ::subxt::sp_core::H256 }, + Requested { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 2)] #[doc = "A preimage has ben cleared."] - Cleared { hash: ::subxt::sp_core::H256 }, + Cleared { hash: ::subxt::ext::sp_core::H256 }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum RequestStatus<_0, _1> { #[codec(index = 0)] Unrequested(::core::option::Option<(_0, _1)>), @@ -46225,7 +32543,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -46246,7 +32566,7 @@ pub mod api { #[doc = "Weight is a function of the number of proxies the user has (P)."] #[doc = "# "] proxy { - real: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::ext::sp_core::crypto::AccountId32, force_proxy_type: ::core::option::Option< runtime_types::polkadot_runtime::ProxyType, >, @@ -46267,7 +32587,7 @@ pub mod api { #[doc = "Weight is a function of the number of proxies the user has (P)."] #[doc = "# "] add_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, @@ -46284,7 +32604,7 @@ pub mod api { #[doc = "Weight is a function of the number of proxies the user has (P)."] #[doc = "# "] remove_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, @@ -46351,7 +32671,7 @@ pub mod api { #[doc = "Weight is a function of the number of proxies the user has (P)."] #[doc = "# "] kill_anonymous { - spawner: ::subxt::sp_core::crypto::AccountId32, + spawner: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, index: ::core::primitive::u16, #[codec(compact)] @@ -46382,8 +32702,8 @@ pub mod api { #[doc = "- P: the number of proxies the user has."] #[doc = "# "] announce { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, + real: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 7)] #[doc = "Remove a given announcement."] @@ -46403,8 +32723,8 @@ pub mod api { #[doc = "- P: the number of proxies the user has."] #[doc = "# "] remove_announcement { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, + real: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 8)] #[doc = "Remove the given announcement of a delegate."] @@ -46424,8 +32744,8 @@ pub mod api { #[doc = "- P: the number of proxies the user has."] #[doc = "# "] reject_announcement { - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 9)] #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] @@ -46446,8 +32766,8 @@ pub mod api { #[doc = "- P: the number of proxies the user has."] #[doc = "# "] proxy_announced { - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, + delegate: ::subxt::ext::sp_core::crypto::AccountId32, + real: ::subxt::ext::sp_core::crypto::AccountId32, force_proxy_type: ::core::option::Option< runtime_types::polkadot_runtime::ProxyType, >, @@ -46455,7 +32775,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -46485,7 +32807,9 @@ pub mod api { NoSelfProxy, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -46501,43 +32825,51 @@ pub mod api { #[doc = "Anonymous account has been created by new proxy with given"] #[doc = "disambiguation index and proxy type."] AnonymousCreated { - anonymous: ::subxt::sp_core::crypto::AccountId32, - who: ::subxt::sp_core::crypto::AccountId32, + anonymous: ::subxt::ext::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, disambiguation_index: ::core::primitive::u16, }, #[codec(index = 2)] #[doc = "An announcement was placed to make a call in the future."] Announced { - real: ::subxt::sp_core::crypto::AccountId32, - proxy: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, + real: ::subxt::ext::sp_core::crypto::AccountId32, + proxy: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: ::subxt::ext::sp_core::H256, }, #[codec(index = 3)] #[doc = "A proxy was added."] ProxyAdded { - delegator: ::subxt::sp_core::crypto::AccountId32, - delegatee: ::subxt::sp_core::crypto::AccountId32, + delegator: ::subxt::ext::sp_core::crypto::AccountId32, + delegatee: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, #[codec(index = 4)] #[doc = "A proxy was removed."] ProxyRemoved { - delegator: ::subxt::sp_core::crypto::AccountId32, - delegatee: ::subxt::sp_core::crypto::AccountId32, + delegator: ::subxt::ext::sp_core::crypto::AccountId32, + delegatee: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Announcement<_0, _1, _2> { pub real: _0, pub call_hash: _1, pub height: _2, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ProxyDefinition<_0, _1, _2> { pub delegate: _0, pub proxy_type: _1, @@ -46549,7 +32881,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -46565,7 +32899,7 @@ pub mod api { call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, }, @@ -46588,7 +32922,7 @@ pub mod api { call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, }, @@ -46613,7 +32947,7 @@ pub mod api { call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, }, @@ -46634,13 +32968,15 @@ pub mod api { call: ::std::boxed::Box< runtime_types::frame_support::traits::schedule::MaybeHashed< runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -46658,7 +32994,9 @@ pub mod api { RescheduleNoChange, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Events type."] pub enum Event { @@ -46698,7 +33036,11 @@ pub mod api { }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ScheduledV3<_0, _1, _2, _3> { pub maybe_id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, @@ -46715,7 +33057,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -46758,7 +33102,9 @@ pub mod api { purge_keys, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Error for the session pallet."] pub enum Error { @@ -46779,7 +33125,9 @@ pub mod api { NoAccount, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -46799,7 +33147,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -46822,14 +33172,14 @@ pub mod api { #[doc = "------------------"] #[doc = "# "] bond { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, #[codec(compact)] value: ::core::primitive::u128, payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, }, #[codec(index = 1)] @@ -46918,8 +33268,8 @@ pub mod api { #[doc = "# "] nominate { targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, >, @@ -46956,7 +33306,7 @@ pub mod api { #[doc = "# "] set_payee { payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, }, #[codec(index = 8)] @@ -46977,8 +33327,8 @@ pub mod api { #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] #[doc = "# "] set_controller { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -47058,15 +33408,16 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin must be Root."] set_invulnerables { - invulnerables: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + invulnerables: ::std::vec::Vec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, }, #[codec(index = 15)] #[doc = "Force a current staker to become completely unstaked, immediately."] #[doc = ""] #[doc = "The dispatch origin must be Root."] force_unstake { - stash: ::subxt::sp_core::crypto::AccountId32, + stash: ::subxt::ext::sp_core::crypto::AccountId32, num_slashing_spans: ::core::primitive::u32, }, #[codec(index = 16)] @@ -47113,7 +33464,7 @@ pub mod api { #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] #[doc = "# "] payout_stakers { - validator_stash: ::subxt::sp_core::crypto::AccountId32, + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, era: ::core::primitive::u32, }, #[codec(index = 19)] @@ -47173,7 +33524,7 @@ pub mod api { #[doc = ""] #[doc = "Refunds the transaction fees upon successful execution."] reap_stash { - stash: ::subxt::sp_core::crypto::AccountId32, + stash: ::subxt::ext::sp_core::crypto::AccountId32, num_slashing_spans: ::core::primitive::u32, }, #[codec(index = 22)] @@ -47190,8 +33541,8 @@ pub mod api { #[doc = "block any further nominations."] kick { who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, >, @@ -47268,18 +33619,20 @@ pub mod api { #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] #[doc = "who do not satisfy these requirements."] chill_other { - controller: ::subxt::sp_core::crypto::AccountId32, + controller: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 25)] #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] #[doc = "can call this."] force_apply_min_commission { - validator_stash: ::subxt::sp_core::crypto::AccountId32, + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum ConfigOp<_0> { #[codec(index = 0)] @@ -47290,7 +33643,9 @@ pub mod api { Remove, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -47372,7 +33727,9 @@ pub mod api { CommissionTooLow, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -47388,14 +33745,14 @@ pub mod api { #[codec(index = 1)] #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] Rewarded( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, ), #[codec(index = 2)] #[doc = "One validator (and its nominators) has been slashed by the given amount."] #[doc = "\\[validator, amount\\]"] Slashed( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, ), #[codec(index = 3)] @@ -47411,27 +33768,27 @@ pub mod api { #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] #[doc = "it will not be emitted for staking rewards when they are added to stake."] Bonded( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, ), #[codec(index = 6)] #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] Unbonded( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, ), #[codec(index = 7)] #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] #[doc = "from the unlocking queue. \\[stash, amount\\]"] Withdrawn( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ::core::primitive::u128, ), #[codec(index = 8)] #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] Kicked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ), #[codec(index = 9)] #[doc = "The election failed. No new era is planned."] @@ -47439,17 +33796,17 @@ pub mod api { #[codec(index = 10)] #[doc = "An account has stopped participating as either a validator or nominator."] #[doc = "\\[stash\\]"] - Chilled(::subxt::sp_core::crypto::AccountId32), + Chilled(::subxt::ext::sp_core::crypto::AccountId32), #[codec(index = 11)] #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] PayoutStarted( ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, ), #[codec(index = 12)] #[doc = "A validator has set their preferences."] ValidatorPrefsSet( - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, runtime_types::pallet_staking::ValidatorPrefs, ), } @@ -47458,7 +33815,9 @@ pub mod api { pub mod slashing { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct SlashingSpans { pub span_index: ::core::primitive::u32, @@ -47467,24 +33826,38 @@ pub mod api { pub prior: ::std::vec::Vec<::core::primitive::u32>, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct SpanRecord<_0> { pub slashed: _0, pub paid_out: _0, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ActiveEraInfo { pub index: ::core::primitive::u32, pub start: ::core::option::Option<::core::primitive::u64>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct EraRewardPoints<_0> { pub total: ::core::primitive::u32, - pub individual: ::subxt::KeyedVec<_0, ::core::primitive::u32>, + pub individual: ::subxt::utils::KeyedVec<_0, ::core::primitive::u32>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Exposure<_0, _1> { #[codec(compact)] pub total: _1, @@ -47494,7 +33867,11 @@ pub mod api { runtime_types::pallet_staking::IndividualExposure<_0, _1>, >, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Forcing { #[codec(index = 0)] NotForcing, @@ -47505,21 +33882,33 @@ pub mod api { #[codec(index = 3)] ForceAlways, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct IndividualExposure<_0, _1> { pub who: _0, #[codec(compact)] pub value: _1, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Nominations { pub targets: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, pub submitted_in: ::core::primitive::u32, pub suppressed: ::core::primitive::bool, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Releases { #[codec(index = 0)] V1_0_0Ancient, @@ -47540,7 +33929,11 @@ pub mod api { #[codec(index = 8)] V9_0_0, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum RewardDestination<_0> { #[codec(index = 0)] Staked, @@ -47553,9 +33946,13 @@ pub mod api { #[codec(index = 4)] None, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct StakingLedger { - pub stash: ::subxt::sp_core::crypto::AccountId32, + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, #[codec(compact)] pub total: ::core::primitive::u128, #[codec(compact)] @@ -47568,7 +33965,11 @@ pub mod api { >, pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct UnappliedSlash<_0, _1> { pub validator: _0, pub own: _1, @@ -47576,14 +33977,22 @@ pub mod api { pub reporters: ::std::vec::Vec<_0>, pub payout: _1, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct UnlockChunk<_0> { #[codec(compact)] pub value: _0, #[codec(compact)] pub era: ::core::primitive::u32, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ValidatorPrefs { #[codec(compact)] pub commission: runtime_types::sp_arithmetic::per_things::Perbill, @@ -47595,7 +34004,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -47628,7 +34039,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -47654,7 +34067,7 @@ pub mod api { #[doc = "# "] report_awesome { reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 1)] #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] @@ -47676,7 +34089,7 @@ pub mod api { #[doc = "- DbReads: `Tips`, `origin account`"] #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] #[doc = "# "] - retract_tip { hash: ::subxt::sp_core::H256 }, + retract_tip { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 2)] #[doc = "Give a tip for something new; no finder's fee will be taken."] #[doc = ""] @@ -47702,7 +34115,7 @@ pub mod api { #[doc = "# "] tip_new { reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, #[codec(compact)] tip_value: ::core::primitive::u128, }, @@ -47732,7 +34145,7 @@ pub mod api { #[doc = "- DbWrites: `Tips`"] #[doc = "# "] tip { - hash: ::subxt::sp_core::H256, + hash: ::subxt::ext::sp_core::H256, #[codec(compact)] tip_value: ::core::primitive::u128, }, @@ -47753,7 +34166,7 @@ pub mod api { #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] #[doc = "# "] - close_tip { hash: ::subxt::sp_core::H256 }, + close_tip { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 5)] #[doc = "Remove and slash an already-open tip."] #[doc = ""] @@ -47767,10 +34180,12 @@ pub mod api { #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] #[doc = " The actual cost depends on the implementation of `T::Tippers`."] #[doc = "# "] - slash_tip { hash: ::subxt::sp_core::H256 }, + slash_tip { hash: ::subxt::ext::sp_core::H256 }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -47794,36 +34209,48 @@ pub mod api { Premature, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new tip suggestion has been opened."] - NewTip { tip_hash: ::subxt::sp_core::H256 }, + NewTip { + tip_hash: ::subxt::ext::sp_core::H256, + }, #[codec(index = 1)] #[doc = "A tip suggestion has reached threshold and is closing."] - TipClosing { tip_hash: ::subxt::sp_core::H256 }, + TipClosing { + tip_hash: ::subxt::ext::sp_core::H256, + }, #[codec(index = 2)] #[doc = "A tip suggestion has been closed."] TipClosed { - tip_hash: ::subxt::sp_core::H256, - who: ::subxt::sp_core::crypto::AccountId32, + tip_hash: ::subxt::ext::sp_core::H256, + who: ::subxt::ext::sp_core::crypto::AccountId32, payout: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "A tip suggestion has been retracted."] - TipRetracted { tip_hash: ::subxt::sp_core::H256 }, + TipRetracted { + tip_hash: ::subxt::ext::sp_core::H256, + }, #[codec(index = 4)] #[doc = "A tip suggestion has been slashed."] TipSlashed { - tip_hash: ::subxt::sp_core::H256, - finder: ::subxt::sp_core::crypto::AccountId32, + tip_hash: ::subxt::ext::sp_core::H256, + finder: ::subxt::ext::sp_core::crypto::AccountId32, deposit: ::core::primitive::u128, }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct OpenTip<_0, _1, _2, _3> { pub reason: _3, pub who: _0, @@ -47836,28 +34263,19 @@ pub mod api { } pub mod pallet_transaction_payment { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, - )] - #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] - pub enum Event { - #[codec(index = 0)] - #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] - #[doc = "has been paid by `who`."] - TransactionFeePaid { - who: ::subxt::sp_core::crypto::AccountId32, - actual_fee: ::core::primitive::u128, - tip: ::core::primitive::u128, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ChargeTransactionPayment( #[codec(compact)] pub ::core::primitive::u128, ); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Releases { #[codec(index = 0)] V1Ancient, @@ -47870,7 +34288,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -47887,8 +34307,8 @@ pub mod api { propose_spend { #[codec(compact)] value: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -47933,8 +34353,8 @@ pub mod api { spend { #[codec(compact)] amount: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -47960,7 +34380,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Error for the treasury pallet."] pub enum Error { @@ -47982,7 +34404,9 @@ pub mod api { ProposalNotApproved, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -48001,7 +34425,7 @@ pub mod api { Awarded { proposal_index: ::core::primitive::u32, award: ::core::primitive::u128, - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 3)] #[doc = "A proposal was rejected; funds were slashed."] @@ -48027,11 +34451,15 @@ pub mod api { SpendApproved { proposal_index: ::core::primitive::u32, amount: ::core::primitive::u128, - beneficiary: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, }, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Proposal<_0, _1> { pub proposer: _0, pub value: _1, @@ -48044,7 +34472,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -48144,7 +34574,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -48153,7 +34585,9 @@ pub mod api { TooManyCalls, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -48194,7 +34628,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -48230,8 +34666,8 @@ pub mod api { #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] #[doc = "# "] vest_other { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, }, @@ -48254,8 +34690,8 @@ pub mod api { #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] #[doc = "# "] vested_transfer { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, schedule: @@ -48284,12 +34720,12 @@ pub mod api { #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] #[doc = "# "] force_vested_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, (), >, schedule: @@ -48326,7 +34762,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Error for the vesting pallet."] pub enum Error { @@ -48348,7 +34786,9 @@ pub mod api { InvalidScheduleParams, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -48356,20 +34796,22 @@ pub mod api { #[doc = "The amount vested has been updated. This could indicate a change in funds available."] #[doc = "The balance given is the amount which is left unvested (and thus locked)."] VestingUpdated { - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, unvested: ::core::primitive::u128, }, #[codec(index = 1)] #[doc = "An \\[account\\] has become fully vested."] VestingCompleted { - account: ::subxt::sp_core::crypto::AccountId32, + account: ::subxt::ext::sp_core::crypto::AccountId32, }, } } pub mod vesting_info { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct VestingInfo<_0, _1> { pub locked: _0, @@ -48377,7 +34819,11 @@ pub mod api { pub starting_block: _1, } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Releases { #[codec(index = 0)] V0, @@ -48390,7 +34836,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -48568,7 +35016,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -48616,7 +35066,9 @@ pub mod api { AlreadySubscribed, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -48734,7 +35186,7 @@ pub mod api { #[doc = ""] #[doc = "\\[ hash, origin, assets \\]"] AssetsTrapped( - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, runtime_types::xcm::v1::multilocation::MultiLocation, runtime_types::xcm::VersionedMultiAssets, ), @@ -48776,7 +35228,9 @@ pub mod api { ), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Origin { #[codec(index = 0)] @@ -48785,7 +35239,9 @@ pub mod api { Response(runtime_types::xcm::v1::multilocation::MultiLocation), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum QueryStatus<_0> { #[codec(index = 0)] @@ -48809,7 +35265,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum VersionMigrationStage { #[codec(index = 0)] @@ -48827,19 +35285,35 @@ pub mod api { } pub mod polkadot_core_primitives { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CandidateHash(pub ::subxt::sp_core::H256); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct CandidateHash(pub ::subxt::ext::sp_core::H256); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct InboundDownwardMessage<_0> { pub sent_at: _0, pub msg: ::std::vec::Vec<::core::primitive::u8>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct InboundHrmpMessage<_0> { pub sent_at: _0, pub data: ::std::vec::Vec<::core::primitive::u8>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct OutboundHrmpMessage<_0> { pub recipient: _0, pub data: ::std::vec::Vec<::core::primitive::u8>, @@ -48850,31 +35324,39 @@ pub mod api { pub mod primitives { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct HeadData(pub ::std::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct HrmpChannelId { pub sender: runtime_types::polkadot_parachain::primitives::Id, pub recipient: runtime_types::polkadot_parachain::primitives::Id, } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Id(pub ::core::primitive::u32); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ValidationCode(pub ::std::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] - pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); + pub struct ValidationCodeHash(pub ::subxt::ext::sp_core::H256); } } pub mod polkadot_primitives { @@ -48884,50 +35366,66 @@ pub mod api { pub mod assignment_app { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } pub mod collator_app { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } pub mod signed { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > } } pub mod validator_app { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct AvailabilityBitfield( - pub ::subxt::bitvec::vec::BitVec< + pub ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, ); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct BackedCandidate<_0> { pub candidate: @@ -48937,13 +35435,15 @@ pub mod api { pub validity_votes: ::std::vec::Vec< runtime_types::polkadot_primitives::v2::ValidityAttestation, >, - pub validator_indices: ::subxt::bitvec::vec::BitVec< + pub validator_indices: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CandidateCommitments<_0> { pub upward_messages: @@ -48962,7 +35462,9 @@ pub mod api { pub hrmp_watermark: _0, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CandidateDescriptor<_0> { pub para_id: runtime_types::polkadot_parachain::primitives::Id, @@ -48979,7 +35481,9 @@ pub mod api { runtime_types::polkadot_parachain::primitives::ValidationCodeHash, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CandidateReceipt<_0> { pub descriptor: @@ -48987,7 +35491,9 @@ pub mod api { pub commitments_hash: _0, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CommittedCandidateReceipt<_0> { pub descriptor: @@ -48998,14 +35504,16 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct CoreIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum CoreOccupied { #[codec(index = 0)] @@ -49014,27 +35522,33 @@ pub mod api { Parachain, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct DisputeState<_0> { - pub validators_for: ::subxt::bitvec::vec::BitVec< + pub validators_for: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, - pub validators_against: ::subxt::bitvec::vec::BitVec< + pub validators_against: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, pub start: _0, pub concluded_at: ::core::option::Option<_0>, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum DisputeStatement { # [codec (index = 0)] Valid (runtime_types :: polkadot_primitives :: v2 :: ValidDisputeStatementKind ,) , # [codec (index = 1)] Invalid (runtime_types :: polkadot_primitives :: v2 :: InvalidDisputeStatementKind ,) , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct DisputeStatementSet { pub candidate_hash: @@ -49047,14 +35561,16 @@ pub mod api { )>, } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct GroupIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct InherentData<_0> { pub bitfields: ::std::vec::Vec< @@ -49065,7 +35581,7 @@ pub mod api { >, pub backed_candidates: ::std::vec::Vec< runtime_types::polkadot_primitives::v2::BackedCandidate< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, >, pub disputes: ::std::vec::Vec< @@ -49074,28 +35590,36 @@ pub mod api { pub parent_header: _0, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum InvalidDisputeStatementKind { #[codec(index = 0)] Explicit, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ParathreadClaim( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_primitives::v2::collator_app::Public, ); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ParathreadEntry { pub claim: runtime_types::polkadot_primitives::v2::ParathreadClaim, pub retries: ::core::primitive::u32, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct PvfCheckStatement { pub accept: ::core::primitive::bool, @@ -49106,7 +35630,9 @@ pub mod api { runtime_types::polkadot_primitives::v2::ValidatorIndex, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ScrapedOnChainVotes<_0> { pub session: ::core::primitive::u32, @@ -49122,7 +35648,9 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct SessionInfo { pub active_validator_indices: ::std::vec::Vec< @@ -49152,7 +35680,9 @@ pub mod api { pub needed_approvals: ::core::primitive::u32, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum UpgradeGoAhead { #[codec(index = 0)] @@ -49161,34 +35691,40 @@ pub mod api { GoAhead, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum UpgradeRestriction { #[codec(index = 0)] Present, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum ValidDisputeStatementKind { #[codec(index = 0)] Explicit, #[codec(index = 1)] - BackingSeconded(::subxt::sp_core::H256), + BackingSeconded(::subxt::ext::sp_core::H256), #[codec(index = 2)] - BackingValid(::subxt::sp_core::H256), + BackingValid(::subxt::ext::sp_core::H256), #[codec(index = 3)] ApprovalChecking, } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct ValidatorIndex(pub ::core::primitive::u32); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum ValidityAttestation { #[codec(index = 1)] @@ -49204,13 +35740,25 @@ pub mod api { } pub mod polkadot_runtime { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Call { # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Call ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Call ,) , # [codec (index = 2)] Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , # [codec (index = 3)] Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , # [codec (index = 6)] Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Call ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Call ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Call ,) , # [codec (index = 51)] Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , # [codec (index = 52)] ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , # [codec (index = 54)] ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , # [codec (index = 57)] Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , # [codec (index = 58)] Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Call ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Call ,) , } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Event { - # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 32)] TransactionPayment (runtime_types :: pallet_transaction_payment :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Event ,) , } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Event ,) , } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct NposCompactSolution16 { pub votes1: ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u16)>, @@ -49335,24 +35883,28 @@ pub mod api { ::core::primitive::u16, )>, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum OriginCaller { #[codec(index = 0)] system( runtime_types::frame_support::dispatch::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, ), #[codec(index = 15)] Council( runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, ), #[codec(index = 16)] TechnicalCommittee( runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, >, ), #[codec(index = 50)] @@ -49364,7 +35916,11 @@ pub mod api { #[codec(index = 5)] Void(runtime_types::sp_core::Void), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum ProxyType { #[codec(index = 0)] Any, @@ -49381,9 +35937,17 @@ pub mod api { #[codec(index = 7)] Auction, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Runtime; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct SessionKeys { pub grandpa: runtime_types::sp_finality_grandpa::app::Public, pub babe: runtime_types::sp_consensus_babe::app::Public, @@ -49404,7 +35968,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -49456,7 +36022,9 @@ pub mod api { cancel_auction, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -49483,7 +36051,9 @@ pub mod api { AlreadyLeasedOut, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -49504,14 +36074,14 @@ pub mod api { #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] #[doc = "Second is the total."] Reserved { - bidder: ::subxt::sp_core::crypto::AccountId32, + bidder: ::subxt::ext::sp_core::crypto::AccountId32, extra_reserved: ::core::primitive::u128, total_amount: ::core::primitive::u128, }, #[codec(index = 3)] #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] Unreserved { - bidder: ::subxt::sp_core::crypto::AccountId32, + bidder: ::subxt::ext::sp_core::crypto::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 4)] @@ -49519,13 +36089,13 @@ pub mod api { #[doc = "but no parachain slot has been leased."] ReserveConfiscated { para_id: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, + leaser: ::subxt::ext::sp_core::crypto::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 5)] #[doc = "A new bid has been accepted as the current winner."] BidAccepted { - bidder: ::subxt::sp_core::crypto::AccountId32, + bidder: ::subxt::ext::sp_core::crypto::AccountId32, para_id: runtime_types::polkadot_parachain::primitives::Id, amount: ::core::primitive::u128, first_slot: ::core::primitive::u32, @@ -49545,13 +36115,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { - # [codec (index = 0)] # [doc = "Make a claim to collect your DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to claim is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)"] # [doc = ""] # [doc = "and `address` matches the `dest` account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , # [codec (index = 1)] # [doc = "Mint a new claim to collect DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _Root_."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `who`: The Ethereum address allowed to collect this claim."] # [doc = "- `value`: The number of DOTs that will be claimed."] # [doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "We assume worst case that both vesting and statement is being inserted."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : :: core :: primitive :: u128 , vesting_schedule : :: core :: option :: Option < (:: core :: primitive :: u128 , :: core :: primitive :: u128 , :: core :: primitive :: u32 ,) > , statement : :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , # [codec (index = 2)] # [doc = "Make a claim to collect your DOTs by signing a statement."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)(statement)"] # [doc = ""] # [doc = "and `address` matches the `dest` account; the `statement` must match that which is"] # [doc = "expected according to your purchase arrangement."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim_attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 3)] # [doc = "Attest to a statement, needed to finalize the claims process."] # [doc = ""] # [doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] # [doc = "and provides a `statement` which is expected for the account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to do pre-validation on `attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] attest { statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : :: core :: option :: Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } + # [codec (index = 0)] # [doc = "Make a claim to collect your DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to claim is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)"] # [doc = ""] # [doc = "and `address` matches the `dest` account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim { dest : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , # [codec (index = 1)] # [doc = "Mint a new claim to collect DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _Root_."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `who`: The Ethereum address allowed to collect this claim."] # [doc = "- `value`: The number of DOTs that will be claimed."] # [doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "We assume worst case that both vesting and statement is being inserted."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : :: core :: primitive :: u128 , vesting_schedule : :: core :: option :: Option < (:: core :: primitive :: u128 , :: core :: primitive :: u128 , :: core :: primitive :: u32 ,) > , statement : :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , # [codec (index = 2)] # [doc = "Make a claim to collect your DOTs by signing a statement."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)(statement)"] # [doc = ""] # [doc = "and `address` matches the `dest` account; the `statement` must match that which is"] # [doc = "expected according to your purchase arrangement."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim_attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim_attest { dest : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 3)] # [doc = "Attest to a statement, needed to finalize the claims process."] # [doc = ""] # [doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] # [doc = "and provides a `statement` which is expected for the account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to do pre-validation on `attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] attest { statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : :: core :: option :: Option < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > , } , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -49576,26 +36150,36 @@ pub mod api { VestedBalanceExists, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { - # [codec (index = 0)] # [doc = "Someone claimed some DOTs."] Claimed { who : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_address : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , amount : :: core :: primitive :: u128 , } , } + # [codec (index = 0)] # [doc = "Someone claimed some DOTs."] Claimed { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , ethereum_address : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , amount : :: core :: primitive :: u128 , } , } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct EcdsaSignature(pub [::core::primitive::u8; 65usize]); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct EthereumAddress(pub [::core::primitive::u8; 20usize]); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct PrevalidateAttests; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum StatementKind { #[codec(index = 0)] @@ -49609,7 +36193,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -49664,7 +36250,7 @@ pub mod api { #[doc = "- `who`: The account whose contribution should be withdrawn."] #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] withdraw { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, #[codec(compact)] index: runtime_types::polkadot_parachain::primitives::Id, }, @@ -49730,7 +36316,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -49805,7 +36393,9 @@ pub mod api { NoLeasePeriod, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -49817,14 +36407,14 @@ pub mod api { #[codec(index = 1)] #[doc = "Contributed to a crowd sale."] Contributed { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, fund_index: runtime_types::polkadot_parachain::primitives::Id, amount: ::core::primitive::u128, }, #[codec(index = 2)] #[doc = "Withdrew full balance of a contributor."] Withdrew { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, fund_index: runtime_types::polkadot_parachain::primitives::Id, amount: ::core::primitive::u128, }, @@ -49861,7 +36451,7 @@ pub mod api { #[codec(index = 8)] #[doc = "A memo has been updated."] MemoUpdated { - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, para_id: runtime_types::polkadot_parachain::primitives::Id, memo: ::std::vec::Vec<::core::primitive::u8>, }, @@ -49873,11 +36463,15 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : :: core :: option :: Option < runtime_types :: sp_runtime :: MultiSigner > , pub deposit : _1 , pub raised : _1 , pub end : _2 , pub cap : _1 , pub last_contribution : runtime_types :: polkadot_runtime_common :: crowdloan :: LastContribution < _2 > , pub first_period : _2 , pub last_period : _2 , pub fund_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum LastContribution<_0> { #[codec(index = 0)] @@ -49893,13 +36487,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { - # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin."] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , } + # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin."] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -49948,14 +36546,16 @@ pub mod api { CannotSwap, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] Registered { para_id: runtime_types::polkadot_parachain::primitives::Id, - manager: ::subxt::sp_core::crypto::AccountId32, + manager: ::subxt::ext::sp_core::crypto::AccountId32, }, #[codec(index = 1)] Deregistered { @@ -49964,12 +36564,14 @@ pub mod api { #[codec(index = 2)] Reserved { para_id: runtime_types::polkadot_parachain::primitives::Id, - who: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::ext::sp_core::crypto::AccountId32, }, } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ParaInfo<_0, _1> { pub manager: _0, @@ -49982,7 +36584,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -49993,7 +36597,7 @@ pub mod api { #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] force_lease { para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, + leaser: ::subxt::ext::sp_core::crypto::AccountId32, amount: ::core::primitive::u128, period_begin: ::core::primitive::u32, period_count: ::core::primitive::u32, @@ -50018,7 +36622,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50030,7 +36636,9 @@ pub mod api { LeaseError, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -50045,7 +36653,7 @@ pub mod api { #[doc = "Second balance is the total amount reserved."] Leased { para_id: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, + leaser: ::subxt::ext::sp_core::crypto::AccountId32, period_begin: ::core::primitive::u32, period_count: ::core::primitive::u32, extra_reserved: ::core::primitive::u128, @@ -50062,7 +36670,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -50231,7 +36841,9 @@ pub mod api { set_bypass_consistency_check { new: ::core::primitive::bool }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50241,7 +36853,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct HostConfiguration<_0> { pub max_code_size: _0, @@ -50294,7 +36908,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -50302,7 +36918,9 @@ pub mod api { force_unfreeze, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50329,14 +36947,18 @@ pub mod api { SingleSidedDispute, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] DisputeInitiated (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeLocation ,) , # [codec (index = 1)] # [doc = "A dispute has concluded for or against a candidate."] # [doc = "`\\[para id, candidate hash, dispute result\\]`"] DisputeConcluded (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeResult ,) , # [codec (index = 2)] # [doc = "A dispute has timed out due to insufficient participation."] # [doc = "`\\[para id, candidate hash\\]`"] DisputeTimedOut (runtime_types :: polkadot_core_primitives :: CandidateHash ,) , # [codec (index = 3)] # [doc = "A dispute has concluded with supermajority against a candidate."] # [doc = "Block authors should no longer build on top of this head and should"] # [doc = "instead revert the block at the given height. This should be the"] # [doc = "number of the child of the last known valid block in the chain."] Revert (:: core :: primitive :: u32 ,) , } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum DisputeLocation { #[codec(index = 0)] @@ -50345,7 +36967,9 @@ pub mod api { Remote, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum DisputeResult { #[codec(index = 0)] @@ -50359,7 +36983,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call {} @@ -50370,13 +36996,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] # [doc = "a para may have. Normally this happens once per session, but this allows"] # [doc = "you to trigger the cleanup immediately for a specific parachain."] # [doc = ""] # [doc = "Origin must be Root."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data of weighing."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data of weighing."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50439,7 +37069,9 @@ pub mod api { WrongWitness, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -50474,7 +37106,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct HrmpChannel { pub max_capacity: ::core::primitive::u32, @@ -50482,12 +37116,14 @@ pub mod api { pub max_message_size: ::core::primitive::u32, pub msg_count: ::core::primitive::u32, pub total_size: ::core::primitive::u32, - pub mqc_head: ::core::option::Option<::subxt::sp_core::H256>, + pub mqc_head: ::core::option::Option<::subxt::ext::sp_core::H256>, pub sender_deposit: ::core::primitive::u128, pub recipient_deposit: ::core::primitive::u128, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct HrmpOpenChannelRequest { pub confirmed: ::core::primitive::bool, @@ -50503,12 +37139,16 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call {} #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50604,7 +37244,9 @@ pub mod api { BitfieldReferencesFreedCore, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -50612,7 +37254,7 @@ pub mod api { #[doc = "A candidate was backed. `[candidate, head_data]`"] CandidateBacked( runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, runtime_types::polkadot_parachain::primitives::HeadData, runtime_types::polkadot_primitives::v2::CoreIndex, @@ -50622,7 +37264,7 @@ pub mod api { #[doc = "A candidate was included. `[candidate, head_data]`"] CandidateIncluded( runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, runtime_types::polkadot_parachain::primitives::HeadData, runtime_types::polkadot_primitives::v2::CoreIndex, @@ -50632,7 +37274,7 @@ pub mod api { #[doc = "A candidate timed out. `[candidate, head_data]`"] CandidateTimedOut( runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, + ::subxt::ext::sp_core::H256, >, runtime_types::polkadot_parachain::primitives::HeadData, runtime_types::polkadot_primitives::v2::CoreIndex, @@ -50640,7 +37282,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct AvailabilityBitfieldRecord<_0> { pub bitfield: @@ -50648,20 +37292,22 @@ pub mod api { pub submitted_at: _0, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CandidatePendingAvailability<_0, _1> { pub core: runtime_types::polkadot_primitives::v2::CoreIndex, pub hash: runtime_types::polkadot_core_primitives::CandidateHash, pub descriptor: runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub availability_votes: ::subxt::bitvec::vec::BitVec< + pub availability_votes: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, - pub backers: ::subxt::bitvec::vec::BitVec< + pub backers: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, pub relay_parent_number: _1, pub backed_in_number: _1, @@ -50673,7 +37319,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -50685,7 +37333,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct BufferedSessionChange { pub validators: ::std::vec::Vec< @@ -50702,7 +37352,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Origin { #[codec(index = 0)] @@ -50715,13 +37367,17 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Set the storage for the parachain validation code immediately."] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Set the storage for the current parachain head data immediately."] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] # [doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Note a new block head for para within the context of the current block."] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] # [doc = "Put a parachain directly into the next session's action queue."] # [doc = "We can't queue it any sooner than this without going into the"] # [doc = "initializer..."] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Adds the validation code to the storage."] # [doc = ""] # [doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] # [doc = "is running for that code, it will be instantly accepted."] # [doc = ""] # [doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] # [doc = "into storage with reference count 0. This is to account the fact that there are no users"] # [doc = "for this code yet. The caller will have to make sure that this code eventually gets"] # [doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] # [doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] # [doc = ""] # [doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] # [doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 6)] # [doc = "Remove the validation code from the storage iff the reference count is 0."] # [doc = ""] # [doc = "This is better than removing the storage directly, because it will not remove the code"] # [doc = "that was suddenly got used by some parachain while this dispatchable was pending"] # [doc = "dispatching."] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] # [doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] # [doc = "enacts the results if that was the last vote before achieving the supermajority."] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v2 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , } , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50764,14 +37420,18 @@ pub mod api { PvfCheckDisabled, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "Current code has been updated for a Para. `para_id`"] CurrentCodeUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 1)] # [doc = "Current head has been updated for a Para. `para_id`"] CurrentHeadUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 2)] # [doc = "A code upgrade has been scheduled for a Para. `para_id`"] CodeUpgradeScheduled (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 3)] # [doc = "A new head has been noted for a Para. `para_id`"] NewHeadNoted (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 4)] # [doc = "A para has been queued to execute pending actions. `para_id`"] ActionQueued (runtime_types :: polkadot_parachain :: primitives :: Id , :: core :: primitive :: u32 ,) , # [codec (index = 5)] # [doc = "The given para either initiated or subscribed to a PVF check for the given validation"] # [doc = "code. `code_hash` `para_id`"] PvfCheckStarted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 6)] # [doc = "The given validation code was accepted by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckAccepted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 7)] # [doc = "The given validation code was rejected by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckRejected (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ParaGenesisArgs { pub genesis_head: @@ -50781,7 +37441,9 @@ pub mod api { pub parachain: ::core::primitive::bool, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum ParaLifecycle { #[codec(index = 0)] @@ -50800,20 +37462,24 @@ pub mod api { OffboardingParachain, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ParaPastCodeMeta < _0 > { pub upgrade_times : :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: paras :: ReplacementTimes < _0 > > , pub last_pruned : :: core :: option :: Option < _0 > , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct PvfCheckActiveVoteState<_0> { - pub votes_accept: ::subxt::bitvec::vec::BitVec< + pub votes_accept: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, - pub votes_reject: ::subxt::bitvec::vec::BitVec< + pub votes_reject: ::subxt::ext::bitvec::vec::BitVec< ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, + ::subxt::ext::bitvec::order::Lsb0, >, pub age: _0, pub created_at: _0, @@ -50824,7 +37490,9 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum PvfCheckCause<_0> { #[codec(index = 0)] @@ -50836,7 +37504,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ReplacementTimes<_0> { pub expected_at: _0, @@ -50848,7 +37518,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -50864,7 +37536,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50893,7 +37567,9 @@ pub mod api { pub mod scheduler { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum AssignmentKind { #[codec(index = 0)] @@ -50905,15 +37581,21 @@ pub mod api { ), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v2 :: CoreIndex , pub para_id : runtime_types :: polkadot_parachain :: primitives :: Id , pub kind : runtime_types :: polkadot_runtime_parachains :: scheduler :: AssignmentKind , pub group_idx : runtime_types :: polkadot_primitives :: v2 :: GroupIndex , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct ParathreadClaimQueue { pub queue : :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: QueuedParathread > , pub next_core_offset : :: core :: primitive :: u32 , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct QueuedParathread { pub claim: runtime_types::polkadot_primitives::v2::ParathreadEntry, @@ -50925,7 +37607,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call {} @@ -50936,7 +37620,9 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { @@ -50959,7 +37645,9 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { @@ -50971,7 +37659,9 @@ pub mod api { WeightOverLimit, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { @@ -51034,7 +37724,11 @@ pub mod api { } pub mod primitive_types { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct H256(pub [::core::primitive::u8; 32usize]); } pub mod sp_arithmetic { @@ -51042,9 +37736,9 @@ pub mod api { pub mod fixed_point { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct FixedU128(pub ::core::primitive::u128); @@ -51052,30 +37746,30 @@ pub mod api { pub mod per_things { use super::runtime_types; #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct PerU16(pub ::core::primitive::u16); #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Perbill(pub ::core::primitive::u32); #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Percent(pub ::core::primitive::u8); #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Permill(pub ::core::primitive::u32); @@ -51086,7 +37780,9 @@ pub mod api { pub mod app { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } @@ -51096,14 +37792,18 @@ pub mod api { pub mod app { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } pub mod digests { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum NextConfigDescriptor { #[codec(index = 1)] @@ -51113,12 +37813,16 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum PreDigest { # [codec (index = 1)] Primary (runtime_types :: sp_consensus_babe :: digests :: PrimaryPreDigest ,) , # [codec (index = 2)] SecondaryPlain (runtime_types :: sp_consensus_babe :: digests :: SecondaryPlainPreDigest ,) , # [codec (index = 3)] SecondaryVRF (runtime_types :: sp_consensus_babe :: digests :: SecondaryVRFPreDigest ,) , } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct PrimaryPreDigest { pub authority_index: ::core::primitive::u32, @@ -51127,14 +37831,18 @@ pub mod api { pub vrf_proof: [::core::primitive::u8; 64usize], } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct SecondaryPlainPreDigest { pub authority_index: ::core::primitive::u32, pub slot: runtime_types::sp_consensus_slots::Slot, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct SecondaryVRFPreDigest { pub authority_index: ::core::primitive::u32, @@ -51143,7 +37851,11 @@ pub mod api { pub vrf_proof: [::core::primitive::u8; 64usize], } } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum AllowedSlots { #[codec(index = 0)] PrimarySlots, @@ -51152,7 +37864,11 @@ pub mod api { #[codec(index = 2)] PrimaryAndSecondaryVRFSlots, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct BabeEpochConfiguration { pub c: (::core::primitive::u64, ::core::primitive::u64), pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, @@ -51160,7 +37876,11 @@ pub mod api { } pub mod sp_consensus_slots { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct EquivocationProof<_0, _1> { pub offender: _1, pub slot: runtime_types::sp_consensus_slots::Slot, @@ -51168,9 +37888,9 @@ pub mod api { pub second_header: _0, } #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Slot(pub ::core::primitive::u64); @@ -51180,44 +37900,60 @@ pub mod api { pub mod crypto { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct AccountId32(pub [::core::primitive::u8; 32usize]); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); } pub mod ecdsa { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub [::core::primitive::u8; 33usize]); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub [::core::primitive::u8; 65usize]); } pub mod ed25519 { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub [::core::primitive::u8; 32usize]); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub [::core::primitive::u8; 64usize]); } pub mod offchain { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct OpaqueNetworkState { pub peer_id: runtime_types::sp_core::OpaquePeerId, @@ -51229,17 +37965,29 @@ pub mod api { pub mod sr25519 { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub [::core::primitive::u8; 32usize]); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub [::core::primitive::u8; 64usize]); } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Void {} } pub mod sp_finality_grandpa { @@ -51247,15 +37995,23 @@ pub mod api { pub mod app { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Public(pub runtime_types::sp_core::ed25519::Public); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum Equivocation<_0, _1> { #[codec(index = 0)] Prevote( @@ -51274,7 +38030,11 @@ pub mod api { >, ), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct EquivocationProof<_0, _1> { pub set_id: ::core::primitive::u64, pub equivocation: @@ -51283,13 +38043,21 @@ pub mod api { } pub mod sp_npos_elections { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ElectionScore { pub minimal_stake: ::core::primitive::u128, pub sum_stake: ::core::primitive::u128, pub sum_stake_squared: ::core::primitive::u128, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Support<_0> { pub total: ::core::primitive::u128, pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, @@ -51302,21 +38070,29 @@ pub mod api { pub mod bounded_btree_map { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] - pub struct BoundedBTreeMap<_0, _1>(pub ::subxt::KeyedVec<_0, _1>); + pub struct BoundedBTreeMap<_0, _1>( + pub ::subxt::utils::KeyedVec<_0, _1>, + ); } pub mod bounded_vec { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct BoundedVec<_0>(pub ::std::vec::Vec<_0>); } pub mod weak_bounded_vec { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); } @@ -51326,7 +38102,9 @@ pub mod api { pub mod digest { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Digest { pub logs: ::std::vec::Vec< @@ -51334,7 +38112,9 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum DigestItem { #[codec(index = 6)] @@ -51361,7 +38141,9 @@ pub mod api { pub mod era { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Era { #[codec(index = 0)] @@ -51881,14 +38663,16 @@ pub mod api { pub mod header { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Header<_0, _1> { - pub parent_hash: ::subxt::sp_core::H256, + pub parent_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub number: _0, - pub state_root: ::subxt::sp_core::H256, - pub extrinsics_root: ::subxt::sp_core::H256, + pub state_root: ::subxt::ext::sp_core::H256, + pub extrinsics_root: ::subxt::ext::sp_core::H256, pub digest: runtime_types::sp_runtime::generic::digest::Digest, #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, @@ -51897,7 +38681,9 @@ pub mod api { pub mod unchecked_extrinsic { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct UncheckedExtrinsic<_0, _1, _2, _3>( pub ::std::vec::Vec<::core::primitive::u8>, @@ -51908,7 +38694,9 @@ pub mod api { pub mod multiaddress { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum MultiAddress<_0, _1> { #[codec(index = 0)] @@ -51926,11 +38714,17 @@ pub mod api { pub mod traits { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct BlakeTwo256; } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum ArithmeticError { #[codec(index = 0)] Underflow, @@ -51939,7 +38733,11 @@ pub mod api { #[codec(index = 2)] DivisionByZero, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum DispatchError { #[codec(index = 0)] Other, @@ -51962,12 +38760,20 @@ pub mod api { #[codec(index = 9)] Transactional(runtime_types::sp_runtime::TransactionalError), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct ModuleError { pub index: ::core::primitive::u8, pub error: [::core::primitive::u8; 4usize], } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum MultiSignature { #[codec(index = 0)] Ed25519(runtime_types::sp_core::ed25519::Signature), @@ -51976,7 +38782,11 @@ pub mod api { #[codec(index = 2)] Ecdsa(runtime_types::sp_core::ecdsa::Signature), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum MultiSigner { #[codec(index = 0)] Ed25519(runtime_types::sp_core::ed25519::Public), @@ -51985,7 +38795,11 @@ pub mod api { #[codec(index = 2)] Ecdsa(runtime_types::sp_core::ecdsa::Public), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum TokenError { #[codec(index = 0)] NoFunds, @@ -52002,7 +38816,11 @@ pub mod api { #[codec(index = 6)] Unsupported, } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum TransactionalError { #[codec(index = 0)] LimitReached, @@ -52012,7 +38830,11 @@ pub mod api { } pub mod sp_session { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct MembershipProof { pub session: ::core::primitive::u32, pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, @@ -52024,7 +38846,9 @@ pub mod api { pub mod offence { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct OffenceDetails<_0, _1> { pub offender: _1, @@ -52034,7 +38858,11 @@ pub mod api { } pub mod sp_version { use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct RuntimeVersion { pub spec_name: ::std::string::String, pub impl_name: ::std::string::String, @@ -52054,7 +38882,9 @@ pub mod api { pub mod double_encoded { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct DoubleEncoded { pub encoded: ::std::vec::Vec<::core::primitive::u8>, @@ -52065,12 +38895,30 @@ pub mod api { pub mod junction { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum BodyId { - # [codec (index = 0)] Unit , # [codec (index = 1)] Named (runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > ,) , # [codec (index = 2)] Index (# [codec (compact)] :: core :: primitive :: u32 ,) , # [codec (index = 3)] Executive , # [codec (index = 4)] Technical , # [codec (index = 5)] Legislative , # [codec (index = 6)] Judicial , } + #[codec(index = 0)] + Unit, + #[codec(index = 1)] + Named(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 2)] + Index(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 3)] + Executive, + #[codec(index = 4)] + Technical, + #[codec(index = 5)] + Legislative, + #[codec(index = 6)] + Judicial, + } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum BodyPart { #[codec(index = 0)] @@ -52103,20 +38951,67 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Junction { - # [codec (index = 0)] Parent , # [codec (index = 1)] Parachain (# [codec (compact)] :: core :: primitive :: u32 ,) , # [codec (index = 2)] AccountId32 { network : runtime_types :: xcm :: v0 :: junction :: NetworkId , id : [:: core :: primitive :: u8 ; 32usize] , } , # [codec (index = 3)] AccountIndex64 { network : runtime_types :: xcm :: v0 :: junction :: NetworkId , # [codec (compact)] index : :: core :: primitive :: u64 , } , # [codec (index = 4)] AccountKey20 { network : runtime_types :: xcm :: v0 :: junction :: NetworkId , key : [:: core :: primitive :: u8 ; 20usize] , } , # [codec (index = 5)] PalletInstance (:: core :: primitive :: u8 ,) , # [codec (index = 6)] GeneralIndex (# [codec (compact)] :: core :: primitive :: u128 ,) , # [codec (index = 7)] GeneralKey (runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > ,) , # [codec (index = 8)] OnlyChild , # [codec (index = 9)] Plurality { id : runtime_types :: xcm :: v0 :: junction :: BodyId , part : runtime_types :: xcm :: v0 :: junction :: BodyPart , } , } + #[codec(index = 0)] + Parent, + #[codec(index = 1)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 2)] + AccountId32 { + network: runtime_types::xcm::v0::junction::NetworkId, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 3)] + AccountIndex64 { + network: runtime_types::xcm::v0::junction::NetworkId, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 4)] + AccountKey20 { + network: runtime_types::xcm::v0::junction::NetworkId, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 5)] + PalletInstance(::core::primitive::u8), + #[codec(index = 6)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 7)] + GeneralKey(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 8)] + OnlyChild, + #[codec(index = 9)] + Plurality { + id: runtime_types::xcm::v0::junction::BodyId, + part: runtime_types::xcm::v0::junction::BodyPart, + }, + } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum NetworkId { - # [codec (index = 0)] Any , # [codec (index = 1)] Named (runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > ,) , # [codec (index = 2)] Polkadot , # [codec (index = 3)] Kusama , } + #[codec(index = 0)] + Any, + #[codec(index = 1)] + Named(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 2)] + Polkadot, + #[codec(index = 3)] + Kusama, + } } pub mod multi_asset { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum MultiAsset { #[codec(index = 0)] @@ -52170,7 +39065,9 @@ pub mod api { pub mod multi_location { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum MultiLocation { #[codec(index = 0)] @@ -52238,7 +39135,9 @@ pub mod api { pub mod order { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Order { #[codec(index = 0)] @@ -52307,7 +39206,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum OriginKind { #[codec(index = 0)] @@ -52320,7 +39221,9 @@ pub mod api { Xcm, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Response { #[codec(index = 0)] @@ -52329,7 +39232,9 @@ pub mod api { ), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Xcm { #[codec(index = 0)] @@ -52415,15 +39320,50 @@ pub mod api { pub mod junction { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Junction { - # [codec (index = 0)] Parachain (# [codec (compact)] :: core :: primitive :: u32 ,) , # [codec (index = 1)] AccountId32 { network : runtime_types :: xcm :: v0 :: junction :: NetworkId , id : [:: core :: primitive :: u8 ; 32usize] , } , # [codec (index = 2)] AccountIndex64 { network : runtime_types :: xcm :: v0 :: junction :: NetworkId , # [codec (compact)] index : :: core :: primitive :: u64 , } , # [codec (index = 3)] AccountKey20 { network : runtime_types :: xcm :: v0 :: junction :: NetworkId , key : [:: core :: primitive :: u8 ; 20usize] , } , # [codec (index = 4)] PalletInstance (:: core :: primitive :: u8 ,) , # [codec (index = 5)] GeneralIndex (# [codec (compact)] :: core :: primitive :: u128 ,) , # [codec (index = 6)] GeneralKey (runtime_types :: sp_runtime :: bounded :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > ,) , # [codec (index = 7)] OnlyChild , # [codec (index = 8)] Plurality { id : runtime_types :: xcm :: v0 :: junction :: BodyId , part : runtime_types :: xcm :: v0 :: junction :: BodyPart , } , } + #[codec(index = 0)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 1)] + AccountId32 { + network: runtime_types::xcm::v0::junction::NetworkId, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + AccountIndex64 { + network: runtime_types::xcm::v0::junction::NetworkId, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 3)] + AccountKey20 { + network: runtime_types::xcm::v0::junction::NetworkId, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 4)] + PalletInstance(::core::primitive::u8), + #[codec(index = 5)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 6)] + GeneralKey(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 7)] + OnlyChild, + #[codec(index = 8)] + Plurality { + id: runtime_types::xcm::v0::junction::BodyId, + part: runtime_types::xcm::v0::junction::BodyPart, + }, + } } pub mod multiasset { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum AssetId { #[codec(index = 0)] @@ -52432,7 +39372,9 @@ pub mod api { Abstract(::std::vec::Vec<::core::primitive::u8>), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum AssetInstance { #[codec(index = 0)] @@ -52451,7 +39393,9 @@ pub mod api { Blob(::std::vec::Vec<::core::primitive::u8>), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Fungibility { #[codec(index = 0)] @@ -52460,14 +39404,18 @@ pub mod api { NonFungible(runtime_types::xcm::v1::multiasset::AssetInstance), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct MultiAsset { pub id: runtime_types::xcm::v1::multiasset::AssetId, pub fun: runtime_types::xcm::v1::multiasset::Fungibility, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum MultiAssetFilter { #[codec(index = 0)] @@ -52476,7 +39424,9 @@ pub mod api { Wild(runtime_types::xcm::v1::multiasset::WildMultiAsset), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct MultiAssets( pub ::std::vec::Vec< @@ -52484,7 +39434,9 @@ pub mod api { >, ); #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum WildFungibility { #[codec(index = 0)] @@ -52493,7 +39445,9 @@ pub mod api { NonFungible, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum WildMultiAsset { #[codec(index = 0)] @@ -52508,7 +39462,9 @@ pub mod api { pub mod multilocation { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Junctions { #[codec(index = 0)] @@ -52573,7 +39529,9 @@ pub mod api { ), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct MultiLocation { pub parents: ::core::primitive::u8, @@ -52583,7 +39541,9 @@ pub mod api { pub mod order { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Order { #[codec(index = 0)] @@ -52640,7 +39600,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Response { #[codec(index = 0)] @@ -52649,7 +39611,9 @@ pub mod api { Version(::core::primitive::u32), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Xcm { #[codec(index = 0)] @@ -52734,7 +39698,9 @@ pub mod api { pub mod traits { use super::runtime_types; #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Error { #[codec(index = 0)] @@ -52791,7 +39757,9 @@ pub mod api { WeightNotComputable, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Outcome { #[codec(index = 0)] @@ -52806,7 +39774,9 @@ pub mod api { } } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Instruction { #[codec(index = 0)] @@ -52952,7 +39922,9 @@ pub mod api { UnsubscribeVersion, } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum Response { #[codec(index = 0)] @@ -52970,7 +39942,9 @@ pub mod api { Version(::core::primitive::u32), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub enum WeightLimit { #[codec(index = 0)] @@ -52979,25 +39953,39 @@ pub mod api { Limited(#[codec(compact)] ::core::primitive::u64), } #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, )] pub struct Xcm(pub ::std::vec::Vec); } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum VersionedMultiAssets { #[codec(index = 0)] V0(::std::vec::Vec), #[codec(index = 1)] V1(runtime_types::xcm::v1::multiasset::MultiAssets), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum VersionedMultiLocation { #[codec(index = 0)] V0(runtime_types::xcm::v0::multi_location::MultiLocation), #[codec(index = 1)] V1(runtime_types::xcm::v1::multilocation::MultiLocation), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum VersionedResponse { #[codec(index = 0)] V0(runtime_types::xcm::v0::Response), @@ -53006,7 +39994,11 @@ pub mod api { #[codec(index = 2)] V2(runtime_types::xcm::v2::Response), } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub enum VersionedXcm { #[codec(index = 0)] V0(runtime_types::xcm::v0::Xcm), @@ -53017,533 +40009,415 @@ pub mod api { } } } - #[doc = r" The default error type returned when there is a runtime issue."] + #[doc = r" The default error type returned when there is a runtime issue,"] + #[doc = r" exposed here for ease of use."] pub type DispatchError = runtime_types::sp_runtime::DispatchError; - impl ::subxt::HasModuleError for runtime_types::sp_runtime::DispatchError { - fn module_error_data(&self) -> Option<::subxt::ModuleErrorData> { - if let Self::Module(module_error) = self { - Some(::subxt::ModuleErrorData { - pallet_index: module_error.index, - error: module_error.error, - }) - } else { - None - } - } - } - pub struct RuntimeApi { - pub client: ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl Clone for RuntimeApi { - fn clone(&self) -> Self { - Self { - client: self.client.clone(), - marker: ::core::marker::PhantomData, - } - } + pub fn constants() -> ConstantsApi { + ConstantsApi } - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - fn from(client: ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - impl<'a, T, X> RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn validate_metadata(&'a self) -> Result<(), ::subxt::MetadataError> { - let runtime_metadata_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.metadata_hash(&PALLETS) - }; - if runtime_metadata_hash - != [ - 14u8, 118u8, 204u8, 231u8, 221u8, 216u8, 141u8, 158u8, 101u8, 64u8, - 90u8, 209u8, 109u8, 181u8, 197u8, 130u8, 199u8, 182u8, 107u8, 141u8, - 198u8, 255u8, 217u8, 71u8, 178u8, 75u8, 222u8, 13u8, 27u8, 141u8, - 199u8, 236u8, - ] - { - Err(::subxt::MetadataError::IncompatibleMetadata) - } else { - Ok(()) - } - } - pub fn constants(&'a self) -> ConstantsApi<'a, T> { - ConstantsApi { - client: &self.client, - } - } - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { - client: &self.client, - } - } - pub fn tx(&'a self) -> TransactionApi<'a, T, X> { - TransactionApi { - client: &self.client, - marker: ::core::marker::PhantomData, - } - } - pub fn events(&'a self) -> EventsApi<'a, T> { - EventsApi { - client: &self.client, - } - } - } - pub struct EventsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> EventsApi<'a, T> { - pub async fn at( - &self, - block_hash: T::Hash, - ) -> Result<::subxt::events::Events, ::subxt::BasicError> { - ::subxt::events::at::(self.client, block_hash).await - } - pub async fn subscribe( - &self, - ) -> Result< - ::subxt::events::EventSubscription< - 'a, - ::subxt::events::EventSub, - T, - Event, - >, - ::subxt::BasicError, - > { - ::subxt::events::subscribe::(self.client).await - } - pub async fn subscribe_finalized( - &self, - ) -> Result< - ::subxt::events::EventSubscription< - 'a, - ::subxt::events::FinalizedEventSub<'a, T::Header>, - T, - Event, - >, - ::subxt::BasicError, - > { - ::subxt::events::subscribe_finalized::(self.client).await - } + pub fn storage() -> StorageApi { + StorageApi } - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + pub fn tx() -> TransactionApi { + TransactionApi } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn system(&self) -> system::constants::ConstantsApi<'a, T> { - system::constants::ConstantsApi::new(self.client) + pub struct ConstantsApi; + impl ConstantsApi { + pub fn system(&self) -> system::constants::ConstantsApi { + system::constants::ConstantsApi } - pub fn scheduler(&self) -> scheduler::constants::ConstantsApi<'a, T> { - scheduler::constants::ConstantsApi::new(self.client) + pub fn scheduler(&self) -> scheduler::constants::ConstantsApi { + scheduler::constants::ConstantsApi } - pub fn babe(&self) -> babe::constants::ConstantsApi<'a, T> { - babe::constants::ConstantsApi::new(self.client) + pub fn babe(&self) -> babe::constants::ConstantsApi { + babe::constants::ConstantsApi } - pub fn timestamp(&self) -> timestamp::constants::ConstantsApi<'a, T> { - timestamp::constants::ConstantsApi::new(self.client) + pub fn timestamp(&self) -> timestamp::constants::ConstantsApi { + timestamp::constants::ConstantsApi } - pub fn indices(&self) -> indices::constants::ConstantsApi<'a, T> { - indices::constants::ConstantsApi::new(self.client) + pub fn indices(&self) -> indices::constants::ConstantsApi { + indices::constants::ConstantsApi } - pub fn balances(&self) -> balances::constants::ConstantsApi<'a, T> { - balances::constants::ConstantsApi::new(self.client) + pub fn balances(&self) -> balances::constants::ConstantsApi { + balances::constants::ConstantsApi } pub fn transaction_payment( &self, - ) -> transaction_payment::constants::ConstantsApi<'a, T> { - transaction_payment::constants::ConstantsApi::new(self.client) + ) -> transaction_payment::constants::ConstantsApi { + transaction_payment::constants::ConstantsApi } - pub fn authorship(&self) -> authorship::constants::ConstantsApi<'a, T> { - authorship::constants::ConstantsApi::new(self.client) + pub fn authorship(&self) -> authorship::constants::ConstantsApi { + authorship::constants::ConstantsApi } - pub fn staking(&self) -> staking::constants::ConstantsApi<'a, T> { - staking::constants::ConstantsApi::new(self.client) + pub fn staking(&self) -> staking::constants::ConstantsApi { + staking::constants::ConstantsApi } - pub fn grandpa(&self) -> grandpa::constants::ConstantsApi<'a, T> { - grandpa::constants::ConstantsApi::new(self.client) + pub fn grandpa(&self) -> grandpa::constants::ConstantsApi { + grandpa::constants::ConstantsApi } - pub fn im_online(&self) -> im_online::constants::ConstantsApi<'a, T> { - im_online::constants::ConstantsApi::new(self.client) + pub fn im_online(&self) -> im_online::constants::ConstantsApi { + im_online::constants::ConstantsApi } - pub fn democracy(&self) -> democracy::constants::ConstantsApi<'a, T> { - democracy::constants::ConstantsApi::new(self.client) + pub fn democracy(&self) -> democracy::constants::ConstantsApi { + democracy::constants::ConstantsApi } - pub fn phragmen_election( - &self, - ) -> phragmen_election::constants::ConstantsApi<'a, T> { - phragmen_election::constants::ConstantsApi::new(self.client) + pub fn phragmen_election(&self) -> phragmen_election::constants::ConstantsApi { + phragmen_election::constants::ConstantsApi } - pub fn treasury(&self) -> treasury::constants::ConstantsApi<'a, T> { - treasury::constants::ConstantsApi::new(self.client) + pub fn treasury(&self) -> treasury::constants::ConstantsApi { + treasury::constants::ConstantsApi } - pub fn claims(&self) -> claims::constants::ConstantsApi<'a, T> { - claims::constants::ConstantsApi::new(self.client) + pub fn claims(&self) -> claims::constants::ConstantsApi { + claims::constants::ConstantsApi } - pub fn vesting(&self) -> vesting::constants::ConstantsApi<'a, T> { - vesting::constants::ConstantsApi::new(self.client) + pub fn vesting(&self) -> vesting::constants::ConstantsApi { + vesting::constants::ConstantsApi } - pub fn utility(&self) -> utility::constants::ConstantsApi<'a, T> { - utility::constants::ConstantsApi::new(self.client) + pub fn utility(&self) -> utility::constants::ConstantsApi { + utility::constants::ConstantsApi } - pub fn identity(&self) -> identity::constants::ConstantsApi<'a, T> { - identity::constants::ConstantsApi::new(self.client) + pub fn identity(&self) -> identity::constants::ConstantsApi { + identity::constants::ConstantsApi } - pub fn proxy(&self) -> proxy::constants::ConstantsApi<'a, T> { - proxy::constants::ConstantsApi::new(self.client) + pub fn proxy(&self) -> proxy::constants::ConstantsApi { + proxy::constants::ConstantsApi } - pub fn multisig(&self) -> multisig::constants::ConstantsApi<'a, T> { - multisig::constants::ConstantsApi::new(self.client) + pub fn multisig(&self) -> multisig::constants::ConstantsApi { + multisig::constants::ConstantsApi } - pub fn bounties(&self) -> bounties::constants::ConstantsApi<'a, T> { - bounties::constants::ConstantsApi::new(self.client) + pub fn bounties(&self) -> bounties::constants::ConstantsApi { + bounties::constants::ConstantsApi } - pub fn child_bounties(&self) -> child_bounties::constants::ConstantsApi<'a, T> { - child_bounties::constants::ConstantsApi::new(self.client) + pub fn child_bounties(&self) -> child_bounties::constants::ConstantsApi { + child_bounties::constants::ConstantsApi } - pub fn tips(&self) -> tips::constants::ConstantsApi<'a, T> { - tips::constants::ConstantsApi::new(self.client) + pub fn tips(&self) -> tips::constants::ConstantsApi { + tips::constants::ConstantsApi } pub fn election_provider_multi_phase( &self, - ) -> election_provider_multi_phase::constants::ConstantsApi<'a, T> { - election_provider_multi_phase::constants::ConstantsApi::new(self.client) + ) -> election_provider_multi_phase::constants::ConstantsApi { + election_provider_multi_phase::constants::ConstantsApi } - pub fn voter_list(&self) -> voter_list::constants::ConstantsApi<'a, T> { - voter_list::constants::ConstantsApi::new(self.client) + pub fn voter_list(&self) -> voter_list::constants::ConstantsApi { + voter_list::constants::ConstantsApi } - pub fn paras(&self) -> paras::constants::ConstantsApi<'a, T> { - paras::constants::ConstantsApi::new(self.client) + pub fn paras(&self) -> paras::constants::ConstantsApi { + paras::constants::ConstantsApi } - pub fn registrar(&self) -> registrar::constants::ConstantsApi<'a, T> { - registrar::constants::ConstantsApi::new(self.client) + pub fn registrar(&self) -> registrar::constants::ConstantsApi { + registrar::constants::ConstantsApi } - pub fn slots(&self) -> slots::constants::ConstantsApi<'a, T> { - slots::constants::ConstantsApi::new(self.client) + pub fn slots(&self) -> slots::constants::ConstantsApi { + slots::constants::ConstantsApi } - pub fn auctions(&self) -> auctions::constants::ConstantsApi<'a, T> { - auctions::constants::ConstantsApi::new(self.client) + pub fn auctions(&self) -> auctions::constants::ConstantsApi { + auctions::constants::ConstantsApi } - pub fn crowdloan(&self) -> crowdloan::constants::ConstantsApi<'a, T> { - crowdloan::constants::ConstantsApi::new(self.client) + pub fn crowdloan(&self) -> crowdloan::constants::ConstantsApi { + crowdloan::constants::ConstantsApi } } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config, - { - pub fn system(&self) -> system::storage::StorageApi<'a, T> { - system::storage::StorageApi::new(self.client) + pub struct StorageApi; + impl StorageApi { + pub fn system(&self) -> system::storage::StorageApi { + system::storage::StorageApi } - pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { - scheduler::storage::StorageApi::new(self.client) + pub fn scheduler(&self) -> scheduler::storage::StorageApi { + scheduler::storage::StorageApi } - pub fn preimage(&self) -> preimage::storage::StorageApi<'a, T> { - preimage::storage::StorageApi::new(self.client) + pub fn preimage(&self) -> preimage::storage::StorageApi { + preimage::storage::StorageApi } - pub fn babe(&self) -> babe::storage::StorageApi<'a, T> { - babe::storage::StorageApi::new(self.client) + pub fn babe(&self) -> babe::storage::StorageApi { + babe::storage::StorageApi } - pub fn timestamp(&self) -> timestamp::storage::StorageApi<'a, T> { - timestamp::storage::StorageApi::new(self.client) + pub fn timestamp(&self) -> timestamp::storage::StorageApi { + timestamp::storage::StorageApi } - pub fn indices(&self) -> indices::storage::StorageApi<'a, T> { - indices::storage::StorageApi::new(self.client) + pub fn indices(&self) -> indices::storage::StorageApi { + indices::storage::StorageApi } - pub fn balances(&self) -> balances::storage::StorageApi<'a, T> { - balances::storage::StorageApi::new(self.client) + pub fn balances(&self) -> balances::storage::StorageApi { + balances::storage::StorageApi } - pub fn transaction_payment( - &self, - ) -> transaction_payment::storage::StorageApi<'a, T> { - transaction_payment::storage::StorageApi::new(self.client) + pub fn transaction_payment(&self) -> transaction_payment::storage::StorageApi { + transaction_payment::storage::StorageApi } - pub fn authorship(&self) -> authorship::storage::StorageApi<'a, T> { - authorship::storage::StorageApi::new(self.client) + pub fn authorship(&self) -> authorship::storage::StorageApi { + authorship::storage::StorageApi } - pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { - staking::storage::StorageApi::new(self.client) + pub fn staking(&self) -> staking::storage::StorageApi { + staking::storage::StorageApi } - pub fn offences(&self) -> offences::storage::StorageApi<'a, T> { - offences::storage::StorageApi::new(self.client) + pub fn offences(&self) -> offences::storage::StorageApi { + offences::storage::StorageApi } - pub fn session(&self) -> session::storage::StorageApi<'a, T> { - session::storage::StorageApi::new(self.client) + pub fn session(&self) -> session::storage::StorageApi { + session::storage::StorageApi } - pub fn grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { - grandpa::storage::StorageApi::new(self.client) + pub fn grandpa(&self) -> grandpa::storage::StorageApi { + grandpa::storage::StorageApi } - pub fn im_online(&self) -> im_online::storage::StorageApi<'a, T> { - im_online::storage::StorageApi::new(self.client) + pub fn im_online(&self) -> im_online::storage::StorageApi { + im_online::storage::StorageApi } - pub fn democracy(&self) -> democracy::storage::StorageApi<'a, T> { - democracy::storage::StorageApi::new(self.client) + pub fn democracy(&self) -> democracy::storage::StorageApi { + democracy::storage::StorageApi } - pub fn council(&self) -> council::storage::StorageApi<'a, T> { - council::storage::StorageApi::new(self.client) + pub fn council(&self) -> council::storage::StorageApi { + council::storage::StorageApi } - pub fn technical_committee( - &self, - ) -> technical_committee::storage::StorageApi<'a, T> { - technical_committee::storage::StorageApi::new(self.client) + pub fn technical_committee(&self) -> technical_committee::storage::StorageApi { + technical_committee::storage::StorageApi } - pub fn phragmen_election(&self) -> phragmen_election::storage::StorageApi<'a, T> { - phragmen_election::storage::StorageApi::new(self.client) + pub fn phragmen_election(&self) -> phragmen_election::storage::StorageApi { + phragmen_election::storage::StorageApi } - pub fn technical_membership( - &self, - ) -> technical_membership::storage::StorageApi<'a, T> { - technical_membership::storage::StorageApi::new(self.client) + pub fn technical_membership(&self) -> technical_membership::storage::StorageApi { + technical_membership::storage::StorageApi } - pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { - treasury::storage::StorageApi::new(self.client) + pub fn treasury(&self) -> treasury::storage::StorageApi { + treasury::storage::StorageApi } - pub fn claims(&self) -> claims::storage::StorageApi<'a, T> { - claims::storage::StorageApi::new(self.client) + pub fn claims(&self) -> claims::storage::StorageApi { + claims::storage::StorageApi } - pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { - vesting::storage::StorageApi::new(self.client) + pub fn vesting(&self) -> vesting::storage::StorageApi { + vesting::storage::StorageApi } - pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { - identity::storage::StorageApi::new(self.client) + pub fn identity(&self) -> identity::storage::StorageApi { + identity::storage::StorageApi } - pub fn proxy(&self) -> proxy::storage::StorageApi<'a, T> { - proxy::storage::StorageApi::new(self.client) + pub fn proxy(&self) -> proxy::storage::StorageApi { + proxy::storage::StorageApi } - pub fn multisig(&self) -> multisig::storage::StorageApi<'a, T> { - multisig::storage::StorageApi::new(self.client) + pub fn multisig(&self) -> multisig::storage::StorageApi { + multisig::storage::StorageApi } - pub fn bounties(&self) -> bounties::storage::StorageApi<'a, T> { - bounties::storage::StorageApi::new(self.client) + pub fn bounties(&self) -> bounties::storage::StorageApi { + bounties::storage::StorageApi } - pub fn child_bounties(&self) -> child_bounties::storage::StorageApi<'a, T> { - child_bounties::storage::StorageApi::new(self.client) + pub fn child_bounties(&self) -> child_bounties::storage::StorageApi { + child_bounties::storage::StorageApi } - pub fn tips(&self) -> tips::storage::StorageApi<'a, T> { - tips::storage::StorageApi::new(self.client) + pub fn tips(&self) -> tips::storage::StorageApi { + tips::storage::StorageApi } pub fn election_provider_multi_phase( &self, - ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { - election_provider_multi_phase::storage::StorageApi::new(self.client) + ) -> election_provider_multi_phase::storage::StorageApi { + election_provider_multi_phase::storage::StorageApi } - pub fn voter_list(&self) -> voter_list::storage::StorageApi<'a, T> { - voter_list::storage::StorageApi::new(self.client) + pub fn voter_list(&self) -> voter_list::storage::StorageApi { + voter_list::storage::StorageApi } - pub fn configuration(&self) -> configuration::storage::StorageApi<'a, T> { - configuration::storage::StorageApi::new(self.client) + pub fn configuration(&self) -> configuration::storage::StorageApi { + configuration::storage::StorageApi } - pub fn paras_shared(&self) -> paras_shared::storage::StorageApi<'a, T> { - paras_shared::storage::StorageApi::new(self.client) + pub fn paras_shared(&self) -> paras_shared::storage::StorageApi { + paras_shared::storage::StorageApi } - pub fn para_inclusion(&self) -> para_inclusion::storage::StorageApi<'a, T> { - para_inclusion::storage::StorageApi::new(self.client) + pub fn para_inclusion(&self) -> para_inclusion::storage::StorageApi { + para_inclusion::storage::StorageApi } - pub fn para_inherent(&self) -> para_inherent::storage::StorageApi<'a, T> { - para_inherent::storage::StorageApi::new(self.client) + pub fn para_inherent(&self) -> para_inherent::storage::StorageApi { + para_inherent::storage::StorageApi } - pub fn para_scheduler(&self) -> para_scheduler::storage::StorageApi<'a, T> { - para_scheduler::storage::StorageApi::new(self.client) + pub fn para_scheduler(&self) -> para_scheduler::storage::StorageApi { + para_scheduler::storage::StorageApi } - pub fn paras(&self) -> paras::storage::StorageApi<'a, T> { - paras::storage::StorageApi::new(self.client) + pub fn paras(&self) -> paras::storage::StorageApi { + paras::storage::StorageApi } - pub fn initializer(&self) -> initializer::storage::StorageApi<'a, T> { - initializer::storage::StorageApi::new(self.client) + pub fn initializer(&self) -> initializer::storage::StorageApi { + initializer::storage::StorageApi } - pub fn dmp(&self) -> dmp::storage::StorageApi<'a, T> { - dmp::storage::StorageApi::new(self.client) + pub fn dmp(&self) -> dmp::storage::StorageApi { + dmp::storage::StorageApi } - pub fn ump(&self) -> ump::storage::StorageApi<'a, T> { - ump::storage::StorageApi::new(self.client) + pub fn ump(&self) -> ump::storage::StorageApi { + ump::storage::StorageApi } - pub fn hrmp(&self) -> hrmp::storage::StorageApi<'a, T> { - hrmp::storage::StorageApi::new(self.client) + pub fn hrmp(&self) -> hrmp::storage::StorageApi { + hrmp::storage::StorageApi } - pub fn para_session_info(&self) -> para_session_info::storage::StorageApi<'a, T> { - para_session_info::storage::StorageApi::new(self.client) + pub fn para_session_info(&self) -> para_session_info::storage::StorageApi { + para_session_info::storage::StorageApi } - pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi<'a, T> { - paras_disputes::storage::StorageApi::new(self.client) + pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi { + paras_disputes::storage::StorageApi } - pub fn registrar(&self) -> registrar::storage::StorageApi<'a, T> { - registrar::storage::StorageApi::new(self.client) + pub fn registrar(&self) -> registrar::storage::StorageApi { + registrar::storage::StorageApi } - pub fn slots(&self) -> slots::storage::StorageApi<'a, T> { - slots::storage::StorageApi::new(self.client) + pub fn slots(&self) -> slots::storage::StorageApi { + slots::storage::StorageApi } - pub fn auctions(&self) -> auctions::storage::StorageApi<'a, T> { - auctions::storage::StorageApi::new(self.client) + pub fn auctions(&self) -> auctions::storage::StorageApi { + auctions::storage::StorageApi } - pub fn crowdloan(&self) -> crowdloan::storage::StorageApi<'a, T> { - crowdloan::storage::StorageApi::new(self.client) + pub fn crowdloan(&self) -> crowdloan::storage::StorageApi { + crowdloan::storage::StorageApi } - pub fn xcm_pallet(&self) -> xcm_pallet::storage::StorageApi<'a, T> { - xcm_pallet::storage::StorageApi::new(self.client) + pub fn xcm_pallet(&self) -> xcm_pallet::storage::StorageApi { + xcm_pallet::storage::StorageApi } } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn system(&self) -> system::calls::TransactionApi<'a, T, X> { - system::calls::TransactionApi::new(self.client) + pub struct TransactionApi; + impl TransactionApi { + pub fn system(&self) -> system::calls::TransactionApi { + system::calls::TransactionApi } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T, X> { - scheduler::calls::TransactionApi::new(self.client) + pub fn scheduler(&self) -> scheduler::calls::TransactionApi { + scheduler::calls::TransactionApi } - pub fn preimage(&self) -> preimage::calls::TransactionApi<'a, T, X> { - preimage::calls::TransactionApi::new(self.client) + pub fn preimage(&self) -> preimage::calls::TransactionApi { + preimage::calls::TransactionApi } - pub fn babe(&self) -> babe::calls::TransactionApi<'a, T, X> { - babe::calls::TransactionApi::new(self.client) + pub fn babe(&self) -> babe::calls::TransactionApi { + babe::calls::TransactionApi } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T, X> { - timestamp::calls::TransactionApi::new(self.client) + pub fn timestamp(&self) -> timestamp::calls::TransactionApi { + timestamp::calls::TransactionApi } - pub fn indices(&self) -> indices::calls::TransactionApi<'a, T, X> { - indices::calls::TransactionApi::new(self.client) + pub fn indices(&self) -> indices::calls::TransactionApi { + indices::calls::TransactionApi } - pub fn balances(&self) -> balances::calls::TransactionApi<'a, T, X> { - balances::calls::TransactionApi::new(self.client) + pub fn balances(&self) -> balances::calls::TransactionApi { + balances::calls::TransactionApi } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T, X> { - authorship::calls::TransactionApi::new(self.client) + pub fn authorship(&self) -> authorship::calls::TransactionApi { + authorship::calls::TransactionApi } - pub fn staking(&self) -> staking::calls::TransactionApi<'a, T, X> { - staking::calls::TransactionApi::new(self.client) + pub fn staking(&self) -> staking::calls::TransactionApi { + staking::calls::TransactionApi } - pub fn session(&self) -> session::calls::TransactionApi<'a, T, X> { - session::calls::TransactionApi::new(self.client) + pub fn session(&self) -> session::calls::TransactionApi { + session::calls::TransactionApi } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T, X> { - grandpa::calls::TransactionApi::new(self.client) + pub fn grandpa(&self) -> grandpa::calls::TransactionApi { + grandpa::calls::TransactionApi } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T, X> { - im_online::calls::TransactionApi::new(self.client) + pub fn im_online(&self) -> im_online::calls::TransactionApi { + im_online::calls::TransactionApi } - pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T, X> { - democracy::calls::TransactionApi::new(self.client) + pub fn democracy(&self) -> democracy::calls::TransactionApi { + democracy::calls::TransactionApi } - pub fn council(&self) -> council::calls::TransactionApi<'a, T, X> { - council::calls::TransactionApi::new(self.client) + pub fn council(&self) -> council::calls::TransactionApi { + council::calls::TransactionApi } - pub fn technical_committee( - &self, - ) -> technical_committee::calls::TransactionApi<'a, T, X> { - technical_committee::calls::TransactionApi::new(self.client) + pub fn technical_committee(&self) -> technical_committee::calls::TransactionApi { + technical_committee::calls::TransactionApi } - pub fn phragmen_election( - &self, - ) -> phragmen_election::calls::TransactionApi<'a, T, X> { - phragmen_election::calls::TransactionApi::new(self.client) + pub fn phragmen_election(&self) -> phragmen_election::calls::TransactionApi { + phragmen_election::calls::TransactionApi } pub fn technical_membership( &self, - ) -> technical_membership::calls::TransactionApi<'a, T, X> { - technical_membership::calls::TransactionApi::new(self.client) + ) -> technical_membership::calls::TransactionApi { + technical_membership::calls::TransactionApi } - pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T, X> { - treasury::calls::TransactionApi::new(self.client) + pub fn treasury(&self) -> treasury::calls::TransactionApi { + treasury::calls::TransactionApi } - pub fn claims(&self) -> claims::calls::TransactionApi<'a, T, X> { - claims::calls::TransactionApi::new(self.client) + pub fn claims(&self) -> claims::calls::TransactionApi { + claims::calls::TransactionApi } - pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T, X> { - vesting::calls::TransactionApi::new(self.client) + pub fn vesting(&self) -> vesting::calls::TransactionApi { + vesting::calls::TransactionApi } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T, X> { - utility::calls::TransactionApi::new(self.client) + pub fn utility(&self) -> utility::calls::TransactionApi { + utility::calls::TransactionApi } - pub fn identity(&self) -> identity::calls::TransactionApi<'a, T, X> { - identity::calls::TransactionApi::new(self.client) + pub fn identity(&self) -> identity::calls::TransactionApi { + identity::calls::TransactionApi } - pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T, X> { - proxy::calls::TransactionApi::new(self.client) + pub fn proxy(&self) -> proxy::calls::TransactionApi { + proxy::calls::TransactionApi } - pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T, X> { - multisig::calls::TransactionApi::new(self.client) + pub fn multisig(&self) -> multisig::calls::TransactionApi { + multisig::calls::TransactionApi } - pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T, X> { - bounties::calls::TransactionApi::new(self.client) + pub fn bounties(&self) -> bounties::calls::TransactionApi { + bounties::calls::TransactionApi } - pub fn child_bounties(&self) -> child_bounties::calls::TransactionApi<'a, T, X> { - child_bounties::calls::TransactionApi::new(self.client) + pub fn child_bounties(&self) -> child_bounties::calls::TransactionApi { + child_bounties::calls::TransactionApi } - pub fn tips(&self) -> tips::calls::TransactionApi<'a, T, X> { - tips::calls::TransactionApi::new(self.client) + pub fn tips(&self) -> tips::calls::TransactionApi { + tips::calls::TransactionApi } pub fn election_provider_multi_phase( &self, - ) -> election_provider_multi_phase::calls::TransactionApi<'a, T, X> { - election_provider_multi_phase::calls::TransactionApi::new(self.client) + ) -> election_provider_multi_phase::calls::TransactionApi { + election_provider_multi_phase::calls::TransactionApi } - pub fn voter_list(&self) -> voter_list::calls::TransactionApi<'a, T, X> { - voter_list::calls::TransactionApi::new(self.client) + pub fn voter_list(&self) -> voter_list::calls::TransactionApi { + voter_list::calls::TransactionApi } - pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T, X> { - configuration::calls::TransactionApi::new(self.client) + pub fn configuration(&self) -> configuration::calls::TransactionApi { + configuration::calls::TransactionApi } - pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T, X> { - paras_shared::calls::TransactionApi::new(self.client) + pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi { + paras_shared::calls::TransactionApi } - pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T, X> { - para_inclusion::calls::TransactionApi::new(self.client) + pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi { + para_inclusion::calls::TransactionApi } - pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T, X> { - para_inherent::calls::TransactionApi::new(self.client) + pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi { + para_inherent::calls::TransactionApi } - pub fn paras(&self) -> paras::calls::TransactionApi<'a, T, X> { - paras::calls::TransactionApi::new(self.client) + pub fn paras(&self) -> paras::calls::TransactionApi { + paras::calls::TransactionApi } - pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T, X> { - initializer::calls::TransactionApi::new(self.client) + pub fn initializer(&self) -> initializer::calls::TransactionApi { + initializer::calls::TransactionApi } - pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T, X> { - dmp::calls::TransactionApi::new(self.client) + pub fn dmp(&self) -> dmp::calls::TransactionApi { + dmp::calls::TransactionApi } - pub fn ump(&self) -> ump::calls::TransactionApi<'a, T, X> { - ump::calls::TransactionApi::new(self.client) + pub fn ump(&self) -> ump::calls::TransactionApi { + ump::calls::TransactionApi } - pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T, X> { - hrmp::calls::TransactionApi::new(self.client) + pub fn hrmp(&self) -> hrmp::calls::TransactionApi { + hrmp::calls::TransactionApi } - pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi<'a, T, X> { - paras_disputes::calls::TransactionApi::new(self.client) + pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi { + paras_disputes::calls::TransactionApi } - pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T, X> { - registrar::calls::TransactionApi::new(self.client) + pub fn registrar(&self) -> registrar::calls::TransactionApi { + registrar::calls::TransactionApi } - pub fn slots(&self) -> slots::calls::TransactionApi<'a, T, X> { - slots::calls::TransactionApi::new(self.client) + pub fn slots(&self) -> slots::calls::TransactionApi { + slots::calls::TransactionApi } - pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T, X> { - auctions::calls::TransactionApi::new(self.client) + pub fn auctions(&self) -> auctions::calls::TransactionApi { + auctions::calls::TransactionApi } - pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T, X> { - crowdloan::calls::TransactionApi::new(self.client) + pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi { + crowdloan::calls::TransactionApi } - pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi<'a, T, X> { - xcm_pallet::calls::TransactionApi::new(self.client) + pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi { + xcm_pallet::calls::TransactionApi + } + } + #[doc = r" check whether the Client you are using is aligned with the statically generated codegen."] + pub fn validate_codegen>( + client: &C, + ) -> Result<(), ::subxt::error::MetadataError> { + let runtime_metadata_hash = client.metadata().metadata_hash(&PALLETS); + if runtime_metadata_hash + != [ + 141u8, 61u8, 173u8, 80u8, 230u8, 59u8, 229u8, 153u8, 169u8, 25u8, 105u8, + 219u8, 165u8, 1u8, 254u8, 195u8, 143u8, 137u8, 51u8, 220u8, 83u8, 165u8, + 88u8, 56u8, 18u8, 29u8, 227u8, 241u8, 164u8, 143u8, 24u8, 69u8, + ] + { + Err(::subxt::error::MetadataError::IncompatibleMetadata) + } else { + Ok(()) } } } diff --git a/testing/integration-tests/src/events/mod.rs b/testing/integration-tests/src/events/mod.rs index 59ddc145df..3abfffffe7 100644 --- a/testing/integration-tests/src/events/mod.rs +++ b/testing/integration-tests/src/events/mod.rs @@ -4,28 +4,30 @@ use crate::{ node_runtime::{ + self, balances, system, }, pair_signer, test_context, + utils::wait_for_blocks, }; use futures::StreamExt; use sp_keyring::AccountKeyring; // Check that we can subscribe to non-finalized block events. #[tokio::test] -async fn non_finalized_block_subscription() -> Result<(), subxt::BasicError> { - tracing_subscriber::fmt::try_init().ok(); +async fn non_finalized_block_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); - let mut event_sub = ctx.api.events().subscribe().await?; + let mut event_sub = api.events().subscribe().await?; // Wait for the next set of events, and check that the // associated block hash is not finalized yet. let events = event_sub.next().await.unwrap()?; let event_block_hash = events.block_hash(); - let current_block_hash = ctx.api.client.rpc().block_hash(None).await?.unwrap(); + let current_block_hash = api.rpc().block_hash(None).await?.unwrap(); assert_eq!(event_block_hash, current_block_hash); Ok(()) @@ -33,18 +35,18 @@ async fn non_finalized_block_subscription() -> Result<(), subxt::BasicError> { // Check that we can subscribe to finalized block events. #[tokio::test] -async fn finalized_block_subscription() -> Result<(), subxt::BasicError> { - tracing_subscriber::fmt::try_init().ok(); +async fn finalized_block_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); - let mut event_sub = ctx.api.events().subscribe_finalized().await?; + let mut event_sub = api.events().subscribe_finalized().await?; // Wait for the next set of events, and check that the // associated block hash is the one we just finalized. // (this can be a bit slow as we have to wait for finalization) let events = event_sub.next().await.unwrap()?; let event_block_hash = events.block_hash(); - let finalized_hash = ctx.api.client.rpc().finalized_head().await?; + let finalized_hash = api.rpc().finalized_head().await?; assert_eq!(event_block_hash, finalized_hash); Ok(()) @@ -53,24 +55,25 @@ async fn finalized_block_subscription() -> Result<(), subxt::BasicError> { // Check that our subscription actually keeps producing events for // a few blocks. #[tokio::test] -async fn subscription_produces_events_each_block() -> Result<(), subxt::BasicError> { - tracing_subscriber::fmt::try_init().ok(); +async fn subscription_produces_events_each_block() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); - let mut event_sub = ctx.api.events().subscribe().await?; + wait_for_blocks(&api).await; + + let mut event_sub = api.events().subscribe().await?; for i in 0..3 { let events = event_sub .next() .await .expect("events expected each block")?; + let success_event = events .find_first::() .expect("decode error"); - // Every now and then I get no bytes back for the first block events; - // I assume that this might be the case for the genesis block, so don't - // worry if no event found (but we should have no decode errors etc either way). - if i > 0 && success_event.is_none() { + + if success_event.is_none() { let n = events.len(); panic!("Expected an extrinsic success event on iteration {i} (saw {n} other events)") } @@ -82,13 +85,12 @@ async fn subscription_produces_events_each_block() -> Result<(), subxt::BasicErr // Check that our subscription receives events, and we can filter them based on // it's Stream impl, and ultimately see the event we expect. #[tokio::test] -async fn balance_transfer_subscription() -> Result<(), subxt::BasicError> { - tracing_subscriber::fmt::try_init().ok(); +async fn balance_transfer_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); // Subscribe to balance transfer events, ignoring all else. - let event_sub = ctx - .api + let event_sub = api .events() .subscribe() .await? @@ -101,11 +103,12 @@ async fn balance_transfer_subscription() -> Result<(), subxt::BasicError> { // Make a transfer: let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id(); - ctx.api - .tx() + let transfer_tx = node_runtime::tx() .balances() - .transfer(bob.clone().into(), 10_000)? - .sign_and_submit_then_watch_default(&alice) + .transfer(bob.clone().into(), 10_000); + + api.tx() + .sign_and_submit_then_watch_default(&transfer_tx, &alice) .await?; // Wait for the next balance transfer event in our subscription stream @@ -124,21 +127,20 @@ async fn balance_transfer_subscription() -> Result<(), subxt::BasicError> { } #[tokio::test] -async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::BasicError> { +async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::Error> { + let ctx = test_context().await; + let api = ctx.client(); + // This function is not publically available to use, but contains // the key logic for filling in missing blocks, so we want to test it. // This is used in `subscribe_finalized` to ensure no block headers are // missed. use subxt::events::subscribe_to_block_headers_filling_in_gaps; - let ctx = test_context().await; - // Manually subscribe to the next 6 finalized block headers, but deliberately // filter out some in the middle so we get back b _ _ b _ b. This guarantees // that there will be some gaps, even if there aren't any from the subscription. - let some_finalized_blocks = ctx - .api - .client + let some_finalized_blocks = api .rpc() .subscribe_finalized_blocks() .await? @@ -152,7 +154,7 @@ async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::BasicErr // This should spot any gaps in the middle and fill them back in. let all_finalized_blocks = subscribe_to_block_headers_filling_in_gaps( - &ctx.api.client, + ctx.client(), None, some_finalized_blocks, ); @@ -185,7 +187,7 @@ async fn check_events_are_sendable() { tokio::task::spawn(async { let ctx = test_context().await; - let mut event_sub = ctx.api.events().subscribe().await?; + let mut event_sub = ctx.client().events().subscribe().await?; while let Some(ev) = event_sub.next().await { // if `event_sub` doesn't implement Send, we can't hold @@ -193,7 +195,7 @@ async fn check_events_are_sendable() { // requires Send. This will lead to a compile error. } - Ok::<_, subxt::BasicError>(()) + Ok::<_, subxt::Error>(()) }); // Check that FilterEvents can be used across await points. @@ -201,7 +203,7 @@ async fn check_events_are_sendable() { let ctx = test_context().await; let mut event_sub = ctx - .api + .client() .events() .subscribe() .await? @@ -213,6 +215,6 @@ async fn check_events_are_sendable() { // requires Send; This will lead to a compile error. } - Ok::<_, subxt::BasicError>(()) + Ok::<_, subxt::Error>(()) }); } diff --git a/testing/integration-tests/src/frame/balances.rs b/testing/integration-tests/src/frame/balances.rs index d71ea2612a..b0dd8d700b 100644 --- a/testing/integration-tests/src/frame/balances.rs +++ b/testing/integration-tests/src/frame/balances.rs @@ -4,10 +4,10 @@ use crate::{ node_runtime::{ + self, balances, runtime_types, system, - DispatchError, }, pair_signer, test_context, @@ -22,32 +22,36 @@ use sp_runtime::{ AccountId32, MultiAddress, }; -use subxt::Error; +use subxt::error::{ + DispatchError, + Error, +}; #[tokio::test] -async fn tx_basic_transfer() -> Result<(), subxt::Error> { +async fn tx_basic_transfer() -> Result<(), subxt::Error> { let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = pair_signer(AccountKeyring::Bob.pair()); let bob_address = bob.account_id().clone().into(); - let cxt = test_context().await; - let api = &cxt.api; + let ctx = test_context().await; + let api = ctx.client(); + + let alice_account_addr = node_runtime::storage().system().account(alice.account_id()); + let bob_account_addr = node_runtime::storage().system().account(bob.account_id()); let alice_pre = api .storage() - .system() - .account(alice.account_id(), None) + .fetch_or_default(&alice_account_addr, None) .await?; let bob_pre = api .storage() - .system() - .account(bob.account_id(), None) + .fetch_or_default(&bob_account_addr, None) .await?; + let tx = node_runtime::tx().balances().transfer(bob_address, 10_000); + let events = api .tx() - .balances() - .transfer(bob_address, 10_000)? - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&tx, &alice) .await? .wait_for_finalized_success() .await?; @@ -69,13 +73,11 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> { let alice_post = api .storage() - .system() - .account(alice.account_id(), None) + .fetch_or_default(&alice_account_addr, None) .await?; let bob_post = api .storage() - .system() - .account(bob.account_id(), None) + .fetch_or_default(&bob_account_addr, None) .await?; assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); @@ -84,26 +86,118 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> { } #[tokio::test] -async fn multiple_transfers_work_nonce_incremented( -) -> Result<(), subxt::Error> { +async fn tx_dynamic_transfer() -> Result<(), subxt::Error> { + use subxt::ext::scale_value::{ + At, + Composite, + Value, + }; + + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); + let ctx = test_context().await; + let api = ctx.client(); + + let alice_account_addr = subxt::dynamic::storage( + "System", + "Account", + vec![Value::from_bytes(&alice.account_id())], + ); + let bob_account_addr = subxt::dynamic::storage( + "System", + "Account", + vec![Value::from_bytes(&bob.account_id())], + ); + + let alice_pre = api + .storage() + .fetch_or_default(&alice_account_addr, None) + .await?; + let bob_pre = api + .storage() + .fetch_or_default(&bob_account_addr, None) + .await?; + + let tx = subxt::dynamic::tx( + "Balances", + "transfer", + vec![ + Value::unnamed_variant("Id", vec![Value::from_bytes(&bob.account_id())]), + Value::u128(10_000u128), + ], + ); + + let events = api + .tx() + .sign_and_submit_then_watch_default(&tx, &alice) + .await? + .wait_for_finalized_success() + .await?; + + let event_fields = events + .iter() + .filter_map(|ev| ev.ok()) + .find(|ev| ev.pallet_name() == "Balances" && ev.variant_name() == "Transfer") + .expect("Failed to find Transfer event") + .field_values() + .map_context(|_| ()); + + let expected_fields = Composite::Named(vec![ + ( + "from".into(), + Value::unnamed_composite(vec![Value::from_bytes(&alice.account_id())]), + ), + ( + "to".into(), + Value::unnamed_composite(vec![Value::from_bytes(&bob.account_id())]), + ), + ("amount".into(), Value::u128(10_000)), + ]); + assert_eq!(event_fields, expected_fields); + + let alice_post = api + .storage() + .fetch_or_default(&alice_account_addr, None) + .await?; + let bob_post = api + .storage() + .fetch_or_default(&bob_account_addr, None) + .await?; + + let alice_pre_free = alice_pre.at("data").at("free").unwrap().as_u128().unwrap(); + let alice_post_free = alice_post.at("data").at("free").unwrap().as_u128().unwrap(); + + let bob_pre_free = bob_pre.at("data").at("free").unwrap().as_u128().unwrap(); + let bob_post_free = bob_post.at("data").at("free").unwrap().as_u128().unwrap(); + + assert!(alice_pre_free - 10_000 >= alice_post_free); + assert_eq!(bob_pre_free + 10_000, bob_post_free); + + Ok(()) +} + +#[tokio::test] +async fn multiple_transfers_work_nonce_incremented() -> Result<(), subxt::Error> { let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = pair_signer(AccountKeyring::Bob.pair()); let bob_address: MultiAddress = bob.account_id().clone().into(); - let cxt = test_context().await; - let api = &cxt.api; + let ctx = test_context().await; + let api = ctx.client(); + + let bob_account_addr = node_runtime::storage().system().account(bob.account_id()); let bob_pre = api .storage() - .system() - .account(bob.account_id(), None) + .fetch_or_default(&bob_account_addr, None) .await?; + let tx = node_runtime::tx() + .balances() + .transfer(bob_address.clone(), 10_000); for _ in 0..3 { api .tx() - .balances() - .transfer(bob_address.clone(), 10_000)? - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&tx, &alice) .await? .wait_for_in_block() // Don't need to wait for finalization; this is quicker. .await? @@ -113,8 +207,7 @@ async fn multiple_transfers_work_nonce_incremented( let bob_post = api .storage() - .system() - .account(bob.account_id(), None) + .fetch_or_default(&bob_account_addr, None) .await?; assert_eq!(bob_pre.data.free + 30_000, bob_post.data.free); @@ -123,45 +216,40 @@ async fn multiple_transfers_work_nonce_incremented( #[tokio::test] async fn storage_total_issuance() { - let cxt = test_context().await; - let total_issuance = cxt - .api - .storage() - .balances() - .total_issuance(None) - .await - .unwrap(); + let ctx = test_context().await; + let api = ctx.client(); + + let addr = node_runtime::storage().balances().total_issuance(); + let total_issuance = api.storage().fetch_or_default(&addr, None).await.unwrap(); assert_ne!(total_issuance, 0); } #[tokio::test] -async fn storage_balance_lock() -> Result<(), subxt::Error> { +async fn storage_balance_lock() -> Result<(), subxt::Error> { let bob = pair_signer(AccountKeyring::Bob.pair()); let charlie = AccountKeyring::Charlie.to_account_id(); - let cxt = test_context().await; + let ctx = test_context().await; + let api = ctx.client(); - cxt.api - .tx() - .staking() - .bond( - charlie.into(), - 100_000_000_000_000, - runtime_types::pallet_staking::RewardDestination::Stash, - )? - .sign_and_submit_then_watch_default(&bob) + let tx = node_runtime::tx().staking().bond( + charlie.into(), + 100_000_000_000_000, + runtime_types::pallet_staking::RewardDestination::Stash, + ); + + api.tx() + .sign_and_submit_then_watch_default(&tx, &bob) .await? .wait_for_finalized_success() .await? .find_first::()? .expect("No ExtrinsicSuccess Event found"); - let locked_account = AccountKeyring::Bob.to_account_id(); - let locks = cxt - .api - .storage() + let locks_addr = node_runtime::storage() .balances() - .locks(&locked_account, None) - .await?; + .locks(&AccountKeyring::Bob.to_account_id()); + + let locks = api.storage().fetch_or_default(&locks_addr, None).await?; assert_eq!( locks.0, @@ -177,38 +265,37 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { #[tokio::test] async fn transfer_error() { - tracing_subscriber::fmt::try_init().ok(); let alice = pair_signer(AccountKeyring::Alice.pair()); let alice_addr = alice.account_id().clone().into(); let hans = pair_signer(Pair::generate().0); let hans_address = hans.account_id().clone().into(); let ctx = test_context().await; + let api = ctx.client(); - ctx.api - .tx() + let to_hans_tx = node_runtime::tx() .balances() - .transfer(hans_address, 100_000_000_000_000_000) - .unwrap() - .sign_and_submit_then_watch_default(&alice) + .transfer(hans_address, 100_000_000_000_000_000); + let to_alice_tx = node_runtime::tx() + .balances() + .transfer(alice_addr, 100_000_000_000_000_000); + + api.tx() + .sign_and_submit_then_watch_default(&to_hans_tx, &alice) .await .unwrap() .wait_for_finalized_success() .await .unwrap(); - let res = ctx - .api + let res = api .tx() - .balances() - .transfer(alice_addr, 100_000_000_000_000_000) - .unwrap() - .sign_and_submit_then_watch_default(&hans) + .sign_and_submit_then_watch_default(&to_alice_tx, &hans) .await .unwrap() .wait_for_finalized_success() .await; - if let Err(Error::Module(err)) = res { + if let Err(Error::Runtime(DispatchError::Module(err))) = res { assert_eq!(err.pallet, "Balances"); assert_eq!(err.error, "InsufficientBalance"); } else { @@ -218,19 +305,17 @@ async fn transfer_error() { #[tokio::test] async fn transfer_implicit_subscription() { - tracing_subscriber::fmt::try_init().ok(); let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id(); let bob_addr = bob.clone().into(); - let cxt = test_context().await; + let ctx = test_context().await; + let api = ctx.client(); - let event = cxt - .api + let to_bob_tx = node_runtime::tx().balances().transfer(bob_addr, 10_000); + + let event = api .tx() - .balances() - .transfer(bob_addr, 10_000) - .unwrap() - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&to_bob_tx, &alice) .await .unwrap() .wait_for_finalized_success() @@ -252,19 +337,19 @@ async fn transfer_implicit_subscription() { #[tokio::test] async fn constant_existential_deposit() { - let cxt = test_context().await; - let locked_metadata = cxt.client().metadata(); - let metadata = locked_metadata.read(); + let ctx = test_context().await; + let api = ctx.client(); + + // get and decode constant manually via metadata: + let metadata = api.metadata(); let balances_metadata = metadata.pallet("Balances").unwrap(); let constant_metadata = balances_metadata.constant("ExistentialDeposit").unwrap(); let existential_deposit = u128::decode(&mut &constant_metadata.value[..]).unwrap(); assert_eq!(existential_deposit, 100_000_000_000_000); - assert_eq!( - existential_deposit, - cxt.api - .constants() - .balances() - .existential_deposit() - .unwrap() - ); + + // constant address for API access: + let addr = node_runtime::constants().balances().existential_deposit(); + + // Make sure thetwo are identical: + assert_eq!(existential_deposit, api.constants().at(&addr).unwrap()); } diff --git a/testing/integration-tests/src/frame/contracts.rs b/testing/integration-tests/src/frame/contracts.rs index 14d496b218..bc8ec88b27 100644 --- a/testing/integration-tests/src/frame/contracts.rs +++ b/testing/integration-tests/src/frame/contracts.rs @@ -7,57 +7,46 @@ use sp_keyring::AccountKeyring; use crate::{ node_runtime::{ self, - contracts::{ - calls::TransactionApi, - events, - storage, - }, + contracts::events, system, - DispatchError, }, test_context, - NodeRuntimeParams, TestContext, }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; use subxt::{ - Client, + tx::{ + PairSigner, + TxProgress, + }, Config, - DefaultConfig, Error, - PairSigner, - TransactionProgress, + OnlineClient, + SubstrateConfig, }; struct ContractsTestContext { cxt: TestContext, - signer: PairSigner, + signer: PairSigner, } -type Hash = ::Hash; -type AccountId = ::AccountId; +type Hash = ::Hash; +type AccountId = ::AccountId; impl ContractsTestContext { async fn init() -> Self { - tracing_subscriber::fmt::try_init().ok(); let cxt = test_context().await; let signer = PairSigner::new(AccountKeyring::Alice.pair()); Self { cxt, signer } } - fn client(&self) -> &Client { + fn client(&self) -> OnlineClient { self.cxt.client() } - fn contracts_tx(&self) -> TransactionApi { - self.cxt.api.tx().contracts() - } - - async fn instantiate_with_code( - &self, - ) -> Result<(Hash, AccountId), Error> { + async fn instantiate_with_code(&self) -> Result<(Hash, AccountId), Error> { tracing::info!("instantiate_with_code:"); const CONTRACT: &str = r#" (module @@ -67,20 +56,19 @@ impl ContractsTestContext { "#; let code = wabt::wat2wasm(CONTRACT).expect("invalid wabt"); + let instantiate_tx = node_runtime::tx().contracts().instantiate_with_code( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + None, // storage_deposit_limit + code, + vec![], // data + vec![], // salt + ); + let events = self - .cxt - .api + .client() .tx() - .contracts() - .instantiate_with_code( - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - None, // storage_deposit_limit - code, - vec![], // data - vec![], // salt - )? - .sign_and_submit_then_watch_default(&self.signer) + .sign_and_submit_then_watch_default(&instantiate_tx, &self.signer) .await? .wait_for_finalized_success() .await?; @@ -108,19 +96,21 @@ impl ContractsTestContext { code_hash: Hash, data: Vec, salt: Vec, - ) -> Result> { + ) -> Result { // call instantiate extrinsic + let instantiate_tx = node_runtime::tx().contracts().instantiate( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + None, // storage_deposit_limit + code_hash, + data, + salt, + ); + let result = self - .contracts_tx() - .instantiate( - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - None, // storage_deposit_limit - code_hash, - data, - salt, - )? - .sign_and_submit_then_watch_default(&self.signer) + .client() + .tx() + .sign_and_submit_then_watch_default(&instantiate_tx, &self.signer) .await? .wait_for_finalized_success() .await?; @@ -137,21 +127,20 @@ impl ContractsTestContext { &self, contract: AccountId, input_data: Vec, - ) -> Result< - TransactionProgress<'_, DefaultConfig, DispatchError, node_runtime::Event>, - Error, - > { + ) -> Result>, Error> { tracing::info!("call: {:?}", contract); + let call_tx = node_runtime::tx().contracts().call( + MultiAddress::Id(contract), + 0, // value + 500_000_000, // gas_limit + None, // storage_deposit_limit + input_data, + ); + let result = self - .contracts_tx() - .call( - MultiAddress::Id(contract), - 0, // value - 500_000_000, // gas_limit - None, // storage_deposit_limit - input_data, - )? - .sign_and_submit_then_watch_default(&self.signer) + .client() + .tx() + .sign_and_submit_then_watch_default(&call_tx, &self.signer) .await?; tracing::info!("Call result: {:?}", result); @@ -190,19 +179,17 @@ async fn tx_call() { let cxt = ContractsTestContext::init().await; let (_, contract) = cxt.instantiate_with_code().await.unwrap(); - let contract_info = cxt - .cxt - .api - .storage() + let info_addr = node_runtime::storage() .contracts() - .contract_info_of(&contract, None) - .await; + .contract_info_of(&contract); + + let contract_info = cxt.client().storage().fetch(&info_addr, None).await; assert!(contract_info.is_ok()); let keys = cxt .client() .storage() - .fetch_keys::(5, None, None) + .fetch_keys(&info_addr.to_bytes(), 10, None, None) .await .unwrap() .iter() diff --git a/testing/integration-tests/src/frame/staking.rs b/testing/integration-tests/src/frame/staking.rs index f7ca86216f..6e9abf81d2 100644 --- a/testing/integration-tests/src/frame/staking.rs +++ b/testing/integration-tests/src/frame/staking.rs @@ -4,12 +4,12 @@ use crate::{ node_runtime::{ + self, runtime_types::pallet_staking::{ RewardDestination, ValidatorPrefs, }, staking, - DispatchError, }, pair_signer, test_context, @@ -20,7 +20,10 @@ use sp_core::{ Pair, }; use sp_keyring::AccountKeyring; -use subxt::Error; +use subxt::error::{ + DispatchError, + Error, +}; /// Helper function to generate a crypto pair from seed fn get_from_seed(seed: &str) -> sr25519::Pair { @@ -37,14 +40,17 @@ fn default_validator_prefs() -> ValidatorPrefs { #[tokio::test] async fn validate_with_controller_account() { - let alice = pair_signer(AccountKeyring::Alice.pair()); let ctx = test_context().await; - ctx.api - .tx() + let api = ctx.client(); + + let alice = pair_signer(AccountKeyring::Alice.pair()); + + let tx = node_runtime::tx() .staking() - .validate(default_validator_prefs()) - .unwrap() - .sign_and_submit_then_watch_default(&alice) + .validate(default_validator_prefs()); + + api.tx() + .sign_and_submit_then_watch_default(&tx, &alice) .await .unwrap() .wait_for_finalized_success() @@ -53,19 +59,23 @@ async fn validate_with_controller_account() { } #[tokio::test] -async fn validate_not_possible_for_stash_account() -> Result<(), Error> { - let alice_stash = pair_signer(get_from_seed("Alice//stash")); +async fn validate_not_possible_for_stash_account() -> Result<(), Error> { let ctx = test_context().await; - let announce_validator = ctx - .api - .tx() + let api = ctx.client(); + + let alice_stash = pair_signer(get_from_seed("Alice//stash")); + + let tx = node_runtime::tx() .staking() - .validate(default_validator_prefs())? - .sign_and_submit_then_watch_default(&alice_stash) + .validate(default_validator_prefs()); + + let announce_validator = api + .tx() + .sign_and_submit_then_watch_default(&tx, &alice_stash) .await? .wait_for_finalized_success() .await; - assert_matches!(announce_validator, Err(Error::Module(err)) => { + assert_matches!(announce_validator, Err(Error::Runtime(DispatchError::Module(err))) => { assert_eq!(err.pallet, "Staking"); assert_eq!(err.error, "NotController"); }); @@ -74,16 +84,18 @@ async fn validate_not_possible_for_stash_account() -> Result<(), Error Result<(), Error> { +async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { + let ctx = test_context().await; + let api = ctx.client(); + let alice_stash = pair_signer(get_from_seed("Alice//stash")); let bob = pair_signer(AccountKeyring::Bob.pair()); - let ctx = test_context().await; - let nomination = ctx - .api - .tx() + let tx = node_runtime::tx() .staking() - .nominate(vec![bob.account_id().clone().into()])? - .sign_and_submit_then_watch_default(&alice_stash) - .await? + .nominate(vec![bob.account_id().clone().into()]); + + let nomination = api + .tx() + .sign_and_submit_then_watch_default(&tx, &alice_stash) + .await + .unwrap() .wait_for_finalized_success() .await; - assert_matches!(nomination, Err(Error::Module(err)) => { + assert_matches!(nomination, Err(Error::Runtime(DispatchError::Module(err))) => { assert_eq!(err.pallet, "Staking"); assert_eq!(err.error, "NotController"); }); @@ -115,52 +131,45 @@ async fn nominate_not_possible_for_stash_account() -> Result<(), Error Result<(), Error> { +async fn chill_works_for_controller_only() -> Result<(), Error> { + let ctx = test_context().await; + let api = ctx.client(); + let alice_stash = pair_signer(get_from_seed("Alice//stash")); let bob_stash = pair_signer(get_from_seed("Bob//stash")); let alice = pair_signer(AccountKeyring::Alice.pair()); - let ctx = test_context().await; // this will fail the second time, which is why this is one test, not two - ctx.api - .tx() + let nominate_tx = node_runtime::tx() .staking() - .nominate(vec![bob_stash.account_id().clone().into()])? - .sign_and_submit_then_watch_default(&alice) + .nominate(vec![bob_stash.account_id().clone().into()]); + api.tx() + .sign_and_submit_then_watch_default(&nominate_tx, &alice) .await? .wait_for_finalized_success() .await?; - let ledger = ctx - .api - .storage() - .staking() - .ledger(alice.account_id(), None) - .await? - .unwrap(); + let ledger_addr = node_runtime::storage().staking().ledger(alice.account_id()); + let ledger = api.storage().fetch(&ledger_addr, None).await?.unwrap(); assert_eq!(alice_stash.account_id(), &ledger.stash); - let chill = ctx - .api + let chill_tx = node_runtime::tx().staking().chill(); + + let chill = api .tx() - .staking() - .chill()? - .sign_and_submit_then_watch_default(&alice_stash) + .sign_and_submit_then_watch_default(&chill_tx, &alice_stash) .await? .wait_for_finalized_success() .await; - assert_matches!(chill, Err(Error::Module(err)) => { + assert_matches!(chill, Err(Error::Runtime(DispatchError::Module(err))) => { assert_eq!(err.pallet, "Staking"); assert_eq!(err.error, "NotController"); }); - let is_chilled = ctx - .api + let is_chilled = api .tx() - .staking() - .chill()? - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&chill_tx, &alice) .await? .wait_for_finalized_success() .await? @@ -171,43 +180,35 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { } #[tokio::test] -async fn tx_bond() -> Result<(), Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); +async fn tx_bond() -> Result<(), Error> { let ctx = test_context().await; + let api = ctx.client(); - let bond = ctx - .api + let alice = pair_signer(AccountKeyring::Alice.pair()); + + let bond_tx = node_runtime::tx().staking().bond( + AccountKeyring::Bob.to_account_id().into(), + 100_000_000_000_000, + RewardDestination::Stash, + ); + + let bond = api .tx() - .staking() - .bond( - AccountKeyring::Bob.to_account_id().into(), - 100_000_000_000_000, - RewardDestination::Stash, - ) - .unwrap() - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&bond_tx, &alice) .await? .wait_for_finalized_success() .await; assert!(bond.is_ok()); - let bond_again = ctx - .api + let bond_again = api .tx() - .staking() - .bond( - AccountKeyring::Bob.to_account_id().into(), - 100_000_000_000_000, - RewardDestination::Stash, - ) - .unwrap() - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&bond_tx, &alice) .await? .wait_for_finalized_success() .await; - assert_matches!(bond_again, Err(Error::Module(err)) => { + assert_matches!(bond_again, Err(Error::Runtime(DispatchError::Module(err))) => { assert_eq!(err.pallet, "Staking"); assert_eq!(err.error, "AlreadyBonded"); }); @@ -215,35 +216,37 @@ async fn tx_bond() -> Result<(), Error> { } #[tokio::test] -async fn storage_history_depth() -> Result<(), Error> { +async fn storage_history_depth() -> Result<(), Error> { let ctx = test_context().await; - let history_depth = ctx.api.storage().staking().history_depth(None).await?; + let api = ctx.client(); + let history_depth_addr = node_runtime::storage().staking().history_depth(); + let history_depth = api + .storage() + .fetch_or_default(&history_depth_addr, None) + .await?; assert_eq!(history_depth, 84); Ok(()) } #[tokio::test] -async fn storage_current_era() -> Result<(), Error> { +async fn storage_current_era() -> Result<(), Error> { let ctx = test_context().await; - let _current_era = ctx - .api + let api = ctx.client(); + let current_era_addr = node_runtime::storage().staking().current_era(); + let _current_era = api .storage() - .staking() - .current_era(None) + .fetch(¤t_era_addr, None) .await? .expect("current era always exists"); Ok(()) } #[tokio::test] -async fn storage_era_reward_points() -> Result<(), Error> { - let cxt = test_context().await; - let current_era_result = cxt - .api - .storage() - .staking() - .eras_reward_points(&0, None) - .await; +async fn storage_era_reward_points() -> Result<(), Error> { + let ctx = test_context().await; + let api = ctx.client(); + let reward_points_addr = node_runtime::storage().staking().eras_reward_points(&0); + let current_era_result = api.storage().fetch(&reward_points_addr, None).await; assert!(current_era_result.is_ok()); Ok(()) diff --git a/testing/integration-tests/src/frame/sudo.rs b/testing/integration-tests/src/frame/sudo.rs index 91e90a4c88..8be70ea2bb 100644 --- a/testing/integration-tests/src/frame/sudo.rs +++ b/testing/integration-tests/src/frame/sudo.rs @@ -4,35 +4,35 @@ use crate::{ node_runtime::{ + self, runtime_types, sudo, - DispatchError, }, pair_signer, test_context, }; use sp_keyring::AccountKeyring; -type Call = runtime_types::node_runtime::Call; +type Call = runtime_types::kitchensink_runtime::Call; type BalancesCall = runtime_types::pallet_balances::pallet::Call; #[tokio::test] -async fn test_sudo() -> Result<(), subxt::Error> { +async fn test_sudo() -> Result<(), subxt::Error> { + let ctx = test_context().await; + let api = ctx.client(); + let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id().into(); - let cxt = test_context().await; let call = Call::Balances(BalancesCall::transfer { dest: bob, value: 10_000, }); + let tx = node_runtime::tx().sudo().sudo(call); - let found_event = cxt - .api + let found_event = api .tx() - .sudo() - .sudo(call)? - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&tx, &alice) .await? .wait_for_finalized_success() .await? @@ -43,22 +43,22 @@ async fn test_sudo() -> Result<(), subxt::Error> { } #[tokio::test] -async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { +async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { + let ctx = test_context().await; + let api = ctx.client(); + let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id().into(); - let cxt = test_context().await; let call = Call::Balances(BalancesCall::transfer { dest: bob, value: 10_000, }); + let tx = node_runtime::tx().sudo().sudo_unchecked_weight(call, 0); - let found_event = cxt - .api + let found_event = api .tx() - .sudo() - .sudo_unchecked_weight(call, 0)? - .sign_and_submit_then_watch_default(&alice) + .sign_and_submit_then_watch_default(&tx, &alice) .await? .wait_for_finalized_success() .await? diff --git a/testing/integration-tests/src/frame/system.rs b/testing/integration-tests/src/frame/system.rs index f226ec45ed..e2e8610586 100644 --- a/testing/integration-tests/src/frame/system.rs +++ b/testing/integration-tests/src/frame/system.rs @@ -4,8 +4,8 @@ use crate::{ node_runtime::{ + self, system, - DispatchError, }, pair_signer, test_context, @@ -14,15 +14,17 @@ use assert_matches::assert_matches; use sp_keyring::AccountKeyring; #[tokio::test] -async fn storage_account() -> Result<(), subxt::Error> { +async fn storage_account() -> Result<(), subxt::Error> { + let ctx = test_context().await; + let api = ctx.client(); + let alice = pair_signer(AccountKeyring::Alice.pair()); - let cxt = test_context().await; - let account_info = cxt - .api + let account_info_addr = node_runtime::storage().system().account(alice.account_id()); + + let account_info = api .storage() - .system() - .account(alice.account_id(), None) + .fetch_or_default(&account_info_addr, None) .await; assert_matches!(account_info, Ok(_)); @@ -30,16 +32,19 @@ async fn storage_account() -> Result<(), subxt::Error> { } #[tokio::test] -async fn tx_remark_with_event() -> Result<(), subxt::Error> { +async fn tx_remark_with_event() -> Result<(), subxt::Error> { + let ctx = test_context().await; + let api = ctx.client(); + let alice = pair_signer(AccountKeyring::Alice.pair()); - let cxt = test_context().await; - let found_event = cxt - .api - .tx() + let tx = node_runtime::tx() .system() - .remark_with_event(b"remarkable".to_vec())? - .sign_and_submit_then_watch_default(&alice) + .remark_with_event(b"remarkable".to_vec()); + + let found_event = api + .tx() + .sign_and_submit_then_watch_default(&tx, &alice) .await? .wait_for_finalized_success() .await? diff --git a/testing/integration-tests/src/frame/timestamp.rs b/testing/integration-tests/src/frame/timestamp.rs index 7f908e9af1..4db9942d2e 100644 --- a/testing/integration-tests/src/frame/timestamp.rs +++ b/testing/integration-tests/src/frame/timestamp.rs @@ -2,13 +2,20 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::test_context; +use crate::{ + node_runtime, + test_context, +}; #[tokio::test] async fn storage_get_current_timestamp() { - let cxt = test_context().await; + let ctx = test_context().await; + let api = ctx.client(); - let timestamp = cxt.api.storage().timestamp().now(None).await; + let timestamp = api + .storage() + .fetch(&node_runtime::storage().timestamp().now(), None) + .await; assert!(timestamp.is_ok()) } diff --git a/testing/integration-tests/src/lib.rs b/testing/integration-tests/src/lib.rs index b1f1490930..1c8722c31d 100644 --- a/testing/integration-tests/src/lib.rs +++ b/testing/integration-tests/src/lib.rs @@ -24,3 +24,11 @@ mod storage; use test_runtime::node_runtime; #[cfg(test)] use utils::*; + +// We don't use this dependency, but it's here so that we +// can enable logging easily if need be. Add this to a test +// to enable tracing for it: +// +// tracing_subscriber::fmt::init(); +#[cfg(test)] +use tracing_subscriber as _; diff --git a/testing/integration-tests/src/metadata/validation.rs b/testing/integration-tests/src/metadata/validation.rs index 80480ed1b8..5d8efcb4ea 100644 --- a/testing/integration-tests/src/metadata/validation.rs +++ b/testing/integration-tests/src/metadata/validation.rs @@ -3,6 +3,7 @@ // see LICENSE for license details. use crate::{ + node_runtime, test_context, TestContext, }; @@ -28,72 +29,57 @@ use scale_info::{ TypeInfo, }; use subxt::{ - ClientBuilder, - DefaultConfig, Metadata, - SubstrateExtrinsicParams, + OfflineClient, + SubstrateConfig, }; -use crate::utils::node_runtime; - -type RuntimeApi = - node_runtime::RuntimeApi>; - -async fn metadata_to_api(metadata: RuntimeMetadataV14, cxt: &TestContext) -> RuntimeApi { +async fn metadata_to_api( + metadata: RuntimeMetadataV14, + ctx: &TestContext, +) -> OfflineClient { let prefixed = RuntimeMetadataPrefixed::from(metadata); let metadata = Metadata::try_from(prefixed).unwrap(); - ClientBuilder::new() - .set_url(cxt.node_proc.ws_url().to_string()) - .set_metadata(metadata) - .build() - .await - .unwrap() - .to_runtime_api::, - >>() + OfflineClient::new( + ctx.client().genesis_hash(), + ctx.client().runtime_version(), + metadata, + ) } #[tokio::test] async fn full_metadata_check() { - let cxt = test_context().await; - let api = &cxt.api; + let ctx = test_context().await; + let api = ctx.client(); // Runtime metadata is identical to the metadata used during API generation. - assert!(api.validate_metadata().is_ok()); + assert!(node_runtime::validate_codegen(&api).is_ok()); // Modify the metadata. - let mut metadata: RuntimeMetadataV14 = { - let locked_client_metadata = api.client.metadata(); - let client_metadata = locked_client_metadata.read(); - client_metadata.runtime_metadata().clone() - }; + let mut metadata: RuntimeMetadataV14 = api.metadata().runtime_metadata().clone(); metadata.pallets[0].name = "NewPallet".to_string(); - let new_api = metadata_to_api(metadata, &cxt).await; + let api = metadata_to_api(metadata, &ctx).await; assert_eq!( - new_api - .validate_metadata() + node_runtime::validate_codegen(&api) .expect_err("Validation should fail for incompatible metadata"), - ::subxt::MetadataError::IncompatibleMetadata + ::subxt::error::MetadataError::IncompatibleMetadata ); } #[tokio::test] async fn constant_values_are_not_validated() { - let cxt = test_context().await; - let api = &cxt.api; + let ctx = test_context().await; + let api = ctx.client(); - // Ensure that `ExistentialDeposit` is compatible before altering the metadata. - assert!(cxt.api.constants().balances().existential_deposit().is_ok()); + let deposit_addr = node_runtime::constants().balances().existential_deposit(); + + // Retrieve existential deposit to validate it and confirm that it's OK. + assert!(api.constants().at(&deposit_addr).is_ok()); // Modify the metadata. - let mut metadata: RuntimeMetadataV14 = { - let locked_client_metadata = api.client.metadata(); - let client_metadata = locked_client_metadata.read(); - client_metadata.runtime_metadata().clone() - }; + let mut metadata: RuntimeMetadataV14 = api.metadata().runtime_metadata().clone(); let mut existential = metadata .pallets @@ -108,13 +94,10 @@ async fn constant_values_are_not_validated() { // Modifying a constant value should not lead to an error: existential.value = vec![0u8; 32]; - let new_api = metadata_to_api(metadata, &cxt).await; - - assert!(new_api.validate_metadata().is_ok()); - assert!(new_api.constants().balances().existential_deposit().is_ok()); + let api = metadata_to_api(metadata, &ctx).await; - // Other constant validation should not be impacted. - assert!(new_api.constants().balances().max_locks().is_ok()); + assert!(node_runtime::validate_codegen(&api).is_ok()); + assert!(api.constants().at(&deposit_addr).is_ok()); } fn default_pallet() -> PalletMetadata { @@ -143,11 +126,15 @@ fn pallets_to_metadata(pallets: Vec) -> RuntimeMetadataV14 { #[tokio::test] async fn calls_check() { - let cxt = test_context().await; + let ctx = test_context().await; + let api = ctx.client(); + + let unbond_tx = node_runtime::tx().staking().unbond(123_456_789_012_345); + let withdraw_unbonded_addr = node_runtime::tx().staking().withdraw_unbonded(10); // Ensure that `Unbond` and `WinthdrawUnbonded` calls are compatible before altering the metadata. - assert!(cxt.api.tx().staking().unbond(123_456_789_012_345).is_ok()); - assert!(cxt.api.tx().staking().withdraw_unbonded(10).is_ok()); + assert!(api.tx().validate(&unbond_tx).is_ok()); + assert!(api.tx().validate(&withdraw_unbonded_addr).is_ok()); // Reconstruct the `Staking` call as is. struct CallRec; @@ -181,9 +168,11 @@ async fn calls_check() { ..default_pallet() }; let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_ok()); - assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); + let api = metadata_to_api(metadata, &ctx).await; + + // The calls should still be valid with this new type info: + assert!(api.tx().validate(&unbond_tx).is_ok()); + assert!(api.tx().validate(&withdraw_unbonded_addr).is_ok()); // Change `Unbond` call but leave the rest as is. struct CallRecSecond; @@ -216,31 +205,24 @@ async fn calls_check() { ..default_pallet() }; let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; + let api = metadata_to_api(metadata, &ctx).await; + // Unbond call should fail, while withdraw_unbonded remains compatible. - assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_err()); - assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); + assert!(api.tx().validate(&unbond_tx).is_err()); + assert!(api.tx().validate(&withdraw_unbonded_addr).is_ok()); } #[tokio::test] async fn storage_check() { - let cxt = test_context().await; + let ctx = test_context().await; + let api = ctx.client(); + + let tx_count_addr = node_runtime::storage().system().extrinsic_count(); + let tx_len_addr = node_runtime::storage().system().all_extrinsics_len(); // Ensure that `ExtrinsicCount` and `EventCount` storages are compatible before altering the metadata. - assert!(cxt - .api - .storage() - .system() - .extrinsic_count(None) - .await - .is_ok()); - assert!(cxt - .api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); + assert!(api.storage().validate(&tx_count_addr).is_ok()); + assert!(api.storage().validate(&tx_len_addr).is_ok()); // Reconstruct the storage. let storage = PalletStorageMetadata { @@ -268,19 +250,11 @@ async fn storage_check() { ..default_pallet() }; let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api - .storage() - .system() - .extrinsic_count(None) - .await - .is_ok()); - assert!(new_api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); + let api = metadata_to_api(metadata, &ctx).await; + + // The addresses should still validate: + assert!(api.storage().validate(&tx_count_addr).is_ok()); + assert!(api.storage().validate(&tx_len_addr).is_ok()); // Reconstruct the storage while modifying ExtrinsicCount. let storage = PalletStorageMetadata { @@ -309,17 +283,9 @@ async fn storage_check() { ..default_pallet() }; let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api - .storage() - .system() - .extrinsic_count(None) - .await - .is_err()); - assert!(new_api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); + let api = metadata_to_api(metadata, &ctx).await; + + // The count route should fail now; the other will be ok still. + assert!(api.storage().validate(&tx_count_addr).is_err()); + assert!(api.storage().validate(&tx_len_addr).is_ok()); } diff --git a/testing/integration-tests/src/storage/mod.rs b/testing/integration-tests/src/storage/mod.rs index af903e3ab1..f56ad8885a 100644 --- a/testing/integration-tests/src/storage/mod.rs +++ b/testing/integration-tests/src/storage/mod.rs @@ -3,47 +3,48 @@ // see LICENSE for license details. use crate::{ - node_runtime::{ - self, - DispatchError, - }, + node_runtime, pair_signer, test_context, + utils::wait_for_blocks, }; use sp_keyring::AccountKeyring; #[tokio::test] -async fn storage_plain_lookup() -> Result<(), subxt::Error> { +async fn storage_plain_lookup() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); // Look up a plain value. Wait long enough that we don't get the genesis block data, // because it may have no storage associated with it. - tokio::time::sleep(std::time::Duration::from_secs(6)).await; - let entry = ctx.api.storage().timestamp().now(None).await?; + wait_for_blocks(&api).await; + + let addr = node_runtime::storage().timestamp().now(); + let entry = api.storage().fetch_or_default(&addr, None).await?; assert!(entry > 0); Ok(()) } #[tokio::test] -async fn storage_map_lookup() -> Result<(), subxt::Error> { +async fn storage_map_lookup() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); let signer = pair_signer(AccountKeyring::Alice.pair()); let alice = AccountKeyring::Alice.to_account_id(); // Do some transaction to bump the Alice nonce to 1: - ctx.api - .tx() - .system() - .remark(vec![1, 2, 3, 4, 5])? - .sign_and_submit_then_watch_default(&signer) + let remark_tx = node_runtime::tx().system().remark(vec![1, 2, 3, 4, 5]); + api.tx() + .sign_and_submit_then_watch_default(&remark_tx, &signer) .await? .wait_for_finalized_success() .await?; // Look up the nonce for the user (we expect it to be 1). - let entry = ctx.api.storage().system().account(&alice, None).await?; + let nonce_addr = node_runtime::storage().system().account(&alice); + let entry = api.storage().fetch_or_default(&nonce_addr, None).await?; assert_eq!(entry.nonce, 1); Ok(()) @@ -54,23 +55,15 @@ async fn storage_map_lookup() -> Result<(), subxt::Error> { // treated as a StorageKey (ie we should hash both values together with one hasher, rather // than hash both values separately, or ignore the second value). #[tokio::test] -async fn storage_n_mapish_key_is_properly_created( -) -> Result<(), subxt::Error> { +async fn storage_n_mapish_key_is_properly_created() -> Result<(), subxt::Error> { use codec::Encode; - use node_runtime::{ - runtime_types::sp_core::crypto::KeyTypeId, - session::storage::KeyOwner, - }; - use subxt::{ - storage::StorageKeyPrefix, - StorageEntry, - }; + use node_runtime::runtime_types::sp_core::crypto::KeyTypeId; // This is what the generated code hashes a `session().key_owner(..)` key into: - let actual_key_bytes = KeyOwner(&KeyTypeId([1, 2, 3, 4]), &[5u8, 6, 7, 8]) - .key() - .final_key(StorageKeyPrefix::new::()) - .0; + let actual_key_bytes = node_runtime::storage() + .session() + .key_owner(KeyTypeId([1, 2, 3, 4]), [5u8, 6, 7, 8]) + .to_bytes(); // Let's manually hash to what we assume it should be and compare: let expected_key_bytes = { @@ -89,8 +82,9 @@ async fn storage_n_mapish_key_is_properly_created( } #[tokio::test] -async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> { +async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> { let ctx = test_context().await; + let api = ctx.client(); // Boilerplate; we create a new asset class with ID 99, and then // we "approveTransfer" of some of this asset class. This gives us an @@ -98,30 +92,27 @@ async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error; - -pub async fn test_node_process_with( - key: AccountKeyring, -) -> TestNodeProcess { +pub async fn test_context_with(key: AccountKeyring) -> TestContext { let path = std::env::var("SUBSTRATE_NODE_PATH").unwrap_or_else(|_| { if which::which(SUBSTRATE_NODE_PATH).is_err() { panic!("A substrate binary should be installed on your path for integration tests. \ @@ -32,35 +26,19 @@ pub async fn test_node_process_with( SUBSTRATE_NODE_PATH.to_string() }); - let proc = TestNodeProcess::::build(path.as_str()) + let proc = TestContext::build(path.as_str()) .with_authority(key) - .spawn::() + .spawn::() .await; proc.unwrap() } -pub async fn test_node_process() -> TestNodeProcess { - test_node_process_with(AccountKeyring::Alice).await -} - -pub struct TestContext { - pub node_proc: TestNodeProcess, - pub api: node_runtime::RuntimeApi, -} - -impl TestContext { - pub fn client(&self) -> &Client { - &self.api.client - } -} +pub type TestContext = TestNodeProcess; pub async fn test_context() -> TestContext { - tracing_subscriber::fmt::try_init().ok(); - let node_proc = test_node_process_with(AccountKeyring::Alice).await; - let api = node_proc.client().clone().to_runtime_api(); - TestContext { node_proc, api } + test_context_with(AccountKeyring::Alice).await } -pub fn pair_signer(pair: Pair) -> PairSigner { +pub fn pair_signer(pair: Pair) -> PairSigner { PairSigner::new(pair) } diff --git a/testing/integration-tests/src/utils/mod.rs b/testing/integration-tests/src/utils/mod.rs index 60cff25b5a..5d365d20d5 100644 --- a/testing/integration-tests/src/utils/mod.rs +++ b/testing/integration-tests/src/utils/mod.rs @@ -4,6 +4,8 @@ mod context; mod node_proc; +mod wait_for_blocks; pub use context::*; pub use node_proc::TestNodeProcess; +pub use wait_for_blocks::wait_for_blocks; diff --git a/testing/integration-tests/src/utils/node_proc.rs b/testing/integration-tests/src/utils/node_proc.rs index b156e223ba..1f18fe0434 100644 --- a/testing/integration-tests/src/utils/node_proc.rs +++ b/testing/integration-tests/src/utils/node_proc.rs @@ -16,16 +16,14 @@ use std::{ process, }; use subxt::{ - Client, - ClientBuilder, Config, + OnlineClient, }; /// Spawn a local substrate node for testing subxt. pub struct TestNodeProcess { proc: process::Child, - client: Client, - ws_url: String, + client: OnlineClient, } impl Drop for TestNodeProcess @@ -61,13 +59,8 @@ where } /// Returns the subxt client connected to the running node. - pub fn client(&self) -> &Client { - &self.client - } - - /// Returns the address to which the client is connected. - pub fn ws_url(&self) -> &str { - &self.ws_url + pub fn client(&self) -> OnlineClient { + self.client.clone() } } @@ -129,15 +122,9 @@ impl TestNodeProcessBuilder { let ws_url = format!("ws://127.0.0.1:{}", ws_port); // Connect to the node with a subxt client: - let client = ClientBuilder::new().set_url(ws_url.clone()).build().await; + let client = OnlineClient::from_url(ws_url.clone()).await; match client { - Ok(client) => { - Ok(TestNodeProcess { - proc, - client, - ws_url, - }) - } + Ok(client) => Ok(TestNodeProcess { proc, client }), Err(err) => { let err = format!("Failed to connect to node rpc at {}: {}", ws_url, err); tracing::error!("{}", err); diff --git a/testing/integration-tests/src/utils/wait_for_blocks.rs b/testing/integration-tests/src/utils/wait_for_blocks.rs new file mode 100644 index 0000000000..0d190ec8ec --- /dev/null +++ b/testing/integration-tests/src/utils/wait_for_blocks.rs @@ -0,0 +1,17 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use subxt::{ + client::OnlineClientT, + Config, +}; + +/// Wait for blocks to be produced before running tests. Waiting for two blocks +/// (the genesis block and another one) seems to be enough to allow tests +/// like `dry_run_passes` to work properly. +pub async fn wait_for_blocks(api: &impl OnlineClientT) { + let mut sub = api.rpc().subscribe_blocks().await.unwrap(); + sub.next().await; + sub.next().await; +}