diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index f276229d9d..0aeccef842 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -166,13 +166,21 @@ fn generate_storage_entry_fns( None => quote!(#t), } }); - - let entry_struct = quote! { - pub struct #entry_struct_ident <'a>( #( pub &'a #field_types ),* ); - + // 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 constructor = - quote!( #entry_struct_ident( #( #field_names ),* ) ); let key_impl = if hashers.len() == fields.len() { // If the number of hashers matches the number of fields, we're dealing with @@ -214,7 +222,7 @@ fn generate_storage_entry_fns( ) }; - (fields, entry_struct, constructor, key_impl, true) + (fields, entry_struct, constructor, key_impl, should_ref) } _ => { let (lifetime_param, lifetime_ref) = (quote!(<'a>), quote!(&'a)); diff --git a/integration-tests/src/codegen/polkadot.rs b/integration-tests/src/codegen/polkadot.rs index d4dacbc6dc..f185e56929 100644 --- a/integration-tests/src/codegen/polkadot.rs +++ b/integration-tests/src/codegen/polkadot.rs @@ -34,7 +34,7 @@ pub mod api { "ChildBounties", "Tips", "ElectionProviderMultiPhase", - "BagsList", + "VoterList", "ParachainsOrigin", "Configuration", "ParasShared", @@ -109,7 +109,7 @@ pub mod api { #[codec(index = 36)] ElectionProviderMultiPhase(election_provider_multi_phase::Event), #[codec(index = 37)] - BagsList(bags_list::Event), + VoterList(voter_list::Event), #[codec(index = 53)] ParaInclusion(para_inclusion::Event), #[codec(index = 56)] @@ -811,349 +811,430 @@ pub mod api { Self { client } } #[doc = " The full account information for a particular account ID."] - pub async fn account( + pub fn account( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::AccountData< - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::AccountData< + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The full account information for a particular account ID."] - pub async fn account_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Total extrinsics count for the current block."] - pub async fn extrinsic_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The current weight for the block."] - pub async fn block_weight( + pub fn block_weight( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u64, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " Total length (in bytes) for all extrinsics put together, for the current block."] - pub async fn all_extrinsics_len( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Map of block numbers to block hashes."] - pub async fn block_hash( + pub fn block_hash( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Map of block numbers to block hashes."] - pub async fn block_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BlockHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub async fn extrinsic_data( + pub fn extrinsic_data( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub async fn extrinsic_data_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ExtrinsicData<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The current block number being processed. Set by `execute_block`."] - pub async fn number( + pub fn number( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Hash of the previous block."] - pub async fn parent_hash( + pub fn parent_hash( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Digest of the current block, also part of the block header."] - pub async fn digest( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_runtime::generic::digest::Digest, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn digest( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " Events deposited for the current block."] @@ -1163,66 +1244,78 @@ pub mod api { #[doc = ""] #[doc = " Events have a large in-memory size. Box the events to not go out-of-memory"] #[doc = " just in case someone still reads them from within the runtime."] - pub async fn events( + pub fn events( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::polkadot_runtime::Event, - ::subxt::sp_core::H256, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + runtime_types::frame_system::EventRecord< + runtime_types::polkadot_runtime::Event, + ::subxt::sp_core::H256, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 240u8, 45u8, 247u8, 87u8, 187u8, 148u8, 241u8, 111u8, 210u8, - 52u8, 145u8, 237u8, 136u8, 30u8, 227u8, 45u8, 251u8, 110u8, - 19u8, 214u8, 5u8, 61u8, 98u8, 188u8, 186u8, 133u8, 106u8, - 145u8, 13u8, 64u8, 140u8, 226u8, - ] - { - let entry = Events; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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, 189u8, 235u8, 243u8, 226u8, 205u8, 111u8, 30u8, + 124u8, 59u8, 193u8, 123u8, 21u8, 73u8, 39u8, 125u8, + 211u8, 241u8, 154u8, 164u8, 25u8, 0u8, 110u8, 11u8, + 151u8, 242u8, 32u8, 215u8, 41u8, 208u8, 184u8, 212u8, + ] + { + let entry = Events; + client.storage().fetch_or_default(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " The number of events in the `Events` list."] - pub async fn event_count( + pub fn event_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] @@ -1235,34 +1328,39 @@ 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 async fn event_topics( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn event_topics( + &self, + _0: &'a ::subxt::sp_core::H256, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] @@ -1275,142 +1373,180 @@ 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 async fn event_topics_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, EventTopics<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] - pub async fn last_runtime_upgrade( + pub fn last_runtime_upgrade( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_system::LastRuntimeUpgradeInfo, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] - pub async fn upgraded_to_u32_ref_count( + pub fn upgraded_to_u32_ref_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " True if we have upgraded so that AccountInfo contains three types of `RefCount`. False"] #[doc = " (default) if not."] - pub async fn upgraded_to_triple_ref_count( + pub fn upgraded_to_triple_ref_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The execution phase of the block."] - pub async fn execution_phase( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -1435,10 +1571,10 @@ pub mod api { let metadata = locked_metadata.read(); if metadata.constant_hash("System", "BlockWeights")? == [ - 77u8, 188u8, 116u8, 105u8, 124u8, 67u8, 201u8, 169u8, 174u8, - 156u8, 7u8, 2u8, 231u8, 65u8, 13u8, 245u8, 220u8, 34u8, - 198u8, 223u8, 0u8, 30u8, 74u8, 148u8, 238u8, 5u8, 150u8, - 55u8, 223u8, 116u8, 97u8, 40u8, + 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")?; @@ -1537,10 +1673,10 @@ pub mod api { let metadata = locked_metadata.read(); if metadata.constant_hash("System", "Version")? == [ - 71u8, 227u8, 99u8, 177u8, 47u8, 27u8, 21u8, 48u8, 38u8, - 211u8, 225u8, 124u8, 13u8, 40u8, 201u8, 250u8, 201u8, 88u8, - 166u8, 105u8, 185u8, 252u8, 100u8, 95u8, 198u8, 183u8, 24u8, - 153u8, 80u8, 223u8, 108u8, 21u8, + 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")?; @@ -1735,10 +1871,10 @@ pub mod api { }; if runtime_call_hash == [ - 191u8, 57u8, 173u8, 36u8, 31u8, 180u8, 34u8, 23u8, 167u8, - 186u8, 119u8, 191u8, 175u8, 175u8, 54u8, 109u8, 136u8, 10u8, - 240u8, 124u8, 32u8, 83u8, 23u8, 22u8, 59u8, 189u8, 54u8, - 68u8, 13u8, 48u8, 43u8, 129u8, + 156u8, 212u8, 20u8, 163u8, 76u8, 226u8, 49u8, 220u8, 138u8, + 67u8, 19u8, 21u8, 102u8, 182u8, 151u8, 114u8, 157u8, 164u8, + 38u8, 49u8, 232u8, 36u8, 44u8, 41u8, 134u8, 38u8, 121u8, + 148u8, 229u8, 188u8, 151u8, 42u8, ] { let call = Schedule { @@ -1819,10 +1955,10 @@ pub mod api { }; if runtime_call_hash == [ - 245u8, 110u8, 85u8, 145u8, 67u8, 243u8, 213u8, 129u8, 139u8, - 179u8, 79u8, 34u8, 12u8, 97u8, 235u8, 40u8, 83u8, 27u8, - 186u8, 215u8, 252u8, 13u8, 163u8, 195u8, 198u8, 38u8, 223u8, - 192u8, 25u8, 201u8, 133u8, 229u8, + 127u8, 59u8, 221u8, 48u8, 39u8, 116u8, 104u8, 186u8, 77u8, + 136u8, 160u8, 62u8, 148u8, 34u8, 111u8, 173u8, 50u8, 120u8, + 153u8, 16u8, 27u8, 153u8, 171u8, 226u8, 160u8, 94u8, 116u8, + 115u8, 102u8, 56u8, 200u8, 24u8, ] { let call = ScheduleNamed { @@ -1906,10 +2042,10 @@ pub mod api { }; if runtime_call_hash == [ - 0u8, 223u8, 159u8, 58u8, 230u8, 216u8, 109u8, 93u8, 34u8, - 200u8, 153u8, 22u8, 182u8, 64u8, 231u8, 142u8, 115u8, 207u8, - 150u8, 179u8, 11u8, 72u8, 251u8, 51u8, 178u8, 2u8, 84u8, - 150u8, 101u8, 167u8, 204u8, 120u8, + 141u8, 209u8, 161u8, 212u8, 18u8, 210u8, 72u8, 154u8, 86u8, + 244u8, 234u8, 202u8, 68u8, 230u8, 164u8, 66u8, 6u8, 10u8, + 12u8, 234u8, 5u8, 240u8, 80u8, 70u8, 155u8, 166u8, 184u8, + 68u8, 162u8, 156u8, 152u8, 106u8, ] { let call = ScheduleAfter { @@ -1959,10 +2095,10 @@ pub mod api { }; if runtime_call_hash == [ - 93u8, 123u8, 108u8, 161u8, 185u8, 23u8, 35u8, 175u8, 231u8, - 138u8, 4u8, 49u8, 244u8, 68u8, 152u8, 114u8, 15u8, 123u8, - 107u8, 125u8, 97u8, 14u8, 25u8, 27u8, 42u8, 102u8, 239u8, - 209u8, 159u8, 217u8, 141u8, 216u8, + 76u8, 92u8, 127u8, 193u8, 231u8, 99u8, 118u8, 121u8, 12u8, + 25u8, 115u8, 146u8, 174u8, 237u8, 215u8, 165u8, 151u8, 248u8, + 47u8, 225u8, 36u8, 218u8, 63u8, 177u8, 190u8, 69u8, 105u8, + 118u8, 157u8, 37u8, 150u8, 107u8, ] { let call = ScheduleNamedAfter { @@ -2071,110 +2207,137 @@ pub mod api { 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 async fn agenda (& self , _0 : & :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: 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 >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 18u8, 151u8, 43u8, 108u8, 227u8, 68u8, 204u8, 82u8, - 150u8, 128u8, 140u8, 213u8, 106u8, 201u8, 4u8, 186u8, 20u8, - 191u8, 125u8, 72u8, 69u8, 134u8, 48u8, 194u8, 109u8, 61u8, - 7u8, 244u8, 52u8, 161u8, 46u8, - ] - { - let entry = Agenda(_0); - self.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 (& 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 + == [ + 172u8, 202u8, 10u8, 25u8, 181u8, 221u8, 119u8, 121u8, + 3u8, 125u8, 85u8, 243u8, 145u8, 97u8, 12u8, 238u8, 35u8, + 211u8, 33u8, 153u8, 189u8, 95u8, 180u8, 28u8, 180u8, + 107u8, 119u8, 177u8, 48u8, 240u8, 123u8, 128u8, + ] + { + 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 async fn agenda_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Agenda<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 18u8, 151u8, 43u8, 108u8, 227u8, 68u8, 204u8, 82u8, - 150u8, 128u8, 140u8, 213u8, 106u8, 201u8, 4u8, 186u8, 20u8, - 191u8, 125u8, 72u8, 69u8, 134u8, 48u8, 194u8, 109u8, 61u8, - 7u8, 244u8, 52u8, 161u8, 46u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 172u8, 202u8, 10u8, 25u8, 181u8, 221u8, 119u8, 121u8, + 3u8, 125u8, 85u8, 243u8, 145u8, 97u8, 12u8, 238u8, 35u8, + 211u8, 33u8, 153u8, 189u8, 95u8, 180u8, 28u8, 180u8, + 107u8, 119u8, 177u8, 48u8, 240u8, 123u8, 128u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Lookup from identity to the block number and index of the task."] - pub async fn lookup( + pub fn lookup( &self, - _0: &[::core::primitive::u8], + _0: &'a [::core::primitive::u8], block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Lookup from identity to the block number and index of the task."] - pub async fn lookup_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Lookup<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -2497,10 +2660,9 @@ pub mod api { impl ::subxt::StorageEntry for PreimageFor<'_> { const PALLET: &'static str = "Preimage"; const STORAGE: &'static str = "PreimageFor"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + 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, @@ -2516,120 +2678,152 @@ pub mod api { Self { client } } #[doc = " The request status of a given hash."] - pub async fn status_for( + pub fn status_for( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_preimage::RequestStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_preimage::RequestStatus< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The request status of a given hash."] - pub async fn status_for_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, StatusFor<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The preimages stored by this pallet."] - pub async fn preimage_for( + pub fn preimage_for( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The preimages stored by this pallet."] - pub async fn preimage_for_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PreimageFor<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -2848,7 +3042,13 @@ pub mod api { impl ::subxt::StorageEntry for Authorities { const PALLET: &'static str = "Babe"; const STORAGE: &'static str = "Authorities"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > ; + 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 } @@ -2903,7 +3103,13 @@ pub mod api { impl ::subxt::StorageEntry for NextAuthorities { const PALLET: &'static str = "Babe"; const STORAGE: &'static str = "NextAuthorities"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > ; + 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 } @@ -2921,10 +3127,9 @@ pub mod api { impl ::subxt::StorageEntry for UnderConstruction<'_> { const PALLET: &'static str = "Babe"; const STORAGE: &'static str = "UnderConstruction"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; + 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, @@ -2996,115 +3201,135 @@ pub mod api { Self { client } } #[doc = " Current epoch index."] - pub async fn epoch_index( + pub fn epoch_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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 async fn authorities (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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()) + } } } #[doc = " The slot at which the first epoch actually started. This is 0"] #[doc = " until the first block of the chain."] - pub async fn genesis_slot( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn genesis_slot( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " Current slot number."] - pub async fn current_slot( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn current_slot( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " The epoch randomness for the *current* epoch."] @@ -3117,115 +3342,125 @@ pub mod api { #[doc = " (like everything else on-chain) it is public. For example, it can be"] #[doc = " used where a number is needed that cannot have been chosen by an"] #[doc = " adversary, for purposes such as public-coin zero-knowledge proofs."] - pub async fn randomness( + pub fn randomness( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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 async fn pending_epoch_config_change( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&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()) + } } } #[doc = " Next epoch randomness."] - pub async fn next_randomness( + pub fn next_randomness( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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 async fn next_authorities (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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()) + } } } #[doc = " Randomness under construction."] @@ -3237,155 +3472,188 @@ pub mod api { #[doc = " Once a segment reaches this length, we begin the next one."] #[doc = " We reset all segments and return to `0` at the beginning of every"] #[doc = " epoch."] - pub async fn segment_index( + pub fn segment_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub async fn under_construction( + pub fn under_construction( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub async fn under_construction_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnderConstruction<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Temporary value (cleared at block finalization) which is `Some`"] #[doc = " if per-block initialization has already been called for current block."] - pub async fn initialized( + pub fn initialized( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< + ) -> impl ::core::future::Future< + Output = ::core::result::Result< ::core::option::Option< - runtime_types::sp_consensus_babe::digests::PreDigest, + ::core::option::Option< + runtime_types::sp_consensus_babe::digests::PreDigest, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " This field should always be populated during block processing unless"] #[doc = " secondary plain slots are enabled (which don't contain a VRF output)."] #[doc = ""] #[doc = " It is set in `on_finalize`, before it will contain the value from the last block."] - pub async fn author_vrf_randomness( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<[::core::primitive::u8; 32usize]>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn author_vrf_randomness( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The block numbers when the last and current epoch have started, respectively `N-1` and"] @@ -3393,33 +3661,38 @@ pub mod api { #[doc = " NOTE: We track this is in order to annotate the block number when a given pool of"] #[doc = " entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in"] #[doc = " slots, which may be skipped, the block numbers may not line up with the slot numbers."] - pub async fn epoch_start( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " How late the current block is compared to its parent."] @@ -3427,91 +3700,114 @@ pub mod api { #[doc = " This entry is populated as part of block execution and is cleaned up"] #[doc = " on block finalization. Querying this storage entry outside of block"] #[doc = " execution context should always yield zero."] - pub async fn lateness( + pub fn lateness( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] #[doc = " genesis."] - pub async fn epoch_config( + pub fn epoch_config( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn next_epoch_config( + pub fn next_epoch_config( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -3720,59 +4016,73 @@ pub mod api { Self { client } } #[doc = " Current time for the current block."] - pub async fn now( + pub fn now( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Did the timestamp get updated in this block?"] - pub async fn did_update( + pub fn did_update( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -4229,61 +4539,77 @@ pub mod api { Self { client } } #[doc = " The lookup from index to account."] - pub async fn accounts( + pub fn accounts( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The lookup from index to account."] - pub async fn accounts_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Accounts<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -4873,7 +5199,12 @@ pub mod api { impl ::subxt::StorageEntry for Locks<'_> { const PALLET: &'static str = "Balances"; const STORAGE: &'static str = "Locks"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > ; + 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, @@ -4885,13 +5216,12 @@ pub mod api { impl ::subxt::StorageEntry for Reserves<'_> { const PALLET: &'static str = "Balances"; const STORAGE: &'static str = "Reserves"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; + 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, @@ -4916,31 +5246,38 @@ pub mod api { Self { client } } #[doc = " The total units issued in the system."] - pub async fn total_issuance( + pub fn total_issuance( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The Balances pallet example of storing the balance of an account."] @@ -4967,34 +5304,41 @@ 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 async fn account( + pub fn account( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " The Balances pallet example of storing the balance of an account."] @@ -5021,174 +5365,211 @@ 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 async fn account_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] pub async fn locks (& self , _0 : & :: subxt :: sp_core :: crypto :: AccountId32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " Any liquidity locks on some account balances."] #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - pub async fn locks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Locks<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 = " Named reserves on some account balances."] - pub async fn reserves( + pub fn reserves( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Named reserves on some account balances."] - pub async fn reserves_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reserves<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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."] #[doc = ""] #[doc = " This is set to v2.0.0 for new networks."] - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::Releases, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn storage_version( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } } @@ -5310,62 +5691,72 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn next_fee_multiplier( + pub fn next_fee_multiplier( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } - pub async fn storage_version( + pub fn storage_version( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_transaction_payment::Releases, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } } @@ -5424,66 +5815,6 @@ pub mod api { Err(::subxt::MetadataError::IncompatibleMetadata.into()) } } - #[doc = " The polynomial that is applied in order to derive fee from weight."] - pub fn weight_to_fee( - &self, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_support::weights::WeightToFeeCoefficient< - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("TransactionPayment", "WeightToFee")? - == [ - 147u8, 78u8, 51u8, 196u8, 214u8, 20u8, 36u8, 114u8, 64u8, - 95u8, 181u8, 140u8, 80u8, 115u8, 253u8, 71u8, 214u8, 21u8, - 118u8, 115u8, 108u8, 124u8, 192u8, 122u8, 26u8, 130u8, 143u8, - 240u8, 250u8, 230u8, 205u8, 200u8, - ] - { - let pallet = metadata.pallet("TransactionPayment")?; - let constant = pallet.constant("WeightToFee")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The polynomial that is applied in order to derive fee from length."] - pub fn length_to_fee( - &self, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_support::weights::WeightToFeeCoefficient< - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - if metadata.constant_hash("TransactionPayment", "LengthToFee")? - == [ - 120u8, 219u8, 85u8, 57u8, 31u8, 128u8, 113u8, 179u8, 51u8, - 81u8, 69u8, 222u8, 206u8, 137u8, 222u8, 104u8, 59u8, 233u8, - 72u8, 51u8, 54u8, 187u8, 182u8, 249u8, 27u8, 17u8, 34u8, - 44u8, 215u8, 77u8, 39u8, 166u8, - ] - { - let pallet = metadata.pallet("TransactionPayment")?; - let constant = pallet.constant("LengthToFee")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } } } } @@ -5610,94 +5941,114 @@ pub mod api { Self { client } } #[doc = " Uncles"] - pub async fn uncles( + pub fn uncles( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_authorship::UncleEntryItem< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_authorship::UncleEntryItem< + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 71u8, 135u8, 85u8, 172u8, 221u8, 165u8, 212u8, 2u8, 208u8, - 50u8, 9u8, 92u8, 251u8, 25u8, 194u8, 123u8, 210u8, 4u8, - 148u8, 30u8, 20u8, 146u8, 21u8, 210u8, 138u8, 128u8, 144u8, - 152u8, 97u8, 57u8, 205u8, 231u8, - ] - { - let entry = Uncles; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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, 135u8, 85u8, 172u8, 221u8, 165u8, 212u8, 2u8, + 208u8, 50u8, 9u8, 92u8, 251u8, 25u8, 194u8, 123u8, 210u8, + 4u8, 148u8, 30u8, 20u8, 146u8, 21u8, 210u8, 138u8, 128u8, + 144u8, 152u8, 97u8, 57u8, 205u8, 231u8, + ] + { + let entry = Uncles; + client.storage().fetch_or_default(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Author of current block."] - pub async fn author( + pub fn author( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Whether uncles were already set in this block."] - pub async fn did_set_uncles( + pub fn did_set_uncles( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -7884,488 +8235,608 @@ pub mod api { #[doc = " Must be more than the number of eras delayed by session otherwise. I.e. active era must"] #[doc = " always be in history. I.e. `active_era > current_era - history_depth` must be"] #[doc = " guaranteed."] - pub async fn history_depth( + pub fn history_depth( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The ideal number of staking participants."] - pub async fn validator_count( + pub fn validator_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Minimum number of staking participants before emergency conditions are imposed."] - pub async fn minimum_validator_count( + pub fn minimum_validator_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn invulnerables( + pub fn invulnerables( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Map from all locked \"stash\" accounts to the controller account."] - pub async fn bonded( + pub fn bonded( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Map from all locked \"stash\" accounts to the controller account."] - pub async fn bonded_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Bonded<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The minimum active bond to become and maintain the role of a nominator."] - pub async fn min_nominator_bond( + pub fn min_nominator_bond( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The minimum active bond to become and maintain the role of a validator."] - pub async fn min_validator_bond( + pub fn min_validator_bond( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The minimum amount of commission that validators can set."] #[doc = ""] #[doc = " If set to `0`, no limit exists."] - pub async fn min_commission( + pub fn min_commission( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] - pub async fn ledger( + pub fn ledger( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] - pub async fn ledger_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Ledger<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Where the reward payment should be made. Keyed by stash."] - pub async fn payee( + pub fn payee( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::pallet_staking::RewardDestination< + ::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 + == [ + 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()) + } } } #[doc = " Where the reward payment should be made. Keyed by stash."] - pub async fn payee_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Payee<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The map from (wannabe) validator stash key to the preferences of that validator."] - pub async fn validators( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn validators( + &self, + _0: &'a ::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " The map from (wannabe) validator stash key to the preferences of that validator."] - pub async fn validators_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Validators<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = "Counter for the related counted storage map"] - pub async fn counter_for_validators( + pub fn counter_for_validators( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn max_validators_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] @@ -8384,31 +8855,41 @@ 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 async fn nominators( + pub fn nominators( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] @@ -8427,206 +8908,263 @@ 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 async fn nominators_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Nominators<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = "Counter for the related counted storage map"] - pub async fn counter_for_nominators( + pub fn counter_for_nominators( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn max_nominators_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The current era index."] #[doc = ""] #[doc = " This is the latest planned era, depending on how the Session pallet queues the validator"] #[doc = " set, it might be active or not."] - pub async fn current_era( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The active era information, it holds index and start."] #[doc = ""] #[doc = " The active era is the era being currently rewarded. Validator set of this era must be"] #[doc = " equal to [`SessionInterface::validators`]."] - pub async fn active_era( + pub fn active_era( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn eras_start_session_index( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn eras_start_session_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStartSessionIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Exposure of validator at era."] @@ -8635,38 +9173,43 @@ 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 async fn eras_stakers( + pub fn eras_stakers( &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::core::primitive::u32, + _1: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::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 + == [ + 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()) + } } } #[doc = " Exposure of validator at era."] @@ -8675,29 +9218,37 @@ 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 async fn eras_stakers_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakers<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Clipped Exposure of validator at era."] @@ -8711,38 +9262,43 @@ 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 async fn eras_stakers_clipped( + pub fn eras_stakers_clipped( &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::core::primitive::u32, + _1: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::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 + == [ + 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()) + } } } #[doc = " Clipped Exposure of validator at era."] @@ -8756,29 +9312,37 @@ 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 async fn eras_stakers_clipped_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakersClipped<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] @@ -8786,35 +9350,40 @@ pub mod api { #[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 async fn eras_validator_prefs( - &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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< + 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()) + } } } #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] @@ -8822,681 +9391,844 @@ pub mod api { #[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 async fn eras_validator_prefs_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorPrefs<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn eras_validator_reward( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn eras_validator_reward_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorReward<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn eras_reward_points( + pub fn eras_reward_points( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::pallet_staking::EraRewardPoints< + ::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 + == [ + 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()) + } } } #[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 async fn eras_reward_points_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasRewardPoints<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn eras_total_stake( + pub fn eras_total_stake( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn eras_total_stake_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasTotalStake<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Mode of era forcing."] - pub async fn force_era( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Forcing, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn force_era( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[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 async fn slash_reward_fraction( + pub fn slash_reward_fraction( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " The amount of currency given to reporters of a slash event which was"] #[doc = " canceled by extraordinary circumstances (e.g. governance)."] - pub async fn canceled_slash_payout( + pub fn canceled_slash_payout( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " All unapplied slashes that are queued for later."] - pub async fn unapplied_slashes( + pub fn unapplied_slashes( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " All unapplied slashes that are queued for later."] - pub async fn unapplied_slashes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnappliedSlashes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " A mapping from still-bonded eras to the first session index of that era."] #[doc = ""] #[doc = " Must contains information for eras for the range:"] #[doc = " `[active_era - bounding_duration; active_era]`"] - pub async fn bonded_eras( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn bonded_eras( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " All slashing events on validators, mapped by era to the highest slash proportion"] #[doc = " and slash value of the era."] - pub async fn validator_slash_in_era( + pub fn validator_slash_in_era( &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::core::primitive::u32, + _1: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " All slashing events on validators, mapped by era to the highest slash proportion"] #[doc = " and slash value of the era."] - pub async fn validator_slash_in_era_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ValidatorSlashInEra<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " All slashing events on nominators, mapped by era to the highest slash value of the era."] - pub async fn nominator_slash_in_era( - &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " All slashing events on nominators, mapped by era to the highest slash value of the era."] - pub async fn nominator_slash_in_era_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NominatorSlashInEra<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Slashing spans for stash accounts."] - pub async fn slashing_spans( + pub fn slashing_spans( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::slashing::SlashingSpans, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Slashing spans for stash accounts."] - pub async fn slashing_spans_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SlashingSpans<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn span_slash( + pub fn span_slash( &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &::core::primitive::u32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, + _1: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::slashing::SpanRecord< - ::core::primitive::u128, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[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 async fn span_slash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpanSlash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The earliest era for which we have a pending, unapplied slash."] - pub async fn earliest_unapplied_slash( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn current_planned_session( + pub fn current_planned_session( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Indices of validators that have offended in the active era and whether they are currently"] @@ -9508,97 +10240,118 @@ pub mod api { #[doc = " `OffendingValidatorsThreshold` is reached. The vec is always kept sorted so that we can find"] #[doc = " whether a given validator has previously offended using binary search. It gets cleared when"] #[doc = " the era ends."] - pub async fn offending_validators( + pub fn offending_validators( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " True if network has been upgraded to this version."] #[doc = " Storage version of the pallet."] #[doc = ""] #[doc = " This is set to v7.0.0 for new networks."] - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Releases, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn storage_version( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[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 async fn chill_threshold( + pub fn chill_threshold( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -9853,126 +10606,155 @@ pub mod api { Self { client } } #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub async fn reports( + pub fn reports( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::sp_core::crypto::AccountId32, - ( + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::sp_staking::offence::OffenceDetails< ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< + ( ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ), + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub async fn reports_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reports<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub async fn concurrent_reports_index( - &self, - _0: &[::core::primitive::u8; 16usize], - _1: &[::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::H256>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub async fn concurrent_reports_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ConcurrentReportsIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Enumerates all reports of a kind along with the time they happened."] @@ -9981,34 +10763,39 @@ 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 async fn reports_by_kind_index( + pub fn reports_by_kind_index( &self, - _0: &[::core::primitive::u8; 16usize], + _0: &'a [::core::primitive::u8; 16usize], block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " Enumerates all reports of a kind along with the time they happened."] @@ -10017,29 +10804,37 @@ 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 async fn reports_by_kind_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReportsByKindIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -10294,124 +11089,148 @@ pub mod api { Self { client } } #[doc = " The current set of validators."] - pub async fn validators( + pub fn validators( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Current index of the session."] - pub async fn current_index( + pub fn current_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " True if the underlying economic identities or weighting behind the validators"] #[doc = " has changed in the queued validator set."] - pub async fn queued_changed( + pub fn queued_changed( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn queued_keys( + pub fn queued_keys( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::SessionKeys, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec<( + ::subxt::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()) + } } } #[doc = " Indices of disabled validators."] @@ -10419,142 +11238,181 @@ pub mod api { #[doc = " The vec is always kept sorted so that we can find whether a given validator is"] #[doc = " disabled using binary search. It gets cleared when `on_session_ending` returns"] #[doc = " a new set of identities."] - pub async fn disabled_validators( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn disabled_validators( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The next session keys for a validator."] - pub async fn next_keys( + pub fn next_keys( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The next session keys for a validator."] - pub async fn next_keys_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NextKeys<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub async fn key_owner( + pub fn key_owner( &self, - _0: &runtime_types::sp_core::crypto::KeyTypeId, - _1: &[::core::primitive::u8], + _0: &'a runtime_types::sp_core::crypto::KeyTypeId, + _1: &'a [::core::primitive::u8], block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub async fn key_owner_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, KeyOwner<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -10714,12 +11572,17 @@ pub mod api { Err(::subxt::MetadataError::IncompatibleMetadata.into()) } } - #[doc = "Note that the current authority set of the GRANDPA finality gadget has"] - #[doc = "stalled. This will trigger a forced authority set change at the beginning"] - #[doc = "of the next session, to be enacted `delay` blocks after that. The delay"] - #[doc = "should be high enough to safely assume that the block signalling the"] - #[doc = "forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters"] - #[doc = "will start the new authority set using the given finalized block as base."] + #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] + #[doc = ""] + #[doc = "This will trigger a forced authority set change at the beginning of the next session, to"] + #[doc = "be enacted `delay` blocks after that. The `delay` should be high enough to safely assume"] + #[doc = "that the block signalling the forced change will not be re-orged e.g. 1000 blocks."] + #[doc = "The block production rate (which may be slowed down because of finality lagging) should"] + #[doc = "be taken into account when choosing the `delay`. The GRANDPA voters based on the new"] + #[doc = "authority will start voting on top of `best_finalized_block_number` for new finalized"] + #[doc = "blocks. `best_finalized_block_number` should be the highest of the latest finalized"] + #[doc = "block of all validators of the new authority set."] + #[doc = ""] #[doc = "Only callable by root."] pub fn note_stalled( &self, @@ -10860,210 +11723,264 @@ pub mod api { Self { client } } #[doc = " State of the current authority set."] - pub async fn state( + pub fn state( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } #[doc = " Pending change: (signaled at, scheduled change)."] - pub async fn pending_change( + pub fn pending_change( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange< - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_grandpa::StoredPendingChange< + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " next block number where we can force a change."] - pub async fn next_forced( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " `true` if we are currently stalled."] - pub async fn stalled( + pub fn stalled( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The number of changes (both in terms of keys and underlying economic responsibilities)"] #[doc = " in the \"set\" of Grandpa validators from genesis."] - pub async fn current_set_id( + pub fn current_set_id( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn set_id_session( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn set_id_session_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SetIdSession<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -11242,7 +12159,10 @@ pub mod api { impl ::subxt::StorageEntry for Keys { const PALLET: &'static str = "ImOnline"; const STORAGE: &'static str = "Keys"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > ; + 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 } @@ -11309,173 +12229,199 @@ pub mod api { #[doc = " This value will only be used as a fallback if we fail to get a proper session"] #[doc = " progress estimate from `NextSessionRotation`, as those estimates should be"] #[doc = " more accurate then the value we calculate for `HeartbeatAfter`."] - pub async fn heartbeat_after( + pub fn heartbeat_after( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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 async fn keys (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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()) + } } } #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] - #[doc = " `WrapperOpaque`."] - pub async fn received_heartbeats( - &self, - _0: &::core::primitive::u32, - _1: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + #[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 = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] #[doc = " `WrapperOpaque`."] - pub async fn received_heartbeats_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReceivedHeartbeats<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] #[doc = " number of blocks authored by the given authority."] - pub async fn authored_blocks( + pub fn authored_blocks( &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::core::primitive::u32, + _1: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] #[doc = " number of blocks authored by the given authority."] - pub async fn authored_blocks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AuthoredBlocks<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -13109,6 +14055,20 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Seconded"; } + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, + Debug, + )] + #[doc = "A proposal got canceled."] + pub struct ProposalCanceled { + pub prop_index: ::core::primitive::u32, + } + impl ::subxt::Event for ProposalCanceled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "ProposalCanceled"; + } } pub mod storage { use super::runtime_types; @@ -13280,581 +14240,710 @@ pub mod api { Self { client } } #[doc = " The number of (public) proposals that have been made so far."] - pub async fn public_prop_count( + pub fn public_prop_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The public proposals. Unsorted. The second item is the proposal's hash."] - pub async fn public_props( + pub fn public_props( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec<( + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::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 + == [ + 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()) + } } } #[doc = " Those who have locked a deposit."] #[doc = ""] #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] - pub async fn deposit_of( + pub fn deposit_of( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Those who have locked a deposit."] #[doc = ""] #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] - pub async fn deposit_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DepositOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn preimages( + pub fn preimages( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_democracy::PreimageStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[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 async fn preimages_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Preimages<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub async fn referendum_count( + pub fn referendum_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The lowest referendum index representing an unbaked referendum. Equal to"] #[doc = " `ReferendumCount` if there isn't a unbaked referendum."] - pub async fn lowest_unbaked( + pub fn lowest_unbaked( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Information concerning any given referendum."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as indexes are not under an attacker’s control."] - pub async fn referendum_info_of( + pub fn referendum_info_of( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_democracy::types::ReferendumInfo< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::core::primitive::u128, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Information concerning any given referendum."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as indexes are not under an attacker’s control."] - pub async fn referendum_info_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReferendumInfoOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn voting_of( + pub fn voting_of( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_democracy::vote::Voting< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::subxt::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()) + } } } #[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 async fn voting_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VotingOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " True if the last referendum tabled was submitted externally. False if it was a public"] #[doc = " proposal."] - pub async fn last_tabled_was_external( + pub fn last_tabled_was_external( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn next_external( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::H256, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + #[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 = " 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 async fn blacklist( + pub fn blacklist( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn blacklist_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Blacklist<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Record of all proposals that have been subject to emergency cancellation."] - pub async fn cancellations( + pub fn cancellations( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Record of all proposals that have been subject to emergency cancellation."] - pub async fn cancellations_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Cancellations<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Storage version of the pallet."] #[doc = ""] #[doc = " New networks start with last version."] - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -14342,10 +15431,10 @@ pub mod api { }; if runtime_call_hash == [ - 171u8, 45u8, 34u8, 122u8, 218u8, 231u8, 219u8, 99u8, 254u8, - 22u8, 172u8, 193u8, 202u8, 243u8, 33u8, 150u8, 251u8, 138u8, - 193u8, 130u8, 211u8, 68u8, 68u8, 22u8, 166u8, 19u8, 217u8, - 21u8, 131u8, 227u8, 144u8, 28u8, + 228u8, 63u8, 11u8, 200u8, 199u8, 85u8, 129u8, 158u8, 119u8, + 237u8, 53u8, 152u8, 73u8, 177u8, 14u8, 253u8, 234u8, 248u8, + 145u8, 223u8, 179u8, 78u8, 175u8, 196u8, 239u8, 58u8, 216u8, + 15u8, 183u8, 140u8, 2u8, 219u8, ] { let call = Execute { @@ -14407,10 +15496,10 @@ pub mod api { }; if runtime_call_hash == [ - 167u8, 222u8, 69u8, 157u8, 53u8, 100u8, 78u8, 219u8, 182u8, - 33u8, 10u8, 169u8, 21u8, 151u8, 230u8, 160u8, 206u8, 56u8, - 247u8, 138u8, 253u8, 150u8, 25u8, 225u8, 242u8, 161u8, 75u8, - 205u8, 175u8, 209u8, 169u8, 176u8, + 19u8, 224u8, 172u8, 137u8, 131u8, 122u8, 127u8, 14u8, 172u8, + 168u8, 48u8, 212u8, 68u8, 113u8, 3u8, 15u8, 44u8, 199u8, + 42u8, 90u8, 254u8, 69u8, 81u8, 133u8, 221u8, 42u8, 200u8, + 163u8, 239u8, 120u8, 168u8, 132u8, ] { let call = Propose { @@ -14687,10 +15776,9 @@ pub mod api { impl ::subxt::StorageEntry for Proposals { const PALLET: &'static str = "Council"; const STORAGE: &'static str = "Proposals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; + type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -14757,233 +15845,290 @@ pub mod api { Self { client } } #[doc = " The hashes of the active proposals."] - pub async fn proposals( + pub fn proposals( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::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 + == [ + 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()) + } } } #[doc = " Actual proposal for a given hash, if it's current."] - pub async fn proposal_of( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 166u8, 196u8, 81u8, 86u8, 135u8, 5u8, 173u8, 163u8, 163u8, - 41u8, 218u8, 32u8, 33u8, 124u8, 49u8, 172u8, 135u8, 84u8, - 228u8, 53u8, 28u8, 27u8, 208u8, 110u8, 244u8, 194u8, 128u8, - 53u8, 73u8, 111u8, 103u8, 49u8, - ] - { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 170u8, 243u8, 110u8, 152u8, 90u8, 28u8, 173u8, 125u8, + 252u8, 111u8, 229u8, 1u8, 241u8, 200u8, 110u8, 114u8, + 89u8, 163u8, 133u8, 249u8, 195u8, 194u8, 81u8, 23u8, + 236u8, 196u8, 71u8, 8u8, 47u8, 211u8, 243u8, 175u8, + ] + { + let entry = ProposalOf(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Actual proposal for a given hash, if it's current."] - pub async fn proposal_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 166u8, 196u8, 81u8, 86u8, 135u8, 5u8, 173u8, 163u8, 163u8, - 41u8, 218u8, 32u8, 33u8, 124u8, 49u8, 172u8, 135u8, 84u8, - 228u8, 53u8, 28u8, 27u8, 208u8, 110u8, 244u8, 194u8, 128u8, - 53u8, 73u8, 111u8, 103u8, 49u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 170u8, 243u8, 110u8, 152u8, 90u8, 28u8, 173u8, 125u8, + 252u8, 111u8, 229u8, 1u8, 241u8, 200u8, 110u8, 114u8, + 89u8, 163u8, 133u8, 249u8, 195u8, 194u8, 81u8, 23u8, + 236u8, 196u8, 71u8, 8u8, 47u8, 211u8, 243u8, 175u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Votes on a given proposal, if it is ongoing."] - pub async fn voting( + pub fn voting( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Votes on a given proposal, if it is ongoing."] - pub async fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Voting<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Proposals so far."] - pub async fn proposal_count( + pub fn proposal_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The current members of the collective. This is stored sorted (just by value)."] - pub async fn members( + pub fn members( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] - pub async fn prime( + pub fn prime( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -15184,10 +16329,10 @@ pub mod api { }; if runtime_call_hash == [ - 171u8, 45u8, 34u8, 122u8, 218u8, 231u8, 219u8, 99u8, 254u8, - 22u8, 172u8, 193u8, 202u8, 243u8, 33u8, 150u8, 251u8, 138u8, - 193u8, 130u8, 211u8, 68u8, 68u8, 22u8, 166u8, 19u8, 217u8, - 21u8, 131u8, 227u8, 144u8, 28u8, + 228u8, 63u8, 11u8, 200u8, 199u8, 85u8, 129u8, 158u8, 119u8, + 237u8, 53u8, 152u8, 73u8, 177u8, 14u8, 253u8, 234u8, 248u8, + 145u8, 223u8, 179u8, 78u8, 175u8, 196u8, 239u8, 58u8, 216u8, + 15u8, 183u8, 140u8, 2u8, 219u8, ] { let call = Execute { @@ -15249,10 +16394,10 @@ pub mod api { }; if runtime_call_hash == [ - 167u8, 222u8, 69u8, 157u8, 53u8, 100u8, 78u8, 219u8, 182u8, - 33u8, 10u8, 169u8, 21u8, 151u8, 230u8, 160u8, 206u8, 56u8, - 247u8, 138u8, 253u8, 150u8, 25u8, 225u8, 242u8, 161u8, 75u8, - 205u8, 175u8, 209u8, 169u8, 176u8, + 19u8, 224u8, 172u8, 137u8, 131u8, 122u8, 127u8, 14u8, 172u8, + 168u8, 48u8, 212u8, 68u8, 113u8, 3u8, 15u8, 44u8, 199u8, + 42u8, 90u8, 254u8, 69u8, 81u8, 133u8, 221u8, 42u8, 200u8, + 163u8, 239u8, 120u8, 168u8, 132u8, ] { let call = Propose { @@ -15529,10 +16674,9 @@ pub mod api { impl ::subxt::StorageEntry for Proposals { const PALLET: &'static str = "TechnicalCommittee"; const STORAGE: &'static str = "Proposals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; + type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -15599,233 +16743,290 @@ pub mod api { Self { client } } #[doc = " The hashes of the active proposals."] - pub async fn proposals( + pub fn proposals( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::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 + == [ + 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()) + } } } #[doc = " Actual proposal for a given hash, if it's current."] - pub async fn proposal_of( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 166u8, 196u8, 81u8, 86u8, 135u8, 5u8, 173u8, 163u8, 163u8, - 41u8, 218u8, 32u8, 33u8, 124u8, 49u8, 172u8, 135u8, 84u8, - 228u8, 53u8, 28u8, 27u8, 208u8, 110u8, 244u8, 194u8, 128u8, - 53u8, 73u8, 111u8, 103u8, 49u8, - ] - { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 170u8, 243u8, 110u8, 152u8, 90u8, 28u8, 173u8, 125u8, + 252u8, 111u8, 229u8, 1u8, 241u8, 200u8, 110u8, 114u8, + 89u8, 163u8, 133u8, 249u8, 195u8, 194u8, 81u8, 23u8, + 236u8, 196u8, 71u8, 8u8, 47u8, 211u8, 243u8, 175u8, + ] + { + let entry = ProposalOf(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Actual proposal for a given hash, if it's current."] - pub async fn proposal_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 166u8, 196u8, 81u8, 86u8, 135u8, 5u8, 173u8, 163u8, 163u8, - 41u8, 218u8, 32u8, 33u8, 124u8, 49u8, 172u8, 135u8, 84u8, - 228u8, 53u8, 28u8, 27u8, 208u8, 110u8, 244u8, 194u8, 128u8, - 53u8, 73u8, 111u8, 103u8, 49u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 170u8, 243u8, 110u8, 152u8, 90u8, 28u8, 173u8, 125u8, + 252u8, 111u8, 229u8, 1u8, 241u8, 200u8, 110u8, 114u8, + 89u8, 163u8, 133u8, 249u8, 195u8, 194u8, 81u8, 23u8, + 236u8, 196u8, 71u8, 8u8, 47u8, 211u8, 243u8, 175u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Votes on a given proposal, if it is ongoing."] - pub async fn voting( + pub fn voting( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Votes on a given proposal, if it is ongoing."] - pub async fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Voting<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Proposals so far."] - pub async fn proposal_count( + pub fn proposal_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The current members of the collective. This is stored sorted (just by value)."] - pub async fn members( + pub fn members( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] - pub async fn prime( + pub fn prime( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -16360,76 +17561,86 @@ pub mod api { #[doc = " The current elected members."] #[doc = ""] #[doc = " Invariant: Always sorted based on account id."] - pub async fn members( + pub fn members( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The current reserved runners-up."] #[doc = ""] #[doc = " Invariant: Always sorted based on rank (worse to best). Upon removal of a member, the"] #[doc = " last (i.e. _best_) runner-up will be replaced."] - pub async fn runners_up( + pub fn runners_up( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The present candidate list. A current member or runner-up can never enter this vector"] @@ -16438,128 +17649,153 @@ pub mod api { #[doc = " Second element is the deposit."] #[doc = ""] #[doc = " Invariant: Always sorted based on account id."] - pub async fn candidates( + pub fn candidates( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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 + == [ + 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()) + } } } #[doc = " The total number of vote rounds that have happened, excluding the upcoming one."] - pub async fn election_rounds( + pub fn election_rounds( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Votes and locked stake of a particular voter."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] - pub async fn voting( + pub fn voting( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + runtime_types::pallet_elections_phragmen::Voter< + ::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 + == [ + 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()) + } } } #[doc = " Votes and locked stake of a particular voter."] #[doc = ""] #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] - pub async fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Voting<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -17143,7 +18379,9 @@ pub mod api { impl ::subxt::StorageEntry for Members { const PALLET: &'static str = "TechnicalMembership"; const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -17165,60 +18403,75 @@ pub mod api { Self { client } } #[doc = " The current membership, stored as an ordered Vec."] - pub async fn members( + pub fn members( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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 + == [ + 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()) + } } } #[doc = " The current prime member, if one exists."] - pub async fn prime( + pub fn prime( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -17267,6 +18520,19 @@ pub mod api { const FUNCTION: &'static str = "approve_proposal"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] + pub struct Spend { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::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)] pub struct RemoveApproval { #[codec(compact)] pub proposal_id: ::core::primitive::u32, @@ -17421,6 +18687,54 @@ pub mod api { Err(::subxt::MetadataError::IncompatibleMetadata.into()) } } + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "- `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = ""] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] + pub fn spend( + &self, + amount: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::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 { + amount, + beneficiary, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } #[doc = "Force a previously approved proposal to be removed from the approval queue."] #[doc = "The original deposit will no longer be returned."] #[doc = ""] @@ -17565,6 +18879,17 @@ pub mod api { const PALLET: &'static str = "Treasury"; const EVENT: &'static str = "Deposit"; } + #[derive(:: subxt :: codec :: Decode, :: subxt :: 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, + } + impl ::subxt::Event for SpendApproved { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "SpendApproved"; + } } pub mod storage { use super::runtime_types; @@ -17596,10 +18921,9 @@ pub mod api { impl ::subxt::StorageEntry for Approvals { const PALLET: &'static str = "Treasury"; const STORAGE: &'static str = "Approvals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; + type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -17612,122 +18936,150 @@ pub mod api { Self { client } } #[doc = " Number of proposals that have been made."] - pub async fn proposal_count( + pub fn proposal_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Proposals that have been made."] - pub async fn proposals( + pub fn proposals( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_treasury::Proposal< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Proposals that have been made."] - pub async fn proposals_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proposals<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Proposal indices that have been approved but not yet awarded."] - pub async fn approvals( + pub fn approvals( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } } @@ -18291,12 +19643,13 @@ pub mod api { pub mod events { use super::runtime_types; #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Someone claimed some DOTs. `[who, ethereum_address, amount]`"] - pub struct Claimed( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub ::core::primitive::u128, - ); + #[doc = "Someone claimed some DOTs."] + pub struct Claimed { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub ethereum_address: + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub amount: ::core::primitive::u128, + } impl ::subxt::Event for Claimed { const PALLET: &'static str = "Claims"; const EVENT: &'static str = "Claimed"; @@ -18380,259 +19733,318 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn claims( - &self, - _0: &runtime_types::polkadot_runtime_common::claims::EthereumAddress, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 async fn claims_iter( + pub fn claims_iter( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Claims<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } - pub async fn total( + pub fn total( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn vesting( + pub fn vesting( &self, - _0: &runtime_types::polkadot_runtime_common::claims::EthereumAddress, + _0 : & 'a runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn vesting_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Vesting<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The statement kind that must be signed, if any."] - pub async fn signing( + pub fn signing( &self, - _0: &runtime_types::polkadot_runtime_common::claims::EthereumAddress, + _0 : & 'a runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The statement kind that must be signed, if any."] - pub async fn signing_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Signing<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } - #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] - pub async fn preclaims( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::EthereumAddress, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 async fn preclaims_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Preclaims<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -19069,13 +20481,12 @@ pub mod api { impl ::subxt::StorageEntry for Vesting<'_> { const PALLET: &'static str = "Vesting"; const STORAGE: &'static str = "Vesting"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - >; + 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, @@ -19100,96 +20511,117 @@ pub mod api { Self { client } } #[doc = " Information regarding the vesting of a given account."] - pub async fn vesting( + pub fn vesting( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, + ) -> 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, + >, >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Information regarding the vesting of a given account."] - pub async fn vesting_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Vesting<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Storage version of the pallet."] #[doc = ""] #[doc = " New networks start with latest version, as determined by the genesis build."] - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_vesting::Releases, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn storage_version( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } } @@ -19362,10 +20794,10 @@ pub mod api { }; if runtime_call_hash == [ - 102u8, 182u8, 19u8, 61u8, 101u8, 149u8, 136u8, 249u8, 229u8, - 72u8, 227u8, 201u8, 225u8, 82u8, 94u8, 255u8, 233u8, 138u8, - 199u8, 139u8, 18u8, 244u8, 111u8, 116u8, 34u8, 85u8, 75u8, - 148u8, 188u8, 25u8, 47u8, 156u8, + 57u8, 191u8, 30u8, 46u8, 195u8, 203u8, 15u8, 79u8, 207u8, + 124u8, 18u8, 168u8, 235u8, 182u8, 100u8, 31u8, 69u8, 130u8, + 134u8, 7u8, 165u8, 108u8, 140u8, 54u8, 253u8, 17u8, 180u8, + 150u8, 148u8, 24u8, 117u8, 137u8, ] { let call = Batch { calls }; @@ -19409,10 +20841,10 @@ pub mod api { }; if runtime_call_hash == [ - 180u8, 175u8, 190u8, 210u8, 241u8, 66u8, 254u8, 62u8, 255u8, - 164u8, 179u8, 239u8, 196u8, 208u8, 14u8, 15u8, 134u8, 124u8, - 168u8, 249u8, 156u8, 6u8, 8u8, 100u8, 179u8, 233u8, 28u8, - 43u8, 154u8, 143u8, 174u8, 32u8, + 73u8, 246u8, 144u8, 155u8, 36u8, 41u8, 208u8, 143u8, 191u8, + 252u8, 184u8, 149u8, 177u8, 106u8, 252u8, 79u8, 237u8, 123u8, + 219u8, 157u8, 147u8, 157u8, 81u8, 41u8, 78u8, 198u8, 140u8, + 78u8, 243u8, 234u8, 172u8, 101u8, ] { let call = AsDerivative { @@ -19459,10 +20891,10 @@ pub mod api { }; if runtime_call_hash == [ - 101u8, 225u8, 46u8, 143u8, 133u8, 157u8, 113u8, 67u8, 254u8, - 105u8, 73u8, 88u8, 197u8, 194u8, 197u8, 125u8, 125u8, 24u8, - 177u8, 161u8, 27u8, 179u8, 183u8, 96u8, 102u8, 77u8, 248u8, - 190u8, 254u8, 188u8, 87u8, 39u8, + 0u8, 112u8, 122u8, 176u8, 137u8, 247u8, 182u8, 123u8, 196u8, + 17u8, 116u8, 228u8, 102u8, 231u8, 74u8, 153u8, 104u8, 131u8, + 130u8, 145u8, 152u8, 77u8, 221u8, 212u8, 16u8, 248u8, 99u8, + 74u8, 41u8, 138u8, 135u8, 99u8, ] { let call = BatchAll { calls }; @@ -19503,10 +20935,10 @@ pub mod api { }; if runtime_call_hash == [ - 9u8, 107u8, 249u8, 74u8, 149u8, 140u8, 51u8, 68u8, 42u8, - 188u8, 182u8, 99u8, 172u8, 144u8, 227u8, 66u8, 84u8, 206u8, - 56u8, 28u8, 74u8, 52u8, 110u8, 88u8, 47u8, 213u8, 89u8, - 218u8, 159u8, 70u8, 117u8, 87u8, + 38u8, 3u8, 146u8, 44u8, 81u8, 233u8, 48u8, 20u8, 192u8, + 219u8, 175u8, 111u8, 200u8, 254u8, 97u8, 180u8, 192u8, 252u8, + 62u8, 250u8, 211u8, 41u8, 152u8, 203u8, 22u8, 143u8, 125u8, + 113u8, 139u8, 239u8, 82u8, 243u8, ] { let call = DispatchAs { @@ -19553,10 +20985,10 @@ pub mod api { }; if runtime_call_hash == [ - 137u8, 246u8, 71u8, 168u8, 206u8, 218u8, 138u8, 237u8, 91u8, - 235u8, 21u8, 26u8, 216u8, 98u8, 195u8, 42u8, 217u8, 58u8, - 71u8, 40u8, 16u8, 83u8, 136u8, 228u8, 169u8, 208u8, 234u8, - 55u8, 71u8, 182u8, 163u8, 169u8, + 26u8, 11u8, 212u8, 172u8, 143u8, 128u8, 134u8, 164u8, 72u8, + 32u8, 192u8, 34u8, 66u8, 114u8, 252u8, 246u8, 56u8, 112u8, + 80u8, 231u8, 250u8, 24u8, 27u8, 175u8, 197u8, 227u8, 67u8, + 71u8, 113u8, 186u8, 150u8, 242u8, ] { let call = ForceBatch { calls }; @@ -20739,7 +22171,7 @@ pub mod api { const STORAGE: &'static str = "SubsOf"; type Value = ( ::core::primitive::u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< ::subxt::sp_core::crypto::AccountId32, >, ); @@ -20754,15 +22186,14 @@ pub mod api { impl ::subxt::StorageEntry for Registrars { const PALLET: &'static str = "Identity"; const STORAGE: &'static str = "Registrars"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_identity::types::RegistrarInfo< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, + 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 } @@ -20777,122 +22208,154 @@ pub mod api { #[doc = " Information that is pertinent to identify the entity behind an account."] #[doc = ""] #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub async fn identity_of( + pub fn identity_of( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Information that is pertinent to identify the entity behind an account."] #[doc = ""] #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub async fn identity_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, IdentityOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn super_of( + pub fn super_of( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn super_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuperOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Alternative \"sub\" identities of this account."] @@ -20900,39 +22363,44 @@ pub mod api { #[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 async fn subs_of( + pub fn subs_of( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - ::core::primitive::u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Alternative \"sub\" identities of this account."] @@ -20940,69 +22408,82 @@ pub mod api { #[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 async fn subs_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SubsOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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)."] #[doc = ""] #[doc = " The index into this can be cast to `RegistrarIndex` to get a valid value."] - pub async fn registrars( + pub fn registrars( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_identity::types::RegistrarInfo< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } } @@ -21333,10 +22814,10 @@ pub mod api { }; if runtime_call_hash == [ - 217u8, 71u8, 31u8, 35u8, 254u8, 72u8, 185u8, 233u8, 245u8, - 87u8, 156u8, 71u8, 75u8, 206u8, 64u8, 128u8, 244u8, 37u8, - 111u8, 9u8, 17u8, 189u8, 187u8, 48u8, 192u8, 169u8, 54u8, - 162u8, 237u8, 90u8, 109u8, 220u8, + 20u8, 236u8, 188u8, 116u8, 43u8, 132u8, 187u8, 83u8, 187u8, + 110u8, 248u8, 196u8, 112u8, 234u8, 74u8, 18u8, 77u8, 199u8, + 146u8, 70u8, 19u8, 74u8, 75u8, 177u8, 31u8, 234u8, 189u8, + 142u8, 127u8, 85u8, 250u8, 218u8, ] { let call = Proxy { @@ -21819,10 +23300,10 @@ pub mod api { }; if runtime_call_hash == [ - 136u8, 192u8, 144u8, 78u8, 240u8, 243u8, 69u8, 182u8, 56u8, - 201u8, 133u8, 193u8, 81u8, 108u8, 41u8, 237u8, 6u8, 231u8, - 232u8, 29u8, 134u8, 207u8, 175u8, 225u8, 24u8, 154u8, 105u8, - 161u8, 167u8, 163u8, 37u8, 100u8, + 47u8, 30u8, 34u8, 216u8, 180u8, 74u8, 243u8, 234u8, 203u8, + 71u8, 186u8, 242u8, 208u8, 61u8, 99u8, 58u8, 233u8, 23u8, + 245u8, 144u8, 84u8, 169u8, 190u8, 124u8, 192u8, 146u8, 119u8, + 197u8, 36u8, 248u8, 39u8, 25u8, ] { let call = ProxyAnnounced { @@ -21907,7 +23388,7 @@ pub mod api { const PALLET: &'static str = "Proxy"; const STORAGE: &'static str = "Proxies"; type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< runtime_types::pallet_proxy::ProxyDefinition< ::subxt::sp_core::crypto::AccountId32, runtime_types::polkadot_runtime::ProxyType, @@ -21928,7 +23409,7 @@ pub mod api { const PALLET: &'static str = "Proxy"; const STORAGE: &'static str = "Announcements"; type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< runtime_types::pallet_proxy::Announcement< ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::H256, @@ -21953,136 +23434,162 @@ pub mod api { } #[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 async fn proxies( + pub fn proxies( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - ::core::primitive::u32, + ) -> 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, + >, >, - >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::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()) + } } } #[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 async fn proxies_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proxies<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The announcements made by the proxy (key)."] - pub async fn announcements( + pub fn announcements( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, + ) -> 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, + >, >, - >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::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()) + } } } #[doc = " The announcements made by the proxy (key)."] - pub async fn announcements_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Announcements<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -22377,10 +23884,10 @@ pub mod api { }; if runtime_call_hash == [ - 114u8, 239u8, 71u8, 201u8, 120u8, 147u8, 150u8, 0u8, 252u8, - 254u8, 208u8, 228u8, 74u8, 136u8, 189u8, 191u8, 104u8, 193u8, - 207u8, 50u8, 153u8, 70u8, 132u8, 58u8, 36u8, 31u8, 151u8, - 123u8, 139u8, 102u8, 245u8, 152u8, + 89u8, 30u8, 112u8, 57u8, 30u8, 251u8, 160u8, 54u8, 158u8, + 207u8, 101u8, 2u8, 39u8, 41u8, 10u8, 46u8, 127u8, 177u8, + 47u8, 243u8, 121u8, 200u8, 130u8, 96u8, 164u8, 204u8, 20u8, + 31u8, 146u8, 202u8, 219u8, 154u8, ] { let call = AsMultiThreshold1 { @@ -22469,10 +23976,10 @@ pub mod api { }; if runtime_call_hash == [ - 158u8, 219u8, 179u8, 104u8, 155u8, 199u8, 218u8, 219u8, - 186u8, 39u8, 10u8, 67u8, 214u8, 34u8, 239u8, 193u8, 18u8, - 155u8, 108u8, 245u8, 245u8, 133u8, 125u8, 73u8, 150u8, 203u8, - 99u8, 191u8, 222u8, 28u8, 22u8, 17u8, + 121u8, 223u8, 171u8, 215u8, 162u8, 134u8, 116u8, 181u8, + 150u8, 7u8, 189u8, 238u8, 186u8, 107u8, 217u8, 124u8, 146u8, + 176u8, 16u8, 165u8, 182u8, 111u8, 189u8, 15u8, 198u8, 30u8, + 195u8, 247u8, 134u8, 245u8, 184u8, 190u8, ] { let call = AsMulti { @@ -22750,120 +24257,154 @@ pub mod api { Self { client } } #[doc = " The set of open multisig operations."] - pub async fn multisigs( + pub fn multisigs( &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &[::core::primitive::u8; 32usize], + _0: &'a ::subxt::sp_core::crypto::AccountId32, + _1: &'a [::core::primitive::u8; 32usize], block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The set of open multisig operations."] - pub async fn multisigs_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Multisigs<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 async fn calls( + pub fn calls( &self, - _0: &[::core::primitive::u8; 32usize], + _0: &'a [::core::primitive::u8; 32usize], block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 76u8, 214u8, 15u8, 136u8, 99u8, 62u8, 40u8, 193u8, 7u8, - 250u8, 114u8, 39u8, 166u8, 30u8, 110u8, 65u8, 41u8, 97u8, - 220u8, 9u8, 47u8, 175u8, 44u8, 174u8, 169u8, 50u8, 29u8, - 180u8, 232u8, 87u8, 179u8, 49u8, - ] - { - let entry = Calls(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option<( + ::subxt::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, + ::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 + == [ + 44u8, 13u8, 135u8, 249u8, 55u8, 222u8, 0u8, 158u8, 197u8, + 20u8, 245u8, 254u8, 194u8, 69u8, 82u8, 167u8, 65u8, 1u8, + 142u8, 52u8, 59u8, 240u8, 193u8, 194u8, 234u8, 116u8, + 159u8, 111u8, 11u8, 5u8, 24u8, 172u8, + ] + { + let entry = Calls(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } - pub async fn calls_iter( + pub fn calls_iter( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Calls<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 76u8, 214u8, 15u8, 136u8, 99u8, 62u8, 40u8, 193u8, 7u8, - 250u8, 114u8, 39u8, 166u8, 30u8, 110u8, 65u8, 41u8, 97u8, - 220u8, 9u8, 47u8, 175u8, 44u8, 174u8, 169u8, 50u8, 29u8, - 180u8, 232u8, 87u8, 179u8, 49u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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 + == [ + 44u8, 13u8, 135u8, 249u8, 55u8, 222u8, 0u8, 158u8, 197u8, + 20u8, 245u8, 254u8, 194u8, 69u8, 82u8, 167u8, 65u8, 1u8, + 142u8, 52u8, 59u8, 240u8, 193u8, 194u8, 234u8, 116u8, + 159u8, 111u8, 11u8, 5u8, 24u8, 172u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } } @@ -23610,10 +25151,9 @@ pub mod api { impl ::subxt::StorageEntry for BountyDescriptions<'_> { const PALLET: &'static str = "Bounties"; const STORAGE: &'static str = "BountyDescriptions"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + 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, @@ -23625,10 +25165,9 @@ pub mod api { impl ::subxt::StorageEntry for BountyApprovals { const PALLET: &'static str = "Bounties"; const STORAGE: &'static str = "BountyApprovals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; + type Value = runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -23641,181 +25180,225 @@ pub mod api { Self { client } } #[doc = " Number of bounty proposals that have been made."] - pub async fn bounty_count( + pub fn bounty_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Bounties that have been made."] - pub async fn bounties( + pub fn bounties( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_bounties::Bounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Bounties that have been made."] - pub async fn bounties_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Bounties<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The description of each bounty."] - pub async fn bounty_descriptions( + pub fn bounty_descriptions( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The description of each bounty."] - pub async fn bounty_descriptions_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BountyDescriptions<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Bounty indices that have been approved but not yet funded."] - pub async fn bounty_approvals( + pub fn bounty_approvals( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } } @@ -24689,10 +26272,9 @@ pub mod api { impl ::subxt::StorageEntry for ChildBountyDescriptions<'_> { const PALLET: &'static str = "ChildBounties"; const STORAGE: &'static str = "ChildBountyDescriptions"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + 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, @@ -24720,262 +26302,331 @@ pub mod api { Self { client } } #[doc = " Number of total child bounties."] - pub async fn child_bounty_count( + pub fn child_bounty_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Number of child bounties per parent bounty."] #[doc = " Map of parent bounty index to number of child bounties."] - pub async fn parent_child_bounties( + pub fn parent_child_bounties( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Number of child bounties per parent bounty."] #[doc = " Map of parent bounty index to number of child bounties."] - pub async fn parent_child_bounties_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ParentChildBounties<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Child bounties that have been added."] - pub async fn child_bounties( + pub fn child_bounties( &self, - _0: &::core::primitive::u32, - _1: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, + _1: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_child_bounties::ChildBounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Child bounties that have been added."] - pub async fn child_bounties_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ChildBounties<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The description of each child-bounty."] - pub async fn child_bounty_descriptions( + pub fn child_bounty_descriptions( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The description of each child-bounty."] - pub async fn child_bounty_descriptions_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ChildBountyDescriptions<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The cumulative child-bounty curator fee for each parent bounty."] - pub async fn children_curator_fees( + pub fn children_curator_fees( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The cumulative child-bounty curator fee for each parent bounty."] - pub async fn children_curator_fees_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ChildrenCuratorFees<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -25536,122 +27187,154 @@ pub mod api { #[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 async fn tips( + pub fn tips( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::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, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[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 async fn tips_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Tips<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn reasons( + pub fn reasons( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn reasons_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reasons<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -25904,10 +27587,10 @@ pub mod api { }; if runtime_call_hash == [ - 202u8, 104u8, 247u8, 250u8, 171u8, 119u8, 119u8, 96u8, 213u8, - 119u8, 41u8, 116u8, 29u8, 99u8, 71u8, 203u8, 168u8, 212u8, - 15u8, 10u8, 64u8, 126u8, 177u8, 56u8, 177u8, 42u8, 236u8, - 124u8, 36u8, 94u8, 47u8, 27u8, + 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 { @@ -26035,10 +27718,10 @@ pub mod api { }; if runtime_call_hash == [ - 192u8, 193u8, 242u8, 99u8, 80u8, 253u8, 100u8, 234u8, 199u8, - 15u8, 119u8, 251u8, 94u8, 248u8, 110u8, 171u8, 216u8, 218u8, - 60u8, 223u8, 227u8, 79u8, 174u8, 232u8, 251u8, 75u8, 17u8, - 241u8, 15u8, 23u8, 11u8, 99u8, + 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 { @@ -26248,7 +27931,7 @@ pub mod api { impl ::subxt::StorageEntry for SignedSubmissionIndices { const PALLET: &'static str = "ElectionProviderMultiPhase"; const STORAGE: &'static str = "SignedSubmissionIndices"; - type Value = runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > ; + 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 } @@ -26287,156 +27970,194 @@ pub mod api { #[doc = " diagnostics of the pallet."] #[doc = ""] #[doc = " This is merely incremented once per every time that an upstream `elect` is called."] - pub async fn round( + pub fn round( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Current phase."] - pub async fn current_phase( + pub fn current_phase( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_election_provider_multi_phase::Phase< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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 async fn queued_solution (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&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()) + } } } #[doc = " Snapshot data of the round."] #[doc = ""] - #[doc = " This is created at the beginning of the signed phase and cleared upon calling `elect`."] pub async fn snapshot (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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 = " Desired number of targets to elect for this round."] #[doc = ""] #[doc = " Only exists when [`Snapshot`] is present."] - pub async fn desired_targets( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The metadata of the [`RoundSnapshot`]"] #[doc = ""] - #[doc = " Only exists when [`Snapshot`] is present."] pub async fn snapshot_metadata (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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 = " The next index to be assigned to an incoming signed submission."] @@ -26448,31 +28169,38 @@ pub mod api { #[doc = " We can't just use `SignedSubmissionIndices.len()`, because that's a bounded set; past its"] #[doc = " capacity, it will simply saturate. We can't just iterate over `SignedSubmissionsMap`,"] #[doc = " because iteration is slow. Instead, we store the value here."] - pub async fn signed_submission_next_index( + pub fn signed_submission_next_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " A sorted, bounded set of `(score, index)`, where each `index` points to a value in"] @@ -26480,27 +28208,30 @@ pub mod api { #[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 async fn signed_submission_indices (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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 = " Unchecked, signed solutions."] @@ -26509,24 +28240,30 @@ 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 async fn signed_submissions_map (& self , _0 : & :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: 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 >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " Unchecked, signed solutions."] @@ -26536,61 +28273,77 @@ pub mod api { #[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 async fn signed_submissions_map_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SignedSubmissionsMap<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 = " The minimum score that each 'untrusted' solution must attain in order to be considered"] #[doc = " feasible."] #[doc = ""] #[doc = " Can be set via `set_minimum_untrusted_score`."] - pub async fn minimum_untrusted_score( + pub fn minimum_untrusted_score( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_npos_elections::ElectionScore, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -26763,34 +28516,6 @@ pub mod api { Err(::subxt::MetadataError::IncompatibleMetadata.into()) } } - #[doc = " Maximum weight that the miner should consume."] - #[doc = ""] - #[doc = " The miner will ensure that the total weight of the unsigned solution will not exceed"] - #[doc = " this value, based on [`WeightInfo::submit_unsigned`]."] - pub fn miner_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", "MinerMaxWeight")? - == [ - 34u8, 141u8, 148u8, 109u8, 219u8, 244u8, 253u8, 179u8, 243u8, - 51u8, 21u8, 185u8, 160u8, 239u8, 17u8, 32u8, 203u8, 213u8, - 77u8, 66u8, 102u8, 9u8, 95u8, 165u8, 197u8, 46u8, 186u8, - 122u8, 140u8, 250u8, 60u8, 37u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MinerMaxWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } #[doc = " Maximum number of signed submissions that can be queued."] #[doc = ""] #[doc = " It is best to avoid adjusting this during an election, as it impacts downstream data"] @@ -26824,7 +28549,9 @@ pub mod api { } #[doc = " Maximum weight of a signed solution."] #[doc = ""] - #[doc = " This should probably be similar to [`Config::MinerMaxWeight`]."] + #[doc = " If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of"] + #[doc = " this pallet), then [`MinerConfig::solution_weight`] is used to compare against"] + #[doc = " this value."] pub fn signed_max_weight( &self, ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> @@ -26834,10 +28561,10 @@ pub mod api { if metadata .constant_hash("ElectionProviderMultiPhase", "SignedMaxWeight")? == [ - 54u8, 61u8, 214u8, 10u8, 196u8, 175u8, 140u8, 223u8, 25u8, - 241u8, 182u8, 169u8, 215u8, 230u8, 227u8, 148u8, 174u8, - 248u8, 158u8, 157u8, 148u8, 248u8, 241u8, 97u8, 191u8, 229u8, - 49u8, 147u8, 180u8, 125u8, 109u8, 26u8, + 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")?; @@ -27026,38 +28753,10 @@ pub mod api { Err(::subxt::MetadataError::IncompatibleMetadata.into()) } } - #[doc = " Maximum length (bytes) that the mined solution should consume."] - #[doc = ""] - #[doc = " The miner will ensure that the total length of the unsigned solution will not exceed"] - #[doc = " this value."] - pub fn miner_max_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("ElectionProviderMultiPhase", "MinerMaxLength")? - == [ - 131u8, 141u8, 170u8, 106u8, 200u8, 39u8, 188u8, 38u8, 159u8, - 91u8, 130u8, 187u8, 164u8, 109u8, 34u8, 75u8, 198u8, 247u8, - 204u8, 249u8, 246u8, 87u8, 217u8, 117u8, 113u8, 120u8, 57u8, - 201u8, 210u8, 22u8, 108u8, 124u8, - ] - { - let pallet = metadata.pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MinerMaxLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } } } } - pub mod bags_list { + pub mod voter_list { use super::{ root_mod, runtime_types, @@ -27073,7 +28772,7 @@ pub mod api { pub dislocated: ::subxt::sp_core::crypto::AccountId32, } impl ::subxt::Call for Rebag { - const PALLET: &'static str = "BagsList"; + const PALLET: &'static str = "VoterList"; const FUNCTION: &'static str = "rebag"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] @@ -27081,7 +28780,7 @@ pub mod api { pub lighter: ::subxt::sp_core::crypto::AccountId32, } impl ::subxt::Call for PutInFrontOf { - const PALLET: &'static str = "BagsList"; + const PALLET: &'static str = "VoterList"; const FUNCTION: &'static str = "put_in_front_of"; } pub struct TransactionApi<'a, T: ::subxt::Config, X> { @@ -27105,8 +28804,10 @@ pub mod api { #[doc = ""] #[doc = "Anyone can call this function about any potentially dislocated account."] #[doc = ""] - #[doc = "Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then"] - #[doc = "it is a noop and fees are still collected from `origin`."] + #[doc = "Will always update the stored score of `dislocated` to the correct score, based on"] + #[doc = "`ScoreProvider`."] + #[doc = ""] + #[doc = "If `dislocated` does not exists, it returns an error."] pub fn rebag( &self, dislocated: ::subxt::sp_core::crypto::AccountId32, @@ -27194,15 +28895,25 @@ pub mod api { pub to: ::core::primitive::u64, } impl ::subxt::Event for Rebagged { - const PALLET: &'static str = "BagsList"; + const PALLET: &'static str = "VoterList"; const EVENT: &'static str = "Rebagged"; } + #[derive(:: subxt :: codec :: Decode, :: subxt :: 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 new_score: ::core::primitive::u64, + } + impl ::subxt::Event 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 = "BagsList"; + const PALLET: &'static str = "VoterList"; const STORAGE: &'static str = "ListNodes"; type Value = runtime_types::pallet_bags_list::list::Node; fn key(&self) -> ::subxt::StorageEntryKey { @@ -27214,7 +28925,7 @@ pub mod api { } pub struct CounterForListNodes; impl ::subxt::StorageEntry for CounterForListNodes { - const PALLET: &'static str = "BagsList"; + const PALLET: &'static str = "VoterList"; const STORAGE: &'static str = "CounterForListNodes"; type Value = ::core::primitive::u32; fn key(&self) -> ::subxt::StorageEntryKey { @@ -27223,7 +28934,7 @@ pub mod api { } pub struct ListBags<'a>(pub &'a ::core::primitive::u64); impl ::subxt::StorageEntry for ListBags<'_> { - const PALLET: &'static str = "BagsList"; + const PALLET: &'static str = "VoterList"; const STORAGE: &'static str = "ListBags"; type Value = runtime_types::pallet_bags_list::list::Bag; fn key(&self) -> ::subxt::StorageEntryKey { @@ -27243,145 +28954,188 @@ pub mod api { #[doc = " A single node, within some bag."] #[doc = ""] #[doc = " Nodes store links forward and back within their respective bags."] - pub async fn list_nodes( + pub fn list_nodes( &self, - _0: &::subxt::sp_core::crypto::AccountId32, + _0: &'a ::subxt::sp_core::crypto::AccountId32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 114u8, 219u8, 206u8, 128u8, 160u8, 134u8, 95u8, 214u8, 195u8, - 15u8, 140u8, 174u8, 89u8, 85u8, 191u8, 85u8, 96u8, 58u8, - 214u8, 128u8, 6u8, 238u8, 148u8, 141u8, 206u8, 107u8, 68u8, - 41u8, 35u8, 246u8, 169u8, 209u8, - ] - { - let entry = ListNodes(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " A single node, within some bag."] #[doc = ""] #[doc = " Nodes store links forward and back within their respective bags."] - pub async fn list_nodes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ListNodes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 114u8, 219u8, 206u8, 128u8, 160u8, 134u8, 95u8, 214u8, 195u8, - 15u8, 140u8, 174u8, 89u8, 85u8, 191u8, 85u8, 96u8, 58u8, - 214u8, 128u8, 6u8, 238u8, 148u8, 141u8, 206u8, 107u8, 68u8, - 41u8, 35u8, 246u8, 169u8, 209u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = "Counter for the related counted storage map"] - pub async fn counter_for_list_nodes( + pub fn counter_for_list_nodes( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " A bag stored in storage."] #[doc = ""] #[doc = " Stores a `Bag` struct, which stores head and tail pointers to itself."] - pub async fn list_bags( + pub fn list_bags( &self, - _0: &::core::primitive::u64, + _0: &'a ::core::primitive::u64, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " A bag stored in storage."] #[doc = ""] #[doc = " Stores a `Bag` struct, which stores head and tail pointers to itself."] - pub async fn list_bags_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ListBags<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -27446,7 +29200,7 @@ pub mod api { > { let locked_metadata = self.client.metadata(); let metadata = locked_metadata.read(); - if metadata.constant_hash("BagsList", "BagThresholds")? + if metadata.constant_hash("VoterList", "BagThresholds")? == [ 95u8, 68u8, 224u8, 175u8, 149u8, 202u8, 192u8, 181u8, 221u8, 32u8, 210u8, 34u8, 242u8, 160u8, 84u8, 54u8, 221u8, 57u8, @@ -27454,7 +29208,7 @@ pub mod api { 129u8, 6u8, 103u8, 171u8, 172u8, ] { - let pallet = metadata.pallet("BagsList")?; + let pallet = metadata.pallet("VoterList")?; let constant = pallet.constant("BagThresholds")?; let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; @@ -29641,27 +31395,30 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - #[doc = " The active configuration for the current session."] pub async fn active_config (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + #[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()) + } } } #[doc = " Pending configuration changes."] @@ -29670,56 +31427,66 @@ 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 async fn pending_configs (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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 = " 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 async fn bypass_consistency_check( + pub fn bypass_consistency_check( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -29794,97 +31561,114 @@ pub mod api { Self { client } } #[doc = " The current session index."] - pub async fn current_session_index( + pub fn current_session_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " All the validators actively participating in parachain consensus."] #[doc = " Indices are into the broader validator set."] - pub async fn active_validator_indices( + pub fn active_validator_indices( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The parachain attestation keys of the validators actively participating in parachain consensus."] #[doc = " This should be the same length as `ActiveValidatorIndices`."] - pub async fn active_validator_keys( + pub fn active_validator_keys( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } } @@ -30017,154 +31801,202 @@ pub mod api { 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 async fn availability_bitfields (& self , _0 : & runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 (& 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 async fn availability_bitfields_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AvailabilityBitfields<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 async fn pending_availability (& self , _0 : & runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, 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 async fn pending_availability_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailability<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The commitments of candidates pending availability, by `ParaId`."] - pub async fn pending_availability_commitments( + pub fn pending_availability_commitments( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::CandidateCommitments< + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " The commitments of candidates pending availability, by `ParaId`."] - pub async fn pending_availability_commitments_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailabilityCommitments<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -30285,59 +32117,77 @@ pub mod api { #[doc = " due to the guarantees of FRAME's storage APIs."] #[doc = ""] #[doc = " If this is `None` at the end of the block, we panic and render the block invalid."] - pub async fn included( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Scraped on chain data for extracting resolved disputes as well as backing votes."] - pub async fn on_chain_votes( + pub fn on_chain_votes( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< - ::subxt::sp_core::H256, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< + ::subxt::sp_core::H256, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } } @@ -30428,63 +32278,71 @@ pub mod api { #[doc = ""] #[doc = " Bound: The number of cores is the sum of the numbers of parachains and parathread multiplexers."] #[doc = " Reasonably, 100-1000. The dominant factor is the number of validators: safe upper bound at 10k."] - pub async fn validator_groups( + pub fn validator_groups( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< + ) -> impl ::core::future::Future< + Output = ::core::result::Result< ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[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 async fn parathread_queue (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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 = " One entry for each availability core. Entries are `None` if the core is not currently occupied. Can be"] @@ -30495,70 +32353,82 @@ pub mod api { #[doc = " Bounded by the maximum of either of these two values:"] #[doc = " * The number of parachains and parathread multiplexers"] #[doc = " * The number of validators divided by `configuration.max_validators_per_core`."] - pub async fn availability_cores( + pub fn availability_cores( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CoreOccupied, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::CoreOccupied, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[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."] #[doc = ""] #[doc = " Bounded by the number of parathread cores and scheduling lookahead. Reasonably, 10 * 50 = 500."] - pub async fn parathread_claim_index( + pub fn parathread_claim_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The block number where the session start occurred. Used to track how many group rotations have occurred."] @@ -30567,31 +32437,38 @@ pub mod api { #[doc = " the block and enacted at the end of the block (at the finalization stage, to be exact)."] #[doc = " Thus for all intents and purposes the effect of the session change is observed at the"] #[doc = " block following the session change, block number of which we save in this storage value."] - pub async fn session_start_block( + pub fn session_start_block( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Currently scheduled cores - free but up to be occupied."] @@ -30599,27 +32476,30 @@ pub mod api { #[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 async fn scheduled (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + #[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()) + } } } } @@ -31388,415 +33268,458 @@ pub mod api { #[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 async fn pvf_active_vote_map (& self , _0 : & runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " 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 async fn pvf_active_vote_map_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PvfActiveVoteMap<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 async fn pvf_active_vote_list( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, 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 = " All parachains. Ordered ascending by `ParaId`. Parathreads are not included."] #[doc = ""] #[doc = " Consider using the [`ParachainsCache`] type of modifying."] - pub async fn parachains( + pub fn parachains( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } - #[doc = " The current lifecycle of a all known Para IDs."] - pub async fn para_lifecycles( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 async fn para_lifecycles_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ParaLifecycles<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The head-data of every registered para."] - pub async fn heads( + pub fn heads( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::HeadData, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The head-data of every registered para."] - pub async fn heads_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Heads<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The validation code hash of every live para."] #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn current_code_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " The validation code hash of every live para."] #[doc = ""] #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn current_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CurrentCodeHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn past_code_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - _1: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " 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 async fn past_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PastCodeHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn past_code_meta( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " 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 async fn past_code_meta_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PastCodeMeta<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 = " Which paras have past code that needs pruning and the relay-chain block at which the code was replaced."] @@ -31805,154 +33728,179 @@ pub mod api { #[doc = " This is to ensure the entire acceptance period is covered, not an offset acceptance period starting"] #[doc = " from the time at which the parachain perceives a code upgrade as having occurred."] #[doc = " Multiple entries for a single para are permitted. Ordered ascending by block number."] - pub async fn past_code_pruning( + pub fn past_code_pruning( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn future_code_upgrades( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[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 async fn future_code_upgrades_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, FutureCodeUpgrades<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } + } + } + #[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()) + } } } #[doc = " The actual future code hash of a para."] #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn future_code_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " The actual future code hash of a para."] #[doc = ""] #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn future_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, FutureCodeHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] @@ -31964,33 +33912,41 @@ 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 async fn upgrade_go_ahead_signal( + pub fn upgrade_go_ahead_signal( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::UpgradeGoAhead, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] @@ -32002,29 +33958,37 @@ 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 async fn upgrade_go_ahead_signal_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UpgradeGoAheadSignal<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] @@ -32036,33 +34000,41 @@ 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 async fn upgrade_restriction_signal( + pub fn upgrade_restriction_signal( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::UpgradeRestriction, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] @@ -32074,326 +34046,404 @@ 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 async fn upgrade_restriction_signal_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UpgradeRestrictionSignal<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The list of parachains that are awaiting for their upgrade restriction to cooldown."] #[doc = ""] #[doc = " Ordered ascending by block number."] - pub async fn upgrade_cooldowns( + pub fn upgrade_cooldowns( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[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."] #[doc = ""] #[doc = " Ordered ascending by block number."] - pub async fn upcoming_upgrades( + pub fn upcoming_upgrades( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The actions to perform during the start of a specific session index."] - pub async fn actions_queue( + pub fn actions_queue( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The actions to perform during the start of a specific session index."] - pub async fn actions_queue_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ActionsQueue<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn upcoming_paras_genesis (& self , _0 : & runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " 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 async fn upcoming_paras_genesis_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UpcomingParasGenesis<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub async fn code_by_hash_refs( + pub fn code_by_hash_refs( &self, - _0 : & runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, + _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub async fn code_by_hash_refs_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeByHashRefs<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Validation code stored by its hash."] #[doc = ""] #[doc = " This storage is consistent with [`FutureCodeHash`], [`CurrentCodeHash`] and"] #[doc = " [`PastCodeHash`]."] - pub async fn code_by_hash( + pub fn code_by_hash( &self, - _0 : & runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, + _0 : & 'a runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCode, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Validation code stored by its hash."] #[doc = ""] #[doc = " This storage is consistent with [`FutureCodeHash`], [`CurrentCodeHash`] and"] #[doc = " [`PastCodeHash`]."] - pub async fn code_by_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeByHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -32545,28 +34595,38 @@ pub mod api { #[doc = " As a `bool`, `set(false)` and `remove()` both lead to the next `get()` being false, but one of"] #[doc = " them writes to the trie and one does not. This confusion makes `Option<()>` more suitable for"] #[doc = " the semantics of this variable."] - pub async fn has_initialized( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Buffered session changes along with the block number at which they should be applied."] @@ -32575,27 +34635,30 @@ 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 async fn buffered_session_changes (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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()) + } } } } @@ -32670,65 +34733,64 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - #[doc = " The downward messages addressed for a certain para."] - pub async fn downward_message_queues( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 (& 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 async fn downward_message_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueues<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " A mapping that stores the downward message queue MQC head for each para."] @@ -32738,32 +34800,39 @@ 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 async fn downward_message_queue_heads( + pub fn downward_message_queue_heads( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " A mapping that stores the downward message queue MQC head for each para."] @@ -32773,29 +34842,37 @@ 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 async fn downward_message_queue_heads_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueueHeads<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -33058,34 +35135,39 @@ pub mod api { #[doc = " channel management messages."] #[doc = ""] #[doc = " The messages are processed in FIFO order."] - pub async fn relay_dispatch_queues( + pub fn relay_dispatch_queues( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] @@ -33094,29 +35176,37 @@ pub mod api { #[doc = " channel management messages."] #[doc = ""] #[doc = " The messages are processed in FIFO order."] - pub async fn relay_dispatch_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, RelayDispatchQueues<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] @@ -33130,34 +35220,39 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - The set of keys should exactly match the set of keys of `RelayDispatchQueues`."] - pub async fn relay_dispatch_queue_size( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] @@ -33171,29 +35266,37 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - The set of keys should exactly match the set of keys of `RelayDispatchQueues`."] - pub async fn relay_dispatch_queue_size_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, RelayDispatchQueueSize<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry."] @@ -33201,33 +35304,40 @@ pub mod api { #[doc = " Invariant:"] #[doc = " - The set of items from this vector should be exactly the set of the keys in"] #[doc = " `RelayDispatchQueues` and `RelayDispatchQueueSize`."] - pub async fn needs_dispatch( + pub fn needs_dispatch( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " This is the para that gets will get dispatched first during the next upward dispatchable queue"] @@ -33235,122 +35345,153 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - If `Some(para)`, then `para` must be present in `NeedsDispatch`."] - pub async fn next_dispatch_round_start_with( + pub fn next_dispatch_round_start_with( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::Id, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The messages that exceeded max individual message weight budget."] #[doc = ""] #[doc = " These messages stay there until manually dispatched."] - pub async fn overweight( + pub fn overweight( &self, - _0: &::core::primitive::u64, + _0: &'a ::core::primitive::u64, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The messages that exceeded max individual message weight budget."] #[doc = ""] #[doc = " These messages stay there until manually dispatched."] - pub async fn overweight_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Overweight<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The number of overweight messages ever recorded in `Overweight` (and thus the lowest free"] #[doc = " index)."] - pub async fn overweight_count( + pub fn overweight_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -33982,24 +36123,30 @@ pub mod api { #[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 async fn hrmp_open_channel_requests (& self , _0 : & runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " The set of pending HRMP open channel requests."] @@ -34008,178 +36155,225 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub async fn hrmp_open_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequests<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } - pub async fn hrmp_open_channel_requests_list( + pub fn hrmp_open_channel_requests_list( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[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 async fn hrmp_open_channel_request_count( + pub fn hrmp_open_channel_request_count( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn hrmp_open_channel_request_count_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequestCount<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn hrmp_accepted_channel_request_count( + pub fn hrmp_accepted_channel_request_count( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn hrmp_accepted_channel_request_count_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpAcceptedChannelRequestCount<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] @@ -34189,29 +36383,39 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub async fn hrmp_close_channel_requests( - &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] @@ -34221,178 +36425,224 @@ pub mod api { #[doc = ""] #[doc = " Invariant:"] #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub async fn hrmp_close_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 async fn hrmp_close_channel_requests_list( + pub fn hrmp_close_channel_requests_list( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[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 async fn hrmp_watermarks( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn hrmp_watermarks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpWatermarks<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn hrmp_channels( + pub fn hrmp_channels( &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, + _0: &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn hrmp_channels_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannels<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] @@ -34408,34 +36658,41 @@ pub mod api { #[doc = " `HrmpChannels` as `(P, E)`."] #[doc = " - there should be no other dangling channels in `HrmpChannels`."] #[doc = " - the vectors are sorted."] - pub async fn hrmp_ingress_channels_index( + pub fn hrmp_ingress_channels_index( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] @@ -34451,147 +36708,183 @@ pub mod api { #[doc = " `HrmpChannels` as `(P, E)`."] #[doc = " - there should be no other dangling channels in `HrmpChannels`."] #[doc = " - the vectors are sorted."] - pub async fn hrmp_ingress_channels_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpIngressChannelsIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 async fn hrmp_egress_channels_index( + pub fn hrmp_egress_channels_index( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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 async fn hrmp_egress_channels_index_iter( + pub fn hrmp_egress_channels_index_iter( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Storage for the messages for each channel."] #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] - pub async fn hrmp_channel_contents( + pub fn hrmp_channel_contents( &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, + _0: &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Storage for the messages for each channel."] #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] - pub async fn hrmp_channel_contents_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelContents<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] @@ -34600,39 +36893,44 @@ 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 async fn hrmp_channel_digests( + pub fn hrmp_channel_digests( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::core::primitive::u32, - ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::Id, - >, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] @@ -34641,29 +36939,37 @@ 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 async fn hrmp_channel_digests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelDigests<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -34708,6 +37014,18 @@ pub mod api { )]) } } + 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, } @@ -34717,124 +37035,213 @@ pub mod api { } #[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 async fn assignment_keys_unsafe( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::assignment_app::Public, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.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 , 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 = " The earliest session for which previous session info is stored."] - pub async fn earliest_stored_session( + pub fn earliest_stored_session( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn sessions( + pub fn sessions( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::SessionInfo, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn sessions_iter( + 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()) + } + } + } + #[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, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Sessions<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } + } + } + #[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()) + } } } } @@ -35042,146 +37449,186 @@ pub mod api { } #[doc = " The last pruned session, if any. All data stored by this module"] #[doc = " references sessions."] - pub async fn last_pruned_session( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub async fn disputes( + pub fn disputes( &self, - _0: &::core::primitive::u32, - _1: &runtime_types::polkadot_core_primitives::CandidateHash, + _0: &'a ::core::primitive::u32, + _1: &'a runtime_types::polkadot_core_primitives::CandidateHash, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::DisputeState< - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::DisputeState< + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub async fn disputes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Disputes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn included( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::polkadot_core_primitives::CandidateHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn included_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Included<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] @@ -35189,31 +37636,39 @@ pub mod api { #[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 async fn spam_slots( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u32>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] @@ -35221,62 +37676,75 @@ pub mod api { #[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 async fn spam_slots_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpamSlots<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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,"] #[doc = " and its value indicates the last valid block number in the chain."] #[doc = " It can only be set back to `None` by governance intervention."] - pub async fn frozen( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + pub fn frozen( + &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 + == [ + 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()) + } } } } @@ -35636,27 +38104,27 @@ pub mod api { pub mod events { use super::runtime_types; #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Registered( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - ); + pub struct Registered { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub manager: ::subxt::sp_core::crypto::AccountId32, + } impl ::subxt::Event for Registered { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Registered"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Deregistered( - pub runtime_types::polkadot_parachain::primitives::Id, - ); + pub struct Deregistered { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + } impl ::subxt::Event for Deregistered { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Deregistered"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Reserved( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - ); + pub struct Reserved { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub who: ::subxt::sp_core::crypto::AccountId32, + } impl ::subxt::Event for Reserved { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Reserved"; @@ -35713,154 +38181,176 @@ pub mod api { Self { client } } #[doc = " Pending swap operations."] - pub async fn pending_swap( + pub fn pending_swap( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::Id, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Pending swap operations."] - pub async fn pending_swap_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingSwap<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn paras( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.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 : & '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 = " 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 async fn paras_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Paras<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The next free `ParaId`."] - pub async fn next_free_para_id( + pub fn next_free_para_id( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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()) + } } } } @@ -36115,7 +38605,9 @@ pub mod api { Debug, )] #[doc = "A new `[lease_period]` is beginning."] - pub struct NewLeasePeriod(pub ::core::primitive::u32); + pub struct NewLeasePeriod { + pub lease_period: ::core::primitive::u32, + } impl ::subxt::Event for NewLeasePeriod { const PALLET: &'static str = "Slots"; const EVENT: &'static str = "NewLeasePeriod"; @@ -36124,15 +38616,14 @@ pub mod api { #[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."] - #[doc = "`[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`"] - pub struct Leased( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); + pub struct Leased { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub leaser: ::subxt::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 { const PALLET: &'static str = "Slots"; const EVENT: &'static str = "Leased"; @@ -36182,39 +38673,44 @@ 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 async fn leases( + pub fn leases( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::std::vec::Vec< + ::core::option::Option<( + ::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 + == [ + 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()) + } } } #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] @@ -36233,29 +38729,37 @@ 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 async fn leases_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Leases<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -36524,12 +39028,11 @@ pub mod api { #[derive(:: subxt :: codec :: Decode, :: subxt :: 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."] - #[doc = "`[auction_index, lease_period, ending]`"] - pub struct AuctionStarted( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); + pub struct AuctionStarted { + pub auction_index: ::core::primitive::u32, + pub lease_period: ::core::primitive::u32, + pub ending: ::core::primitive::u32, + } impl ::subxt::Event for AuctionStarted { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "AuctionStarted"; @@ -36540,30 +39043,32 @@ pub mod api { :: subxt :: codec :: Encode, Debug, )] - #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] - pub struct AuctionClosed(pub ::core::primitive::u32); + #[doc = "An auction ended. All funds become unreserved."] + pub struct AuctionClosed { + pub auction_index: ::core::primitive::u32, + } impl ::subxt::Event for AuctionClosed { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "AuctionClosed"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] - #[doc = "Second is the total. `[bidder, extra_reserved, total_amount]`"] - pub struct Reserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); + #[doc = "Second is the total."] + pub struct Reserved { + pub bidder: ::subxt::sp_core::crypto::AccountId32, + pub extra_reserved: ::core::primitive::u128, + pub total_amount: ::core::primitive::u128, + } impl ::subxt::Event for Reserved { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "Reserved"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] - pub struct Unreserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + pub struct Unreserved { + pub bidder: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::Event for Unreserved { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "Unreserved"; @@ -36571,37 +39076,34 @@ pub mod api { #[derive(:: subxt :: codec :: Decode, :: subxt :: 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."] - #[doc = "`[parachain_id, leaser, amount]`"] - pub struct ReserveConfiscated( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + pub struct ReserveConfiscated { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub leaser: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::Event for ReserveConfiscated { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "ReserveConfiscated"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] #[doc = "A new bid has been accepted as the current winner."] - #[doc = "`[who, para_id, amount, first_slot, last_slot]`"] - pub struct BidAccepted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u128, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); + pub struct BidAccepted { + pub bidder: ::subxt::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 { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "BidAccepted"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] #[doc = "The winning offset was chosen for an auction. This will map into the `Winning` storage map."] - #[doc = "`[auction_index, block_number]`"] - pub struct WinningOffset( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); + pub struct WinningOffset { + pub auction_index: ::core::primitive::u32, + pub block_number: ::core::primitive::u32, + } impl ::subxt::Event for WinningOffset { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "WinningOffset"; @@ -36666,31 +39168,38 @@ pub mod api { Self { client } } #[doc = " Number of auctions started so far."] - pub async fn auction_counter( + pub fn auction_counter( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Information relating to the current auction, if there is one."] @@ -36698,154 +39207,194 @@ pub mod api { #[doc = " The first item in the tuple is the lease period index that the first of the four"] #[doc = " contiguous lease periods on auction is for. The second is the block number when the"] #[doc = " auction will \"begin to end\", i.e. the first block of the Ending Period of the auction."] - pub async fn auction_info( + pub fn auction_info( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] #[doc = " (sub-)ranges."] - pub async fn reserved_amounts( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] #[doc = " (sub-)ranges."] - pub async fn reserved_amounts_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReservedAmounts<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn winning( + pub fn winning( &self, - _0: &::core::primitive::u32, + _0: &'a ::core::primitive::u32, block_hash: ::core::option::Option, - ) -> ::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, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn winning_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Winning<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } } @@ -37475,91 +40024,100 @@ pub mod api { pub mod events { use super::runtime_types; #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] - pub struct Created(pub runtime_types::polkadot_parachain::primitives::Id); + #[doc = "Create a new crowdloaning campaign."] + pub struct Created { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + } impl ::subxt::Event for Created { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Created"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Contributed to a crowd sale. `[who, fund_index, amount]`"] - pub struct Contributed( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u128, - ); + #[doc = "Contributed to a crowd sale."] + pub struct Contributed { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub fund_index: runtime_types::polkadot_parachain::primitives::Id, + pub amount: ::core::primitive::u128, + } impl ::subxt::Event for Contributed { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Contributed"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Withdrew full balance of a contributor. `[who, fund_index, amount]`"] - pub struct Withdrew( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u128, - ); + #[doc = "Withdrew full balance of a contributor."] + pub struct Withdrew { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub fund_index: runtime_types::polkadot_parachain::primitives::Id, + pub amount: ::core::primitive::u128, + } impl ::subxt::Event for Withdrew { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Withdrew"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: 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. `[fund_index]`"] - pub struct PartiallyRefunded( - pub runtime_types::polkadot_parachain::primitives::Id, - ); + #[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 { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "PartiallyRefunded"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "All loans in a fund have been refunded. `[fund_index]`"] - pub struct AllRefunded(pub runtime_types::polkadot_parachain::primitives::Id); + #[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 { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "AllRefunded"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Fund is dissolved. `[fund_index]`"] - pub struct Dissolved(pub runtime_types::polkadot_parachain::primitives::Id); + #[doc = "Fund is dissolved."] + pub struct Dissolved { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + } impl ::subxt::Event for Dissolved { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Dissolved"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] #[doc = "The result of trying to submit a new bid to the Slots pallet."] - pub struct HandleBidResult( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); + 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 { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "HandleBidResult"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The configuration to a crowdloan has been edited. `[fund_index]`"] - pub struct Edited(pub runtime_types::polkadot_parachain::primitives::Id); + #[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 { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Edited"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A memo has been updated. `[who, fund_index, memo]`"] - pub struct MemoUpdated( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::std::vec::Vec<::core::primitive::u8>, - ); + #[doc = "A memo has been updated."] + pub struct MemoUpdated { + pub who: ::subxt::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 { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "MemoUpdated"; } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] #[doc = "A parachain has been moved to `NewRaise`"] - pub struct AddedToNewRaise( - pub runtime_types::polkadot_parachain::primitives::Id, - ); + pub struct AddedToNewRaise { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + } impl ::subxt::Event for AddedToNewRaise { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "AddedToNewRaise"; @@ -37622,151 +40180,188 @@ pub mod api { Self { client } } #[doc = " Info on all of the funds."] - pub async fn funds( + pub fn funds( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &'a runtime_types::polkadot_parachain::primitives::Id, block_hash: ::core::option::Option, - ) -> ::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, + ) -> 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, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } #[doc = " Info on all of the funds."] - pub async fn funds_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Funds<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn new_raise( + pub fn new_raise( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::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()) + } } } #[doc = " The number of auctions that have entered into their ending period so far."] - pub async fn endings_count( + pub fn endings_count( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " Tracker for the next available fund index"] - pub async fn next_fund_index( + pub fn next_fund_index( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -38816,7 +41411,7 @@ pub mod api { const PALLET: &'static str = "XcmPallet"; const STORAGE: &'static str = "VersionDiscoveryQueue"; type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( runtime_types::xcm::VersionedMultiLocation, ::core::primitive::u32, )>; @@ -38841,413 +41436,520 @@ pub mod api { Self { client } } #[doc = " The latest available query index."] - pub async fn query_counter( + pub fn query_counter( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[doc = " The ongoing queries."] - pub async fn queries( + pub fn queries( &self, - _0: &::core::primitive::u64, + _0: &'a ::core::primitive::u64, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::QueryStatus< - ::core::primitive::u32, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_xcm::pallet::QueryStatus< + ::core::primitive::u32, + >, >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 47u8, 241u8, 126u8, 71u8, 203u8, 121u8, 171u8, 226u8, 89u8, - 17u8, 61u8, 198u8, 123u8, 73u8, 20u8, 197u8, 6u8, 23u8, 34u8, - 127u8, 89u8, 35u8, 49u8, 101u8, 110u8, 15u8, 206u8, 203u8, - 155u8, 93u8, 0u8, 97u8, - ] - { - let entry = Queries(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = client.metadata(); + let metadata = locked_metadata.read(); + match metadata.storage_hash::() { + Ok(hash) => hash, + Err(e) => return Err(e.into()), + } + }; + if runtime_storage_hash + == [ + 47u8, 241u8, 126u8, 71u8, 203u8, 121u8, 171u8, 226u8, + 89u8, 17u8, 61u8, 198u8, 123u8, 73u8, 20u8, 197u8, 6u8, + 23u8, 34u8, 127u8, 89u8, 35u8, 49u8, 101u8, 110u8, 15u8, + 206u8, 203u8, 155u8, 93u8, 0u8, 97u8, + ] + { + let entry = Queries(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " The ongoing queries."] - pub async fn queries_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Queries<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 47u8, 241u8, 126u8, 71u8, 203u8, 121u8, 171u8, 226u8, 89u8, - 17u8, 61u8, 198u8, 123u8, 73u8, 20u8, 197u8, 6u8, 23u8, 34u8, - 127u8, 89u8, 35u8, 49u8, 101u8, 110u8, 15u8, 206u8, 203u8, - 155u8, 93u8, 0u8, 97u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 47u8, 241u8, 126u8, 71u8, 203u8, 121u8, 171u8, 226u8, + 89u8, 17u8, 61u8, 198u8, 123u8, 73u8, 20u8, 197u8, 6u8, + 23u8, 34u8, 127u8, 89u8, 35u8, 49u8, 101u8, 110u8, 15u8, + 206u8, 203u8, 155u8, 93u8, 0u8, 97u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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 async fn asset_traps( + pub fn asset_traps( &self, - _0: &::subxt::sp_core::H256, + _0: &'a ::subxt::sp_core::H256, block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } #[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 async fn asset_traps_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AssetTraps<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[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 async fn safe_xcm_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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()) + } } } #[doc = " The Latest versions that we know various locations support."] - pub async fn supported_version( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 231u8, 202u8, 129u8, 82u8, 121u8, 63u8, 67u8, 57u8, 191u8, - 190u8, 25u8, 27u8, 219u8, 42u8, 180u8, 142u8, 71u8, 119u8, - 212u8, 211u8, 21u8, 11u8, 8u8, 7u8, 9u8, 243u8, 11u8, 117u8, - 66u8, 47u8, 246u8, 85u8, - ] - { - let entry = SupportedVersion(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 231u8, 202u8, 129u8, 82u8, 121u8, 63u8, 67u8, 57u8, + 191u8, 190u8, 25u8, 27u8, 219u8, 42u8, 180u8, 142u8, + 71u8, 119u8, 212u8, 211u8, 21u8, 11u8, 8u8, 7u8, 9u8, + 243u8, 11u8, 117u8, 66u8, 47u8, 246u8, 85u8, + ] + { + let entry = SupportedVersion(_0, _1); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " The Latest versions that we know various locations support."] - pub async fn supported_version_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SupportedVersion<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 231u8, 202u8, 129u8, 82u8, 121u8, 63u8, 67u8, 57u8, 191u8, - 190u8, 25u8, 27u8, 219u8, 42u8, 180u8, 142u8, 71u8, 119u8, - 212u8, 211u8, 21u8, 11u8, 8u8, 7u8, 9u8, 243u8, 11u8, 117u8, - 66u8, 47u8, 246u8, 85u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 231u8, 202u8, 129u8, 82u8, 121u8, 63u8, 67u8, 57u8, + 191u8, 190u8, 25u8, 27u8, 219u8, 42u8, 180u8, 142u8, + 71u8, 119u8, 212u8, 211u8, 21u8, 11u8, 8u8, 7u8, 9u8, + 243u8, 11u8, 117u8, 66u8, 47u8, 246u8, 85u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " All locations that we have requested version notifications from."] - pub async fn version_notifiers( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u64>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 126u8, 49u8, 13u8, 135u8, 137u8, 68u8, 248u8, 211u8, 160u8, - 160u8, 93u8, 128u8, 157u8, 230u8, 62u8, 119u8, 191u8, 51u8, - 147u8, 149u8, 60u8, 227u8, 154u8, 97u8, 244u8, 249u8, 0u8, - 220u8, 189u8, 92u8, 178u8, 149u8, - ] - { - let entry = VersionNotifiers(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 126u8, 49u8, 13u8, 135u8, 137u8, 68u8, 248u8, 211u8, + 160u8, 160u8, 93u8, 128u8, 157u8, 230u8, 62u8, 119u8, + 191u8, 51u8, 147u8, 149u8, 60u8, 227u8, 154u8, 97u8, + 244u8, 249u8, 0u8, 220u8, 189u8, 92u8, 178u8, 149u8, + ] + { + let entry = VersionNotifiers(_0, _1); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " All locations that we have requested version notifications from."] - pub async fn version_notifiers_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifiers<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 126u8, 49u8, 13u8, 135u8, 137u8, 68u8, 248u8, 211u8, 160u8, - 160u8, 93u8, 128u8, 157u8, 230u8, 62u8, 119u8, 191u8, 51u8, - 147u8, 149u8, 60u8, 227u8, 154u8, 97u8, 244u8, 249u8, 0u8, - 220u8, 189u8, 92u8, 178u8, 149u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 126u8, 49u8, 13u8, 135u8, 137u8, 68u8, 248u8, 211u8, + 160u8, 160u8, 93u8, 128u8, 157u8, 230u8, 62u8, 119u8, + 191u8, 51u8, 147u8, 149u8, 60u8, 227u8, 154u8, 97u8, + 244u8, 249u8, 0u8, 220u8, 189u8, 92u8, 178u8, 149u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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 async fn version_notify_targets( + pub fn version_notify_targets( &self, - _0: &::core::primitive::u32, - _1: &runtime_types::xcm::VersionedMultiLocation, + _0: &'a ::core::primitive::u32, + _1: &'a runtime_types::xcm::VersionedMultiLocation, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 251u8, 128u8, 243u8, 94u8, 162u8, 11u8, 206u8, 101u8, 33u8, - 24u8, 163u8, 157u8, 112u8, 50u8, 91u8, 155u8, 241u8, 73u8, - 77u8, 185u8, 231u8, 3u8, 220u8, 161u8, 36u8, 208u8, 116u8, - 183u8, 80u8, 38u8, 56u8, 104u8, - ] - { - let entry = VersionNotifyTargets(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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 + == [ + 251u8, 128u8, 243u8, 94u8, 162u8, 11u8, 206u8, 101u8, + 33u8, 24u8, 163u8, 157u8, 112u8, 50u8, 91u8, 155u8, + 241u8, 73u8, 77u8, 185u8, 231u8, 3u8, 220u8, 161u8, 36u8, + 208u8, 116u8, 183u8, 80u8, 38u8, 56u8, 104u8, + ] + { + let entry = VersionNotifyTargets(_0, _1); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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 async fn version_notify_targets_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifyTargets<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 251u8, 128u8, 243u8, 94u8, 162u8, 11u8, 206u8, 101u8, 33u8, - 24u8, 163u8, 157u8, 112u8, 50u8, 91u8, 155u8, 241u8, 73u8, - 77u8, 185u8, 231u8, 3u8, 220u8, 161u8, 36u8, 208u8, 116u8, - 183u8, 80u8, 38u8, 56u8, 104u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + 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 + == [ + 251u8, 128u8, 243u8, 94u8, 162u8, 11u8, 206u8, 101u8, + 33u8, 24u8, 163u8, 157u8, 112u8, 50u8, 91u8, 155u8, + 241u8, 73u8, 77u8, 185u8, 231u8, 3u8, 220u8, 161u8, 36u8, + 208u8, 116u8, 183u8, 80u8, 38u8, 56u8, 104u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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 async fn version_discovery_queue( + pub fn version_discovery_queue( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 45u8, 28u8, 29u8, 233u8, 239u8, 65u8, 24u8, 214u8, 153u8, - 189u8, 132u8, 235u8, 62u8, 197u8, 252u8, 56u8, 38u8, 97u8, - 13u8, 16u8, 149u8, 25u8, 252u8, 181u8, 206u8, 54u8, 250u8, - 133u8, 133u8, 74u8, 186u8, 22u8, - ] - { - let entry = VersionDiscoveryQueue; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + 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 + == [ + 45u8, 28u8, 29u8, 233u8, 239u8, 65u8, 24u8, 214u8, 153u8, + 189u8, 132u8, 235u8, 62u8, 197u8, 252u8, 56u8, 38u8, + 97u8, 13u8, 16u8, 149u8, 25u8, 252u8, 181u8, 206u8, 54u8, + 250u8, 133u8, 133u8, 74u8, 186u8, 22u8, + ] + { + let entry = VersionDiscoveryQueue; + client.storage().fetch_or_default(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " The current migration's stage, if any."] - pub async fn current_migration( + pub fn current_migration( &self, block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::VersionMigrationStage, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - let metadata = locked_metadata.read(); - metadata.storage_hash::()? - }; - 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; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) + ) -> 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()) + } } } } @@ -39301,30 +42003,6 @@ pub mod api { None, } } - pub mod storage { - use super::runtime_types; - pub mod bounded_btree_map { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, - )] - pub struct BoundedBTreeMap<_0, _1>(pub ::subxt::KeyedVec<_0, _1>); - } - pub mod bounded_vec { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Decode, :: subxt :: 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, - )] - pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); - } - } pub mod traits { use super::runtime_types; pub mod misc { @@ -39428,15 +42106,6 @@ pub mod api { pub read: ::core::primitive::u64, pub write: ::core::primitive::u64, } - #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, - )] - pub struct WeightToFeeCoefficient<_0> { - pub coeff_integer: _0, - pub coeff_frac: runtime_types::sp_arithmetic::per_things::Perbill, - pub negative: ::core::primitive::bool, - pub degree: ::core::primitive::u8, - } } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] pub struct PalletId(pub [::core::primitive::u8; 8usize]); @@ -39821,6 +42490,7 @@ pub mod api { pub next: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, pub bag_upper: ::core::primitive::u64, + pub score: ::core::primitive::u64, } } pub mod pallet { @@ -39836,8 +42506,10 @@ pub mod api { #[doc = ""] #[doc = "Anyone can call this function about any potentially dislocated account."] #[doc = ""] - #[doc = "Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then"] - #[doc = "it is a noop and fees are still collected from `origin`."] + #[doc = "Will always update the stored score of `dislocated` to the correct score, based on"] + #[doc = "`ScoreProvider`."] + #[doc = ""] + #[doc = "If `dislocated` does not exists, it returns an error."] rebag { dislocated: ::subxt::sp_core::crypto::AccountId32, }, @@ -39873,6 +42545,12 @@ pub mod api { 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, + new_score: ::core::primitive::u64, + }, } } } @@ -41414,7 +44092,7 @@ pub mod api { :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, )] 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 = 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 , } , } } pub mod types { use super::runtime_types; @@ -41661,7 +44339,7 @@ pub mod api { pub voters: ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u64, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< ::subxt::sp_core::crypto::AccountId32, >, )>, @@ -41970,12 +44648,17 @@ pub mod api { key_owner_proof: runtime_types::sp_session::MembershipProof, }, #[codec(index = 2)] - #[doc = "Note that the current authority set of the GRANDPA finality gadget has"] - #[doc = "stalled. This will trigger a forced authority set change at the beginning"] - #[doc = "of the next session, to be enacted `delay` blocks after that. The delay"] - #[doc = "should be high enough to safely assume that the block signalling the"] - #[doc = "forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters"] - #[doc = "will start the new authority set using the given finalized block as base."] + #[doc = "Note that the current authority set of the GRANDPA finality gadget has stalled."] + #[doc = ""] + #[doc = "This will trigger a forced authority set change at the beginning of the next session, to"] + #[doc = "be enacted `delay` blocks after that. The `delay` should be high enough to safely assume"] + #[doc = "that the block signalling the forced change will not be re-orged e.g. 1000 blocks."] + #[doc = "The block production rate (which may be slowed down because of finality lagging) should"] + #[doc = "be taken into account when choosing the `delay`. The GRANDPA voters based on the new"] + #[doc = "authority will start voting on top of `best_finalized_block_number` for new finalized"] + #[doc = "blocks. `best_finalized_block_number` should be the highest of the latest finalized"] + #[doc = "block of all validators of the new authority set."] + #[doc = ""] #[doc = "Only callable by root."] note_stalled { delay: ::core::primitive::u32, @@ -42031,7 +44714,18 @@ pub mod api { } } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct StoredPendingChange < _0 > { pub scheduled_at : _0 , pub delay : _0 , pub next_authorities : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_finality_grandpa :: app :: Public , :: core :: primitive :: u64 ,) > , pub forced : :: core :: option :: Option < _0 > , } + pub struct StoredPendingChange<_0> { + pub scheduled_at: _0, + pub delay: _0, + pub next_authorities: + runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< + ( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + ), + >, + pub forced: ::core::option::Option<_0>, + } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] pub enum StoredState<_0> { #[codec(index = 0)] @@ -42602,7 +45296,7 @@ pub mod api { )] pub struct IdentityInfo { pub additional: - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( runtime_types::pallet_identity::types::Data, runtime_types::pallet_identity::types::Data, )>, @@ -42650,7 +45344,7 @@ pub mod api { )] pub struct Registration<_0> { pub judgements: - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( ::core::primitive::u32, runtime_types::pallet_identity::types::Judgement<_0>, )>, @@ -42720,7 +45414,7 @@ pub mod api { } } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BoundedOpaqueNetworkState { pub peer_id : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > , pub external_addresses : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < :: core :: primitive :: u8 > > , } + 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)] pub struct Heartbeat<_0> { pub block_number: _0, @@ -42965,6 +45659,9 @@ pub mod api { #[codec(index = 1)] #[doc = "Not a member."] NotMember, + #[codec(index = 2)] + #[doc = "Too many members."] + TooManyMembers, } #[derive( :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, @@ -44651,10 +47348,9 @@ pub mod api { } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] pub struct Nominations { - pub targets: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, + pub targets: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, pub submitted_in: ::core::primitive::u32, pub suppressed: ::core::primitive::bool, } @@ -44700,7 +47396,7 @@ pub mod api { #[codec(compact)] pub active: ::core::primitive::u128, pub unlocking: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< runtime_types::pallet_staking::UnlockChunk< ::core::primitive::u128, >, @@ -45039,6 +47735,23 @@ pub mod api { proposal_id: ::core::primitive::u32, }, #[codec(index = 3)] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "- `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = ""] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] + spend { + #[codec(compact)] + amount: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 4)] #[doc = "Force a previously approved proposal to be removed from the approval queue."] #[doc = "The original deposit will no longer be returned."] #[doc = ""] @@ -45073,6 +47786,10 @@ pub mod api { #[doc = "Too many approvals in the queue."] TooManyApprovals, #[codec(index = 3)] + #[doc = "The spend origin is valid but the amount it is allowed to spend is lower than the"] + #[doc = "amount to be spent."] + InsufficientPermission, + #[codec(index = 4)] #[doc = "Proposal has not been approved."] ProposalNotApproved, } @@ -45116,6 +47833,13 @@ pub mod api { #[codec(index = 6)] #[doc = "Some funds have been deposited."] Deposit { value: ::core::primitive::u128 }, + #[codec(index = 7)] + #[doc = "A new spend proposal has been approved."] + SpendApproved { + proposal_index: ::core::primitive::u32, + amount: ::core::primitive::u128, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, } } #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] @@ -46284,10 +49008,10 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Decode, :: subxt :: 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)] BagsList (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 ,) , } + # [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)] 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 = 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)] BagsList (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 ,) , } + # [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 :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] pub struct NposCompactSolution16 { pub votes1: @@ -46565,52 +49289,53 @@ pub mod api { #[codec(index = 0)] #[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."] - #[doc = "`[auction_index, lease_period, ending]`"] - AuctionStarted( - ::core::primitive::u32, - ::core::primitive::u32, - ::core::primitive::u32, - ), + AuctionStarted { + auction_index: ::core::primitive::u32, + lease_period: ::core::primitive::u32, + ending: ::core::primitive::u32, + }, #[codec(index = 1)] - #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] - AuctionClosed(::core::primitive::u32), + #[doc = "An auction ended. All funds become unreserved."] + AuctionClosed { + auction_index: ::core::primitive::u32, + }, #[codec(index = 2)] #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] - #[doc = "Second is the total. `[bidder, extra_reserved, total_amount]`"] - Reserved( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u128, - ), + #[doc = "Second is the total."] + Reserved { + bidder: ::subxt::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( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + Unreserved { + bidder: ::subxt::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 4)] #[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."] - #[doc = "`[parachain_id, leaser, amount]`"] - ReserveConfiscated( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + ReserveConfiscated { + para_id: runtime_types::polkadot_parachain::primitives::Id, + leaser: ::subxt::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 5)] #[doc = "A new bid has been accepted as the current winner."] - #[doc = "`[who, para_id, amount, first_slot, last_slot]`"] - BidAccepted( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - ), + BidAccepted { + bidder: ::subxt::sp_core::crypto::AccountId32, + para_id: runtime_types::polkadot_parachain::primitives::Id, + amount: ::core::primitive::u128, + first_slot: ::core::primitive::u32, + last_slot: ::core::primitive::u32, + }, #[codec(index = 6)] #[doc = "The winning offset was chosen for an auction. This will map into the `Winning` storage map."] - #[doc = "`[auction_index, block_number]`"] - WinningOffset(::core::primitive::u32, ::core::primitive::u32), + WinningOffset { + auction_index: ::core::primitive::u32, + block_number: ::core::primitive::u32, + }, } } } @@ -46651,7 +49376,7 @@ pub mod api { :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, )] pub enum Event { - # [codec (index = 0)] # [doc = "Someone claimed some DOTs. `[who, ethereum_address, amount]`"] Claimed (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , :: core :: primitive :: u128 ,) , } + # [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 , } , } } #[derive( :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, @@ -46878,58 +49603,66 @@ pub mod api { )] pub enum Event { #[codec(index = 0)] - #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] - Created(runtime_types::polkadot_parachain::primitives::Id), + #[doc = "Create a new crowdloaning campaign."] + Created { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, #[codec(index = 1)] - #[doc = "Contributed to a crowd sale. `[who, fund_index, amount]`"] - Contributed( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - ), + #[doc = "Contributed to a crowd sale."] + Contributed { + who: ::subxt::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. `[who, fund_index, amount]`"] - Withdrew( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - ), + #[doc = "Withdrew full balance of a contributor."] + Withdrew { + who: ::subxt::sp_core::crypto::AccountId32, + fund_index: runtime_types::polkadot_parachain::primitives::Id, + amount: ::core::primitive::u128, + }, #[codec(index = 3)] #[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. `[fund_index]`"] - PartiallyRefunded( - runtime_types::polkadot_parachain::primitives::Id, - ), + #[doc = "over child keys that still need to be killed."] + PartiallyRefunded { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, #[codec(index = 4)] - #[doc = "All loans in a fund have been refunded. `[fund_index]`"] - AllRefunded(runtime_types::polkadot_parachain::primitives::Id), + #[doc = "All loans in a fund have been refunded."] + AllRefunded { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, #[codec(index = 5)] - #[doc = "Fund is dissolved. `[fund_index]`"] - Dissolved(runtime_types::polkadot_parachain::primitives::Id), + #[doc = "Fund is dissolved."] + Dissolved { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, #[codec(index = 6)] #[doc = "The result of trying to submit a new bid to the Slots pallet."] - HandleBidResult( - runtime_types::polkadot_parachain::primitives::Id, - ::core::result::Result< + HandleBidResult { + para_id: runtime_types::polkadot_parachain::primitives::Id, + result: ::core::result::Result< (), runtime_types::sp_runtime::DispatchError, >, - ), + }, #[codec(index = 7)] - #[doc = "The configuration to a crowdloan has been edited. `[fund_index]`"] - Edited(runtime_types::polkadot_parachain::primitives::Id), + #[doc = "The configuration to a crowdloan has been edited."] + Edited { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, #[codec(index = 8)] - #[doc = "A memo has been updated. `[who, fund_index, memo]`"] - MemoUpdated( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - ), + #[doc = "A memo has been updated."] + MemoUpdated { + who: ::subxt::sp_core::crypto::AccountId32, + para_id: runtime_types::polkadot_parachain::primitives::Id, + memo: ::std::vec::Vec<::core::primitive::u8>, + }, #[codec(index = 9)] #[doc = "A parachain has been moved to `NewRaise`"] - AddedToNewRaise( - runtime_types::polkadot_parachain::primitives::Id, - ), + AddedToNewRaise { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, } } #[derive( @@ -47010,17 +49743,19 @@ pub mod api { )] pub enum Event { #[codec(index = 0)] - Registered( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ), + Registered { + para_id: runtime_types::polkadot_parachain::primitives::Id, + manager: ::subxt::sp_core::crypto::AccountId32, + }, #[codec(index = 1)] - Deregistered(runtime_types::polkadot_parachain::primitives::Id), + Deregistered { + para_id: runtime_types::polkadot_parachain::primitives::Id, + }, #[codec(index = 2)] - Reserved( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ), + Reserved { + para_id: runtime_types::polkadot_parachain::primitives::Id, + who: ::subxt::sp_core::crypto::AccountId32, + }, } } #[derive( @@ -47088,20 +49823,21 @@ pub mod api { pub enum Event { #[codec(index = 0)] #[doc = "A new `[lease_period]` is beginning."] - NewLeasePeriod(::core::primitive::u32), + NewLeasePeriod { + lease_period: ::core::primitive::u32, + }, #[codec(index = 1)] #[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."] - #[doc = "`[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`"] - Leased( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - ::core::primitive::u128, - ::core::primitive::u128, - ), + Leased { + para_id: runtime_types::polkadot_parachain::primitives::Id, + leaser: ::subxt::sp_core::crypto::AccountId32, + period_begin: ::core::primitive::u32, + period_count: ::core::primitive::u32, + extra_reserved: ::core::primitive::u128, + total_amount: ::core::primitive::u128, + }, } } } @@ -48326,6 +51062,30 @@ pub mod api { } pub mod sp_runtime { use super::runtime_types; + pub mod bounded { + use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, + )] + pub struct BoundedBTreeMap<_0, _1>(pub ::subxt::KeyedVec<_0, _1>); + } + pub mod bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Decode, :: subxt :: 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, + )] + pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); + } + } pub mod generic { use super::runtime_types; pub mod digest { @@ -50159,10 +52919,10 @@ pub mod api { }; if runtime_metadata_hash != [ - 210u8, 45u8, 31u8, 79u8, 151u8, 149u8, 38u8, 156u8, 209u8, 36u8, - 248u8, 47u8, 243u8, 234u8, 251u8, 113u8, 31u8, 72u8, 9u8, 97u8, - 118u8, 172u8, 164u8, 60u8, 56u8, 158u8, 219u8, 77u8, 169u8, 230u8, - 148u8, 51u8, + 147u8, 4u8, 219u8, 235u8, 30u8, 170u8, 31u8, 204u8, 122u8, 215u8, + 247u8, 77u8, 5u8, 195u8, 148u8, 219u8, 244u8, 41u8, 173u8, 234u8, + 240u8, 76u8, 16u8, 83u8, 27u8, 97u8, 105u8, 134u8, 156u8, 239u8, + 228u8, 53u8, ] { Err(::subxt::MetadataError::IncompatibleMetadata) @@ -50311,8 +53071,8 @@ pub mod api { ) -> election_provider_multi_phase::constants::ConstantsApi<'a, T> { election_provider_multi_phase::constants::ConstantsApi::new(self.client) } - pub fn bags_list(&self) -> bags_list::constants::ConstantsApi<'a, T> { - bags_list::constants::ConstantsApi::new(self.client) + pub fn voter_list(&self) -> voter_list::constants::ConstantsApi<'a, T> { + voter_list::constants::ConstantsApi::new(self.client) } pub fn paras(&self) -> paras::constants::ConstantsApi<'a, T> { paras::constants::ConstantsApi::new(self.client) @@ -50432,8 +53192,8 @@ pub mod api { ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { election_provider_multi_phase::storage::StorageApi::new(self.client) } - pub fn bags_list(&self) -> bags_list::storage::StorageApi<'a, T> { - bags_list::storage::StorageApi::new(self.client) + pub fn voter_list(&self) -> voter_list::storage::StorageApi<'a, T> { + voter_list::storage::StorageApi::new(self.client) } pub fn configuration(&self) -> configuration::storage::StorageApi<'a, T> { configuration::storage::StorageApi::new(self.client) @@ -50588,8 +53348,8 @@ pub mod api { ) -> election_provider_multi_phase::calls::TransactionApi<'a, T, X> { election_provider_multi_phase::calls::TransactionApi::new(self.client) } - pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T, X> { - bags_list::calls::TransactionApi::new(self.client) + pub fn voter_list(&self) -> voter_list::calls::TransactionApi<'a, T, X> { + voter_list::calls::TransactionApi::new(self.client) } pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T, X> { configuration::calls::TransactionApi::new(self.client)