From e22f65a63447fa4ed11d75892fa87e651294e12f Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 14:40:10 +0300 Subject: [PATCH 01/37] codegen: Composite fields docs Signed-off-by: Alexandru Vasile --- codegen/src/api/calls.rs | 2 +- codegen/src/types/composite_def.rs | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index 80e79564b5..fb8614ff28 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -54,7 +54,7 @@ pub fn generate_calls( CompositeDefFields::Named(ref named_fields) => { named_fields .iter() - .map(|(name, field)| { + .map(|(_, name, field)| { let fn_arg_type = &field.type_path; let call_arg = if field.is_boxed() { quote! { #name: ::std::boxed::Box::new(#name) } diff --git a/codegen/src/types/composite_def.rs b/codegen/src/types/composite_def.rs index 5f3379898f..aa20048b4a 100644 --- a/codegen/src/types/composite_def.rs +++ b/codegen/src/types/composite_def.rs @@ -178,7 +178,7 @@ pub enum CompositeDefKind { #[derive(Debug)] pub enum CompositeDefFields { NoFields, - Named(Vec<(syn::Ident, CompositeDefFieldType)>), + Named(Vec<(TokenStream, syn::Ident, CompositeDefFieldType)>), Unnamed(Vec), } @@ -207,8 +207,10 @@ impl CompositeDefFields { ); if let Some(name) = field.name() { + let docs = field.docs(); + let docs_token = quote! { #( #[doc = #docs ] )* }; let field_name = format_ident!("{}", name); - named_fields.push((field_name, field_type)) + named_fields.push((docs_token, field_name, field_type)) } else { unnamed_fields.push(field_type) } @@ -232,7 +234,7 @@ impl CompositeDefFields { pub fn field_types(&self) -> Box + '_> { match self { Self::NoFields => Box::new([].iter()), - Self::Named(named_fields) => Box::new(named_fields.iter().map(|(_, f)| f)), + Self::Named(named_fields) => Box::new(named_fields.iter().map(|(_, _, f)| f)), Self::Unnamed(unnamed_fields) => Box::new(unnamed_fields.iter()), } } @@ -252,9 +254,9 @@ impl CompositeDefFields { } } Self::Named(ref fields) => { - let fields = fields.iter().map(|(name, ty)| { + let fields = fields.iter().map(|(docs, name, ty)| { let compact_attr = ty.compact_attr(); - quote! { #compact_attr #visibility #name: #ty } + quote! { #docs #compact_attr #visibility #name: #ty } }); let marker = phantom_data.map(|phantom_data| { quote!( @@ -295,9 +297,9 @@ impl CompositeDefFields { match self { Self::NoFields => quote! {}, Self::Named(ref fields) => { - let fields = fields.iter().map(|(name, ty)| { + let fields = fields.iter().map(|(docs, name, ty)| { let compact_attr = ty.compact_attr(); - quote! { #compact_attr #name: #ty } + quote! { #docs #compact_attr #name: #ty } }); quote!( { #( #fields, )* } ) } From 40f041c7c3362dd4579339f28ec1330a29bc6882 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 14:51:19 +0300 Subject: [PATCH 02/37] codegen: Propagate docs for Event type Signed-off-by: Alexandru Vasile --- codegen/src/api/events.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codegen/src/api/events.rs b/codegen/src/api/events.rs index 6c2389b52b..285c52f08a 100644 --- a/codegen/src/api/events.rs +++ b/codegen/src/api/events.rs @@ -50,8 +50,11 @@ pub fn generate_events( } }); let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); + let event_ty = type_gen.resolve_type(event.ty.id()); + let docs = event_ty.docs(); quote! { + #( #[doc = #docs ] )* pub type Event = #event_type; pub mod events { use super::#types_mod_ident; From b097bc18b0fb33d492ef05d6ec11722647b6dbc3 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 14:51:36 +0300 Subject: [PATCH 03/37] codegen: Propagate docs for calls module Signed-off-by: Alexandru Vasile --- codegen/src/api/calls.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index fb8614ff28..bccd0196f3 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -104,7 +104,11 @@ pub fn generate_calls( }) .unzip(); + let call_ty = type_gen.resolve_type(call.ty.id()); + let docs = call_ty.docs(); + quote! { + #( #[doc = #docs ] )* pub mod calls { use super::root_mod; use super::#types_mod_ident; From 8a7382d8a3facd2a7e1f64c40d30ac26fab06a1e Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 14:52:21 +0300 Subject: [PATCH 04/37] subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile --- subxt/tests/integration/codegen/polkadot.rs | 81 +++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs index b15d7029de..3b4da803d6 100644 --- a/subxt/tests/integration/codegen/polkadot.rs +++ b/subxt/tests/integration/codegen/polkadot.rs @@ -83,6 +83,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -352,6 +353,7 @@ pub mod api { } } } + #[doc = "Event for the System pallet."] pub type Event = runtime_types::frame_system::pallet::Event; pub mod events { use super::runtime_types; @@ -921,6 +923,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -1198,6 +1201,7 @@ pub mod api { } } } + #[doc = "Events type."] pub type Event = runtime_types::pallet_scheduler::pallet::Event; pub mod events { use super::runtime_types; @@ -1370,6 +1374,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -1493,6 +1498,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_preimage::pallet::Event; pub mod events { use super::runtime_types; @@ -1624,6 +1630,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -2180,6 +2187,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -2319,6 +2327,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -2568,6 +2577,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_indices::pallet::Event; pub mod events { use super::runtime_types; @@ -2686,6 +2696,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -2977,6 +2988,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_balances::pallet::Event; pub mod events { use super::runtime_types; @@ -3463,6 +3475,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -3629,6 +3642,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -4649,6 +4663,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; pub mod events { use super::runtime_types; @@ -6104,6 +6119,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Events type."] pub type Event = runtime_types::pallet_offences::pallet::Event; pub mod events { use super::runtime_types; @@ -6285,6 +6301,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -6381,6 +6398,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_session::pallet::Event; pub mod events { use super::runtime_types; @@ -6597,6 +6615,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -6731,6 +6750,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_grandpa::pallet::Event; pub mod events { use super::runtime_types; @@ -6948,6 +6968,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -7011,6 +7032,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_im_online::pallet::Event; pub mod events { use super::runtime_types; @@ -7231,6 +7253,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -8124,6 +8147,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_democracy::pallet::Event; pub mod events { use super::runtime_types; @@ -8899,6 +8923,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -9232,6 +9257,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_collective::pallet::Event; pub mod events { use super::runtime_types; @@ -9490,6 +9516,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -9823,6 +9850,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_collective::pallet::Event; pub mod events { use super::runtime_types; @@ -10081,6 +10109,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -10338,6 +10367,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; pub mod events { use super::runtime_types; @@ -10678,6 +10708,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -10880,6 +10911,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_membership::pallet::Event; pub mod events { use super::runtime_types; @@ -10983,6 +11015,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -11111,6 +11144,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_treasury::pallet::Event; pub mod events { use super::runtime_types; @@ -11400,6 +11434,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -11664,6 +11699,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; pub mod events { use super::runtime_types; @@ -11895,6 +11931,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -12160,6 +12197,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_vesting::pallet::Event; pub mod events { use super::runtime_types; @@ -12300,6 +12338,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -12478,6 +12517,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_utility::pallet::Event; pub mod events { use super::runtime_types; @@ -12544,6 +12584,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Identity pallet declaration."] pub mod calls { use super::{ root_mod, @@ -13187,6 +13228,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_identity::pallet::Event; pub mod events { use super::runtime_types; @@ -13566,6 +13608,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -14042,6 +14085,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_proxy::pallet::Event; pub mod events { use super::runtime_types; @@ -14311,6 +14355,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -14617,6 +14662,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_multisig::pallet::Event; pub mod events { use super::runtime_types; @@ -14832,6 +14878,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -15185,6 +15232,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_bounties::pallet::Event; pub mod events { use super::runtime_types; @@ -15533,6 +15581,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -15926,6 +15975,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_child_bounties::pallet::Event; pub mod events { use super::runtime_types; @@ -16200,6 +16250,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -16481,6 +16532,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_tips::pallet::Event; pub mod events { use super::runtime_types; @@ -16702,6 +16754,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -16902,6 +16955,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_election_provider_multi_phase::pallet::Event; pub mod events { @@ -17451,6 +17505,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -17534,6 +17589,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_bags_list::pallet::Event; pub mod events { use super::runtime_types; @@ -17731,6 +17787,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -19101,6 +19158,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -19209,6 +19267,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -19232,6 +19291,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; pub mod events { @@ -19393,6 +19453,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -19683,6 +19744,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -19932,6 +19994,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; pub mod events { use super::runtime_types; @@ -20773,6 +20836,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -20887,6 +20951,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -21017,6 +21082,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -21079,6 +21145,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; pub mod events { use super::runtime_types; @@ -21397,6 +21464,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -21651,6 +21719,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; pub mod events { use super::runtime_types; @@ -22302,6 +22371,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -22344,6 +22414,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; pub mod events { @@ -22594,6 +22665,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -22824,6 +22896,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; pub mod events { @@ -23013,6 +23086,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -23130,6 +23204,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; pub mod events { use super::runtime_types; @@ -23287,6 +23362,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -23423,6 +23499,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; pub mod events { use super::runtime_types; @@ -23713,6 +23790,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -24050,6 +24128,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; pub mod events { use super::runtime_types; @@ -24311,6 +24390,7 @@ pub mod api { root_mod, runtime_types, }; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { use super::{ root_mod, @@ -24729,6 +24809,7 @@ pub mod api { } } } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_xcm::pallet::Event; pub mod events { use super::runtime_types; From 70dfd68d6551aba772aa17126dd7c757f3cee436 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 15:41:50 +0300 Subject: [PATCH 05/37] codegen: Propagate documentation for `TypeDefGenKind::Enum` kind Signed-off-by: Alexandru Vasile --- codegen/src/types/type_def.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index 9b19ddb047..57217f6c0b 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -46,6 +46,8 @@ pub struct TypeDefGen<'a> { derives: &'a GeneratedTypeDerives, /// The kind of type to be generated. ty_kind: TypeDefGenKind, + /// Type documentation. + ty_docs: TokenStream, } impl<'a> TypeDefGen<'a> { @@ -118,10 +120,14 @@ impl<'a> TypeDefGen<'a> { _ => TypeDefGenKind::BuiltIn, }; + let docs = ty.docs(); + let ty_docs = quote! { #( #[doc = #docs ] )* }; + Self { type_params, derives, ty_kind, + ty_docs, } } } @@ -151,8 +157,10 @@ impl<'a> quote::ToTokens for TypeDefGen<'a> { let enum_ident = format_ident!("{}", type_name); let type_params = &self.type_params; let derives = self.derives; + let docs = &self.ty_docs; let ty_toks = quote! { #derives + #docs pub enum #enum_ident #type_params { #( #variants, )* } From d0bdbad7d15f57e434a50a8cad79cf09edbb957c Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 15:42:36 +0300 Subject: [PATCH 06/37] subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile --- subxt/tests/integration/codegen/polkadot.rs | 118 ++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs index 3b4da803d6..98c1be72f3 100644 --- a/subxt/tests/integration/codegen/polkadot.rs +++ b/subxt/tests/integration/codegen/polkadot.rs @@ -25639,6 +25639,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "A dispatch that will fill the block weight up to the given ratio."] @@ -25717,6 +25718,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Error for the System pallet"] pub enum Error { #[codec(index = 0)] #[doc = "The name of specification does not match between the current runtime"] @@ -25744,6 +25746,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Event for the System pallet."] pub enum Event { #[codec(index = 0)] #[doc = "An extrinsic completed successfully."] @@ -25816,6 +25819,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Provide a set of uncles."] @@ -25831,6 +25835,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The uncle parent not in the chain."] @@ -25870,11 +25875,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] report_equivocation { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 1)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] # [doc = "This extrinsic must be called unsigned and it is expected that only"] # [doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] # [doc = "if the block author is defined it will be defined as the equivocation"] # [doc = "reporter."] report_equivocation_unsigned { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 2)] # [doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] # [doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] # [doc = "Multiple calls to this method will replace any existing planned config change that had"] # [doc = "not been enacted yet."] plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] @@ -25918,6 +25925,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] @@ -25947,6 +25955,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Attempted to place node in front of a node in another bag."] @@ -25961,6 +25970,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Moved an account from one bag to another."] @@ -25979,6 +25989,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Transfer some liquid free balance to another account."] @@ -26107,6 +26118,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Vesting balance too high to send value"] @@ -26136,6 +26148,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "An account was created with some free balance."] Endowed { account : :: subxt :: sp_core :: crypto :: AccountId32 , free_balance : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] # [doc = "resulting in an outright loss."] DustLost { account : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 2)] # [doc = "Transfer succeeded."] Transfer { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "A balance was set by root."] BalanceSet { who : :: subxt :: sp_core :: crypto :: AccountId32 , free : :: core :: primitive :: u128 , reserved : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Some balance was reserved (moved from free to reserved)."] Reserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 5)] # [doc = "Some balance was unreserved (moved from reserved to free)."] Unreserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 6)] # [doc = "Some balance was moved from the reserve of the first account to the second account."] # [doc = "Final argument indicates the destination balance type."] ReserveRepatriated { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , destination_status : runtime_types :: frame_support :: traits :: tokens :: misc :: BalanceStatus , } , # [codec (index = 7)] # [doc = "Some amount was deposited (e.g. for transaction fees)."] Deposit { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 8)] # [doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] Withdraw { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 9)] # [doc = "Some amount was removed from the account (e.g. for misbehavior)."] Slashed { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , } } @@ -26181,6 +26194,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Propose a new bounty."] @@ -26336,6 +26350,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Proposer's balance is too low."] @@ -26375,6 +26390,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "New bounty proposal."] @@ -26445,6 +26461,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Add a new child-bounty."] @@ -26652,6 +26669,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The parent bounty is not in active state."] @@ -26666,6 +26684,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A child-bounty is added."] @@ -26728,6 +26747,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Set the collective's membership."] @@ -26909,6 +26929,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Account is not a member"] @@ -26944,6 +26965,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] @@ -27048,6 +27070,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Propose a sensitive action to be taken."] @@ -27419,6 +27442,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Value too low"] @@ -27509,6 +27533,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "A motion has been proposed by a public account."] Proposed { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "A public proposal has been tabled for referendum vote."] Tabled { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , depositors : :: std :: vec :: Vec < :: subxt :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 2)] # [doc = "An external proposal has been tabled."] ExternalTabled , # [codec (index = 3)] # [doc = "A referendum has begun."] Started { ref_index : :: core :: primitive :: u32 , threshold : runtime_types :: pallet_democracy :: vote_threshold :: VoteThreshold , } , # [codec (index = 4)] # [doc = "A proposal has been approved by referendum."] Passed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "A proposal has been rejected by referendum."] NotPassed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "A referendum has been cancelled."] Cancelled { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "A proposal has been enacted."] Executed { ref_index : :: core :: primitive :: u32 , result : :: core :: result :: Result < () , runtime_types :: sp_runtime :: DispatchError > , } , # [codec (index = 8)] # [doc = "An account has delegated their vote to another account."] Delegated { who : :: subxt :: sp_core :: crypto :: AccountId32 , target : :: subxt :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 9)] # [doc = "An account has cancelled a previous delegation operation."] Undelegated { account : :: subxt :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 10)] # [doc = "An external proposal has been vetoed."] Vetoed { who : :: subxt :: sp_core :: crypto :: AccountId32 , proposal_hash : :: subxt :: sp_core :: H256 , until : :: core :: primitive :: u32 , } , # [codec (index = 11)] # [doc = "A proposal's preimage was noted, and the deposit taken."] PreimageNoted { proposal_hash : :: subxt :: sp_core :: H256 , who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 12)] # [doc = "A proposal preimage was removed and used (the deposit was returned)."] PreimageUsed { proposal_hash : :: subxt :: sp_core :: H256 , provider : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 13)] # [doc = "A proposal could not be executed because its preimage was invalid."] PreimageInvalid { proposal_hash : :: subxt :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 14)] # [doc = "A proposal could not be executed because its preimage was missing."] PreimageMissing { proposal_hash : :: subxt :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 15)] # [doc = "A registered preimage was removed and the deposit collected by the reaper."] PreimageReaped { proposal_hash : :: subxt :: sp_core :: H256 , provider : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , reaper : :: subxt :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 16)] # [doc = "A proposal_hash has been blacklisted permanently."] Blacklisted { proposal_hash : :: subxt :: sp_core :: H256 , } , # [codec (index = 17)] # [doc = "An account has voted in a referendum"] Voted { voter : :: subxt :: sp_core :: crypto :: AccountId32 , ref_index : :: core :: primitive :: u32 , vote : runtime_types :: pallet_democracy :: vote :: AccountVote < :: core :: primitive :: u128 > , } , # [codec (index = 18)] # [doc = "An account has secconded a proposal"] Seconded { seconder : :: subxt :: sp_core :: crypto :: AccountId32 , prop_index : :: core :: primitive :: u32 , } , } } @@ -27650,11 +27675,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Submit a solution for the unsigned phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __none__."] # [doc = ""] # [doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] # [doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] # [doc = "that only active validators can submit this transaction when authoring a block (similar"] # [doc = "to an inherent)."] # [doc = ""] # [doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] # [doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] # [doc = "putting their authoring reward at risk."] # [doc = ""] # [doc = "No deposit or reward is associated with this submission."] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] # [doc = "Set a new value for `MinimumUntrustedScore`."] # [doc = ""] # [doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] # [doc = ""] # [doc = "This check can be turned off by setting the value to `None`."] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < runtime_types :: sp_npos_elections :: ElectionScore > , } , # [codec (index = 2)] # [doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] # [doc = "call to `ElectionProvider::elect`."] # [doc = ""] # [doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] # [doc = ""] # [doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] # [doc = "feasibility check itself can in principle cause the election process to fail (due to"] # [doc = "memory/weight constrains)."] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] # [doc = "Submit a solution for the signed phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __signed__."] # [doc = ""] # [doc = "The solution is potentially queued, based on the claimed score and processed at the end"] # [doc = "of the signed phase."] # [doc = ""] # [doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] # [doc = "might be rewarded, slashed, or get all or a part of the deposit back."] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , } , # [codec (index = 4)] # [doc = "Trigger the governance fallback."] # [doc = ""] # [doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] # [doc = "calling [`Call::set_emergency_election_result`]."] governance_fallback { maybe_max_voters : :: core :: option :: Option < :: core :: primitive :: u32 > , maybe_max_targets : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Error of the pallet that can be returned in response to dispatches."] pub enum Error { #[codec(index = 0)] #[doc = "Submission was too early."] @@ -27696,6 +27723,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "A solution was stored with the given compute."] # [doc = ""] # [doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] # [doc = "solution is unsigned, this means that it has also been processed."] # [doc = ""] # [doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] SolutionStored { election_compute : runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , prev_ejected : :: core :: primitive :: bool , } , # [codec (index = 1)] # [doc = "The election has been finalized, with `Some` of the given computation, or else if the"] # [doc = "election failed, `None`."] ElectionFinalized { election_compute : :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > , } , # [codec (index = 2)] # [doc = "An account has been rewarded for their signed submission being finalized."] Rewarded { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "An account has been slashed for submitting an invalid signed submission."] Slashed { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "The signed phase of the given round has started."] SignedPhaseStarted { round : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "The unsigned phase of the given round has started."] UnsignedPhaseStarted { round : :: core :: primitive :: u32 , } , } } @@ -27778,6 +27806,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] @@ -27898,6 +27927,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Cannot vote when no candidates or members exist."] @@ -27954,6 +27984,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] @@ -28031,6 +28062,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Report voter equivocation/misbehavior. This method will verify the"] @@ -28081,6 +28113,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Attempt to signal GRANDPA pause when the authority set isn't live"] @@ -28109,6 +28142,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "New authority set has been applied."] @@ -28147,6 +28181,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Identity pallet declaration."] pub enum Call { #[codec(index = 0)] #[doc = "Add a registrar to the system."] @@ -28461,6 +28496,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Too many subs-accounts."] @@ -28514,6 +28550,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A name was set or reset (which will remove all judgements)."] @@ -28762,11 +28799,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "# "] # [doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] # [doc = " length of `heartbeat.network_state.external_address`"] # [doc = " - `O(K)`: decoding of length `K`"] # [doc = " - `O(E)`: decoding/encoding of length `E`"] # [doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] # [doc = " `ReceivedHeartbeats`"] # [doc = "- DbWrites: `ReceivedHeartbeats`"] # [doc = "# "] heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < :: core :: primitive :: u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Non existent public key."] @@ -28778,6 +28817,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new heartbeat was received from `AuthorityId`."] @@ -28833,6 +28873,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Assign an previously unassigned index."] @@ -28950,6 +28991,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The index was not already assigned."] @@ -28970,6 +29012,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A account index was assigned."] @@ -28996,6 +29039,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Add a member `who` to the set."] @@ -29054,6 +29098,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Already a member."] @@ -29065,6 +29110,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "The given member was added; see the transaction for who."] @@ -29094,6 +29140,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] @@ -29266,6 +29313,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Threshold must be 2 or greater."] @@ -29313,6 +29361,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new multisig operation has begun."] @@ -29377,6 +29426,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Events type."] pub enum Event { #[codec(index = 0)] #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] @@ -29396,6 +29446,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Register a preimage on-chain."] @@ -29423,6 +29474,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Preimage is too large to store on-chain."] @@ -29446,6 +29498,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A preimage has been noted."] @@ -29473,6 +29526,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] @@ -29702,6 +29756,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "There are too many proxies registered or too many announcements pending."] @@ -29731,6 +29786,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A proxy was executed correctly, with the given."] @@ -29794,6 +29850,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Anonymously schedule a task."] @@ -29884,6 +29941,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Failed to schedule a call"] @@ -29901,6 +29959,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Events type."] pub enum Event { #[codec(index = 0)] #[doc = "Scheduled some task."] @@ -29957,6 +30016,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Sets the session key(s) of the function caller to `keys`."] @@ -29999,6 +30059,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Error for the session pallet."] pub enum Error { #[codec(index = 0)] #[doc = "Invalid ownership proof."] @@ -30019,6 +30080,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "New session has happened. Note that the argument is the session index, not the"] @@ -30038,6 +30100,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] @@ -30528,6 +30591,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Not a controller account."] @@ -30609,6 +30673,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] @@ -30824,6 +30889,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Set the current time."] @@ -30856,6 +30922,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] @@ -30997,6 +31064,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The reason given is just too big."] @@ -31020,6 +31088,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new tip suggestion has been opened."] @@ -31078,6 +31147,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] @@ -31130,6 +31200,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Error for the treasury pallet."] pub enum Error { #[codec(index = 0)] #[doc = "Proposer's balance is too low."] @@ -31144,6 +31215,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "New proposal."] @@ -31198,6 +31270,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Send a batch of dispatch calls."] @@ -31279,6 +31352,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Too many calls batched."] @@ -31287,6 +31361,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] @@ -31319,6 +31394,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Unlock any vested funds of the sender account."] @@ -31450,6 +31526,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Error for the vesting pallet."] pub enum Error { #[codec(index = 0)] #[doc = "The account given is not vesting."] @@ -31471,6 +31548,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "The amount vested has been updated. This could indicate a change in funds available."] @@ -31512,6 +31590,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] send { @@ -31689,6 +31768,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The desired destination was unreachable, generally because there is a no way of routing"] @@ -31736,6 +31816,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Execution of an XCM message was attempted."] @@ -32523,6 +32604,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Create a new auction."] @@ -32574,6 +32656,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "This auction is already in progress."] @@ -32600,6 +32683,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "An auction started. Provides its index and the block number where it will begin to"] @@ -32660,11 +32744,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Make a claim to collect your DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to claim is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)"] # [doc = ""] # [doc = "and `address` matches the `dest` account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , # [codec (index = 1)] # [doc = "Mint a new claim to collect DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _Root_."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `who`: The Ethereum address allowed to collect this claim."] # [doc = "- `value`: The number of DOTs that will be claimed."] # [doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "We assume worst case that both vesting and statement is being inserted."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : :: core :: primitive :: u128 , vesting_schedule : :: core :: option :: Option < (:: core :: primitive :: u128 , :: core :: primitive :: u128 , :: core :: primitive :: u32 ,) > , statement : :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , # [codec (index = 2)] # [doc = "Make a claim to collect your DOTs by signing a statement."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)(statement)"] # [doc = ""] # [doc = "and `address` matches the `dest` account; the `statement` must match that which is"] # [doc = "expected according to your purchase arrangement."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim_attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 3)] # [doc = "Attest to a statement, needed to finalize the claims process."] # [doc = ""] # [doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] # [doc = "and provides a `statement` which is expected for the account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to do pre-validation on `attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] attest { statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : :: core :: option :: Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Invalid Ethereum signature."] @@ -32689,6 +32775,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "Someone claimed some DOTs. `[who, ethereum_address, amount]`"] Claimed (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , :: core :: primitive :: u128 ,) , } } @@ -32721,6 +32808,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] @@ -32841,6 +32929,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The current lease period is more than the first lease period."] @@ -32915,6 +33004,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] @@ -32994,11 +33084,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin."] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The ID is not registered."] @@ -33047,6 +33139,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] Registered( @@ -33078,6 +33171,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] @@ -33113,6 +33207,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The parachain ID is not onboarding."] @@ -33124,6 +33219,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A new `[lease_period]` is beginning."] @@ -33207,6 +33303,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Set the validation upgrade cooldown."] @@ -33375,6 +33472,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The new value for a configuration parameter is invalid."] @@ -33437,6 +33535,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] force_unfreeze, @@ -33444,6 +33543,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Duplicate dispute statement sets provided."] @@ -33470,6 +33570,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] DisputeInitiated (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeLocation ,) , # [codec (index = 1)] # [doc = "A dispute has concluded for or against a candidate."] # [doc = "`\\[para id, candidate hash, dispute result\\]`"] DisputeConcluded (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeResult ,) , # [codec (index = 2)] # [doc = "A dispute has timed out due to insufficient participation."] # [doc = "`\\[para id, candidate hash\\]`"] DisputeTimedOut (runtime_types :: polkadot_core_primitives :: CandidateHash ,) , # [codec (index = 3)] # [doc = "A dispute has concluded with supermajority against a candidate."] # [doc = "Block authors should no longer build on top of this head and should"] # [doc = "instead revert the block at the given height. This should be the"] # [doc = "number of the child of the last known valid block in the chain."] Revert (:: core :: primitive :: u32 ,) , } } @@ -33499,6 +33600,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call {} } } @@ -33509,11 +33611,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] # [doc = "a para may have. Normally this happens once per session, but this allows"] # [doc = "you to trigger the cleanup immediately for a specific parachain."] # [doc = ""] # [doc = "Origin must be Root."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data of weighing."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data of weighing."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The sender tried to open a channel to themselves."] @@ -33576,6 +33680,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Open HRMP channel requested."] @@ -33639,10 +33744,12 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call {} #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Validator indices are out of order or contains duplicates."] @@ -33738,6 +33845,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "A candidate was backed. `[candidate, head_data]`"] @@ -33806,6 +33914,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] @@ -33847,11 +33956,13 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { # [codec (index = 0)] # [doc = "Set the storage for the parachain validation code immediately."] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Set the storage for the current parachain head data immediately."] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] # [doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Note a new block head for para within the context of the current block."] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] # [doc = "Put a parachain directly into the next session's action queue."] # [doc = "We can't queue it any sooner than this without going into the"] # [doc = "initializer..."] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Adds the validation code to the storage."] # [doc = ""] # [doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] # [doc = "is running for that code, it will be instantly accepted."] # [doc = ""] # [doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] # [doc = "into storage with reference count 0. This is to account the fact that there are no users"] # [doc = "for this code yet. The caller will have to make sure that this code eventually gets"] # [doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] # [doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] # [doc = ""] # [doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] # [doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 6)] # [doc = "Remove the validation code from the storage iff the reference count is 0."] # [doc = ""] # [doc = "This is better than removing the storage directly, because it will not remove the code"] # [doc = "that was suddenly got used by some parachain while this dispatchable was pending"] # [doc = "dispatching."] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] # [doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] # [doc = "enacts the results if that was the last vote before achieving the supermajority."] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v2 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Para is not registered in our system."] @@ -33894,6 +34005,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { # [codec (index = 0)] # [doc = "Current code has been updated for a Para. `para_id`"] CurrentCodeUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 1)] # [doc = "Current head has been updated for a Para. `para_id`"] CurrentHeadUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 2)] # [doc = "A code upgrade has been scheduled for a Para. `para_id`"] CodeUpgradeScheduled (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 3)] # [doc = "A new head has been noted for a Para. `para_id`"] NewHeadNoted (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 4)] # [doc = "A para has been queued to execute pending actions. `para_id`"] ActionQueued (runtime_types :: polkadot_parachain :: primitives :: Id , :: core :: primitive :: u32 ,) , # [codec (index = 5)] # [doc = "The given para either initiated or subscribed to a PVF check for the given validation"] # [doc = "code. `code_hash` `para_id`"] PvfCheckStarted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 6)] # [doc = "The given validation code was accepted by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckAccepted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 7)] # [doc = "The given validation code was rejected by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckRejected (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , } } @@ -33977,6 +34089,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] @@ -33992,6 +34105,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "Inclusion inherent called more than once per block."] @@ -34052,6 +34166,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call {} } } @@ -34062,6 +34177,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { #[codec(index = 0)] #[doc = "Service a single overweight upward message."] @@ -34084,6 +34200,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] pub enum Error { #[codec(index = 0)] #[doc = "The message index given is unknown."] @@ -34095,6 +34212,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] #[doc = "Upward message is invalid XCM."] From 06eb385eab8b6423c243c53d90182c4be3d46b10 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 17:35:46 +0300 Subject: [PATCH 07/37] codegen/tests: Recursively obtain raw metadata documentation Signed-off-by: Alexandru Vasile --- codegen/Cargo.toml | 1 + codegen/src/api/mod.rs | 2 ++ codegen/src/api/tests.rs | 55 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 codegen/src/api/tests.rs diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index a50280d5cc..7f764ab7a2 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -26,3 +26,4 @@ scale-info = { version = "2.0.0", features = ["bit-vec"] } [dev-dependencies] bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } pretty_assertions = "1.0.0" +test-runtime = { path = "../test-runtime" } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 949a530fc4..55623d21b9 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -36,6 +36,8 @@ mod constants; mod errors; mod events; mod storage; +#[cfg(test)] +mod tests; use super::GeneratedTypeDerives; use crate::{ diff --git a/codegen/src/api/tests.rs b/codegen/src/api/tests.rs new file mode 100644 index 0000000000..90751601e3 --- /dev/null +++ b/codegen/src/api/tests.rs @@ -0,0 +1,55 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +fn metadata_docs() -> Vec { + // Load the runtime metadata downloaded from a node via `test-runtime`. + let bytes = test_runtime::METADATA; + let meta: frame_metadata::RuntimeMetadataPrefixed = + codec::Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); + let metadata = match meta.1 { + frame_metadata::RuntimeMetadata::V14(v14) => v14, + _ => panic!("Unsupported metadata version {:?}", meta.1), + }; + + // Inspect the metadata types and collect the documentation. + let mut docs = Vec::new(); + for ty in metadata.types.types() { + docs.extend_from_slice(ty.ty().docs()); + } + + for pallet in metadata.pallets { + if let Some(storage) = pallet.storage { + for entry in storage.entries { + docs.extend(entry.docs); + } + } + // Note: Calls, Events and Errors are deduced directly to + // PortableTypes which are handled above. + for constant in pallet.constants { + docs.extend(constant.docs); + } + } + // Note: Extrinsics do not have associated documentation, but is implied by + // associated Type. + + docs +} + +#[test] +fn check_documentation() { + // Inspect metadata recursively and obtain all associated documentation. + let _raw_docs = metadata_docs(); +} From e25ac4be9b36c04eba55917341bcecc0629996d2 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 17:39:04 +0300 Subject: [PATCH 08/37] codegen/tests: Generate runtime interface from node metadata Signed-off-by: Alexandru Vasile --- codegen/src/api/tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/codegen/src/api/tests.rs b/codegen/src/api/tests.rs index 90751601e3..8a7440b5df 100644 --- a/codegen/src/api/tests.rs +++ b/codegen/src/api/tests.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use super::*; + fn metadata_docs() -> Vec { // Load the runtime metadata downloaded from a node via `test-runtime`. let bytes = test_runtime::METADATA; @@ -48,6 +50,21 @@ fn metadata_docs() -> Vec { docs } +fn generate_runtime_interface() -> String { + // Load the runtime metadata downloaded from a node via `test-runtime`. + let bytes = test_runtime::METADATA; + let metadata: frame_metadata::RuntimeMetadataPrefixed = + codec::Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); + + // Generate a runtime interface form the provided metadata. + let generator = RuntimeGenerator::new(metadata); + let item_mod = syn::parse_quote!( + pub mod api {} + ); + let mut derives = GeneratedTypeDerives::default(); + generator.generate_runtime(item_mod, derives).to_string() +} + #[test] fn check_documentation() { // Inspect metadata recursively and obtain all associated documentation. From ea06e05b00d695323af0a8ac9b84b74fb69db829 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 17:47:15 +0300 Subject: [PATCH 09/37] codegen/tests: Obtain documentation from generated runtime API Signed-off-by: Alexandru Vasile --- codegen/Cargo.toml | 1 + codegen/src/api/tests.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 7f764ab7a2..a55bb73755 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -27,3 +27,4 @@ scale-info = { version = "2.0.0", features = ["bit-vec"] } bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } pretty_assertions = "1.0.0" test-runtime = { path = "../test-runtime" } +regex = "1.5" diff --git a/codegen/src/api/tests.rs b/codegen/src/api/tests.rs index 8a7440b5df..d322d9f7cd 100644 --- a/codegen/src/api/tests.rs +++ b/codegen/src/api/tests.rs @@ -65,8 +65,37 @@ fn generate_runtime_interface() -> String { generator.generate_runtime(item_mod, derives).to_string() } +fn interface_docs() -> Vec { + // Generate the runtime interface from the node's metadata. + // Note: the API is generated on a single line. + let runtime_api = generate_runtime_interface(); + + // Documentation lines have the following format: + // # [ doc = "Upward message is invalid XCM."] + // Given the API is generated on a single line, the regex matching + // must be lazy hence the `?` in the matched group `(.*?)`. + // The `(.*?)` stands for match any character zero or more times lazily. + let re = Regex::new(r#"\# \[doc = "(.*?)"\]"#).unwrap(); + re.captures_iter(&runtime_api) + .filter_map(|capture| { + // Get the matched group (ie index 1). + capture.get(1).as_ref().map(|doc| { + // Generated documentation will escape special characters. + // Replace escaped characters with unescaped variants for + // exact matching on the raw metadata documentation. + doc.as_str() + .replace("\\n", "\n") + .replace("\\t", "\t") + .replace("\\\"", "\"") + }) + }) + .collect() +} + #[test] fn check_documentation() { // Inspect metadata recursively and obtain all associated documentation. let _raw_docs = metadata_docs(); + // Obtain documentation from the generated API. + let _runtime_docs = interface_docs(); } From d6e63179b65c0e7cc8c23fe9f5089244e558775e Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 21 Apr 2022 18:01:00 +0300 Subject: [PATCH 10/37] codegen/tests: Match raw documentation with the generated one Signed-off-by: Alexandru Vasile --- codegen/src/api/tests.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/codegen/src/api/tests.rs b/codegen/src/api/tests.rs index d322d9f7cd..d3935295cb 100644 --- a/codegen/src/api/tests.rs +++ b/codegen/src/api/tests.rs @@ -15,6 +15,7 @@ // along with subxt. If not, see . use super::*; +use regex::Regex; fn metadata_docs() -> Vec { // Load the runtime metadata downloaded from a node via `test-runtime`. @@ -61,7 +62,7 @@ fn generate_runtime_interface() -> String { let item_mod = syn::parse_quote!( pub mod api {} ); - let mut derives = GeneratedTypeDerives::default(); + let derives = GeneratedTypeDerives::default(); generator.generate_runtime(item_mod, derives).to_string() } @@ -95,7 +96,15 @@ fn interface_docs() -> Vec { #[test] fn check_documentation() { // Inspect metadata recursively and obtain all associated documentation. - let _raw_docs = metadata_docs(); + let raw_docs = metadata_docs(); // Obtain documentation from the generated API. - let _runtime_docs = interface_docs(); + let runtime_docs = interface_docs(); + + for raw in raw_docs.iter() { + assert!( + runtime_docs.contains(raw), + "Documentation not present in runtime API: {}", + raw + ); + } } From 9ae68dd1d740e13bc466c043f39bb83f3184d5b6 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 11:54:48 +0300 Subject: [PATCH 11/37] Revert not longer needed "codegen: Composite fields docs" This reverts commit 5460bbafc6262ac4f53e11d4ef11e44e1ce8296f. --- codegen/src/api/calls.rs | 2 +- codegen/src/types/composite_def.rs | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index bccd0196f3..785b0aacb0 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -54,7 +54,7 @@ pub fn generate_calls( CompositeDefFields::Named(ref named_fields) => { named_fields .iter() - .map(|(_, name, field)| { + .map(|(name, field)| { let fn_arg_type = &field.type_path; let call_arg = if field.is_boxed() { quote! { #name: ::std::boxed::Box::new(#name) } diff --git a/codegen/src/types/composite_def.rs b/codegen/src/types/composite_def.rs index aa20048b4a..5f3379898f 100644 --- a/codegen/src/types/composite_def.rs +++ b/codegen/src/types/composite_def.rs @@ -178,7 +178,7 @@ pub enum CompositeDefKind { #[derive(Debug)] pub enum CompositeDefFields { NoFields, - Named(Vec<(TokenStream, syn::Ident, CompositeDefFieldType)>), + Named(Vec<(syn::Ident, CompositeDefFieldType)>), Unnamed(Vec), } @@ -207,10 +207,8 @@ impl CompositeDefFields { ); if let Some(name) = field.name() { - let docs = field.docs(); - let docs_token = quote! { #( #[doc = #docs ] )* }; let field_name = format_ident!("{}", name); - named_fields.push((docs_token, field_name, field_type)) + named_fields.push((field_name, field_type)) } else { unnamed_fields.push(field_type) } @@ -234,7 +232,7 @@ impl CompositeDefFields { pub fn field_types(&self) -> Box + '_> { match self { Self::NoFields => Box::new([].iter()), - Self::Named(named_fields) => Box::new(named_fields.iter().map(|(_, _, f)| f)), + Self::Named(named_fields) => Box::new(named_fields.iter().map(|(_, f)| f)), Self::Unnamed(unnamed_fields) => Box::new(unnamed_fields.iter()), } } @@ -254,9 +252,9 @@ impl CompositeDefFields { } } Self::Named(ref fields) => { - let fields = fields.iter().map(|(docs, name, ty)| { + let fields = fields.iter().map(|(name, ty)| { let compact_attr = ty.compact_attr(); - quote! { #docs #compact_attr #visibility #name: #ty } + quote! { #compact_attr #visibility #name: #ty } }); let marker = phantom_data.map(|phantom_data| { quote!( @@ -297,9 +295,9 @@ impl CompositeDefFields { match self { Self::NoFields => quote! {}, Self::Named(ref fields) => { - let fields = fields.iter().map(|(docs, name, ty)| { + let fields = fields.iter().map(|(name, ty)| { let compact_attr = ty.compact_attr(); - quote! { #docs #compact_attr #name: #ty } + quote! { #compact_attr #name: #ty } }); quote!( { #( #fields, )* } ) } From 96c2d6eb5c52f58d1715acd226c33208ba58a459 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 12:00:55 +0300 Subject: [PATCH 12/37] codegen/tests: Improve test regex documentation Signed-off-by: Alexandru Vasile --- codegen/src/api/tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codegen/src/api/tests.rs b/codegen/src/api/tests.rs index d3935295cb..a1d6d9dc88 100644 --- a/codegen/src/api/tests.rs +++ b/codegen/src/api/tests.rs @@ -75,6 +75,12 @@ fn interface_docs() -> Vec { // # [ doc = "Upward message is invalid XCM."] // Given the API is generated on a single line, the regex matching // must be lazy hence the `?` in the matched group `(.*?)`. + // + // The greedy `non-?` matching would lead to one single match + // from the beginning of the first documentation tag, containing everything up to + // the last documentation tag + // `# [ doc = "msg"] # [ doc = "msg2"] ... api ... # [ doc = "msgN" ]` + // // The `(.*?)` stands for match any character zero or more times lazily. let re = Regex::new(r#"\# \[doc = "(.*?)"\]"#).unwrap(); re.captures_iter(&runtime_api) From 03f5f7487a5fb9067874c0b250b4bec09718bc9d Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 16:07:00 +0300 Subject: [PATCH 13/37] subxt: Add integration-tests feature flag Signed-off-by: Alexandru Vasile --- subxt/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 607ee33468..2d1828bd7c 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -12,6 +12,9 @@ homepage = "https://www.parity.io/" description = "Submit extrinsics (transactions) to a substrate node via RPC" keywords = ["parity", "substrate", "blockchain"] +[features] +integration-tests = [] + [dependencies] async-trait = "0.1.49" bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } From 45b84ebaa8fd8b26f7e2bd73e6f3b210b2880e14 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 16:07:33 +0300 Subject: [PATCH 14/37] subxt: Guard integration tests under feature flag Signed-off-by: Alexandru Vasile --- subxt/tests/integration/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subxt/tests/integration/main.rs b/subxt/tests/integration/main.rs index 4a44d07b98..afdaea0db3 100644 --- a/subxt/tests/integration/main.rs +++ b/subxt/tests/integration/main.rs @@ -15,16 +15,23 @@ // along with subxt. If not, see . mod codegen; +#[cfg(feature = "integration-tests")] mod utils; #[cfg(test)] +#[cfg(feature = "integration-tests")] mod client; #[cfg(test)] +#[cfg(feature = "integration-tests")] mod events; #[cfg(test)] +#[cfg(feature = "integration-tests")] mod frame; #[cfg(test)] +#[cfg(feature = "integration-tests")] mod storage; +#[cfg(feature = "integration-tests")] use test_runtime::node_runtime; +#[cfg(feature = "integration-tests")] use utils::*; From fbdfdf60dbf34f608c2ecb6c52d00bd5a375c745 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 16:43:59 +0300 Subject: [PATCH 15/37] test-runtime: Place build.rs under feature flag Signed-off-by: Alexandru Vasile --- test-runtime/Cargo.toml | 3 +++ test-runtime/build.rs | 7 +++++++ test-runtime/src/lib.rs | 2 ++ 3 files changed, 12 insertions(+) diff --git a/test-runtime/Cargo.toml b/test-runtime/Cargo.toml index 932934f5c2..2629191db5 100644 --- a/test-runtime/Cargo.toml +++ b/test-runtime/Cargo.toml @@ -3,6 +3,9 @@ name = "test-runtime" version = "0.20.0" edition = "2021" +[features] +integration-tests = [] + [dependencies] subxt = { path = "../subxt" } sp-runtime = "6.0.0" diff --git a/test-runtime/build.rs b/test-runtime/build.rs index c052cf4c69..ee906e12ea 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -33,6 +33,7 @@ use subxt::rpc::{ }; static SUBSTRATE_BIN_ENV_VAR: &str = "SUBSTRATE_NODE_PATH"; +static INTEGRATION_FEATURE_FLAG: &str = "CARGO_FEATURE_INTEGRATION_TESTS"; #[tokio::main] async fn main() { @@ -40,6 +41,12 @@ async fn main() { } async fn run() { + // The build script must run only in test context, as having `integration-tests` feature + // flag enabled. + if env::var_os(INTEGRATION_FEATURE_FLAG).is_none() { + return + } + // Select substrate binary to run based on env var. let substrate_bin = env::var(SUBSTRATE_BIN_ENV_VAR).unwrap_or_else(|_| "substrate".to_owned()); diff --git a/test-runtime/src/lib.rs b/test-runtime/src/lib.rs index e5bbb383e1..8cca9b6f28 100644 --- a/test-runtime/src/lib.rs +++ b/test-runtime/src/lib.rs @@ -17,6 +17,8 @@ #![allow(clippy::too_many_arguments)] /// The SCALE encoded metadata obtained from a local run of a substrate node. +#[cfg(feature = "integration-tests")] pub static METADATA: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/metadata.scale")); +#[cfg(feature = "integration-tests")] include!(concat!(env!("OUT_DIR"), "/runtime.rs")); From c9ad19b3ea814f0fd38c190769f70f496879a576 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 16:49:36 +0300 Subject: [PATCH 16/37] subxt: Pass `integration-tests` feature to `test-runtime` Signed-off-by: Alexandru Vasile --- subxt/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 2d1828bd7c..3035c3b34a 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -13,7 +13,7 @@ description = "Submit extrinsics (transactions) to a substrate node via RPC" keywords = ["parity", "substrate", "blockchain"] [features] -integration-tests = [] +integration-tests = ["test-runtime/integration-tests"] [dependencies] async-trait = "0.1.49" From 8e5f38ba8c633ac40420fadf58700ac402f762d4 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 22 Apr 2022 17:00:50 +0300 Subject: [PATCH 17/37] CI: Use `integration-tests` feature to run all tests Signed-off-by: Alexandru Vasile --- .github/workflows/nightly.yml | 2 +- .github/workflows/rust.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8062a677dc..bdf68986fb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -40,7 +40,7 @@ jobs: uses: actions-rs/cargo@v1.0.3 with: command: test - args: --all-targets --workspace + args: --features integration-tests --all-targets --workspace # If the previous step fails, create a new Github issue # to nofity us about it. diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 73078643f0..e910ca7d1d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -127,7 +127,7 @@ jobs: uses: actions-rs/cargo@v1.0.3 with: command: test - args: --all-targets --workspace + args: --features integration-tests --all-targets --workspace clippy: name: Cargo clippy @@ -158,4 +158,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all-targets -- -D warnings + args: --features integration-tests --all-targets -- -D warnings From 057f07584939ac14171c7228a3586022bf95afa1 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 15:54:29 +0300 Subject: [PATCH 18/37] subxt: Rely on `#[cfg(feature = "integration-tests")]` for integration Signed-off-by: Alexandru Vasile --- subxt/src/client.rs | 2 +- subxt/tests/integration/utils/node_proc.rs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index 5dcb8206d7..3072f674b4 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -88,7 +88,7 @@ impl ClientBuilder { /// Set the metadata. /// /// *Note:* Metadata will no longer be downloaded from the runtime node. - #[cfg(integration_tests)] + #[cfg(feature = "integration-tests")] pub fn set_metadata(mut self, metadata: Metadata) -> Self { self.metadata = Some(metadata); self diff --git a/subxt/tests/integration/utils/node_proc.rs b/subxt/tests/integration/utils/node_proc.rs index 66c5c3543a..16e5d8887f 100644 --- a/subxt/tests/integration/utils/node_proc.rs +++ b/subxt/tests/integration/utils/node_proc.rs @@ -37,7 +37,6 @@ use subxt::{ pub struct TestNodeProcess { proc: process::Child, client: Client, - #[cfg(integration_tests)] ws_url: String, } @@ -79,7 +78,6 @@ where } /// Returns the address to which the client is connected. - #[cfg(integration_tests)] pub fn ws_url(&self) -> &str { &self.ws_url } @@ -149,7 +147,6 @@ impl TestNodeProcessBuilder { Ok(TestNodeProcess { proc, client, - #[cfg(integration_tests)] ws_url, }) } From e596c68ddebd9ad2479ad8e295485b428ffb409f Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 16:28:01 +0300 Subject: [PATCH 19/37] subxt/metadata: Manually construct test metadata Signed-off-by: Alexandru Vasile --- subxt/src/metadata/metadata_type.rs | 59 +++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/subxt/src/metadata/metadata_type.rs b/subxt/src/metadata/metadata_type.rs index 2ceeddcfeb..d11179128f 100644 --- a/subxt/src/metadata/metadata_type.rs +++ b/subxt/src/metadata/metadata_type.rs @@ -478,13 +478,64 @@ impl TryFrom for Metadata { mod tests { use super::*; use crate::StorageEntryKey; + use frame_metadata::{ + ExtrinsicMetadata, + PalletStorageMetadata, + StorageEntryModifier, + StorageEntryType, + }; + use scale_info::{ + meta_type, + TypeInfo, + }; fn load_metadata() -> Metadata { - let bytes = test_runtime::METADATA; - let meta: RuntimeMetadataPrefixed = - codec::Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); + #[allow(dead_code)] + #[allow(non_camel_case_types)] + #[derive(TypeInfo)] + enum Call { + fill_block { param: u128 }, + } + let storage = PalletStorageMetadata { + prefix: "System", + entries: vec![StorageEntryMetadata { + name: "Account", + modifier: StorageEntryModifier::Optional, + ty: StorageEntryType::Plain(meta_type::()), + default: vec![0], + docs: vec![], + }], + }; + let constant = PalletConstantMetadata { + name: "BlockWeights", + ty: meta_type::(), + value: vec![1, 2, 3], + docs: vec![], + }; + let pallet = frame_metadata::PalletMetadata { + index: 0, + name: "System", + calls: Some(frame_metadata::PalletCallMetadata { + ty: meta_type::(), + }), + storage: Some(storage), + constants: vec![constant], + event: None, + error: None, + }; + + let metadata = RuntimeMetadataV14::new( + vec![pallet], + ExtrinsicMetadata { + ty: meta_type::<()>(), + version: 0, + signed_extensions: vec![], + }, + meta_type::<()>(), + ); + let prefixed = RuntimeMetadataPrefixed::from(metadata); - Metadata::try_from(meta) + Metadata::try_from(prefixed) .expect("Cannot translate runtime metadata to internal Metadata") } From c192f177461264a83ca6b8e334f7e632459ede6a Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 16:33:06 +0300 Subject: [PATCH 20/37] artifacts: Move scale binary blob to dedicated folder Signed-off-by: Alexandru Vasile --- .../examples => artifacts}/polkadot_metadata.scale | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename {examples/examples => artifacts}/polkadot_metadata.scale (100%) diff --git a/examples/examples/polkadot_metadata.scale b/artifacts/polkadot_metadata.scale similarity index 100% rename from examples/examples/polkadot_metadata.scale rename to artifacts/polkadot_metadata.scale From 680bc052f6f4619f122dececdc10db83697289a6 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 16:41:58 +0300 Subject: [PATCH 21/37] examples: Update path to metadata blob Signed-off-by: Alexandru Vasile --- examples/examples/balance_transfer.rs | 2 +- examples/examples/balance_transfer_with_params.rs | 2 +- examples/examples/custom_config.rs | 2 +- examples/examples/fetch_all_accounts.rs | 2 +- examples/examples/fetch_staking_details.rs | 2 +- examples/examples/metadata_compatibility.rs | 2 +- examples/examples/rpc_call.rs | 2 +- examples/examples/submit_and_watch.rs | 2 +- examples/examples/subscribe_all_events.rs | 2 +- examples/examples/subscribe_one_event.rs | 2 +- examples/examples/subscribe_some_events.rs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/examples/balance_transfer.rs b/examples/examples/balance_transfer.rs index 5d5accda0a..21f64435ed 100644 --- a/examples/examples/balance_transfer.rs +++ b/examples/examples/balance_transfer.rs @@ -30,7 +30,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/balance_transfer_with_params.rs b/examples/examples/balance_transfer_with_params.rs index 41150e3d89..9d00eacaa8 100644 --- a/examples/examples/balance_transfer_with_params.rs +++ b/examples/examples/balance_transfer_with_params.rs @@ -35,7 +35,7 @@ use subxt::{ PolkadotExtrinsicParamsBuilder as Params, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index a28eff9515..27adb892a1 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -31,7 +31,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} /// Custom [`Config`] impl where the default types for the target chain differ from the diff --git a/examples/examples/fetch_all_accounts.rs b/examples/examples/fetch_all_accounts.rs index bffb6fb134..32c0818f34 100644 --- a/examples/examples/fetch_all_accounts.rs +++ b/examples/examples/fetch_all_accounts.rs @@ -28,7 +28,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/fetch_staking_details.rs b/examples/examples/fetch_staking_details.rs index eec0d85fce..180f210397 100644 --- a/examples/examples/fetch_staking_details.rs +++ b/examples/examples/fetch_staking_details.rs @@ -34,7 +34,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/metadata_compatibility.rs b/examples/examples/metadata_compatibility.rs index 7318582226..a660bb9d14 100644 --- a/examples/examples/metadata_compatibility.rs +++ b/examples/examples/metadata_compatibility.rs @@ -28,7 +28,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/rpc_call.rs b/examples/examples/rpc_call.rs index e24c07005d..414a1d2f25 100644 --- a/examples/examples/rpc_call.rs +++ b/examples/examples/rpc_call.rs @@ -28,7 +28,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs index a5e9cda9b6..c41d7541ef 100644 --- a/examples/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -31,7 +31,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} #[tokio::main] diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index 9dd0b48e07..304cf4bd59 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -32,7 +32,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} /// Subscribe to all events, and then manually look through them and diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index 4864825787..1d09071a25 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -32,7 +32,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} /// Subscribe to all events, and then manually look through them and diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index 4585d06314..2e253ad16c 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -32,7 +32,7 @@ use subxt::{ PolkadotExtrinsicParams, }; -#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] pub mod polkadot {} /// Subscribe to all events, and then manually look through them and From 3a1a692bca869a0a0a02f03aaa4107b1970c18ec Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 16:45:31 +0300 Subject: [PATCH 22/37] metadata: Rely on artifact metadata blob for benches Signed-off-by: Alexandru Vasile --- metadata/benches/bench.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/metadata/benches/bench.rs b/metadata/benches/bench.rs index 09c866a1b1..20ef71e600 100644 --- a/metadata/benches/bench.rs +++ b/metadata/benches/bench.rs @@ -26,6 +26,10 @@ use scale_info::{ TypeDef, TypeDefVariant, }; +use std::{ + fs, + path::Path, +}; use subxt_metadata::{ get_call_hash, get_constant_hash, @@ -35,7 +39,8 @@ use subxt_metadata::{ }; fn load_metadata() -> RuntimeMetadataV14 { - let bytes = test_runtime::METADATA; + let bytes = fs::read(Path::new("../artifacts/polkadot_metadata.scale")) + .expect("Cannot read metadata blob"); let meta: RuntimeMetadataPrefixed = Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); From 2461c3bd5a0f55dcf3e104cb75f202d3fb3c2728 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 16:46:07 +0300 Subject: [PATCH 23/37] metadata: Remove `test-runtime` dependency Signed-off-by: Alexandru Vasile --- metadata/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index b51ac458eb..8657d2833b 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -21,7 +21,6 @@ sp-core = { version = "6.0.0" } bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } criterion = "0.3" scale-info = { version = "2.0.0", features = ["bit-vec"] } -test-runtime = { path = "../test-runtime" } [lib] # Without this, libtest cli opts interfere with criteron benches: From 3d9b9aba6118719e817e2dba310f925929a28d6f Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 16:49:07 +0300 Subject: [PATCH 24/37] examples: Modify runtime path for `custom_type_derives` Signed-off-by: Alexandru Vasile --- examples/examples/custom_type_derives.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/examples/custom_type_derives.rs b/examples/examples/custom_type_derives.rs index 2812fca268..06a93efdf2 100644 --- a/examples/examples/custom_type_derives.rs +++ b/examples/examples/custom_type_derives.rs @@ -19,7 +19,7 @@ #![allow(clippy::redundant_clone)] #[subxt::subxt( - runtime_metadata_path = "examples/polkadot_metadata.scale", + runtime_metadata_path = "../artifacts/polkadot_metadata.scale", // We can add (certain) custom derives to the generated types by providing // a comma separated list to the below attribute. Most useful for adding `Clone`. // The derives that we can add ultimately is limited to the traits that the base From 1e0522d236157369d8b90f07e56e7357a4dc5094 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:07:41 +0300 Subject: [PATCH 25/37] subxt: Remove tests folder Signed-off-by: Alexandru Vasile --- subxt/Cargo.toml | 2 +- subxt/tests/integration/client.rs | 133 - subxt/tests/integration/codegen/mod.rs | 26 - subxt/tests/integration/codegen/polkadot.rs | 47645 ---------------- subxt/tests/integration/events.rs | 230 - subxt/tests/integration/frame/balances.rs | 280 - subxt/tests/integration/frame/contracts.rs | 227 - subxt/tests/integration/frame/mod.rs | 24 - subxt/tests/integration/frame/staking.rs | 262 - subxt/tests/integration/frame/sudo.rs | 81 - subxt/tests/integration/frame/system.rs | 62 - subxt/tests/integration/frame/timestamp.rs | 26 - subxt/tests/integration/main.rs | 40 - subxt/tests/integration/metadata/mod.rs | 17 - .../tests/integration/metadata/validation.rs | 334 - subxt/tests/integration/storage.rs | 139 - subxt/tests/integration/utils/context.rs | 78 - subxt/tests/integration/utils/mod.rs | 21 - subxt/tests/integration/utils/node_proc.rs | 191 - 19 files changed, 1 insertion(+), 49817 deletions(-) delete mode 100644 subxt/tests/integration/client.rs delete mode 100644 subxt/tests/integration/codegen/mod.rs delete mode 100644 subxt/tests/integration/codegen/polkadot.rs delete mode 100644 subxt/tests/integration/events.rs delete mode 100644 subxt/tests/integration/frame/balances.rs delete mode 100644 subxt/tests/integration/frame/contracts.rs delete mode 100644 subxt/tests/integration/frame/mod.rs delete mode 100644 subxt/tests/integration/frame/staking.rs delete mode 100644 subxt/tests/integration/frame/sudo.rs delete mode 100644 subxt/tests/integration/frame/system.rs delete mode 100644 subxt/tests/integration/frame/timestamp.rs delete mode 100644 subxt/tests/integration/main.rs delete mode 100644 subxt/tests/integration/metadata/mod.rs delete mode 100644 subxt/tests/integration/metadata/validation.rs delete mode 100644 subxt/tests/integration/storage.rs delete mode 100644 subxt/tests/integration/utils/context.rs delete mode 100644 subxt/tests/integration/utils/mod.rs delete mode 100644 subxt/tests/integration/utils/node_proc.rs diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index c0f8ff5144..ffc982dcbd 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -13,7 +13,7 @@ description = "Submit extrinsics (transactions) to a substrate node via RPC" keywords = ["parity", "substrate", "blockchain"] [features] -integration-tests = ["test-runtime/integration-tests"] +integration-tests = [] [dependencies] async-trait = "0.1.49" diff --git a/subxt/tests/integration/client.rs b/subxt/tests/integration/client.rs deleted file mode 100644 index 050ef2e32b..0000000000 --- a/subxt/tests/integration/client.rs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - test_node_process, - test_node_process_with, - utils::node_runtime::system, -}; - -use sp_core::storage::{ - well_known_keys, - StorageKey, -}; -use sp_keyring::AccountKeyring; - -#[tokio::test] -async fn insert_key() { - let test_node_process = test_node_process_with(AccountKeyring::Bob).await; - let client = test_node_process.client(); - let public = AccountKeyring::Alice.public().as_array_ref().to_vec(); - client - .rpc() - .insert_key( - "aura".to_string(), - "//Alice".to_string(), - public.clone().into(), - ) - .await - .unwrap(); - assert!(client - .rpc() - .has_key(public.clone().into(), "aura".to_string()) - .await - .unwrap()); -} - -#[tokio::test] -async fn fetch_block_hash() { - let node_process = test_node_process().await; - node_process.client().rpc().block_hash(None).await.unwrap(); -} - -#[tokio::test] -async fn fetch_block() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client.rpc().block(block_hash).await.unwrap(); -} - -#[tokio::test] -async fn fetch_read_proof() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client - .rpc() - .read_proof( - vec![ - StorageKey(well_known_keys::HEAP_PAGES.to_vec()), - StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), - ], - block_hash, - ) - .await - .unwrap(); -} - -#[tokio::test] -async fn chain_subscribe_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_blocks().await.unwrap(); - blocks.next().await.unwrap().unwrap(); -} - -#[tokio::test] -async fn chain_subscribe_finalized_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_finalized_blocks().await.unwrap(); - blocks.next().await.unwrap().unwrap(); -} - -#[tokio::test] -async fn fetch_keys() { - let node_process = test_node_process().await; - let client = node_process.client(); - let keys = client - .storage() - .fetch_keys::(4, None, None) - .await - .unwrap(); - assert_eq!(keys.len(), 4) -} - -#[tokio::test] -async fn test_iter() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut iter = client - .storage() - .iter::(None) - .await - .unwrap(); - let mut i = 0; - while iter.next().await.unwrap().is_some() { - i += 1; - } - assert_eq!(i, 13); -} - -#[tokio::test] -async fn fetch_system_info() { - let node_process = test_node_process().await; - let client = node_process.client(); - assert_eq!(client.rpc().system_chain().await.unwrap(), "Development"); - assert_eq!(client.rpc().system_name().await.unwrap(), "Substrate Node"); - assert!(!client.rpc().system_version().await.unwrap().is_empty()); -} diff --git a/subxt/tests/integration/codegen/mod.rs b/subxt/tests/integration/codegen/mod.rs deleted file mode 100644 index 4f35f5d3e9..0000000000 --- a/subxt/tests/integration/codegen/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -/// Checks that code generated by `subxt-cli codegen` compiles. Allows inspection of compiler errors -/// directly, more accurately than via the macro and `cargo expand`. -/// -/// Generate by: -/// -/// - run `polkadot --dev --tmp` node locally -/// - `cargo run --release -p subxt-cli -- codegen | rustfmt > subxt/tests/integration/codegen/polkadot.rs` -#[rustfmt::skip] -#[allow(clippy::all)] -mod polkadot; diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs deleted file mode 100644 index d9dc9e17a8..0000000000 --- a/subxt/tests/integration/codegen/polkadot.rs +++ /dev/null @@ -1,47645 +0,0 @@ -#[allow(dead_code, unused_imports, non_camel_case_types)] -pub mod api { - use super::api as root_mod; - pub static PALLETS: [&str; 51usize] = [ - "System", - "Scheduler", - "Preimage", - "Babe", - "Timestamp", - "Indices", - "Balances", - "TransactionPayment", - "Authorship", - "Staking", - "Offences", - "Historical", - "Session", - "Grandpa", - "ImOnline", - "AuthorityDiscovery", - "Democracy", - "Council", - "TechnicalCommittee", - "PhragmenElection", - "TechnicalMembership", - "Treasury", - "Claims", - "Vesting", - "Utility", - "Identity", - "Proxy", - "Multisig", - "Bounties", - "ChildBounties", - "Tips", - "ElectionProviderMultiPhase", - "BagsList", - "ParachainsOrigin", - "Configuration", - "ParasShared", - "ParaInclusion", - "ParaInherent", - "ParaScheduler", - "Paras", - "Initializer", - "Dmp", - "Ump", - "Hrmp", - "ParaSessionInfo", - "ParasDisputes", - "Registrar", - "Slots", - "Auctions", - "Crowdloan", - "XcmPallet", - ]; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Event { - #[codec(index = 0)] - System(system::Event), - #[codec(index = 1)] - Scheduler(scheduler::Event), - #[codec(index = 10)] - Preimage(preimage::Event), - #[codec(index = 4)] - Indices(indices::Event), - #[codec(index = 5)] - Balances(balances::Event), - #[codec(index = 7)] - Staking(staking::Event), - #[codec(index = 8)] - Offences(offences::Event), - #[codec(index = 9)] - Session(session::Event), - #[codec(index = 11)] - Grandpa(grandpa::Event), - #[codec(index = 12)] - ImOnline(im_online::Event), - #[codec(index = 14)] - Democracy(democracy::Event), - #[codec(index = 15)] - Council(council::Event), - #[codec(index = 16)] - TechnicalCommittee(technical_committee::Event), - #[codec(index = 17)] - PhragmenElection(phragmen_election::Event), - #[codec(index = 18)] - TechnicalMembership(technical_membership::Event), - #[codec(index = 19)] - Treasury(treasury::Event), - #[codec(index = 24)] - Claims(claims::Event), - #[codec(index = 25)] - Vesting(vesting::Event), - #[codec(index = 26)] - Utility(utility::Event), - #[codec(index = 28)] - Identity(identity::Event), - #[codec(index = 29)] - Proxy(proxy::Event), - #[codec(index = 30)] - Multisig(multisig::Event), - #[codec(index = 34)] - Bounties(bounties::Event), - #[codec(index = 38)] - ChildBounties(child_bounties::Event), - #[codec(index = 35)] - Tips(tips::Event), - #[codec(index = 36)] - ElectionProviderMultiPhase(election_provider_multi_phase::Event), - #[codec(index = 37)] - BagsList(bags_list::Event), - #[codec(index = 53)] - ParaInclusion(para_inclusion::Event), - #[codec(index = 56)] - Paras(paras::Event), - #[codec(index = 59)] - Ump(ump::Event), - #[codec(index = 60)] - Hrmp(hrmp::Event), - #[codec(index = 62)] - ParasDisputes(paras_disputes::Event), - #[codec(index = 70)] - Registrar(registrar::Event), - #[codec(index = 71)] - Slots(slots::Event), - #[codec(index = 72)] - Auctions(auctions::Event), - #[codec(index = 73)] - Crowdloan(crowdloan::Event), - #[codec(index = 99)] - XcmPallet(xcm_pallet::Event), - } - pub mod system { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct FillBlock { - pub ratio: runtime_types::sp_arithmetic::per_things::Perbill, - } - impl ::subxt::Call for FillBlock { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "fill_block"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Remark { - pub remark: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Remark { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHeapPages { - pub pages: ::core::primitive::u64, - } - impl ::subxt::Call for SetHeapPages { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_heap_pages"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetCode { - pub code: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for SetCode { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetCodeWithoutChecks { - pub code: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for SetCodeWithoutChecks { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code_without_checks"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetStorage { - pub items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - } - impl ::subxt::Call for SetStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_storage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct KillStorage { - pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - } - impl ::subxt::Call for KillStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_storage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct KillPrefix { - pub prefix: ::std::vec::Vec<::core::primitive::u8>, - pub subkeys: ::core::primitive::u32, - } - impl ::subxt::Call for KillPrefix { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_prefix"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemarkWithEvent { - pub remark: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for RemarkWithEvent { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark_with_event"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "A dispatch that will fill the block weight up to the given ratio."] - pub fn fill_block( - &self, - ratio: runtime_types::sp_arithmetic::per_things::Perbill, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - FillBlock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 228u8, 117u8, 251u8, 95u8, 47u8, 56u8, 32u8, 177u8, 191u8, - 72u8, 75u8, 23u8, 193u8, 175u8, 227u8, 218u8, 127u8, 94u8, - 114u8, 110u8, 215u8, 61u8, 162u8, 102u8, 73u8, 89u8, 218u8, - 148u8, 59u8, 73u8, 59u8, 149u8, - ] - { - let call = FillBlock { ratio }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`"] - #[doc = "# "] - pub fn remark( - &self, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Remark, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 186u8, 79u8, 33u8, 199u8, 216u8, 115u8, 19u8, 146u8, 220u8, - 174u8, 98u8, 61u8, 179u8, 230u8, 40u8, 70u8, 22u8, 251u8, - 77u8, 62u8, 133u8, 80u8, 186u8, 70u8, 135u8, 172u8, 178u8, - 241u8, 69u8, 106u8, 235u8, 140u8, - ] - { - let call = Remark { remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - pub fn set_heap_pages( - &self, - pages: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHeapPages, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 77u8, 138u8, 122u8, 55u8, 179u8, 101u8, 60u8, 137u8, 173u8, - 39u8, 28u8, 36u8, 237u8, 243u8, 232u8, 162u8, 76u8, 176u8, - 135u8, 58u8, 60u8, 177u8, 105u8, 136u8, 94u8, 53u8, 26u8, - 31u8, 41u8, 156u8, 228u8, 241u8, - ] - { - let call = SetHeapPages { pages }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the new runtime code."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] - #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] - #[doc = " expensive)."] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] - #[doc = "expensive. We will treat this as a full block."] - #[doc = "# "] - pub fn set_code( - &self, - code: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 35u8, 75u8, 103u8, 203u8, 91u8, 141u8, 77u8, 95u8, 37u8, - 157u8, 107u8, 240u8, 54u8, 242u8, 245u8, 205u8, 104u8, 165u8, - 177u8, 37u8, 86u8, 197u8, 28u8, 202u8, 121u8, 159u8, 18u8, - 204u8, 237u8, 117u8, 141u8, 131u8, - ] - { - let call = SetCode { code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C)` where `C` length of `code`"] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] - #[doc = "block. # "] - pub fn set_code_without_checks( - &self, - code: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCodeWithoutChecks, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 150u8, 148u8, 119u8, 129u8, 77u8, 216u8, 135u8, 187u8, 127u8, - 24u8, 238u8, 15u8, 227u8, 229u8, 191u8, 217u8, 106u8, 129u8, - 149u8, 79u8, 154u8, 78u8, 53u8, 159u8, 89u8, 69u8, 103u8, - 197u8, 93u8, 161u8, 134u8, 17u8, - ] - { - let call = SetCodeWithoutChecks { code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set some items of storage."] - pub fn set_storage( - &self, - items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetStorage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 197u8, 12u8, 119u8, 205u8, 152u8, 103u8, 211u8, 170u8, 146u8, - 253u8, 25u8, 56u8, 180u8, 146u8, 74u8, 75u8, 38u8, 108u8, - 212u8, 154u8, 23u8, 22u8, 148u8, 175u8, 107u8, 186u8, 222u8, - 13u8, 149u8, 132u8, 204u8, 217u8, - ] - { - let call = SetStorage { items }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Kill some items from storage."] - pub fn kill_storage( - &self, - keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillStorage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 154u8, 115u8, 185u8, 20u8, 126u8, 90u8, 222u8, 131u8, 199u8, - 57u8, 184u8, 226u8, 43u8, 245u8, 161u8, 176u8, 194u8, 123u8, - 139u8, 97u8, 97u8, 94u8, 47u8, 64u8, 204u8, 96u8, 190u8, - 94u8, 216u8, 237u8, 69u8, 51u8, - ] - { - let call = KillStorage { keys }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - pub fn kill_prefix( - &self, - prefix: ::std::vec::Vec<::core::primitive::u8>, - subkeys: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillPrefix, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 214u8, 101u8, 191u8, 241u8, 1u8, 241u8, 144u8, 116u8, 246u8, - 199u8, 159u8, 249u8, 155u8, 164u8, 220u8, 221u8, 75u8, 33u8, - 204u8, 3u8, 255u8, 201u8, 187u8, 238u8, 181u8, 213u8, 41u8, - 105u8, 234u8, 120u8, 202u8, 115u8, - ] - { - let call = KillPrefix { prefix, subkeys }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make some on-chain remark and emit event."] - pub fn remark_with_event( - &self, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemarkWithEvent, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 171u8, 82u8, 75u8, 237u8, 69u8, 197u8, 223u8, 125u8, 123u8, - 51u8, 241u8, 35u8, 202u8, 210u8, 227u8, 109u8, 1u8, 241u8, - 255u8, 63u8, 33u8, 115u8, 156u8, 239u8, 97u8, 76u8, 193u8, - 35u8, 74u8, 199u8, 43u8, 255u8, - ] - { - let call = RemarkWithEvent { remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::frame_system::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An extrinsic completed successfully."] - pub struct ExtrinsicSuccess { - pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, - } - impl ::subxt::Event for ExtrinsicSuccess { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "ExtrinsicSuccess"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An extrinsic failed."] - pub struct ExtrinsicFailed { - pub dispatch_error: runtime_types::sp_runtime::DispatchError, - pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, - } - impl ::subxt::Event for ExtrinsicFailed { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "ExtrinsicFailed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "`:code` was updated."] - pub struct CodeUpdated; - impl ::subxt::Event for CodeUpdated { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "CodeUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new account was created."] - pub struct NewAccount { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for NewAccount { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "NewAccount"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account was reaped."] - pub struct KilledAccount { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for KilledAccount { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "KilledAccount"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "On on-chain remark happened."] - pub struct Remarked { - pub sender: ::subxt::sp_core::crypto::AccountId32, - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Remarked { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "Remarked"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Account"; - type Value = runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ExtrinsicCount; - impl ::subxt::StorageEntry for ExtrinsicCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockWeight; - impl ::subxt::StorageEntry for BlockWeight { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "BlockWeight"; - type Value = runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u64, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AllExtrinsicsLen; - impl ::subxt::StorageEntry for AllExtrinsicsLen { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "AllExtrinsicsLen"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockHash<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for BlockHash<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "BlockHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ExtrinsicData<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ExtrinsicData<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicData"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Number; - impl ::subxt::StorageEntry for Number { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Number"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParentHash; - impl ::subxt::StorageEntry for ParentHash { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ParentHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Digest; - impl ::subxt::StorageEntry for Digest { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Digest"; - type Value = runtime_types::sp_runtime::generic::digest::Digest; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Events; - impl ::subxt::StorageEntry for Events { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Events"; - type Value = ::std::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::polkadot_runtime::Event, - ::subxt::sp_core::H256, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventCount; - impl ::subxt::StorageEntry for EventCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventTopics<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for EventTopics<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventTopics"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct LastRuntimeUpgrade; - impl ::subxt::StorageEntry for LastRuntimeUpgrade { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "LastRuntimeUpgrade"; - type Value = runtime_types::frame_system::LastRuntimeUpgradeInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToU32RefCount; - impl ::subxt::StorageEntry for UpgradedToU32RefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToU32RefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToTripleRefCount; - impl ::subxt::StorageEntry for UpgradedToTripleRefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToTripleRefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ExecutionPhase; - impl ::subxt::StorageEntry for ExecutionPhase { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExecutionPhase"; - type Value = runtime_types::frame_system::Phase; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The full account information for a particular account ID."] - pub async fn account( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The current weight for the block."] - pub async fn block_weight( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u64, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Map of block numbers to block hashes."] - pub async fn block_hash( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub async fn extrinsic_data( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The current block number being processed. Set by `execute_block`."] - pub async fn number( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Hash of the previous block."] - pub async fn parent_hash( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Events deposited for the current block."] - #[doc = ""] - #[doc = " NOTE: This storage item is explicitly unbounded since it is never intended to be read"] - #[doc = " from within the runtime."] - pub async 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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().storage_hash::()? - == [ - 51u8, 117u8, 189u8, 125u8, 155u8, 137u8, 63u8, 1u8, 80u8, - 211u8, 18u8, 228u8, 58u8, 237u8, 241u8, 176u8, 127u8, 189u8, - 246u8, 174u8, 50u8, 174u8, 102u8, 21u8, 108u8, 229u8, 132u8, - 20u8, 6u8, 205u8, 13u8, 88u8, - ] - { - let entry = Events; - self.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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] - #[doc = " of events in the `>` list."] - #[doc = ""] - #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] - #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] - #[doc = " in case of changes fetch the list of events of interest."] - #[doc = ""] - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] - #[doc = " of events in the `>` list."] - #[doc = ""] - #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] - #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] - #[doc = " in case of changes fetch the list of events of interest."] - #[doc = ""] - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] - pub async fn last_runtime_upgrade( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_system::LastRuntimeUpgradeInfo, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] - pub async fn upgraded_to_u32_ref_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Block & extrinsics weights: base values and limits."] - pub fn block_weights( - &self, - ) -> ::core::result::Result< - runtime_types::frame_system::limits::BlockWeights, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("System", "BlockWeights")? - == [ - 204u8, 48u8, 167u8, 131u8, 33u8, 100u8, 198u8, 189u8, 195u8, - 1u8, 117u8, 121u8, 184u8, 221u8, 144u8, 199u8, 43u8, 212u8, - 40u8, 31u8, 121u8, 47u8, 154u8, 102u8, 87u8, 136u8, 106u8, - 147u8, 213u8, 167u8, 193u8, 209u8, - ] - { - let pallet = self.client.metadata().pallet("System")?; - let constant = pallet.constant("BlockWeights")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum length of a block (in bytes)."] - pub fn block_length( - &self, - ) -> ::core::result::Result< - runtime_types::frame_system::limits::BlockLength, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("System", "BlockLength")? - == [ - 162u8, 232u8, 19u8, 135u8, 181u8, 6u8, 183u8, 230u8, 146u8, - 3u8, 140u8, 106u8, 44u8, 46u8, 50u8, 144u8, 239u8, 69u8, - 100u8, 195u8, 13u8, 73u8, 52u8, 140u8, 204u8, 91u8, 32u8, - 153u8, 179u8, 7u8, 207u8, 49u8, - ] - { - let pallet = self.client.metadata().pallet("System")?; - let constant = pallet.constant("BlockLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] - pub fn block_hash_count( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("System", "BlockHashCount")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("System")?; - let constant = pallet.constant("BlockHashCount")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The weight of runtime database operations the runtime can invoke."] - pub fn db_weight( - &self, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::RuntimeDbWeight, - ::subxt::BasicError, - > { - if self.client.metadata().constant_hash("System", "DbWeight")? - == [ - 148u8, 162u8, 51u8, 245u8, 246u8, 116u8, 90u8, 22u8, 43u8, - 254u8, 84u8, 59u8, 121u8, 135u8, 46u8, 37u8, 5u8, 71u8, - 146u8, 64u8, 252u8, 95u8, 226u8, 64u8, 137u8, 198u8, 222u8, - 159u8, 14u8, 92u8, 175u8, 174u8, - ] - { - let pallet = self.client.metadata().pallet("System")?; - let constant = pallet.constant("DbWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Get the chain's current version."] - pub fn version( - &self, - ) -> ::core::result::Result< - runtime_types::sp_version::RuntimeVersion, - ::subxt::BasicError, - > { - if self.client.metadata().constant_hash("System", "Version")? - == [ - 121u8, 146u8, 105u8, 234u8, 154u8, 125u8, 117u8, 194u8, - 183u8, 62u8, 171u8, 26u8, 86u8, 200u8, 90u8, 254u8, 176u8, - 67u8, 111u8, 241u8, 185u8, 244u8, 208u8, 140u8, 94u8, 2u8, - 48u8, 138u8, 231u8, 151u8, 157u8, 217u8, - ] - { - let pallet = self.client.metadata().pallet("System")?; - let constant = pallet.constant("Version")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The designated SS85 prefix of this chain."] - #[doc = ""] - #[doc = " This replaces the \"ss58Format\" property declared in the chain spec. Reason is"] - #[doc = " that the runtime should know about the prefix in order to make use of it as"] - #[doc = " an identifier of the chain."] - pub fn ss58_prefix( - &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("System", "SS58Prefix")? - == [ - 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, - 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, - 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, - 123u8, 128u8, 193u8, 29u8, 70u8, - ] - { - let pallet = self.client.metadata().pallet("System")?; - let constant = pallet.constant("SS58Prefix")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod scheduler { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Schedule { - pub when: ::core::primitive::u32, - pub maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - } - impl ::subxt::Call for Schedule { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Cancel { - pub when: ::core::primitive::u32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Cancel { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ScheduleNamed { - pub id: ::std::vec::Vec<::core::primitive::u8>, - pub when: ::core::primitive::u32, - pub maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - } - impl ::subxt::Call for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CancelNamed { - pub id: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel_named"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ScheduleAfter { - pub after: ::core::primitive::u32, - pub maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - } - impl ::subxt::Call for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_after"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ScheduleNamedAfter { - pub id: ::std::vec::Vec<::core::primitive::u8>, - pub after: ::core::primitive::u32, - pub maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - } - impl ::subxt::Call for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named_after"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Anonymously schedule a task."] - pub fn schedule( - &self, - when: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Schedule, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 171u8, 203u8, 174u8, 141u8, 138u8, 30u8, 100u8, 95u8, 14u8, - 2u8, 34u8, 14u8, 199u8, 60u8, 129u8, 160u8, 8u8, 166u8, 4u8, - 20u8, 41u8, 86u8, 21u8, 73u8, 222u8, 151u8, 179u8, 209u8, - 74u8, 31u8, 71u8, 73u8, - ] - { - let call = Schedule { - when, - maybe_periodic, - priority, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel an anonymously scheduled task."] - pub fn cancel( - &self, - when: ::core::primitive::u32, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Cancel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 118u8, 0u8, 188u8, 218u8, 148u8, 86u8, 139u8, 15u8, 3u8, - 161u8, 6u8, 150u8, 46u8, 32u8, 85u8, 179u8, 106u8, 113u8, - 240u8, 115u8, 167u8, 114u8, 243u8, 69u8, 103u8, 60u8, 99u8, - 135u8, 21u8, 8u8, 19u8, 225u8, - ] - { - let call = Cancel { when, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a named task."] - pub fn schedule_named( - &self, - id: ::std::vec::Vec<::core::primitive::u8>, - when: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScheduleNamed, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 47u8, 156u8, 239u8, 248u8, 198u8, 13u8, 10u8, 156u8, 176u8, - 254u8, 247u8, 152u8, 108u8, 255u8, 224u8, 185u8, 109u8, 56u8, - 233u8, 5u8, 73u8, 230u8, 151u8, 97u8, 125u8, 183u8, 4u8, - 202u8, 163u8, 3u8, 70u8, 221u8, - ] - { - let call = ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( - &self, - id: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelNamed, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 118u8, 221u8, 232u8, 126u8, 67u8, 134u8, 33u8, 7u8, 224u8, - 110u8, 181u8, 18u8, 57u8, 39u8, 15u8, 64u8, 90u8, 132u8, 2u8, - 238u8, 19u8, 241u8, 194u8, 120u8, 5u8, 109u8, 74u8, 205u8, - 42u8, 244u8, 99u8, 54u8, - ] - { - let call = CancelNamed { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Anonymously schedule a task after a delay."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`schedule`]."] - #[doc = "# "] - pub fn schedule_after( - &self, - after: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScheduleAfter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 150u8, 70u8, 131u8, 52u8, 50u8, 73u8, 176u8, 193u8, 17u8, - 31u8, 218u8, 113u8, 220u8, 23u8, 160u8, 196u8, 100u8, 27u8, - 193u8, 79u8, 254u8, 68u8, 22u8, 216u8, 157u8, 136u8, 233u8, - 98u8, 46u8, 220u8, 121u8, 29u8, - ] - { - let call = ScheduleAfter { - after, - maybe_periodic, - priority, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a named task after a delay."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`schedule_named`](Self::schedule_named)."] - #[doc = "# "] - pub fn schedule_named_after( - &self, - id: ::std::vec::Vec<::core::primitive::u8>, - after: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScheduleNamedAfter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 127u8, 121u8, 141u8, 162u8, 95u8, 211u8, 214u8, 15u8, 22u8, - 28u8, 23u8, 71u8, 92u8, 58u8, 249u8, 163u8, 216u8, 85u8, - 155u8, 88u8, 161u8, 113u8, 153u8, 200u8, 248u8, 168u8, 121u8, - 124u8, 131u8, 122u8, 232u8, 160u8, - ] - { - let call = ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_scheduler::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Scheduled some task."] - pub struct Scheduled { - pub when: ::core::primitive::u32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Canceled some task."] - pub struct Canceled { - pub when: ::core::primitive::u32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for Canceled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Dispatched some task."] - pub struct Dispatched { - pub task: (::core::primitive::u32, ::core::primitive::u32), - pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for Dispatched { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The call for the provided hash was not found so the task has been aborted."] - pub struct CallLookupFailed { - pub task: (::core::primitive::u32, ::core::primitive::u32), - pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - pub error: runtime_types::frame_support::traits::schedule::LookupError, - } - impl ::subxt::Event for CallLookupFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallLookupFailed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Agenda<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Agenda<'_> { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Agenda"; - type Value = ::std::vec::Vec< - ::core::option::Option< - runtime_types::pallet_scheduler::ScheduledV3< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - ::core::primitive::u32, - runtime_types::polkadot_runtime::OriginCaller, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Lookup<'a>(pub &'a [::core::primitive::u8]); - impl ::subxt::StorageEntry for Lookup<'_> { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Lookup"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub 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 >{ - if self.client.metadata().storage_hash::()? - == [ - 235u8, 95u8, 118u8, 134u8, 98u8, 235u8, 250u8, 110u8, 250u8, - 7u8, 75u8, 190u8, 53u8, 194u8, 153u8, 51u8, 125u8, 69u8, - 46u8, 232u8, 63u8, 132u8, 47u8, 167u8, 210u8, 46u8, 43u8, - 142u8, 255u8, 252u8, 99u8, 253u8, - ] - { - 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 async fn agenda_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Agenda<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().storage_hash::()? - == [ - 235u8, 95u8, 118u8, 134u8, 98u8, 235u8, 250u8, 110u8, 250u8, - 7u8, 75u8, 190u8, 53u8, 194u8, 153u8, 51u8, 125u8, 69u8, - 46u8, 232u8, 63u8, 132u8, 47u8, 167u8, 210u8, 46u8, 43u8, - 142u8, 255u8, 252u8, 99u8, 253u8, - ] - { - self.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( - &self, - _0: &[::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The maximum weight that may be scheduled per block for any dispatchables of less"] - #[doc = " priority than `schedule::HARD_DEADLINE`."] - pub fn maximum_weight( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Scheduler", "MaximumWeight")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self.client.metadata().pallet("Scheduler")?; - let constant = pallet.constant("MaximumWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of scheduled calls in the queue for a single block."] - #[doc = " Not strictly enforced, but used for weight estimation."] - pub fn max_scheduled_per_block( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Scheduler", "MaxScheduledPerBlock")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Scheduler")?; - let constant = pallet.constant("MaxScheduledPerBlock")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod preimage { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NotePreimage { - pub bytes: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for NotePreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "note_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct UnnotePreimage { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for UnnotePreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "unnote_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RequestPreimage { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "request_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct UnrequestPreimage { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for UnrequestPreimage { - const PALLET: &'static str = "Preimage"; - const FUNCTION: &'static str = "unrequest_preimage"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub fn note_preimage( - &self, - bytes: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NotePreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 116u8, 66u8, 88u8, 251u8, 187u8, 86u8, 82u8, 136u8, 215u8, - 82u8, 240u8, 255u8, 70u8, 190u8, 116u8, 187u8, 232u8, 168u8, - 125u8, 234u8, 8u8, 21u8, 247u8, 195u8, 167u8, 237u8, 27u8, - 202u8, 123u8, 25u8, 225u8, 131u8, - ] - { - let call = NotePreimage { bytes }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clear an unrequested preimage from the runtime storage."] - pub fn unnote_preimage( - &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnnotePreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 162u8, 195u8, 220u8, 134u8, 147u8, 150u8, 145u8, 130u8, - 231u8, 104u8, 83u8, 70u8, 42u8, 90u8, 248u8, 61u8, 223u8, - 63u8, 162u8, 219u8, 92u8, 248u8, 179u8, 99u8, 158u8, 252u8, - 89u8, 59u8, 115u8, 130u8, 73u8, 21u8, - ] - { - let call = UnnotePreimage { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub fn request_preimage( - &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RequestPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 186u8, 108u8, 235u8, 145u8, 104u8, 29u8, 22u8, 33u8, 21u8, - 121u8, 32u8, 75u8, 141u8, 125u8, 205u8, 186u8, 210u8, 184u8, - 134u8, 248u8, 74u8, 175u8, 104u8, 91u8, 247u8, 151u8, 70u8, - 192u8, 183u8, 163u8, 245u8, 180u8, - ] - { - let call = RequestPreimage { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub fn unrequest_preimage( - &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnrequestPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 160u8, 6u8, 6u8, 198u8, 77u8, 37u8, 28u8, 86u8, 240u8, 160u8, - 128u8, 123u8, 144u8, 150u8, 150u8, 60u8, 107u8, 148u8, 189u8, - 192u8, 125u8, 25u8, 55u8, 212u8, 193u8, 212u8, 198u8, 131u8, - 113u8, 37u8, 213u8, 152u8, - ] - { - let call = UnrequestPreimage { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_preimage::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A preimage has been noted."] - pub struct Noted { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Noted { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Noted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A preimage has been requested."] - pub struct Requested { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Requested { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Requested"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A preimage has ben cleared."] - pub struct Cleared { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Cleared { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Cleared"; - } - } - pub mod storage { - use super::runtime_types; - pub struct StatusFor<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for StatusFor<'_> { - const PALLET: &'static str = "Preimage"; - const STORAGE: &'static str = "StatusFor"; - type Value = runtime_types::pallet_preimage::RequestStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct PreimageFor<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for PreimageFor<'_> { - const PALLET: &'static str = "Preimage"; - const STORAGE: &'static str = "PreimageFor"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The request status of a given hash."] - pub async fn status_for( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The preimages stored by this pallet."] - pub async fn preimage_for( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod babe { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReportEquivocation { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "report_equivocation"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PlanConfigChange { - pub config: - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - } - impl ::subxt::Call for PlanConfigChange { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "plan_config_change"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - pub fn report_equivocation( - &self, - equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocation, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 123u8, 212u8, 216u8, 77u8, 79u8, 132u8, 201u8, 155u8, 166u8, - 230u8, 50u8, 89u8, 98u8, 68u8, 56u8, 213u8, 206u8, 245u8, - 91u8, 104u8, 89u8, 189u8, 57u8, 38u8, 127u8, 22u8, 47u8, - 206u8, 142u8, 202u8, 106u8, 154u8, - ] - { - let call = ReportEquivocation { - equivocation_proof: ::std::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_equivocation_unsigned( - &self, - equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocationUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 32u8, 163u8, 168u8, 251u8, 251u8, 9u8, 1u8, 195u8, 173u8, - 32u8, 235u8, 125u8, 141u8, 201u8, 130u8, 207u8, 239u8, 76u8, - 150u8, 99u8, 74u8, 193u8, 60u8, 165u8, 93u8, 49u8, 95u8, - 224u8, 217u8, 243u8, 117u8, 173u8, - ] - { - let call = ReportEquivocationUnsigned { - equivocation_proof: ::std::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] - #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] - #[doc = "Multiple calls to this method will replace any existing planned config change that had"] - #[doc = "not been enacted yet."] - pub fn plan_config_change( - &self, - config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PlanConfigChange, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 215u8, 121u8, 90u8, 87u8, 178u8, 247u8, 114u8, 53u8, 174u8, - 28u8, 20u8, 33u8, 139u8, 216u8, 13u8, 187u8, 74u8, 198u8, - 38u8, 28u8, 175u8, 13u8, 73u8, 132u8, 103u8, 78u8, 217u8, - 207u8, 113u8, 169u8, 42u8, 103u8, - ] - { - let call = PlanConfigChange { config }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct EpochIndex; - impl ::subxt::StorageEntry for EpochIndex { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochIndex"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Authorities; - impl ::subxt::StorageEntry for Authorities { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Authorities"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct GenesisSlot; - impl ::subxt::StorageEntry for GenesisSlot { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "GenesisSlot"; - type Value = runtime_types::sp_consensus_slots::Slot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentSlot; - impl ::subxt::StorageEntry for CurrentSlot { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "CurrentSlot"; - type Value = runtime_types::sp_consensus_slots::Slot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Randomness; - impl ::subxt::StorageEntry for Randomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Randomness"; - type Value = [::core::primitive::u8; 32usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingEpochConfigChange; - impl ::subxt::StorageEntry for PendingEpochConfigChange { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "PendingEpochConfigChange"; - type Value = - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextRandomness; - impl ::subxt::StorageEntry for NextRandomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextRandomness"; - type Value = [::core::primitive::u8; 32usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextAuthorities; - impl ::subxt::StorageEntry for NextAuthorities { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextAuthorities"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SegmentIndex; - impl ::subxt::StorageEntry for SegmentIndex { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "SegmentIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnderConstruction<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for UnderConstruction<'_> { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "UnderConstruction"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Initialized; - impl ::subxt::StorageEntry for Initialized { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Initialized"; - type Value = ::core::option::Option<[::core::primitive::u8; 32usize]>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AuthorVrfRandomness; - impl ::subxt::StorageEntry for AuthorVrfRandomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "AuthorVrfRandomness"; - type Value = ::core::option::Option<[::core::primitive::u8; 32usize]>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochStart; - impl ::subxt::StorageEntry for EpochStart { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochStart"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Lateness; - impl ::subxt::StorageEntry for Lateness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Lateness"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochConfig; - impl ::subxt::StorageEntry for EpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextEpochConfig; - impl ::subxt::StorageEntry for NextEpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextEpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Current epoch index."] - pub async fn epoch_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The epoch randomness for the *current* epoch."] - #[doc = ""] - #[doc = " # Security"] - #[doc = ""] - #[doc = " This MUST NOT be used for gambling, as it can be influenced by a"] - #[doc = " malicious validator in the short term. It MAY be used in many"] - #[doc = " cryptographic protocols, however, so long as one remembers that this"] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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 = " Next epoch randomness."] - pub async fn next_randomness( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " Randomness under construction."] - #[doc = ""] - #[doc = " We make a trade-off between storage accesses and list length."] - #[doc = " We store the under-construction randomness in segments of up to"] - #[doc = " `UNDER_CONSTRUCTION_SEGMENT_LENGTH`."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub async fn under_construction( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - ::core::option::Option<[::core::primitive::u8; 32usize]>, - >, - ::subxt::BasicError, - > { - if self.client.metadata().storage_hash::()? - == [ - 48u8, 206u8, 111u8, 118u8, 149u8, 175u8, 148u8, 53u8, 233u8, - 82u8, 220u8, 57u8, 22u8, 164u8, 116u8, 228u8, 134u8, 237u8, - 129u8, 195u8, 60u8, 169u8, 1u8, 164u8, 74u8, 177u8, 145u8, - 112u8, 66u8, 198u8, 53u8, 157u8, - ] - { - let entry = Initialized; - self.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_initialize`, 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The block numbers when the last and current epoch have started, respectively `N-1` and"] - #[doc = " `N`."] - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " How late the current block is compared to its parent."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] - #[doc = " genesis."] - pub async fn epoch_config( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The amount of time, in slots, that each epoch should last."] - #[doc = " NOTE: Currently it is not possible to change the epoch duration after"] - #[doc = " the chain has started. Attempting to do so will brick block production."] - pub fn epoch_duration( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Babe", "EpochDuration")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self.client.metadata().pallet("Babe")?; - let constant = pallet.constant("EpochDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The expected average block time at which BABE should be creating"] - #[doc = " blocks. Since BABE is probabilistic it is not trivial to figure out"] - #[doc = " what the expected average block time should be based on the slot"] - #[doc = " duration and the security parameter `c` (where `1 - c` represents"] - #[doc = " the probability of a slot being empty)."] - pub fn expected_block_time( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Babe", "ExpectedBlockTime")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self.client.metadata().pallet("Babe")?; - let constant = pallet.constant("ExpectedBlockTime")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Max number of authorities allowed"] - pub fn max_authorities( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Babe", "MaxAuthorities")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Babe")?; - let constant = pallet.constant("MaxAuthorities")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod timestamp { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Set { - #[codec(compact)] - pub now: ::core::primitive::u64, - } - impl ::subxt::Call for Set { - const PALLET: &'static str = "Timestamp"; - const FUNCTION: &'static str = "set"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the current time."] - #[doc = ""] - #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] - #[doc = "phase, if this call hasn't been invoked by that time."] - #[doc = ""] - #[doc = "The timestamp should be greater than the previous one by the amount specified by"] - #[doc = "`MinimumPeriod`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Inherent`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] - #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] - #[doc = " `on_finalize`)"] - #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] - #[doc = "# "] - pub fn set( - &self, - now: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Set, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 191u8, 73u8, 102u8, 150u8, 65u8, 157u8, 172u8, 194u8, 7u8, - 72u8, 1u8, 35u8, 54u8, 99u8, 245u8, 139u8, 40u8, 136u8, - 245u8, 53u8, 167u8, 100u8, 143u8, 244u8, 160u8, 5u8, 18u8, - 130u8, 77u8, 160u8, 227u8, 51u8, - ] - { - let call = Set { now }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Now; - impl ::subxt::StorageEntry for Now { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "Now"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidUpdate; - impl ::subxt::StorageEntry for DidUpdate { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "DidUpdate"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Current time for the current block."] - pub async fn now( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Did the timestamp get updated in this block?"] - pub async fn did_update( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The minimum period between blocks. Beware that this is different to the *expected*"] - #[doc = " period that the block production apparatus provides. Your chosen consensus system will"] - #[doc = " generally work with this to determine a sensible block time. e.g. For Aura, it will be"] - #[doc = " double this period on default settings."] - pub fn minimum_period( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Timestamp", "MinimumPeriod")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self.client.metadata().pallet("Timestamp")?; - let constant = pallet.constant("MinimumPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod indices { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Claim { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "claim"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Transfer { - pub new: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "transfer"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Free { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Free { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "free"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceTransfer { - pub new: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - pub freeze: ::core::primitive::bool, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Freeze { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "freeze"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Assign an previously unassigned index."] - #[doc = ""] - #[doc = "Payment: `Deposit` is reserved from the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be claimed. This must not be in use."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - pub fn claim( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Claim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 27u8, 4u8, 108u8, 55u8, 23u8, 109u8, 175u8, 25u8, 201u8, - 230u8, 228u8, 51u8, 164u8, 15u8, 79u8, 10u8, 219u8, 182u8, - 242u8, 102u8, 164u8, 148u8, 39u8, 91u8, 106u8, 197u8, 29u8, - 190u8, 178u8, 221u8, 16u8, 87u8, - ] - { - let call = Claim { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] - #[doc = "is effectively transferred to the new account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One transfer operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (recipient)"] - #[doc = " - Writes: Indices Accounts, System Account (recipient)"] - #[doc = "# "] - pub fn transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Transfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 124u8, 83u8, 33u8, 230u8, 23u8, 70u8, 83u8, 59u8, 76u8, - 100u8, 219u8, 100u8, 165u8, 163u8, 102u8, 193u8, 11u8, 22u8, - 30u8, 125u8, 114u8, 28u8, 61u8, 156u8, 38u8, 170u8, 129u8, - 74u8, 187u8, 28u8, 33u8, 65u8, - ] - { - let call = Transfer { new, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Free up an index owned by the sender."] - #[doc = ""] - #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] - #[doc = ""] - #[doc = "- `index`: the index to be freed. This must be owned by the sender."] - #[doc = ""] - #[doc = "Emits `IndexFreed` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - pub fn free( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Free, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 153u8, 143u8, 162u8, 33u8, 229u8, 3u8, 159u8, 153u8, 111u8, - 100u8, 160u8, 250u8, 227u8, 24u8, 157u8, 226u8, 173u8, 39u8, - 25u8, 200u8, 137u8, 147u8, 232u8, 213u8, 182u8, 49u8, 142u8, - 250u8, 139u8, 155u8, 84u8, 214u8, - ] - { - let call = Free { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] - #[doc = "held, then any deposit is reimbursed to its current owner."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `index`: the index to be (re-)assigned."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (original owner)"] - #[doc = " - Writes: Indices Accounts, System Account (original owner)"] - #[doc = "# "] - pub fn force_transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - freeze: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 181u8, 143u8, 90u8, 135u8, 132u8, 11u8, 145u8, 85u8, 4u8, - 211u8, 56u8, 110u8, 213u8, 153u8, 224u8, 106u8, 198u8, 250u8, - 130u8, 253u8, 72u8, 58u8, 133u8, 150u8, 102u8, 119u8, 177u8, - 175u8, 77u8, 106u8, 253u8, 99u8, - ] - { - let call = ForceTransfer { new, index, freeze }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] - #[doc = "deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "- `index`: the index to be frozen in place."] - #[doc = ""] - #[doc = "Emits `IndexFrozen` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one slash operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - pub fn freeze( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Freeze, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 204u8, 127u8, 214u8, 137u8, 138u8, 28u8, 171u8, 169u8, 184u8, - 164u8, 235u8, 114u8, 132u8, 176u8, 14u8, 207u8, 72u8, 39u8, - 179u8, 231u8, 137u8, 243u8, 242u8, 57u8, 89u8, 57u8, 213u8, - 210u8, 87u8, 12u8, 253u8, 159u8, - ] - { - let call = Freeze { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_indices::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A account index was assigned."] - pub struct IndexAssigned { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for IndexAssigned { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexAssigned"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A account index has been freed up (unassigned)."] - pub struct IndexFreed { - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for IndexFreed { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFreed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A account index has been frozen to its current account ID."] - pub struct IndexFrozen { - pub index: ::core::primitive::u32, - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for IndexFrozen { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFrozen"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Accounts<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Accounts<'_> { - const PALLET: &'static str = "Indices"; - const STORAGE: &'static str = "Accounts"; - type Value = ( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The lookup from index to account."] - pub async fn accounts( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The deposit needed for reserving an index."] - pub fn deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().constant_hash("Indices", "Deposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Indices")?; - let constant = pallet.constant("Deposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod balances { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Transfer { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetBalance { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub new_free: ::core::primitive::u128, - #[codec(compact)] - pub new_reserved: ::core::primitive::u128, - } - impl ::subxt::Call for SetBalance { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "set_balance"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TransferKeepAlive { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for TransferKeepAlive { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_keep_alive"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TransferAll { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub keep_alive: ::core::primitive::bool, - } - impl ::subxt::Call for TransferAll { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_all"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceUnreserve { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Call for ForceUnreserve { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_unreserve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] - #[doc = " types. See related functions below."] - #[doc = "- It contains a limited number of reads and writes internally and no complex"] - #[doc = " computation."] - #[doc = ""] - #[doc = "Related functions:"] - #[doc = ""] - #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] - #[doc = " - Transferring balances to accounts that did not exist before will cause"] - #[doc = " `T::OnNewAccount::on_new_account` to be called."] - #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] - #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] - #[doc = " that the transfer will not kill the origin account."] - #[doc = "---------------------------------"] - #[doc = "- Origin account is already in memory, so no DB operations for them."] - #[doc = "# "] - pub fn transfer( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Transfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 250u8, 8u8, 164u8, 186u8, 80u8, 220u8, 134u8, 247u8, 142u8, - 121u8, 34u8, 22u8, 169u8, 39u8, 6u8, 93u8, 72u8, 47u8, 44u8, - 107u8, 9u8, 98u8, 203u8, 190u8, 136u8, 55u8, 251u8, 78u8, - 216u8, 150u8, 98u8, 118u8, - ] - { - let call = Transfer { dest, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the balances of a given account."] - #[doc = ""] - #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] - #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] - #[doc = "If the new free or reserved balance is below the existential deposit,"] - #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - pub fn set_balance( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - new_free: ::core::primitive::u128, - new_reserved: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetBalance, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 232u8, 6u8, 27u8, 131u8, 163u8, 72u8, 148u8, 197u8, 14u8, - 239u8, 94u8, 1u8, 32u8, 94u8, 17u8, 14u8, 123u8, 82u8, 39u8, - 233u8, 77u8, 20u8, 40u8, 139u8, 222u8, 137u8, 103u8, 18u8, - 126u8, 63u8, 200u8, 149u8, - ] - { - let call = SetBalance { - who, - new_free, - new_reserved, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] - #[doc = "specified."] - #[doc = "# "] - #[doc = "- Same as transfer, but additional read and write because the source account is not"] - #[doc = " assumed to be in the overlay."] - #[doc = "# "] - pub fn force_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 120u8, 66u8, 111u8, 84u8, 176u8, 241u8, 214u8, 118u8, 219u8, - 75u8, 127u8, 222u8, 45u8, 33u8, 204u8, 147u8, 126u8, 214u8, - 101u8, 190u8, 37u8, 37u8, 159u8, 166u8, 61u8, 143u8, 22u8, - 32u8, 15u8, 83u8, 221u8, 230u8, - ] - { - let call = ForceTransfer { - source, - dest, - value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] - #[doc = "origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer`] instead."] - #[doc = ""] - #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] - pub fn transfer_keep_alive( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TransferKeepAlive, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 111u8, 233u8, 125u8, 71u8, 223u8, 141u8, 112u8, 94u8, 157u8, - 11u8, 88u8, 7u8, 239u8, 145u8, 247u8, 183u8, 245u8, 87u8, - 157u8, 35u8, 49u8, 91u8, 54u8, 103u8, 101u8, 76u8, 110u8, - 94u8, 81u8, 170u8, 153u8, 209u8, - ] - { - let call = TransferKeepAlive { dest, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true). # "] - #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] - #[doc = " #"] - pub fn transfer_all( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - keep_alive: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TransferAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 240u8, 165u8, 185u8, 144u8, 24u8, 149u8, 15u8, 46u8, 60u8, - 147u8, 19u8, 187u8, 96u8, 24u8, 150u8, 53u8, 151u8, 232u8, - 200u8, 164u8, 176u8, 167u8, 8u8, 23u8, 63u8, 135u8, 68u8, - 110u8, 5u8, 21u8, 35u8, 78u8, - ] - { - let call = TransferAll { dest, keep_alive }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - pub fn force_unreserve( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - amount: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnreserve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 106u8, 42u8, 48u8, 136u8, 41u8, 155u8, 214u8, 112u8, 99u8, - 122u8, 202u8, 250u8, 95u8, 60u8, 182u8, 13u8, 25u8, 149u8, - 212u8, 212u8, 247u8, 191u8, 130u8, 95u8, 84u8, 252u8, 252u8, - 197u8, 244u8, 149u8, 103u8, 67u8, - ] - { - let call = ForceUnreserve { who, amount }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_balances::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account was created with some free balance."] - pub struct Endowed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub free_balance: ::core::primitive::u128, - } - impl ::subxt::Event for Endowed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Endowed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] - #[doc = "resulting in an outright loss."] - pub struct DustLost { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for DustLost { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "DustLost"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Transfer succeeded."] - pub struct Transfer { - pub from: ::subxt::sp_core::crypto::AccountId32, - pub to: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Transfer { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A balance was set by root."] - pub struct BalanceSet { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub free: ::core::primitive::u128, - pub reserved: ::core::primitive::u128, - } - impl ::subxt::Event for BalanceSet { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "BalanceSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some balance was reserved (moved from free to reserved)."] - pub struct Reserved { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Reserved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some balance was unreserved (moved from reserved to free)."] - pub struct Unreserved { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Unreserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Unreserved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some balance was moved from the reserve of the first account to the second account."] - #[doc = "Final argument indicates the destination balance type."] - pub struct ReserveRepatriated { - pub from: ::subxt::sp_core::crypto::AccountId32, - pub to: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - pub destination_status: - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, - } - impl ::subxt::Event for ReserveRepatriated { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "ReserveRepatriated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some amount was deposited (e.g. for transaction fees)."] - pub struct Deposit { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Deposit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] - pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Withdraw { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Withdraw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] - pub struct Slashed { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Slashed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct TotalIssuance; - impl ::subxt::StorageEntry for TotalIssuance { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "TotalIssuance"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Account"; - type Value = - runtime_types::pallet_balances::AccountData<::core::primitive::u128>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Locks<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Locks"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Reserves<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Reserves<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Reserves"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_balances::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The total units issued in the system."] - pub async fn total_issuance( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The Balances pallet example of storing the balance of an account."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " You can also store the balance of an account in the `System` pallet."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = System"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] - #[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( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The Balances pallet example of storing the balance of an account."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " You can also store the balance of an account in the `System` pallet."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = System"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] - #[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, - > { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Named reserves on some account balances."] - pub async fn reserves( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The minimum amount required to keep an account open."] - pub fn existential_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Balances", "ExistentialDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Balances")?; - let constant = pallet.constant("ExistentialDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of locks that should exist on an account."] - #[doc = " Not strictly enforced, but used for weight estimation."] - pub fn max_locks( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Balances", "MaxLocks")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Balances")?; - let constant = pallet.constant("MaxLocks")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of named reserves that can exist on an account."] - pub fn max_reserves( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Balances", "MaxReserves")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Balances")?; - let constant = pallet.constant("MaxReserves")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod transaction_payment { - use super::{ - root_mod, - runtime_types, - }; - pub mod storage { - use super::runtime_types; - pub struct NextFeeMultiplier; - impl ::subxt::StorageEntry for NextFeeMultiplier { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "NextFeeMultiplier"; - type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_transaction_payment::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn next_fee_multiplier( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_transaction_payment::Releases, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The fee to be paid for making a transaction; the per-byte portion."] - pub fn transaction_byte_fee( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("TransactionPayment", "TransactionByteFee")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = - self.client.metadata().pallet("TransactionPayment")?; - let constant = pallet.constant("TransactionByteFee")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A fee mulitplier for `Operational` extrinsics to compute \"virtual tip\" to boost their"] - #[doc = " `priority`"] - #[doc = ""] - #[doc = " This value is multipled by the `final_fee` to obtain a \"virtual tip\" that is later"] - #[doc = " added to a tip component in regular `priority` calculations."] - #[doc = " It means that a `Normal` transaction can front-run a similarly-sized `Operational`"] - #[doc = " extrinsic (with no tip), by including a tip value greater than the virtual tip."] - #[doc = ""] - #[doc = " ```rust,ignore"] - #[doc = " // For `Normal`"] - #[doc = " let priority = priority_calc(tip);"] - #[doc = ""] - #[doc = " // For `Operational`"] - #[doc = " let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;"] - #[doc = " let priority = priority_calc(tip + virtual_tip);"] - #[doc = " ```"] - #[doc = ""] - #[doc = " Note that since we use `final_fee` the multiplier applies also to the regular `tip`"] - #[doc = " sent with the transaction. So, not only does the transaction get a priority bump based"] - #[doc = " on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`"] - #[doc = " transactions."] - pub fn operational_fee_multiplier( - &self, - ) -> ::core::result::Result<::core::primitive::u8, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("TransactionPayment", "OperationalFeeMultiplier")? - == [ - 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, - 110u8, 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, - 185u8, 66u8, 226u8, 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, - 114u8, 237u8, 228u8, 183u8, 165u8, - ] - { - let pallet = - self.client.metadata().pallet("TransactionPayment")?; - let constant = pallet.constant("OperationalFeeMultiplier")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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, - > { - if self - .client - .metadata() - .constant_hash("TransactionPayment", "WeightToFee")? - == [ - 99u8, 211u8, 10u8, 189u8, 123u8, 171u8, 119u8, 79u8, 112u8, - 33u8, 10u8, 47u8, 119u8, 55u8, 237u8, 32u8, 127u8, 21u8, - 117u8, 156u8, 153u8, 243u8, 128u8, 211u8, 243u8, 75u8, 15u8, - 181u8, 126u8, 73u8, 51u8, 47u8, - ] - { - let pallet = - self.client.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()) - } - } - } - } - } - pub mod authorship { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetUncles { - pub new_uncles: ::std::vec::Vec< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for SetUncles { - const PALLET: &'static str = "Authorship"; - const FUNCTION: &'static str = "set_uncles"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Provide a set of uncles."] - pub fn set_uncles( - &self, - new_uncles: ::std::vec::Vec< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUncles, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 5u8, 56u8, 71u8, 152u8, 103u8, 232u8, 101u8, 171u8, 200u8, - 2u8, 177u8, 102u8, 0u8, 93u8, 210u8, 90u8, 56u8, 151u8, 5u8, - 235u8, 227u8, 197u8, 189u8, 248u8, 2u8, 71u8, 49u8, 220u8, - 212u8, 253u8, 235u8, 67u8, - ] - { - let call = SetUncles { new_uncles }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Uncles; - impl ::subxt::StorageEntry for Uncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Uncles"; - type Value = ::std::vec::Vec< - runtime_types::pallet_authorship::UncleEntryItem< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Author; - impl ::subxt::StorageEntry for Author { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Author"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidSetUncles; - impl ::subxt::StorageEntry for DidSetUncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "DidSetUncles"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Uncles"] - pub async 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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Author of current block."] - pub async fn author( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Whether uncles were already set in this block."] - pub async fn did_set_uncles( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of blocks back we should accept uncles."] - #[doc = " This means that we will deal with uncle-parents that are"] - #[doc = " `UncleGenerations + 1` before `now`."] - pub fn uncle_generations( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Authorship", "UncleGenerations")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Authorship")?; - let constant = pallet.constant("UncleGenerations")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod staking { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Bond { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub value: ::core::primitive::u128, - pub payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - } - impl ::subxt::Call for Bond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "bond"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct BondExtra { - #[codec(compact)] - pub max_additional: ::core::primitive::u128, - } - impl ::subxt::Call for BondExtra { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "bond_extra"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Unbond { - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Unbond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "unbond"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct WithdrawUnbonded { - pub num_slashing_spans: ::core::primitive::u32, - } - impl ::subxt::Call for WithdrawUnbonded { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "withdraw_unbonded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Validate { - pub prefs: runtime_types::pallet_staking::ValidatorPrefs, - } - impl ::subxt::Call for Validate { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "validate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Nominate { - pub targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - } - impl ::subxt::Call for Nominate { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "nominate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Chill; - impl ::subxt::Call for Chill { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "chill"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetPayee { - pub payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - } - impl ::subxt::Call for SetPayee { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_payee"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetController { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for SetController { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_controller"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetValidatorCount { - #[codec(compact)] - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetValidatorCount { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_validator_count"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct IncreaseValidatorCount { - #[codec(compact)] - pub additional: ::core::primitive::u32, - } - impl ::subxt::Call for IncreaseValidatorCount { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "increase_validator_count"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ScaleValidatorCount { - pub factor: runtime_types::sp_arithmetic::per_things::Percent, - } - impl ::subxt::Call for ScaleValidatorCount { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "scale_validator_count"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceNoEras; - impl ::subxt::Call for ForceNoEras { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_no_eras"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceNewEra; - impl ::subxt::Call for ForceNewEra { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_new_era"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetInvulnerables { - pub invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for SetInvulnerables { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_invulnerables"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceUnstake { - pub stash: ::subxt::sp_core::crypto::AccountId32, - pub num_slashing_spans: ::core::primitive::u32, - } - impl ::subxt::Call for ForceUnstake { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_unstake"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceNewEraAlways; - impl ::subxt::Call for ForceNewEraAlways { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_new_era_always"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CancelDeferredSlash { - pub era: ::core::primitive::u32, - pub slash_indices: ::std::vec::Vec<::core::primitive::u32>, - } - impl ::subxt::Call for CancelDeferredSlash { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "cancel_deferred_slash"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PayoutStakers { - pub validator_stash: ::subxt::sp_core::crypto::AccountId32, - pub era: ::core::primitive::u32, - } - impl ::subxt::Call for PayoutStakers { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "payout_stakers"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Rebond { - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Rebond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "rebond"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetHistoryDepth { - #[codec(compact)] - pub new_history_depth: ::core::primitive::u32, - #[codec(compact)] - pub era_items_deleted: ::core::primitive::u32, - } - impl ::subxt::Call for SetHistoryDepth { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_history_depth"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReapStash { - pub stash: ::subxt::sp_core::crypto::AccountId32, - pub num_slashing_spans: ::core::primitive::u32, - } - impl ::subxt::Call for ReapStash { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "reap_stash"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Kick { - pub who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - } - impl ::subxt::Call for Kick { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "kick"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetStakingConfigs { - pub min_nominator_bond: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u128, - >, - pub min_validator_bond: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u128, - >, - pub max_nominator_count: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u32, - >, - pub max_validator_count: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u32, - >, - pub chill_threshold: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - runtime_types::sp_arithmetic::per_things::Percent, - >, - pub min_commission: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - runtime_types::sp_arithmetic::per_things::Perbill, - >, - } - impl ::subxt::Call for SetStakingConfigs { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_staking_configs"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ChillOther { - pub controller: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChillOther { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "chill_other"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceApplyMinCommission { - pub validator_stash: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ForceApplyMinCommission { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_apply_min_commission"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] - #[doc = "be the account that controls it."] - #[doc = ""] - #[doc = "`value` must be more than the `minimum_balance` specified by `T::Currency`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the stash account."] - #[doc = ""] - #[doc = "Emits `Bonded`."] - #[doc = "# "] - #[doc = "- Independent of the arguments. Moderate complexity."] - #[doc = "- O(1)."] - #[doc = "- Three extra DB entries."] - #[doc = ""] - #[doc = "NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned"] - #[doc = "unless the `origin` falls below _existential deposit_ and gets removed as dust."] - #[doc = "------------------"] - #[doc = "# "] - pub fn bond( - &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Bond, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 41u8, 8u8, 237u8, 132u8, 236u8, 61u8, 222u8, 146u8, 255u8, - 136u8, 174u8, 104u8, 120u8, 64u8, 198u8, 147u8, 80u8, 237u8, - 65u8, 255u8, 187u8, 55u8, 252u8, 34u8, 252u8, 88u8, 35u8, - 236u8, 249u8, 170u8, 116u8, 208u8, - ] - { - let call = Bond { - controller, - value, - payee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] - #[doc = "for staking."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] - #[doc = ""] - #[doc = "Use this if there are additional funds in your stash account that you wish to bond."] - #[doc = "Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose"] - #[doc = "any limitation on the amount that can be added."] - #[doc = ""] - #[doc = "Emits `Bonded`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn bond_extra( - &self, - max_additional: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - BondExtra, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 170u8, 38u8, 37u8, 71u8, 243u8, 41u8, 24u8, 59u8, 17u8, - 229u8, 61u8, 20u8, 130u8, 167u8, 1u8, 1u8, 158u8, 180u8, - 234u8, 65u8, 196u8, 181u8, 232u8, 146u8, 62u8, 90u8, 194u8, - 183u8, 253u8, 142u8, 251u8, 200u8, - ] - { - let call = BondExtra { max_additional }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] - #[doc = "period ends. If this leaves an amount actively bonded less than"] - #[doc = "T::Currency::minimum_balance(), then it is increased to the full amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "Once the unlock period is done, you can call `withdraw_unbonded` to actually move"] - #[doc = "the funds out of management ready for transfer."] - #[doc = ""] - #[doc = "No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)"] - #[doc = "can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need"] - #[doc = "to be called first to remove some of the chunks (if possible)."] - #[doc = ""] - #[doc = "If a user encounters the `InsufficientBond` error when calling this extrinsic,"] - #[doc = "they should call `chill` first in order to free up their bonded funds."] - #[doc = ""] - #[doc = "Emits `Unbonded`."] - #[doc = ""] - #[doc = "See also [`Call::withdraw_unbonded`]."] - pub fn unbond( - &self, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Unbond, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 85u8, 188u8, 141u8, 62u8, 242u8, 15u8, 6u8, 20u8, 96u8, - 220u8, 201u8, 163u8, 29u8, 136u8, 24u8, 4u8, 143u8, 13u8, - 22u8, 118u8, 22u8, 212u8, 164u8, 125u8, 200u8, 219u8, 6u8, - 25u8, 174u8, 92u8, 108u8, 89u8, - ] - { - let call = Unbond { value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] - #[doc = ""] - #[doc = "This essentially frees up that balance to be used by the stash account to do"] - #[doc = "whatever it wants."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller."] - #[doc = ""] - #[doc = "Emits `Withdrawn`."] - #[doc = ""] - #[doc = "See also [`Call::unbond`]."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity O(S) where S is the number of slashing spans to remove"] - #[doc = "NOTE: Weight annotation is the kill scenario, we refund otherwise."] - #[doc = "# "] - pub fn withdraw_unbonded( - &self, - num_slashing_spans: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - WithdrawUnbonded, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 252u8, 47u8, 185u8, 86u8, 179u8, 203u8, 20u8, 5u8, 88u8, - 252u8, 212u8, 173u8, 20u8, 202u8, 206u8, 56u8, 10u8, 186u8, - 124u8, 221u8, 42u8, 61u8, 202u8, 110u8, 233u8, 40u8, 210u8, - 135u8, 204u8, 110u8, 133u8, 123u8, - ] - { - let call = WithdrawUnbonded { num_slashing_spans }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Declare the desire to validate for the origin controller."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - pub fn validate( - &self, - prefs: runtime_types::pallet_staking::ValidatorPrefs, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Validate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 138u8, 13u8, 146u8, 216u8, 4u8, 27u8, 20u8, 159u8, 148u8, - 25u8, 169u8, 229u8, 145u8, 2u8, 251u8, 58u8, 13u8, 128u8, - 20u8, 22u8, 194u8, 11u8, 13u8, 65u8, 50u8, 51u8, 158u8, - 239u8, 45u8, 90u8, 6u8, 37u8, - ] - { - let call = Validate { prefs }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Declare the desire to nominate `targets` for the origin controller."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "# "] - #[doc = "- The transaction's complexity is proportional to the size of `targets` (N)"] - #[doc = "which is capped at CompactAssignments::LIMIT (T::MaxNominations)."] - #[doc = "- Both the reads and writes follow a similar pattern."] - #[doc = "# "] - pub fn nominate( - &self, - targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Nominate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 199u8, 181u8, 123u8, 171u8, 186u8, 9u8, 23u8, 220u8, 147u8, - 7u8, 252u8, 26u8, 25u8, 195u8, 126u8, 175u8, 181u8, 118u8, - 162u8, 37u8, 99u8, 31u8, 100u8, 249u8, 245u8, 122u8, 235u8, - 11u8, 43u8, 39u8, 198u8, 145u8, - ] - { - let call = Nominate { targets }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Declare no desire to either validate or nominate."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- Contains one read."] - #[doc = "- Writes are limited to the `origin` account key."] - #[doc = "# "] - pub fn chill( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Chill, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 94u8, 20u8, 196u8, 31u8, 220u8, 125u8, 115u8, 167u8, 140u8, - 3u8, 20u8, 132u8, 81u8, 120u8, 215u8, 166u8, 230u8, 56u8, - 16u8, 222u8, 31u8, 153u8, 120u8, 62u8, 153u8, 67u8, 220u8, - 239u8, 11u8, 234u8, 127u8, 122u8, - ] - { - let call = Chill {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "(Re-)set the payment target for a controller."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- Contains a limited number of reads."] - #[doc = "- Writes are limited to the `origin` account key."] - #[doc = "---------"] - #[doc = "- Weight: O(1)"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Ledger"] - #[doc = " - Write: Payee"] - #[doc = "# "] - pub fn set_payee( - &self, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPayee, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 185u8, 62u8, 154u8, 65u8, 135u8, 104u8, 38u8, 171u8, 237u8, - 16u8, 169u8, 38u8, 53u8, 161u8, 170u8, 232u8, 249u8, 185u8, - 24u8, 155u8, 54u8, 88u8, 96u8, 147u8, 171u8, 85u8, 216u8, - 240u8, 52u8, 158u8, 134u8, 72u8, - ] - { - let call = SetPayee { payee }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "(Re-)set the controller of a stash."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- Contains a limited number of reads."] - #[doc = "- Writes are limited to the `origin` account key."] - #[doc = "----------"] - #[doc = "Weight: O(1)"] - #[doc = "DB Weight:"] - #[doc = "- Read: Bonded, Ledger New Controller, Ledger Old Controller"] - #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] - #[doc = "# "] - pub fn set_controller( - &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetController, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 239u8, 105u8, 43u8, 234u8, 201u8, 103u8, 93u8, 252u8, 26u8, - 52u8, 27u8, 23u8, 219u8, 153u8, 195u8, 150u8, 244u8, 13u8, - 24u8, 241u8, 199u8, 160u8, 119u8, 37u8, 55u8, 239u8, 142u8, - 16u8, 80u8, 45u8, 20u8, 233u8, - ] - { - let call = SetController { controller }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the ideal number of validators."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight: O(1)"] - #[doc = "Write: Validator Count"] - #[doc = "# "] - pub fn set_validator_count( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidatorCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 181u8, 82u8, 21u8, 239u8, 81u8, 194u8, 166u8, 66u8, 55u8, - 156u8, 68u8, 22u8, 76u8, 251u8, 241u8, 113u8, 168u8, 8u8, - 193u8, 125u8, 112u8, 82u8, 200u8, 139u8, 55u8, 139u8, 22u8, - 35u8, 171u8, 124u8, 112u8, 52u8, - ] - { - let call = SetValidatorCount { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Increments the ideal number of validators."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`Self::set_validator_count`]."] - #[doc = "# "] - pub fn increase_validator_count( - &self, - additional: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncreaseValidatorCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 219u8, 143u8, 69u8, 205u8, 182u8, 155u8, 101u8, 39u8, 59u8, - 214u8, 81u8, 47u8, 247u8, 54u8, 106u8, 92u8, 183u8, 42u8, - 30u8, 57u8, 28u8, 136u8, 13u8, 13u8, 170u8, 101u8, 216u8, - 234u8, 194u8, 90u8, 248u8, 234u8, - ] - { - let call = IncreaseValidatorCount { additional }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Scale up the ideal number of validators by a factor."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`Self::set_validator_count`]."] - #[doc = "# "] - pub fn scale_validator_count( - &self, - factor: runtime_types::sp_arithmetic::per_things::Percent, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ScaleValidatorCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 170u8, 156u8, 101u8, 109u8, 117u8, 199u8, 38u8, 157u8, 132u8, - 210u8, 54u8, 66u8, 251u8, 10u8, 123u8, 120u8, 237u8, 31u8, - 206u8, 176u8, 224u8, 112u8, 82u8, 70u8, 152u8, 6u8, 166u8, - 118u8, 10u8, 172u8, 254u8, 148u8, - ] - { - let call = ScaleValidatorCount { factor }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force there to be no new eras indefinitely."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# Warning"] - #[doc = ""] - #[doc = "The election process starts multiple blocks before the end of the era."] - #[doc = "Thus the election process may be ongoing when this is called. In this case the"] - #[doc = "election will continue until the next era is triggered."] - #[doc = ""] - #[doc = "# "] - #[doc = "- No arguments."] - #[doc = "- Weight: O(1)"] - #[doc = "- Write: ForceEra"] - #[doc = "# "] - pub fn force_no_eras( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNoEras, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 16u8, 81u8, 207u8, 168u8, 23u8, 236u8, 11u8, 75u8, 141u8, - 107u8, 92u8, 2u8, 53u8, 111u8, 252u8, 116u8, 91u8, 120u8, - 75u8, 24u8, 125u8, 53u8, 9u8, 28u8, 242u8, 87u8, 245u8, 55u8, - 40u8, 103u8, 151u8, 178u8, - ] - { - let call = ForceNoEras {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] - #[doc = "reset to normal (non-forced) behaviour."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# Warning"] - #[doc = ""] - #[doc = "The election process starts multiple blocks before the end of the era."] - #[doc = "If this is called just before a new era is triggered, the election process may not"] - #[doc = "have enough blocks to get a result."] - #[doc = ""] - #[doc = "# "] - #[doc = "- No arguments."] - #[doc = "- Weight: O(1)"] - #[doc = "- Write ForceEra"] - #[doc = "# "] - pub fn force_new_era( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNewEra, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 230u8, 242u8, 169u8, 196u8, 78u8, 145u8, 24u8, 191u8, 113u8, - 68u8, 5u8, 138u8, 48u8, 51u8, 109u8, 126u8, 73u8, 136u8, - 162u8, 158u8, 174u8, 201u8, 213u8, 230u8, 215u8, 44u8, 200u8, - 32u8, 75u8, 27u8, 23u8, 254u8, - ] - { - let call = ForceNewEra {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the validators who cannot be slashed (if any)."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - pub fn set_invulnerables( - &self, - invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetInvulnerables, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 0u8, 119u8, 27u8, 243u8, 238u8, 65u8, 133u8, 89u8, 210u8, - 202u8, 154u8, 243u8, 168u8, 158u8, 9u8, 147u8, 146u8, 215u8, - 172u8, 28u8, 171u8, 183u8, 112u8, 42u8, 245u8, 232u8, 238u8, - 94u8, 205u8, 46u8, 0u8, 20u8, - ] - { - let call = SetInvulnerables { invulnerables }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force a current staker to become completely unstaked, immediately."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - pub fn force_unstake( - &self, - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnstake, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 254u8, 115u8, 250u8, 15u8, 235u8, 119u8, 2u8, 131u8, 237u8, - 144u8, 247u8, 66u8, 150u8, 92u8, 12u8, 112u8, 137u8, 195u8, - 246u8, 178u8, 129u8, 64u8, 214u8, 4u8, 183u8, 18u8, 94u8, - 104u8, 157u8, 174u8, 231u8, 1u8, - ] - { - let call = ForceUnstake { - stash, - num_slashing_spans, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force there to be a new era at the end of sessions indefinitely."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# Warning"] - #[doc = ""] - #[doc = "The election process starts multiple blocks before the end of the era."] - #[doc = "If this is called just before a new era is triggered, the election process may not"] - #[doc = "have enough blocks to get a result."] - pub fn force_new_era_always( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNewEraAlways, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 179u8, 118u8, 189u8, 54u8, 248u8, 141u8, 207u8, 142u8, 80u8, - 37u8, 241u8, 185u8, 138u8, 254u8, 117u8, 147u8, 225u8, 118u8, - 34u8, 177u8, 197u8, 158u8, 8u8, 82u8, 202u8, 108u8, 208u8, - 26u8, 64u8, 33u8, 74u8, 43u8, - ] - { - let call = ForceNewEraAlways {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel enactment of a deferred slash."] - #[doc = ""] - #[doc = "Can be called by the `T::SlashCancelOrigin`."] - #[doc = ""] - #[doc = "Parameters: era and indices of the slashes for that era to kill."] - pub fn cancel_deferred_slash( - &self, - era: ::core::primitive::u32, - slash_indices: ::std::vec::Vec<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelDeferredSlash, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 217u8, 175u8, 246u8, 108u8, 78u8, 134u8, 98u8, 49u8, 178u8, - 209u8, 98u8, 178u8, 52u8, 242u8, 173u8, 135u8, 171u8, 70u8, - 129u8, 239u8, 62u8, 150u8, 84u8, 142u8, 243u8, 193u8, 179u8, - 249u8, 114u8, 231u8, 8u8, 252u8, - ] - { - let call = CancelDeferredSlash { era, slash_indices }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Pay out all the stakers behind a single validator for a single era."] - #[doc = ""] - #[doc = "- `validator_stash` is the stash account of the validator. Their nominators, up to"] - #[doc = " `T::MaxNominatorRewardedPerValidator`, will also receive their rewards."] - #[doc = "- `era` may be any era between `[current_era - history_depth; current_era]`."] - #[doc = ""] - #[doc = "The origin of this call must be _Signed_. Any account can call this function, even if"] - #[doc = "it is not one of the stakers."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Time complexity: at most O(MaxNominatorRewardedPerValidator)."] - #[doc = "- Contains a limited number of reads and writes."] - #[doc = "-----------"] - #[doc = "N is the Number of payouts for the validator (including the validator)"] - #[doc = "Weight:"] - #[doc = "- Reward Destination Staked: O(N)"] - #[doc = "- Reward Destination Controller (Creating): O(N)"] - #[doc = ""] - #[doc = " NOTE: weights are assuming that payouts are made to alive stash account (Staked)."] - #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] - #[doc = "# "] - pub fn payout_stakers( - &self, - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PayoutStakers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 235u8, 65u8, 65u8, 249u8, 162u8, 235u8, 127u8, 48u8, 216u8, - 51u8, 252u8, 111u8, 186u8, 191u8, 174u8, 245u8, 144u8, 77u8, - 135u8, 124u8, 205u8, 160u8, 148u8, 130u8, 81u8, 213u8, 195u8, - 105u8, 21u8, 65u8, 186u8, 157u8, - ] - { - let call = PayoutStakers { - validator_stash, - era, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Rebond a portion of the stash scheduled to be unlocked."] - #[doc = ""] - #[doc = "The dispatch origin must be signed by the controller."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Time complexity: O(L), where L is unlocking chunks"] - #[doc = "- Bounded by `MaxUnlockingChunks`."] - #[doc = "- Storage changes: Can't increase storage, only decrease it."] - #[doc = "# "] - pub fn rebond( - &self, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Rebond, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 138u8, 156u8, 164u8, 170u8, 178u8, 236u8, 221u8, 242u8, - 157u8, 176u8, 173u8, 145u8, 254u8, 94u8, 158u8, 27u8, 138u8, - 103u8, 116u8, 31u8, 41u8, 106u8, 199u8, 180u8, 233u8, 172u8, - 38u8, 7u8, 76u8, 29u8, 5u8, 225u8, - ] - { - let call = Rebond { value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set `HistoryDepth` value. This function will delete any history information"] - #[doc = "when `HistoryDepth` is reduced."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `new_history_depth`: The new history depth you would like to set."] - #[doc = "- `era_items_deleted`: The number of items that will be deleted by this dispatch. This"] - #[doc = " should report all the storage items that will be deleted by clearing old era history."] - #[doc = " Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an"] - #[doc = " accurate number."] - #[doc = ""] - #[doc = "Origin must be root."] - #[doc = ""] - #[doc = "# "] - #[doc = "- E: Number of history depths removed, i.e. 10 -> 7 = 3"] - #[doc = "- Weight: O(E)"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Current Era, History Depth"] - #[doc = " - Writes: History Depth"] - #[doc = " - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs"] - #[doc = " - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,"] - #[doc = " ErasStartSessionIndex"] - #[doc = "# "] - pub fn set_history_depth( - &self, - new_history_depth: ::core::primitive::u32, - era_items_deleted: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHistoryDepth, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 128u8, 149u8, 139u8, 192u8, 213u8, 239u8, 248u8, 215u8, 57u8, - 145u8, 177u8, 225u8, 43u8, 214u8, 228u8, 14u8, 213u8, 181u8, - 18u8, 40u8, 242u8, 1u8, 210u8, 87u8, 143u8, 78u8, 0u8, 23u8, - 145u8, 46u8, 210u8, 168u8, - ] - { - let call = SetHistoryDepth { - new_history_depth, - era_items_deleted, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] - #[doc = "be considered `dust` in the staking system. The requirements are:"] - #[doc = ""] - #[doc = "1. the `total_balance` of the stash is below existential deposit."] - #[doc = "2. or, the `ledger.total` of the stash is below existential deposit."] - #[doc = ""] - #[doc = "The former can happen in cases like a slash; the latter when a fully unbonded account"] - #[doc = "is still receiving staking rewards in `RewardDestination::Staked`."] - #[doc = ""] - #[doc = "It can be called by anyone, as long as `stash` meets the above requirements."] - #[doc = ""] - #[doc = "Refunds the transaction fees upon successful execution."] - pub fn reap_stash( - &self, - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReapStash, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 84u8, 192u8, 207u8, 193u8, 133u8, 53u8, 93u8, 148u8, 153u8, - 112u8, 54u8, 145u8, 68u8, 195u8, 42u8, 158u8, 17u8, 230u8, - 197u8, 218u8, 179u8, 101u8, 237u8, 105u8, 17u8, 232u8, 125u8, - 163u8, 209u8, 134u8, 3u8, 248u8, - ] - { - let call = ReapStash { - stash, - num_slashing_spans, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the given nominations from the calling validator."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "- `who`: A list of nominator stash accounts who are nominating this validator which"] - #[doc = " should no longer be nominating this validator."] - #[doc = ""] - #[doc = "Note: Making this call only makes sense if you first set the validator preferences to"] - #[doc = "block any further nominations."] - pub fn kick( - &self, - who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Kick, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 145u8, 201u8, 168u8, 147u8, 25u8, 39u8, 62u8, 48u8, 236u8, - 44u8, 45u8, 233u8, 178u8, 196u8, 117u8, 117u8, 74u8, 193u8, - 131u8, 101u8, 210u8, 40u8, 18u8, 207u8, 99u8, 160u8, 103u8, - 89u8, 69u8, 72u8, 155u8, 89u8, - ] - { - let call = Kick { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Update the various staking configurations ."] - #[doc = ""] - #[doc = "* `min_nominator_bond`: The minimum active bond needed to be a nominator."] - #[doc = "* `min_validator_bond`: The minimum active bond needed to be a validator."] - #[doc = "* `max_nominator_count`: The max number of users who can be a nominator at once. When"] - #[doc = " set to `None`, no limit is enforced."] - #[doc = "* `max_validator_count`: The max number of users who can be a validator at once. When"] - #[doc = " set to `None`, no limit is enforced."] - #[doc = "* `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which"] - #[doc = " should be filled in order for the `chill_other` transaction to work."] - #[doc = "* `min_commission`: The minimum amount of commission that each validators must maintain."] - #[doc = " This is checked only upon calling `validate`. Existing validators are not affected."] - #[doc = ""] - #[doc = "Origin must be Root to call this function."] - #[doc = ""] - #[doc = "NOTE: Existing nominators and validators will not be affected by this update."] - #[doc = "to kick people under the new limits, `chill_other` should be called."] - pub fn set_staking_configs( - &self, - min_nominator_bond : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u128 >, - min_validator_bond : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u128 >, - max_nominator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, - max_validator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, - chill_threshold : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Percent >, - min_commission : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Perbill >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetStakingConfigs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 249u8, 192u8, 107u8, 126u8, 200u8, 50u8, 63u8, 120u8, 116u8, - 53u8, 183u8, 80u8, 134u8, 135u8, 49u8, 112u8, 232u8, 140u8, - 177u8, 175u8, 136u8, 220u8, 209u8, 179u8, 219u8, 110u8, 19u8, - 165u8, 191u8, 173u8, 65u8, 13u8, - ] - { - let call = SetStakingConfigs { - min_nominator_bond, - min_validator_bond, - max_nominator_count, - max_validator_count, - chill_threshold, - min_commission, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_, but can be called by anyone."] - #[doc = ""] - #[doc = "If the caller is the same as the controller being targeted, then no further checks are"] - #[doc = "enforced, and this function behaves just like `chill`."] - #[doc = ""] - #[doc = "If the caller is different than the controller being targeted, the following conditions"] - #[doc = "must be met:"] - #[doc = ""] - #[doc = "* `controller` must belong to a nominator who has become non-decodable,"] - #[doc = ""] - #[doc = "Or:"] - #[doc = ""] - #[doc = "* A `ChillThreshold` must be set and checked which defines how close to the max"] - #[doc = " nominators or validators we must reach before users can start chilling one-another."] - #[doc = "* A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine"] - #[doc = " how close we are to the threshold."] - #[doc = "* A `MinNominatorBond` and `MinValidatorBond` must be set and checked, which determines"] - #[doc = " if this is a person that should be chilled because they have not met the threshold"] - #[doc = " bond required."] - #[doc = ""] - #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] - #[doc = "who do not satisfy these requirements."] - pub fn chill_other( - &self, - controller: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ChillOther, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 219u8, 114u8, 146u8, 43u8, 175u8, 216u8, 70u8, 148u8, 137u8, - 192u8, 77u8, 247u8, 134u8, 80u8, 188u8, 100u8, 79u8, 141u8, - 32u8, 94u8, 15u8, 178u8, 159u8, 233u8, 235u8, 6u8, 243u8, - 253u8, 22u8, 145u8, 146u8, 219u8, - ] - { - let call = ChillOther { controller }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] - #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] - #[doc = "can call this."] - pub fn force_apply_min_commission( - &self, - validator_stash: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceApplyMinCommission, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 8u8, 57u8, 61u8, 141u8, 175u8, 100u8, 174u8, 161u8, 236u8, - 2u8, 133u8, 169u8, 249u8, 168u8, 236u8, 188u8, 168u8, 221u8, - 88u8, 148u8, 95u8, 24u8, 214u8, 206u8, 165u8, 170u8, 200u8, - 134u8, 38u8, 174u8, 187u8, 119u8, - ] - { - let call = ForceApplyMinCommission { validator_stash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] - #[doc = "the remainder from the maximum amount of reward."] - #[doc = "\\[era_index, validator_payout, remainder\\]"] - pub struct EraPaid( - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for EraPaid { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "EraPaid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] - pub struct Rewarded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Rewarded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Rewarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "One validator (and its nominators) has been slashed by the given amount."] - #[doc = "\\[validator, amount\\]"] - pub struct Slashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Slashed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "An old slashing report from a prior era was discarded because it could"] - #[doc = "not be processed. \\[session_index\\]"] - pub struct OldSlashingReportDiscarded(pub ::core::primitive::u32); - impl ::subxt::Event for OldSlashingReportDiscarded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "OldSlashingReportDiscarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new set of stakers was elected."] - pub struct StakersElected; - impl ::subxt::Event for StakersElected { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "StakersElected"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has bonded this amount. \\[stash, amount\\]"] - #[doc = ""] - #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] - #[doc = "it will not be emitted for staking rewards when they are added to stake."] - pub struct Bonded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Bonded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Bonded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] - pub struct Unbonded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Unbonded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Unbonded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] - #[doc = "from the unlocking queue. \\[stash, amount\\]"] - pub struct Withdrawn( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Withdrawn { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Withdrawn"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] - pub struct Kicked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Kicked { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Kicked"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The election failed. No new era is planned."] - pub struct StakingElectionFailed; - impl ::subxt::Event for StakingElectionFailed { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "StakingElectionFailed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has stopped participating as either a validator or nominator."] - #[doc = "\\[stash\\]"] - pub struct Chilled(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Chilled { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Chilled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] - pub struct PayoutStarted( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for PayoutStarted { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "PayoutStarted"; - } - } - pub mod storage { - use super::runtime_types; - pub struct HistoryDepth; - impl ::subxt::StorageEntry for HistoryDepth { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "HistoryDepth"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorCount; - impl ::subxt::StorageEntry for ValidatorCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ValidatorCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MinimumValidatorCount; - impl ::subxt::StorageEntry for MinimumValidatorCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinimumValidatorCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Invulnerables; - impl ::subxt::StorageEntry for Invulnerables { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Invulnerables"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bonded<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Bonded<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Bonded"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MinNominatorBond; - impl ::subxt::StorageEntry for MinNominatorBond { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinNominatorBond"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MinValidatorBond; - impl ::subxt::StorageEntry for MinValidatorBond { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinValidatorBond"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MinCommission; - impl ::subxt::StorageEntry for MinCommission { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MinCommission"; - type Value = runtime_types::sp_arithmetic::per_things::Perbill; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Ledger<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Ledger<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Ledger"; - type Value = runtime_types::pallet_staking::StakingLedger< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Payee<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Payee<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Payee"; - type Value = runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Validators<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Validators<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Validators"; - type Value = runtime_types::pallet_staking::ValidatorPrefs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CounterForValidators; - impl ::subxt::StorageEntry for CounterForValidators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CounterForValidators"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxValidatorsCount; - impl ::subxt::StorageEntry for MaxValidatorsCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MaxValidatorsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Nominators<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Nominators<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "Nominators"; - type Value = runtime_types::pallet_staking::Nominations; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CounterForNominators; - impl ::subxt::StorageEntry for CounterForNominators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CounterForNominators"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxNominatorsCount; - impl ::subxt::StorageEntry for MaxNominatorsCount { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "MaxNominatorsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentEra; - impl ::subxt::StorageEntry for CurrentEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CurrentEra"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveEra; - impl ::subxt::StorageEntry for ActiveEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ActiveEra"; - type Value = runtime_types::pallet_staking::ActiveEraInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ErasStartSessionIndex<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasStartSessionIndex<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStartSessionIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasStakers<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ErasStakers<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStakers"; - type Value = runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ErasStakersClipped<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ErasStakersClipped<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStakersClipped"; - type Value = runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ErasValidatorPrefs<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ErasValidatorPrefs<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasValidatorPrefs"; - type Value = runtime_types::pallet_staking::ValidatorPrefs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ErasValidatorReward<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasValidatorReward<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasValidatorReward"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasRewardPoints<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasRewardPoints<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasRewardPoints"; - type Value = runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasTotalStake<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ErasTotalStake<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasTotalStake"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ForceEra; - impl ::subxt::StorageEntry for ForceEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ForceEra"; - type Value = runtime_types::pallet_staking::Forcing; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SlashRewardFraction; - impl ::subxt::StorageEntry for SlashRewardFraction { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SlashRewardFraction"; - type Value = runtime_types::sp_arithmetic::per_things::Perbill; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CanceledSlashPayout; - impl ::subxt::StorageEntry for CanceledSlashPayout { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CanceledSlashPayout"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnappliedSlashes<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for UnappliedSlashes<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "UnappliedSlashes"; - type Value = ::std::vec::Vec< - runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BondedEras; - impl ::subxt::StorageEntry for BondedEras { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "BondedEras"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorSlashInEra<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ValidatorSlashInEra<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ValidatorSlashInEra"; - type Value = ( - runtime_types::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct NominatorSlashInEra<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for NominatorSlashInEra<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "NominatorSlashInEra"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct SlashingSpans<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SlashingSpans<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SlashingSpans"; - type Value = runtime_types::pallet_staking::slashing::SlashingSpans; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct SpanSlash<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for SpanSlash<'_> { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SpanSlash"; - type Value = runtime_types::pallet_staking::slashing::SpanRecord< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct EarliestUnappliedSlash; - impl ::subxt::StorageEntry for EarliestUnappliedSlash { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "EarliestUnappliedSlash"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentPlannedSession; - impl ::subxt::StorageEntry for CurrentPlannedSession { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CurrentPlannedSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct OffendingValidators; - impl ::subxt::StorageEntry for OffendingValidators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "OffendingValidators"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_staking::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ChillThreshold; - impl ::subxt::StorageEntry for ChillThreshold { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ChillThreshold"; - type Value = runtime_types::sp_arithmetic::per_things::Percent; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Number of eras to keep in history."] - #[doc = ""] - #[doc = " Information is kept for eras in `[current_era - history_depth; current_era]`."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The ideal number of staking participants."] - pub async fn validator_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Minimum number of staking participants before emergency conditions are imposed."] - pub async fn minimum_validator_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Map from all locked \"stash\" accounts to the controller account."] - pub async fn bonded( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The minimum active bond to become and maintain the role of a nominator."] - pub async fn min_nominator_bond( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The minimum active bond to become and maintain the role of a validator."] - pub async fn min_validator_bond( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The minimum amount of commission that validators can set."] - #[doc = ""] - #[doc = " If set to `0`, no limit exists."] - pub async fn min_commission( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] - pub async fn ledger( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::StakingLedger< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().storage_hash::()? - == [ - 91u8, 46u8, 130u8, 228u8, 126u8, 95u8, 46u8, 57u8, 222u8, - 98u8, 250u8, 145u8, 83u8, 135u8, 240u8, 153u8, 57u8, 21u8, - 232u8, 254u8, 217u8, 22u8, 62u8, 76u8, 128u8, 159u8, 137u8, - 149u8, 112u8, 251u8, 142u8, 35u8, - ] - { - let entry = Ledger(_0); - self.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, - > { - if self.client.metadata().storage_hash::()? - == [ - 91u8, 46u8, 130u8, 228u8, 126u8, 95u8, 46u8, 57u8, 222u8, - 98u8, 250u8, 145u8, 83u8, 135u8, 240u8, 153u8, 57u8, 21u8, - 232u8, 254u8, 217u8, 22u8, 62u8, 76u8, 128u8, 159u8, 137u8, - 149u8, 112u8, 251u8, 142u8, 35u8, - ] - { - self.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( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = "Counter for the related counted storage map"] - pub async fn counter_for_validators( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] - #[doc = " they wish to support."] - #[doc = ""] - #[doc = " Note that the keys of this storage map might become non-decodable in case the"] - #[doc = " [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators"] - #[doc = " are still existent in storage, their key is correct and retrievable (i.e. `contains_key`"] - #[doc = " indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable"] - #[doc = " nominators will effectively not-exist, until they re-submit their preferences such that it"] - #[doc = " is within the bounds of the newly set `Config::MaxNominations`."] - #[doc = ""] - #[doc = " This implies that `::iter_keys().count()` and `::iter().count()` might return different"] - #[doc = " values for this map. Moreover, the main `::count()` is aligned with the former, namely the"] - #[doc = " number of keys that exist."] - #[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( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] - #[doc = " they wish to support."] - #[doc = ""] - #[doc = " Note that the keys of this storage map might become non-decodable in case the"] - #[doc = " [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators"] - #[doc = " are still existent in storage, their key is correct and retrievable (i.e. `contains_key`"] - #[doc = " indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable"] - #[doc = " nominators will effectively not-exist, until they re-submit their preferences such that it"] - #[doc = " is within the bounds of the newly set `Config::MaxNominations`."] - #[doc = ""] - #[doc = " This implies that `::iter_keys().count()` and `::iter().count()` might return different"] - #[doc = " values for this map. Moreover, the main `::count()` is aligned with the former, namely the"] - #[doc = " number of keys that exist."] - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = "Counter for the related counted storage map"] - pub async fn counter_for_nominators( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Exposure of validator at era."] - #[doc = ""] - #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] - #[doc = ""] - #[doc = " Is it removed after `HISTORY_DEPTH` eras."] - #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] - pub async fn eras_stakers( - &self, - _0: &::core::primitive::u32, - _1: &::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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Exposure of validator at era."] - #[doc = ""] - #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] - #[doc = ""] - #[doc = " Is it removed after `HISTORY_DEPTH` eras."] - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Clipped Exposure of validator at era."] - #[doc = ""] - #[doc = " This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the"] - #[doc = " `T::MaxNominatorRewardedPerValidator` biggest stakers."] - #[doc = " (Note: the field `total` and `own` of the exposure remains unchanged)."] - #[doc = " This is used to limit the i/o cost for the nominator payout."] - #[doc = ""] - #[doc = " This is keyed fist by the era index to allow bulk deletion and then the stash account."] - #[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( - &self, - _0: &::core::primitive::u32, - _1: &::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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Clipped Exposure of validator at era."] - #[doc = ""] - #[doc = " This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the"] - #[doc = " `T::MaxNominatorRewardedPerValidator` biggest stakers."] - #[doc = " (Note: the field `total` and `own` of the exposure remains unchanged)."] - #[doc = " This is used to limit the i/o cost for the nominator payout."] - #[doc = ""] - #[doc = " This is keyed fist by the era index to allow bulk deletion and then the stash account."] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] - #[doc = ""] - #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] - #[doc = ""] - #[doc = " Is it removed after `HISTORY_DEPTH` eras."] - pub 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] - #[doc = ""] - #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] - #[doc = ""] - #[doc = " Is it removed after `HISTORY_DEPTH` eras."] - pub async fn eras_validator_prefs_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorPrefs<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[doc = " All unapplied slashes that are queued for later."] - pub async fn unapplied_slashes( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - _1: &::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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Slashing spans for stash accounts."] - pub async fn slashing_spans( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::slashing::SlashingSpans, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::slashing::SpanRecord< - ::core::primitive::u128, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Indices of validators that have offended in the active era and whether they are currently"] - #[doc = " disabled."] - #[doc = ""] - #[doc = " This value should be a superset of disabled validators since not all offences lead to the"] - #[doc = " validator being disabled (if there was no slash). This is needed to track the percentage of"] - #[doc = " validators that have offended in the current era, ensuring a new era is forced if"] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Maximum number of nominations per nominator."] - pub fn max_nominations( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Staking", "MaxNominations")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Staking")?; - let constant = pallet.constant("MaxNominations")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of sessions per era."] - pub fn sessions_per_era( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Staking", "SessionsPerEra")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Staking")?; - let constant = pallet.constant("SessionsPerEra")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of eras that staked funds must remain bonded for."] - pub fn bonding_duration( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Staking", "BondingDuration")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Staking")?; - let constant = pallet.constant("BondingDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of eras that slashes are deferred by, after computation."] - #[doc = ""] - #[doc = " This should be less than the bonding duration. Set to 0 if slashes"] - #[doc = " should be applied immediately, without opportunity for intervention."] - pub fn slash_defer_duration( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Staking", "SlashDeferDuration")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Staking")?; - let constant = pallet.constant("SlashDeferDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of nominators rewarded for each validator."] - #[doc = ""] - #[doc = " For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can"] - #[doc = " claim their reward. This used to limit the i/o cost for the nominator payout."] - pub fn max_nominator_rewarded_per_validator( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Staking", "MaxNominatorRewardedPerValidator")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Staking")?; - let constant = - pallet.constant("MaxNominatorRewardedPerValidator")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively"] - #[doc = " determines how many unique eras a staker may be unbonding in."] - pub fn max_unlocking_chunks( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Staking", "MaxUnlockingChunks")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Staking")?; - let constant = pallet.constant("MaxUnlockingChunks")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod offences { - use super::{ - root_mod, - runtime_types, - }; - pub type Event = runtime_types::pallet_offences::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] - #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] - #[doc = "\\[kind, timeslot\\]."] - pub struct Offence { - pub kind: [::core::primitive::u8; 16usize], - pub timeslot: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Event for Offence { - const PALLET: &'static str = "Offences"; - const EVENT: &'static str = "Offence"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Reports<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reports<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "Reports"; - type Value = runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::sp_core::crypto::AccountId32, - ( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ConcurrentReportsIndex<'a>( - pub &'a [::core::primitive::u8; 16usize], - pub &'a [::core::primitive::u8], - ); - impl ::subxt::StorageEntry for ConcurrentReportsIndex<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ConcurrentReportsIndex"; - type Value = ::std::vec::Vec<::subxt::sp_core::H256>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ReportsByKindIndex<'a>(pub &'a [::core::primitive::u8; 16usize]); - impl ::subxt::StorageEntry for ReportsByKindIndex<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub async fn reports( - &self, - _0: &::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, - ( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ), - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Enumerates all reports of a kind along with the time they happened."] - #[doc = ""] - #[doc = " All reports are sorted by the time of offence."] - #[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( - &self, - _0: &[::core::primitive::u8; 16usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Enumerates all reports of a kind along with the time they happened."] - #[doc = ""] - #[doc = " All reports are sorted by the time of offence."] - #[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, - > { - if self - .client - .metadata() - .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 mod historical { - use super::{ - root_mod, - runtime_types, - }; - } - pub mod session { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetKeys { - pub keys: runtime_types::polkadot_runtime::SessionKeys, - pub proof: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for SetKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "set_keys"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PurgeKeys; - impl ::subxt::Call for PurgeKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "purge_keys"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Sets the session key(s) of the function caller to `keys`."] - #[doc = "Allows an account to set its session key prior to becoming a validator."] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be signed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] - #[doc = " `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] - #[doc = "- DbWrites: `origin account`, `NextKeys`"] - #[doc = "- DbReads per key id: `KeyOwner`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - pub fn set_keys( - &self, - keys: runtime_types::polkadot_runtime::SessionKeys, - proof: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetKeys, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 194u8, 88u8, 145u8, 74u8, 215u8, 181u8, 126u8, 21u8, 193u8, - 174u8, 42u8, 142u8, 229u8, 213u8, 104u8, 36u8, 134u8, 83u8, - 245u8, 106u8, 9u8, 42u8, 75u8, 206u8, 161u8, 248u8, 232u8, - 31u8, 160u8, 213u8, 70u8, 228u8, - ] - { - let call = SetKeys { keys, proof }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Removes any session key(s) of the function caller."] - #[doc = ""] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] - #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] - #[doc = "means being a controller account) or directly convertible into a validator ID (which"] - #[doc = "usually means being a stash account)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] - #[doc = " of `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] - #[doc = "- DbWrites: `NextKeys`, `origin account`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - pub fn purge_keys( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PurgeKeys, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 200u8, 255u8, 4u8, 213u8, 188u8, 92u8, 99u8, 116u8, 163u8, - 152u8, 29u8, 35u8, 133u8, 119u8, 246u8, 44u8, 91u8, 31u8, - 145u8, 23u8, 213u8, 64u8, 71u8, 242u8, 207u8, 239u8, 231u8, - 37u8, 61u8, 63u8, 190u8, 35u8, - ] - { - let call = PurgeKeys {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_session::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "New session has happened. Note that the argument is the session index, not the"] - #[doc = "block number as the type might suggest."] - pub struct NewSession { - pub session_index: ::core::primitive::u32, - } - impl ::subxt::Event for NewSession { - const PALLET: &'static str = "Session"; - const EVENT: &'static str = "NewSession"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Validators; - impl ::subxt::StorageEntry for Validators { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "Validators"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentIndex; - impl ::subxt::StorageEntry for CurrentIndex { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "CurrentIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedChanged; - impl ::subxt::StorageEntry for QueuedChanged { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "QueuedChanged"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedKeys; - impl ::subxt::StorageEntry for QueuedKeys { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "QueuedKeys"; - type Value = ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::SessionKeys, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DisabledValidators; - impl ::subxt::StorageEntry for DisabledValidators { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "DisabledValidators"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextKeys<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for NextKeys<'_> { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::polkadot_runtime::SessionKeys; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct KeyOwner<'a>( - pub &'a runtime_types::sp_core::crypto::KeyTypeId, - pub &'a [::core::primitive::u8], - ); - impl ::subxt::StorageEntry for KeyOwner<'_> { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "KeyOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current set of validators."] - pub async fn validators( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Current index of the session."] - pub async fn current_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::SessionKeys, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Indices of disabled validators."] - #[doc = ""] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The next session keys for a validator."] - pub async fn next_keys( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub async fn key_owner( - &self, - _0: &runtime_types::sp_core::crypto::KeyTypeId, - _1: &[::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod grandpa { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReportEquivocation { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NoteStalled { - pub delay: ::core::primitive::u32, - pub best_finalized_block_number: ::core::primitive::u32, - } - impl ::subxt::Call for NoteStalled { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "note_stalled"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - pub fn report_equivocation( - &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocation, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 230u8, 252u8, 24u8, 207u8, 164u8, 127u8, 177u8, 30u8, 113u8, - 175u8, 207u8, 252u8, 230u8, 225u8, 181u8, 190u8, 236u8, - 110u8, 145u8, 168u8, 200u8, 134u8, 88u8, 234u8, 231u8, 45u8, - 149u8, 169u8, 155u8, 114u8, 62u8, 65u8, - ] - { - let call = ReportEquivocation { - equivocation_proof: ::std::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_equivocation_unsigned( - &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocationUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 141u8, 235u8, 27u8, 135u8, 124u8, 124u8, 234u8, 51u8, 100u8, - 105u8, 188u8, 248u8, 133u8, 10u8, 84u8, 14u8, 40u8, 235u8, - 14u8, 107u8, 63u8, 148u8, 107u8, 172u8, 136u8, 159u8, 86u8, - 23u8, 145u8, 221u8, 93u8, 206u8, - ] - { - let call = ReportEquivocationUnsigned { - equivocation_proof: ::std::boxed::Box::new( - equivocation_proof, - ), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - 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 = "Only callable by root."] - pub fn note_stalled( - &self, - delay: ::core::primitive::u32, - best_finalized_block_number: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteStalled, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 227u8, 98u8, 249u8, 158u8, 96u8, 124u8, 72u8, 188u8, 27u8, - 215u8, 73u8, 62u8, 103u8, 79u8, 38u8, 48u8, 212u8, 88u8, - 233u8, 187u8, 11u8, 95u8, 39u8, 247u8, 55u8, 184u8, 228u8, - 102u8, 13u8, 251u8, 52u8, 206u8, - ] - { - let call = NoteStalled { - delay, - best_finalized_block_number, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_grandpa::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "New authority set has been applied."] - pub struct NewAuthorities { - pub authority_set: ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - } - impl ::subxt::Event for NewAuthorities { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "NewAuthorities"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Current authority set has been paused."] - pub struct Paused; - impl ::subxt::Event for Paused { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Paused"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Current authority set has been resumed."] - pub struct Resumed; - impl ::subxt::Event for Resumed { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Resumed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct State; - impl ::subxt::StorageEntry for State { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "State"; - type Value = - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingChange; - impl ::subxt::StorageEntry for PendingChange { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "PendingChange"; - type Value = runtime_types::pallet_grandpa::StoredPendingChange< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextForced; - impl ::subxt::StorageEntry for NextForced { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "NextForced"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Stalled; - impl ::subxt::StorageEntry for Stalled { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "Stalled"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentSetId; - impl ::subxt::StorageEntry for CurrentSetId { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "CurrentSetId"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SetIdSession<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for SetIdSession<'_> { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "SetIdSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " State of the current authority set."] - pub async fn state( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " Pending change: (signaled at, scheduled change)."] - pub async fn pending_change( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " `true` if we are currently stalled."] - pub async fn stalled( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Max Authorities in use"] - pub fn max_authorities( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Grandpa", "MaxAuthorities")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Grandpa")?; - let constant = pallet.constant("MaxAuthorities")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod im_online { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Heartbeat { - pub heartbeat: - runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, - pub signature: - runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, - } - impl ::subxt::Call for Heartbeat { - const PALLET: &'static str = "ImOnline"; - const FUNCTION: &'static str = "heartbeat"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "# "] - #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] - #[doc = " length of `heartbeat.network_state.external_address`"] - #[doc = " - `O(K)`: decoding of length `K`"] - #[doc = " - `O(E)`: decoding/encoding of length `E`"] - #[doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] - #[doc = " `ReceivedHeartbeats`"] - #[doc = "- DbWrites: `ReceivedHeartbeats`"] - #[doc = "# "] - pub fn heartbeat( - &self, - heartbeat: runtime_types::pallet_im_online::Heartbeat< - ::core::primitive::u32, - >, - signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Heartbeat, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 246u8, 83u8, 28u8, 233u8, 69u8, 55u8, 28u8, 178u8, 82u8, - 159u8, 56u8, 241u8, 111u8, 78u8, 194u8, 15u8, 14u8, 250u8, - 172u8, 148u8, 208u8, 52u8, 33u8, 106u8, 159u8, 210u8, 196u8, - 79u8, 138u8, 194u8, 150u8, 201u8, - ] - { - let call = Heartbeat { - heartbeat, - signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_im_online::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new heartbeat was received from `AuthorityId`."] - pub struct HeartbeatReceived { - pub authority_id: - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - } - impl ::subxt::Event for HeartbeatReceived { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "HeartbeatReceived"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "At the end of the session, no offence was committed."] - pub struct AllGood; - impl ::subxt::Event for AllGood { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "AllGood"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "At the end of the session, at least one validator was found to be offline."] - pub struct SomeOffline { - pub offline: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - )>, - } - impl ::subxt::Event for SomeOffline { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "SomeOffline"; - } - } - pub mod storage { - use super::runtime_types; - pub struct HeartbeatAfter; - impl ::subxt::StorageEntry for HeartbeatAfter { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "HeartbeatAfter"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Keys; - impl ::subxt::StorageEntry for Keys { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "Keys"; - type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReceivedHeartbeats<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for ReceivedHeartbeats<'_> { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "ReceivedHeartbeats"; - type Value = runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct AuthoredBlocks<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for AuthoredBlocks<'_> { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "AuthoredBlocks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The block number after which it's ok to send heartbeats in the current"] - #[doc = " session."] - #[doc = ""] - #[doc = " At the beginning of each session we set this to a value that should fall"] - #[doc = " roughly in the middle of the session duration. The idea is to first wait for"] - #[doc = " the validators to produce a block in the current session, so that the"] - #[doc = " heartbeat later on will not be necessary."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " 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, - > { - if self - .client - .metadata() - .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 = " 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " A configuration for base priority of unsigned transactions."] - #[doc = ""] - #[doc = " This is exposed so that it can be tuned for particular runtime, when"] - #[doc = " multiple pallets send unsigned transactions."] - pub fn unsigned_priority( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ImOnline", "UnsignedPriority")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self.client.metadata().pallet("ImOnline")?; - let constant = pallet.constant("UnsignedPriority")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod authority_discovery { - use super::{ - root_mod, - runtime_types, - }; - } - pub mod democracy { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Propose { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Second { - #[codec(compact)] - pub proposal: ::core::primitive::u32, - #[codec(compact)] - pub seconds_upper_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Second { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "second"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Vote { - #[codec(compact)] - pub ref_index: ::core::primitive::u32, - pub vote: runtime_types::pallet_democracy::vote::AccountVote< - ::core::primitive::u128, - >, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "vote"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct EmergencyCancel { - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Call for EmergencyCancel { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "emergency_cancel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ExternalPropose { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for ExternalPropose { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "external_propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ExternalProposeMajority { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for ExternalProposeMajority { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "external_propose_majority"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ExternalProposeDefault { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for ExternalProposeDefault { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "external_propose_default"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct FastTrack { - pub proposal_hash: ::subxt::sp_core::H256, - pub voting_period: ::core::primitive::u32, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Call for FastTrack { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "fast_track"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct VetoExternal { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for VetoExternal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "veto_external"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CancelReferendum { - #[codec(compact)] - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Call for CancelReferendum { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_referendum"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct CancelQueued { - pub which: ::core::primitive::u32, - } - impl ::subxt::Call for CancelQueued { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_queued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Delegate { - pub to: ::subxt::sp_core::crypto::AccountId32, - pub conviction: runtime_types::pallet_democracy::conviction::Conviction, - pub balance: ::core::primitive::u128, - } - impl ::subxt::Call for Delegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "delegate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Undelegate; - impl ::subxt::Call for Undelegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "undelegate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClearPublicProposals; - impl ::subxt::Call for ClearPublicProposals { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "clear_public_proposals"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NotePreimage { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for NotePreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NotePreimageOperational { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for NotePreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage_operational"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NoteImminentPreimage { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for NoteImminentPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NoteImminentPreimageOperational { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for NoteImminentPreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage_operational"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReapPreimage { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub proposal_len_upper_bound: ::core::primitive::u32, - } - impl ::subxt::Call for ReapPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "reap_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Unlock { - pub target: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for Unlock { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "unlock"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct RemoveVote { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for RemoveVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveOtherVote { - pub target: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for RemoveOtherVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_other_vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct EnactProposal { - pub proposal_hash: ::subxt::sp_core::H256, - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for EnactProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "enact_proposal"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Blacklist { - pub proposal_hash: ::subxt::sp_core::H256, - pub maybe_ref_index: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for Blacklist { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "blacklist"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CancelProposal { - #[codec(compact)] - pub prop_index: ::core::primitive::u32, - } - impl ::subxt::Call for CancelProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Propose a sensitive action to be taken."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] - #[doc = "have funds to cover the deposit."] - #[doc = ""] - #[doc = "- `proposal_hash`: The hash of the proposal preimage."] - #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] - #[doc = ""] - #[doc = "Emits `Proposed`."] - #[doc = ""] - #[doc = "Weight: `O(p)`"] - pub fn propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 149u8, 60u8, 16u8, 143u8, 114u8, 16u8, 124u8, 96u8, 97u8, - 5u8, 176u8, 137u8, 188u8, 164u8, 65u8, 145u8, 142u8, 104u8, - 74u8, 120u8, 248u8, 90u8, 109u8, 112u8, 29u8, 226u8, 208u8, - 230u8, 101u8, 8u8, 79u8, 12u8, - ] - { - let call = Propose { - proposal_hash, - value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Signals agreement with a particular proposal."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the sender"] - #[doc = "must have funds to cover the deposit, equal to the original deposit."] - #[doc = ""] - #[doc = "- `proposal`: The index of the proposal to second."] - #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] - #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] - #[doc = ""] - #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] - pub fn second( - &self, - proposal: ::core::primitive::u32, - seconds_upper_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Second, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 37u8, 226u8, 138u8, 26u8, 138u8, 46u8, 39u8, 147u8, 22u8, - 32u8, 245u8, 40u8, 49u8, 228u8, 218u8, 225u8, 72u8, 89u8, - 37u8, 90u8, 132u8, 31u8, 52u8, 22u8, 234u8, 124u8, 254u8, - 223u8, 56u8, 215u8, 255u8, 79u8, - ] - { - let call = Second { - proposal, - seconds_upper_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `ref_index`: The index of the referendum to vote for."] - #[doc = "- `vote`: The vote configuration."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] - pub fn vote( - &self, - ref_index: ::core::primitive::u32, - vote: runtime_types::pallet_democracy::vote::AccountVote< - ::core::primitive::u128, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 1u8, 235u8, 77u8, 58u8, 54u8, 224u8, 30u8, 168u8, 150u8, - 169u8, 20u8, 172u8, 137u8, 191u8, 189u8, 184u8, 28u8, 118u8, - 204u8, 233u8, 146u8, 212u8, 45u8, 139u8, 58u8, 175u8, 231u8, - 169u8, 43u8, 164u8, 149u8, 16u8, - ] - { - let call = Vote { ref_index, vote }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] - #[doc = "referendum."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `CancellationOrigin`."] - #[doc = ""] - #[doc = "-`ref_index`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "Weight: `O(1)`."] - pub fn emergency_cancel( - &self, - ref_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - EmergencyCancel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 4u8, 129u8, 205u8, 102u8, 202u8, 197u8, 75u8, 155u8, 24u8, - 125u8, 157u8, 73u8, 50u8, 243u8, 173u8, 103u8, 49u8, 60u8, - 50u8, 63u8, 54u8, 40u8, 34u8, 227u8, 29u8, 247u8, 179u8, - 102u8, 107u8, 177u8, 117u8, 161u8, - ] - { - let call = EmergencyCancel { ref_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] - #[doc = "referendum."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] - #[doc = " Decoding vec of length V. Charged as maximum"] - pub fn external_propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExternalPropose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 50u8, 82u8, 155u8, 206u8, 57u8, 61u8, 64u8, 43u8, 30u8, 71u8, - 89u8, 91u8, 221u8, 46u8, 15u8, 222u8, 15u8, 211u8, 56u8, - 176u8, 84u8, 225u8, 192u8, 92u8, 253u8, 56u8, 207u8, 29u8, - 252u8, 77u8, 245u8, 113u8, - ] - { - let call = ExternalPropose { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] - #[doc = "an external referendum."] - #[doc = ""] - #[doc = "The dispatch of this call must be `ExternalMajorityOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] - #[doc = "pre-scheduled `external_propose` call."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn external_propose_majority( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExternalProposeMajority, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 18u8, 92u8, 204u8, 120u8, 189u8, 60u8, 223u8, 166u8, 213u8, - 49u8, 20u8, 131u8, 202u8, 1u8, 87u8, 226u8, 168u8, 156u8, - 144u8, 110u8, 118u8, 125u8, 81u8, 111u8, 229u8, 244u8, 89u8, - 93u8, 202u8, 140u8, 16u8, 220u8, - ] - { - let call = ExternalProposeMajority { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] - #[doc = "schedule an external referendum."] - #[doc = ""] - #[doc = "The dispatch of this call must be `ExternalDefaultOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] - #[doc = "pre-scheduled `external_propose` call."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn external_propose_default( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExternalProposeDefault, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 51u8, 75u8, 236u8, 51u8, 53u8, 39u8, 26u8, 231u8, 212u8, - 191u8, 175u8, 233u8, 181u8, 156u8, 210u8, 221u8, 181u8, - 182u8, 113u8, 69u8, 171u8, 70u8, 219u8, 133u8, 88u8, 78u8, - 87u8, 228u8, 177u8, 53u8, 111u8, 115u8, - ] - { - let call = ExternalProposeDefault { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] - #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] - #[doc = "but it is not a majority-carries referendum then it fails."] - #[doc = ""] - #[doc = "The dispatch of this call must be `FastTrackOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The hash of the current external proposal."] - #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] - #[doc = " `FastTrackVotingPeriod` if too low."] - #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] - #[doc = " enacted. This doesn't have a minimum amount."] - #[doc = ""] - #[doc = "Emits `Started`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn fast_track( - &self, - proposal_hash: ::subxt::sp_core::H256, - voting_period: ::core::primitive::u32, - delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - FastTrack, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 232u8, 255u8, 150u8, 13u8, 151u8, 28u8, 253u8, 37u8, 183u8, - 127u8, 53u8, 228u8, 160u8, 11u8, 223u8, 48u8, 74u8, 5u8, - 37u8, 3u8, 84u8, 224u8, 79u8, 172u8, 120u8, 220u8, 158u8, - 191u8, 127u8, 55u8, 126u8, 135u8, - ] - { - let call = FastTrack { - proposal_hash, - voting_period, - delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Veto and blacklist the external proposal hash."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `VetoOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal to veto and blacklist."] - #[doc = ""] - #[doc = "Emits `Vetoed`."] - #[doc = ""] - #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] - pub fn veto_external( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - VetoExternal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 230u8, 207u8, 43u8, 137u8, 173u8, 97u8, 143u8, 183u8, 193u8, - 78u8, 252u8, 104u8, 237u8, 32u8, 151u8, 164u8, 91u8, 247u8, - 233u8, 36u8, 198u8, 88u8, 63u8, 176u8, 77u8, 87u8, 26u8, - 242u8, 211u8, 47u8, 193u8, 180u8, - ] - { - let call = VetoExternal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a referendum."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "- `ref_index`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "# Weight: `O(1)`."] - pub fn cancel_referendum( - &self, - ref_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelReferendum, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 107u8, 144u8, 114u8, 224u8, 39u8, 217u8, 156u8, 202u8, 62u8, - 4u8, 196u8, 63u8, 145u8, 196u8, 107u8, 241u8, 3u8, 61u8, - 202u8, 20u8, 123u8, 158u8, 153u8, 45u8, 192u8, 192u8, 244u8, - 42u8, 224u8, 23u8, 243u8, 225u8, - ] - { - let call = CancelReferendum { ref_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a proposal queued for enactment."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "- `which`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] - pub fn cancel_queued( - &self, - which: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelQueued, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 130u8, 218u8, 212u8, 143u8, 89u8, 134u8, 207u8, 161u8, 165u8, - 202u8, 237u8, 237u8, 81u8, 125u8, 165u8, 147u8, 222u8, 198u8, - 236u8, 1u8, 223u8, 74u8, 200u8, 6u8, 208u8, 128u8, 215u8, - 50u8, 46u8, 117u8, 16u8, 143u8, - ] - { - let call = CancelQueued { which }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Delegate the voting power (with some given conviction) of the sending account."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed/consolidated"] - #[doc = " through `reap_vote` or `unvote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] - #[doc = " voted on. Weight is charged as if maximum votes."] - pub fn delegate( - &self, - to: ::subxt::sp_core::crypto::AccountId32, - conviction: runtime_types::pallet_democracy::conviction::Conviction, - balance: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Delegate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 33u8, 155u8, 180u8, 53u8, 39u8, 251u8, 59u8, 100u8, 16u8, - 124u8, 209u8, 40u8, 42u8, 152u8, 3u8, 109u8, 97u8, 211u8, - 129u8, 151u8, 82u8, 45u8, 16u8, 98u8, 114u8, 250u8, 145u8, - 176u8, 244u8, 39u8, 64u8, 11u8, - ] - { - let call = Delegate { - to, - conviction, - balance, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Undelegate the voting power of the sending account."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "Emits `Undelegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] - #[doc = " voted on. Weight is charged as if maximum votes."] - pub fn undelegate( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Undelegate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 165u8, 40u8, 183u8, 209u8, 57u8, 153u8, 111u8, 29u8, 114u8, - 109u8, 107u8, 235u8, 97u8, 61u8, 53u8, 155u8, 44u8, 245u8, - 28u8, 220u8, 56u8, 134u8, 43u8, 122u8, 248u8, 156u8, 191u8, - 154u8, 4u8, 121u8, 152u8, 153u8, - ] - { - let call = Undelegate {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clears all public proposals."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "Weight: `O(1)`."] - pub fn clear_public_proposals( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearPublicProposals, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 59u8, 126u8, 254u8, 223u8, 252u8, 225u8, 75u8, 185u8, 188u8, - 181u8, 42u8, 179u8, 211u8, 73u8, 12u8, 141u8, 243u8, 197u8, - 46u8, 130u8, 215u8, 196u8, 225u8, 88u8, 48u8, 199u8, 231u8, - 249u8, 195u8, 53u8, 184u8, 204u8, - ] - { - let call = ClearPublicProposals {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] - #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - pub fn note_preimage( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NotePreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 121u8, 179u8, 204u8, 32u8, 104u8, 133u8, 99u8, 153u8, 226u8, - 190u8, 89u8, 121u8, 232u8, 154u8, 89u8, 133u8, 124u8, 222u8, - 237u8, 39u8, 50u8, 128u8, 80u8, 115u8, 186u8, 180u8, 151u8, - 139u8, 73u8, 112u8, 148u8, 232u8, - ] - { - let call = NotePreimage { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] - pub fn note_preimage_operational( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NotePreimageOperational, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 102u8, 20u8, 213u8, 32u8, 64u8, 28u8, 150u8, 241u8, 173u8, - 182u8, 201u8, 70u8, 52u8, 211u8, 95u8, 211u8, 127u8, 12u8, - 249u8, 57u8, 128u8, 64u8, 185u8, 239u8, 255u8, 191u8, 203u8, - 222u8, 123u8, 187u8, 106u8, 12u8, - ] - { - let call = NotePreimageOperational { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] - #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] - #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] - #[doc = "no fee is paid."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - pub fn note_imminent_preimage( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteImminentPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 240u8, 77u8, 42u8, 178u8, 110u8, 117u8, 152u8, 158u8, 64u8, - 26u8, 49u8, 37u8, 177u8, 178u8, 203u8, 227u8, 23u8, 251u8, - 242u8, 112u8, 184u8, 234u8, 95u8, 73u8, 86u8, 37u8, 148u8, - 150u8, 6u8, 50u8, 239u8, 64u8, - ] - { - let call = NoteImminentPreimage { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] - pub fn note_imminent_preimage_operational( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteImminentPreimageOperational, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 119u8, 17u8, 140u8, 81u8, 7u8, 103u8, 162u8, 112u8, 160u8, - 179u8, 116u8, 34u8, 126u8, 150u8, 64u8, 117u8, 93u8, 225u8, - 197u8, 40u8, 62u8, 238u8, 174u8, 63u8, 148u8, 248u8, 214u8, - 212u8, 228u8, 86u8, 87u8, 195u8, - ] - { - let call = NoteImminentPreimageOperational { encoded_proposal }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove an expired proposal preimage and collect the deposit."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of a proposal."] - #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] - #[doc = " weighted according to this value with no refund."] - #[doc = ""] - #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] - #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] - #[doc = "work an additional `EnactmentPeriod` later."] - #[doc = ""] - #[doc = "Emits `PreimageReaped`."] - #[doc = ""] - #[doc = "Weight: `O(D)` where D is length of proposal."] - pub fn reap_preimage( - &self, - proposal_hash: ::subxt::sp_core::H256, - proposal_len_upper_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReapPreimage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 45u8, 191u8, 46u8, 19u8, 87u8, 216u8, 48u8, 29u8, 124u8, - 205u8, 39u8, 178u8, 158u8, 95u8, 163u8, 116u8, 232u8, 58u8, - 6u8, 242u8, 52u8, 215u8, 251u8, 49u8, 1u8, 234u8, 99u8, - 142u8, 76u8, 182u8, 134u8, 173u8, - ] - { - let call = ReapPreimage { - proposal_hash, - proposal_len_upper_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unlock tokens that have an expired lock."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account to remove the lock on."] - #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub fn unlock( - &self, - target: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Unlock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 106u8, 17u8, 189u8, 71u8, 208u8, 26u8, 49u8, 71u8, 162u8, - 196u8, 126u8, 192u8, 242u8, 239u8, 77u8, 196u8, 62u8, 171u8, - 58u8, 176u8, 157u8, 81u8, 65u8, 246u8, 210u8, 43u8, 1u8, - 226u8, 143u8, 149u8, 210u8, 192u8, - ] - { - let call = Unlock { target }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a vote for a referendum."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the referendum was cancelled, or"] - #[doc = "- the referendum is ongoing, or"] - #[doc = "- the referendum has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the referendum has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for referendum `index`."] - #[doc = ""] - #[doc = "- `index`: The index of referendum of the vote to be removed."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_vote( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveVote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 33u8, 72u8, 14u8, 166u8, 152u8, 18u8, 232u8, 153u8, 163u8, - 96u8, 146u8, 180u8, 98u8, 155u8, 119u8, 75u8, 247u8, 175u8, - 246u8, 183u8, 182u8, 108u8, 250u8, 80u8, 148u8, 86u8, 255u8, - 59u8, 93u8, 197u8, 209u8, 226u8, - ] - { - let call = RemoveVote { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a vote for a referendum."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the referendum was cancelled, because the voter lost the referendum or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for"] - #[doc = " referendum `index`."] - #[doc = "- `index`: The index of referendum of the vote to be removed."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_other_vote( - &self, - target: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveOtherVote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 43u8, 194u8, 32u8, 219u8, 87u8, 143u8, 240u8, 34u8, 236u8, - 232u8, 128u8, 7u8, 99u8, 113u8, 106u8, 124u8, 92u8, 115u8, - 75u8, 228u8, 39u8, 234u8, 192u8, 134u8, 69u8, 109u8, 119u8, - 133u8, 194u8, 110u8, 167u8, 244u8, - ] - { - let call = RemoveOtherVote { target, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] - pub fn enact_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - EnactProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 246u8, 188u8, 9u8, 244u8, 56u8, 81u8, 201u8, 59u8, 212u8, - 11u8, 204u8, 7u8, 173u8, 7u8, 212u8, 34u8, 173u8, 248u8, - 83u8, 225u8, 209u8, 105u8, 249u8, 167u8, 243u8, 49u8, 119u8, - 167u8, 28u8, 31u8, 60u8, 75u8, - ] - { - let call = EnactProposal { - proposal_hash, - index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] - #[doc = "proposed again."] - #[doc = ""] - #[doc = "If called on a queued public or external proposal, then this will result in it being"] - #[doc = "removed. If the `ref_index` supplied is an active referendum with the proposal hash,"] - #[doc = "then it will be cancelled."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `BlacklistOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The proposal hash to blacklist permanently."] - #[doc = "- `ref_index`: An ongoing referendum whose hash is `proposal_hash`, which will be"] - #[doc = "cancelled."] - #[doc = ""] - #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] - #[doc = " reasonable value)."] - pub fn blacklist( - &self, - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Blacklist, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 105u8, 99u8, 153u8, 150u8, 122u8, 234u8, 105u8, 238u8, 152u8, - 152u8, 121u8, 181u8, 133u8, 246u8, 159u8, 35u8, 8u8, 65u8, - 15u8, 203u8, 206u8, 75u8, 28u8, 214u8, 111u8, 26u8, 40u8, - 141u8, 68u8, 57u8, 217u8, 244u8, - ] - { - let call = Blacklist { - proposal_hash, - maybe_ref_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a proposal."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] - #[doc = ""] - #[doc = "- `prop_index`: The index of the proposal to cancel."] - #[doc = ""] - #[doc = "Weight: `O(p)` where `p = PublicProps::::decode_len()`"] - pub fn cancel_proposal( - &self, - prop_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 26u8, 117u8, 180u8, 24u8, 12u8, 177u8, 77u8, 254u8, 113u8, - 53u8, 146u8, 48u8, 164u8, 255u8, 45u8, 205u8, 207u8, 46u8, - 74u8, 184u8, 73u8, 95u8, 216u8, 190u8, 240u8, 64u8, 121u8, - 104u8, 147u8, 141u8, 128u8, 82u8, - ] - { - let call = CancelProposal { prop_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_democracy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion has been proposed by a public account."] - pub struct Proposed { - pub proposal_index: ::core::primitive::u32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A public proposal has been tabled for referendum vote."] - pub struct Tabled { - pub proposal_index: ::core::primitive::u32, - pub deposit: ::core::primitive::u128, - pub depositors: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Event for Tabled { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Tabled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An external proposal has been tabled."] - pub struct ExternalTabled; - impl ::subxt::Event for ExternalTabled { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "ExternalTabled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A referendum has begun."] - pub struct Started { - pub ref_index: ::core::primitive::u32, - pub threshold: - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - } - impl ::subxt::Event for Started { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Started"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A proposal has been approved by referendum."] - pub struct Passed { - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Event for Passed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Passed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A proposal has been rejected by referendum."] - pub struct NotPassed { - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Event for NotPassed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "NotPassed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Event for Cancelled { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Cancelled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal has been enacted."] - pub struct Executed { - pub ref_index: ::core::primitive::u32, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for Executed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Executed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has delegated their vote to another account."] - pub struct Delegated { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub target: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Delegated { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Delegated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has cancelled a previous delegation operation."] - pub struct Undelegated { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Undelegated { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Undelegated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An external proposal has been vetoed."] - pub struct Vetoed { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, - pub until: ::core::primitive::u32, - } - impl ::subxt::Event for Vetoed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Vetoed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal's preimage was noted, and the deposit taken."] - pub struct PreimageNoted { - pub proposal_hash: ::subxt::sp_core::H256, - pub who: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for PreimageNoted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageNoted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal preimage was removed and used (the deposit was returned)."] - pub struct PreimageUsed { - pub proposal_hash: ::subxt::sp_core::H256, - pub provider: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for PreimageUsed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageUsed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal could not be executed because its preimage was invalid."] - pub struct PreimageInvalid { - pub proposal_hash: ::subxt::sp_core::H256, - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Event for PreimageInvalid { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageInvalid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal could not be executed because its preimage was missing."] - pub struct PreimageMissing { - pub proposal_hash: ::subxt::sp_core::H256, - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::Event for PreimageMissing { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageMissing"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A registered preimage was removed and the deposit collected by the reaper."] - pub struct PreimageReaped { - pub proposal_hash: ::subxt::sp_core::H256, - pub provider: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - pub reaper: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for PreimageReaped { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageReaped"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal_hash has been blacklisted permanently."] - pub struct Blacklisted { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Blacklisted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Blacklisted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has voted in a referendum"] - pub struct Voted { - pub voter: ::subxt::sp_core::crypto::AccountId32, - pub ref_index: ::core::primitive::u32, - pub vote: runtime_types::pallet_democracy::vote::AccountVote< - ::core::primitive::u128, - >, - } - impl ::subxt::Event for Voted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has secconded a proposal"] - pub struct Seconded { - pub seconder: ::subxt::sp_core::crypto::AccountId32, - pub prop_index: ::core::primitive::u32, - } - impl ::subxt::Event for Seconded { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Seconded"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PublicPropCount; - impl ::subxt::StorageEntry for PublicPropCount { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "PublicPropCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PublicProps; - impl ::subxt::StorageEntry for PublicProps { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "PublicProps"; - type Value = ::std::vec::Vec<( - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DepositOf<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for DepositOf<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "DepositOf"; - type Value = ( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Preimages<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Preimages<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Preimages"; - type Value = runtime_types::pallet_democracy::PreimageStatus< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ReferendumCount; - impl ::subxt::StorageEntry for ReferendumCount { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "ReferendumCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct LowestUnbaked; - impl ::subxt::StorageEntry for LowestUnbaked { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "LowestUnbaked"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReferendumInfoOf<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ReferendumInfoOf<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "ReferendumInfoOf"; - type Value = runtime_types::pallet_democracy::types::ReferendumInfo< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct VotingOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for VotingOf<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "VotingOf"; - type Value = runtime_types::pallet_democracy::vote::Voting< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct LastTabledWasExternal; - impl ::subxt::StorageEntry for LastTabledWasExternal { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "LastTabledWasExternal"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextExternal; - impl ::subxt::StorageEntry for NextExternal { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "NextExternal"; - type Value = ( - ::subxt::sp_core::H256, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Blacklist<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Blacklist<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Blacklist"; - type Value = ( - ::core::primitive::u32, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Cancellations<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Cancellations<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Cancellations"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_democracy::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of (public) proposals that have been made so far."] - pub async fn public_prop_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The public proposals. Unsorted. The second item is the proposal's hash."] - pub async 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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Those who have locked a deposit."] - #[doc = ""] - #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] - pub async fn deposit_of( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub async fn referendum_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self.client.metadata().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 = " 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( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Record of all proposals that have been subject to emergency cancellation."] - pub async fn cancellations( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The period between a proposal being approved and enacted."] - #[doc = ""] - #[doc = " It should generally be a little more than the unstake period to ensure that"] - #[doc = " voting stakers have an opportunity to remove themselves from the system in the case"] - #[doc = " where they are on the losing side of a vote."] - pub fn enactment_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "EnactmentPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("EnactmentPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " How often (in blocks) new public referenda are launched."] - pub fn launch_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "LaunchPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("LaunchPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " How often (in blocks) to check for new votes."] - pub fn voting_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "VotingPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("VotingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The minimum period of vote locking."] - #[doc = ""] - #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] - #[doc = " those successful voters are locked into the consequences that their votes entail."] - pub fn vote_locking_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "VoteLockingPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("VoteLockingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn minimum_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "MinimumDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("MinimumDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Indicator for whether an emergency origin is even allowed to happen. Some chains may"] - #[doc = " want to set this permanently to `false`, others may want to condition it on things such"] - #[doc = " as an upgrade having happened recently."] - pub fn instant_allowed( - &self, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "InstantAllowed")? - == [ - 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, - 1u8, 68u8, 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, - 47u8, 126u8, 134u8, 100u8, 14u8, 86u8, 209u8, 39u8, 20u8, - 4u8, 233u8, 115u8, 102u8, 131u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("InstantAllowed")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Minimum voting period allowed for a fast-track referendum."] - pub fn fast_track_voting_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "FastTrackVotingPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("FastTrackVotingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Period in blocks where an external proposal may not be re-submitted after being vetoed."] - pub fn cooloff_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "CooloffPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("CooloffPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of balance that must be deposited per byte of preimage stored."] - pub fn preimage_byte_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "PreimageByteDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("PreimageByteDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of votes for an account."] - #[doc = ""] - #[doc = " Also used to compute weight, an overly big value can"] - #[doc = " lead to extrinsic with very big weight: see `delegate` for instance."] - pub fn max_votes( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "MaxVotes")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("MaxVotes")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of public proposals that can exist at any time."] - pub fn max_proposals( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Democracy", "MaxProposals")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Democracy")?; - let constant = pallet.constant("MaxProposals")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod council { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetMembers { - pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub old_count: ::core::primitive::u32, - } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Execute { - pub proposal: ::std::boxed::Box, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Propose { - #[codec(compact)] - pub threshold: ::core::primitive::u32, - pub proposal: ::std::boxed::Box, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Vote { - pub proposal: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: ::core::primitive::u32, - pub approve: ::core::primitive::bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: ::core::primitive::u32, - #[codec(compact)] - pub proposal_weight_bound: ::core::primitive::u64, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Close { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct DisapproveProposal { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for DisapproveProposal { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "disapprove_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the collective's membership."] - #[doc = ""] - #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] - #[doc = "- `prime`: The prime member whose vote sets the default."] - #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] - #[doc = " weight estimation."] - #[doc = ""] - #[doc = "Requires root origin."] - #[doc = ""] - #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] - #[doc = " the weight estimations rely on it to estimate dispatchable weight."] - #[doc = ""] - #[doc = "# WARNING:"] - #[doc = ""] - #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] - #[doc = "implementation of the trait [`ChangeMembers`]."] - #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] - #[doc = "with other logic managing the member set."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(MP + N)` where:"] - #[doc = " - `M` old-members-count (code- and governance-bounded)"] - #[doc = " - `N` new-members-count (code- and governance-bounded)"] - #[doc = " - `P` proposals-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] - #[doc = " members"] - #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] - #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] - #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] - #[doc = "# "] - pub fn set_members( - &self, - new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - old_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, - 200u8, 68u8, 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, - 95u8, 215u8, 36u8, 49u8, 0u8, 163u8, 172u8, 252u8, 221u8, - 9u8, 1u8, 222u8, 44u8, 214u8, - ] - { - let call = SetMembers { - new_members, - prime, - old_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatch a proposal from a member using the `Member` origin."] - #[doc = ""] - #[doc = "Origin must be a member of the collective."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] - #[doc = " `proposal`"] - #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] - #[doc = "- 1 event"] - #[doc = "# "] - pub fn execute( - &self, - proposal: runtime_types::polkadot_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 170u8, 77u8, 65u8, 3u8, 95u8, 88u8, 81u8, 103u8, 220u8, 72u8, - 237u8, 80u8, 181u8, 46u8, 196u8, 106u8, 142u8, 55u8, 244u8, - 204u8, 219u8, 152u8, 219u8, 17u8, 80u8, 55u8, 178u8, 56u8, - 161u8, 169u8, 50u8, 37u8, - ] - { - let call = Execute { - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add a new proposal to either be voted on or executed directly."] - #[doc = ""] - #[doc = "Requires the sender to be member."] - #[doc = ""] - #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] - #[doc = "or put up for voting."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - branching is influenced by `threshold` where:"] - #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] - #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] - #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] - #[doc = " - DB accesses influenced by `threshold`:"] - #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] - #[doc = " - OR proposal insertion (`threshold <= 2`)"] - #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] - #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] - #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] - #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] - #[doc = " - 1 event"] - #[doc = "# "] - pub fn propose( - &self, - threshold: ::core::primitive::u32, - proposal: runtime_types::polkadot_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 180u8, 170u8, 72u8, 21u8, 96u8, 25u8, 177u8, 147u8, 98u8, - 143u8, 186u8, 112u8, 99u8, 197u8, 146u8, 170u8, 35u8, 195u8, - 154u8, 87u8, 119u8, 190u8, 148u8, 82u8, 134u8, 3u8, 163u8, - 182u8, 132u8, 130u8, 2u8, 48u8, - ] - { - let call = Propose { - threshold, - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "Requires the sender to be a member."] - #[doc = ""] - #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `Members` (codec `O(M)`)"] - #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] - #[doc = "- 1 event"] - #[doc = "# "] - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, - 27u8, 38u8, 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, - 220u8, 120u8, 231u8, 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, - 154u8, 183u8, 142u8, 165u8, 161u8, - ] - { - let call = Vote { - proposal, - index, - approve, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] - #[doc = ""] - #[doc = "May be called by any signed account in order to finish voting and close the proposal."] - #[doc = ""] - #[doc = "If called before the end of the voting period it will only close the vote if it is"] - #[doc = "has enough votes to be approved or disapproved."] - #[doc = ""] - #[doc = "If called after the end of the voting period abstentions are counted as rejections"] - #[doc = "unless there is a prime member set and the prime member cast an approval."] - #[doc = ""] - #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] - #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] - #[doc = ""] - #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] - #[doc = "proposal."] - #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] - #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1 + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - `P1` is the complexity of `proposal` preimage."] - #[doc = " - `P2` is proposal-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] - #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] - #[doc = " `O(P2)`)"] - #[doc = " - any mutations done while executing `proposal` (`P1`)"] - #[doc = "- up to 3 events"] - #[doc = "# "] - pub fn close( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - proposal_weight_bound: ::core::primitive::u64, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Close, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, - 217u8, 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, - 173u8, 172u8, 227u8, 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, - 135u8, 203u8, 69u8, 105u8, 47u8, - ] - { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] - #[doc = "state."] - #[doc = ""] - #[doc = "Must be called by the Root origin."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity: O(P) where P is the number of max proposals"] - #[doc = "DB Weight:"] - #[doc = "* Reads: Proposals"] - #[doc = "* Writes: Voting, Proposals, ProposalOf"] - #[doc = "# "] - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DisapproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, - 191u8, 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, - 219u8, 30u8, 51u8, 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, - 197u8, 95u8, 232u8, 59u8, 169u8, 133u8, - ] - { - let call = DisapproveProposal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] - #[doc = "`MemberCount`)."] - pub struct Proposed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_index: ::core::primitive::u32, - pub proposal_hash: ::subxt::sp_core::H256, - pub threshold: ::core::primitive::u32, - } - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion (given hash) has been voted on by given account, leaving"] - #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] - pub struct Voted { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, - pub voted: ::core::primitive::bool, - pub yes: ::core::primitive::u32, - pub no: ::core::primitive::u32, - } - impl ::subxt::Event for Voted { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion was approved by the required threshold."] - pub struct Approved { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Approved { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Approved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion was not approved by the required threshold."] - pub struct Disapproved { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Disapproved { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Disapproved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion was executed; result will be `Ok` if it returned without error."] - pub struct Executed { - pub proposal_hash: ::subxt::sp_core::H256, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for Executed { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Executed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A single member did some action; result will be `Ok` if it returned without error."] - pub struct MemberExecuted { - pub proposal_hash: ::subxt::sp_core::H256, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for MemberExecuted { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "MemberExecuted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] - pub struct Closed { - pub proposal_hash: ::subxt::sp_core::H256, - pub yes: ::core::primitive::u32, - pub no: ::core::primitive::u32, - } - impl ::subxt::Event for Closed { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Closed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proposals; - impl ::subxt::StorageEntry for Proposals { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Proposals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf<'_> { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::polkadot_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The hashes of the active proposals."] - pub async 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().storage_hash::()? - == [ - 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, - 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, - 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, - 189u8, 198u8, 68u8, 189u8, 218u8, - ] - { - let entry = ProposalOf(_0); - self.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, - > { - if self.client.metadata().storage_hash::()? - == [ - 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, - 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, - 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, - 189u8, 198u8, 68u8, 189u8, 218u8, - ] - { - self.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( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Proposals so far."] - pub async fn proposal_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The current members of the collective. This is stored sorted (just by value)."] - pub async fn members( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] - pub async fn prime( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - } - pub mod technical_committee { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetMembers { - pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub old_count: ::core::primitive::u32, - } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Execute { - pub proposal: ::std::boxed::Box, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Propose { - #[codec(compact)] - pub threshold: ::core::primitive::u32, - pub proposal: ::std::boxed::Box, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Vote { - pub proposal: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: ::core::primitive::u32, - pub approve: ::core::primitive::bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: ::core::primitive::u32, - #[codec(compact)] - pub proposal_weight_bound: ::core::primitive::u64, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Close { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct DisapproveProposal { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for DisapproveProposal { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "disapprove_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the collective's membership."] - #[doc = ""] - #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] - #[doc = "- `prime`: The prime member whose vote sets the default."] - #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] - #[doc = " weight estimation."] - #[doc = ""] - #[doc = "Requires root origin."] - #[doc = ""] - #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] - #[doc = " the weight estimations rely on it to estimate dispatchable weight."] - #[doc = ""] - #[doc = "# WARNING:"] - #[doc = ""] - #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] - #[doc = "implementation of the trait [`ChangeMembers`]."] - #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] - #[doc = "with other logic managing the member set."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(MP + N)` where:"] - #[doc = " - `M` old-members-count (code- and governance-bounded)"] - #[doc = " - `N` new-members-count (code- and governance-bounded)"] - #[doc = " - `P` proposals-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] - #[doc = " members"] - #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] - #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] - #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] - #[doc = "# "] - pub fn set_members( - &self, - new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - old_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, - 200u8, 68u8, 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, - 95u8, 215u8, 36u8, 49u8, 0u8, 163u8, 172u8, 252u8, 221u8, - 9u8, 1u8, 222u8, 44u8, 214u8, - ] - { - let call = SetMembers { - new_members, - prime, - old_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatch a proposal from a member using the `Member` origin."] - #[doc = ""] - #[doc = "Origin must be a member of the collective."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] - #[doc = " `proposal`"] - #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] - #[doc = "- 1 event"] - #[doc = "# "] - pub fn execute( - &self, - proposal: runtime_types::polkadot_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 170u8, 77u8, 65u8, 3u8, 95u8, 88u8, 81u8, 103u8, 220u8, 72u8, - 237u8, 80u8, 181u8, 46u8, 196u8, 106u8, 142u8, 55u8, 244u8, - 204u8, 219u8, 152u8, 219u8, 17u8, 80u8, 55u8, 178u8, 56u8, - 161u8, 169u8, 50u8, 37u8, - ] - { - let call = Execute { - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add a new proposal to either be voted on or executed directly."] - #[doc = ""] - #[doc = "Requires the sender to be member."] - #[doc = ""] - #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] - #[doc = "or put up for voting."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - branching is influenced by `threshold` where:"] - #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] - #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] - #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] - #[doc = " - DB accesses influenced by `threshold`:"] - #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] - #[doc = " - OR proposal insertion (`threshold <= 2`)"] - #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] - #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] - #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] - #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] - #[doc = " - 1 event"] - #[doc = "# "] - pub fn propose( - &self, - threshold: ::core::primitive::u32, - proposal: runtime_types::polkadot_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 180u8, 170u8, 72u8, 21u8, 96u8, 25u8, 177u8, 147u8, 98u8, - 143u8, 186u8, 112u8, 99u8, 197u8, 146u8, 170u8, 35u8, 195u8, - 154u8, 87u8, 119u8, 190u8, 148u8, 82u8, 134u8, 3u8, 163u8, - 182u8, 132u8, 130u8, 2u8, 48u8, - ] - { - let call = Propose { - threshold, - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "Requires the sender to be a member."] - #[doc = ""] - #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `Members` (codec `O(M)`)"] - #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] - #[doc = "- 1 event"] - #[doc = "# "] - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, - 27u8, 38u8, 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, - 220u8, 120u8, 231u8, 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, - 154u8, 183u8, 142u8, 165u8, 161u8, - ] - { - let call = Vote { - proposal, - index, - approve, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] - #[doc = ""] - #[doc = "May be called by any signed account in order to finish voting and close the proposal."] - #[doc = ""] - #[doc = "If called before the end of the voting period it will only close the vote if it is"] - #[doc = "has enough votes to be approved or disapproved."] - #[doc = ""] - #[doc = "If called after the end of the voting period abstentions are counted as rejections"] - #[doc = "unless there is a prime member set and the prime member cast an approval."] - #[doc = ""] - #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] - #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] - #[doc = ""] - #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] - #[doc = "proposal."] - #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] - #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1 + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - `P1` is the complexity of `proposal` preimage."] - #[doc = " - `P2` is proposal-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] - #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] - #[doc = " `O(P2)`)"] - #[doc = " - any mutations done while executing `proposal` (`P1`)"] - #[doc = "- up to 3 events"] - #[doc = "# "] - pub fn close( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - proposal_weight_bound: ::core::primitive::u64, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Close, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, - 217u8, 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, - 173u8, 172u8, 227u8, 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, - 135u8, 203u8, 69u8, 105u8, 47u8, - ] - { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] - #[doc = "state."] - #[doc = ""] - #[doc = "Must be called by the Root origin."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity: O(P) where P is the number of max proposals"] - #[doc = "DB Weight:"] - #[doc = "* Reads: Proposals"] - #[doc = "* Writes: Voting, Proposals, ProposalOf"] - #[doc = "# "] - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DisapproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, - 191u8, 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, - 219u8, 30u8, 51u8, 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, - 197u8, 95u8, 232u8, 59u8, 169u8, 133u8, - ] - { - let call = DisapproveProposal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] - #[doc = "`MemberCount`)."] - pub struct Proposed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_index: ::core::primitive::u32, - pub proposal_hash: ::subxt::sp_core::H256, - pub threshold: ::core::primitive::u32, - } - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion (given hash) has been voted on by given account, leaving"] - #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] - pub struct Voted { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, - pub voted: ::core::primitive::bool, - pub yes: ::core::primitive::u32, - pub no: ::core::primitive::u32, - } - impl ::subxt::Event for Voted { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion was approved by the required threshold."] - pub struct Approved { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Approved { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Approved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion was not approved by the required threshold."] - pub struct Disapproved { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Disapproved { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Disapproved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A motion was executed; result will be `Ok` if it returned without error."] - pub struct Executed { - pub proposal_hash: ::subxt::sp_core::H256, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for Executed { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Executed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A single member did some action; result will be `Ok` if it returned without error."] - pub struct MemberExecuted { - pub proposal_hash: ::subxt::sp_core::H256, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for MemberExecuted { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "MemberExecuted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] - pub struct Closed { - pub proposal_hash: ::subxt::sp_core::H256, - pub yes: ::core::primitive::u32, - pub no: ::core::primitive::u32, - } - impl ::subxt::Event for Closed { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Closed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proposals; - impl ::subxt::StorageEntry for Proposals { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Proposals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf<'_> { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::polkadot_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The hashes of the active proposals."] - pub async 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().storage_hash::()? - == [ - 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, - 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, - 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, - 189u8, 198u8, 68u8, 189u8, 218u8, - ] - { - let entry = ProposalOf(_0); - self.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, - > { - if self.client.metadata().storage_hash::()? - == [ - 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, - 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, - 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, - 189u8, 198u8, 68u8, 189u8, 218u8, - ] - { - self.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( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Proposals so far."] - pub async fn proposal_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The current members of the collective. This is stored sorted (just by value)."] - pub async fn members( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] - pub async fn prime( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - } - pub mod phragmen_election { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Vote { - pub votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveVoter; - impl ::subxt::Call for RemoveVoter { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "remove_voter"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SubmitCandidacy { - #[codec(compact)] - pub candidate_count: ::core::primitive::u32, - } - impl ::subxt::Call for SubmitCandidacy { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "submit_candidacy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RenounceCandidacy { - pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - } - impl ::subxt::Call for RenounceCandidacy { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "renounce_candidacy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveMember { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub has_replacement: ::core::primitive::bool, - } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "remove_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CleanDefunctVoters { - pub num_voters: ::core::primitive::u32, - pub num_defunct: ::core::primitive::u32, - } - impl ::subxt::Call for CleanDefunctVoters { - const PALLET: &'static str = "PhragmenElection"; - const FUNCTION: &'static str = "clean_defunct_voters"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] - #[doc = "set the initial votes, or update already existing votes."] - #[doc = ""] - #[doc = "Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is"] - #[doc = "reserved. The deposit is based on the number of votes and can be updated over time."] - #[doc = ""] - #[doc = "The `votes` should:"] - #[doc = " - not be empty."] - #[doc = " - be less than the number of possible candidates. Note that all current members and"] - #[doc = " runners-up are also automatically candidates for the next round."] - #[doc = ""] - #[doc = "If `value` is more than `who`'s free balance, then the maximum of the two is used."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed."] - #[doc = ""] - #[doc = "### Warning"] - #[doc = ""] - #[doc = "It is the responsibility of the caller to **NOT** place all of their balance into the"] - #[doc = "lock and keep some for further operations."] - #[doc = ""] - #[doc = "# "] - #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] - #[doc = "# "] - pub fn vote( - &self, - votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vote, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 245u8, 122u8, 160u8, 64u8, 234u8, 121u8, 191u8, 224u8, 12u8, - 16u8, 153u8, 70u8, 41u8, 236u8, 211u8, 145u8, 238u8, 112u8, - 11u8, 94u8, 92u8, 160u8, 67u8, 176u8, 126u8, 232u8, 63u8, - 226u8, 207u8, 205u8, 90u8, 61u8, - ] - { - let call = Vote { votes, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove `origin` as a voter."] - #[doc = ""] - #[doc = "This removes the lock and returns the deposit."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed and be a voter."] - pub fn remove_voter( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveVoter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 254u8, 46u8, 140u8, 4u8, 218u8, 45u8, 150u8, 72u8, 67u8, - 131u8, 108u8, 201u8, 46u8, 157u8, 104u8, 161u8, 53u8, 155u8, - 130u8, 50u8, 88u8, 149u8, 255u8, 12u8, 17u8, 85u8, 95u8, - 69u8, 153u8, 130u8, 221u8, 1u8, - ] - { - let call = RemoveVoter {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] - #[doc = ""] - #[doc = "All candidates are wiped at the end of the term. They either become a member/runner-up,"] - #[doc = "or leave the system while their deposit is slashed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed."] - #[doc = ""] - #[doc = "### Warning"] - #[doc = ""] - #[doc = "Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]"] - #[doc = "to get their deposit back. Losing the spot in an election will always lead to a slash."] - #[doc = ""] - #[doc = "# "] - #[doc = "The number of current candidates must be provided as witness data."] - #[doc = "# "] - pub fn submit_candidacy( - &self, - candidate_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SubmitCandidacy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 100u8, 38u8, 146u8, 5u8, 234u8, 101u8, 193u8, 9u8, 245u8, - 237u8, 220u8, 21u8, 36u8, 64u8, 205u8, 103u8, 11u8, 194u8, - 18u8, 96u8, 44u8, 231u8, 125u8, 82u8, 63u8, 51u8, 51u8, - 183u8, 28u8, 33u8, 121u8, 89u8, - ] - { - let call = SubmitCandidacy { candidate_count }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] - #[doc = "outcomes exist:"] - #[doc = ""] - #[doc = "- `origin` is a candidate and not elected in any set. In this case, the deposit is"] - #[doc = " unreserved, returned and origin is removed as a candidate."] - #[doc = "- `origin` is a current runner-up. In this case, the deposit is unreserved, returned and"] - #[doc = " origin is removed as a runner-up."] - #[doc = "- `origin` is a current member. In this case, the deposit is unreserved and origin is"] - #[doc = " removed as a member, consequently not being a candidate for the next round anymore."] - #[doc = " Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they"] - #[doc = " are immediately used. If the prime is renouncing, then no prime will exist until the"] - #[doc = " next round."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed, and have one of the above roles."] - #[doc = ""] - #[doc = "# "] - #[doc = "The type of renouncing must be provided as witness data."] - #[doc = "# "] - pub fn renounce_candidacy( - &self, - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RenounceCandidacy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 184u8, 45u8, 220u8, 198u8, 21u8, 54u8, 15u8, 235u8, 192u8, - 78u8, 96u8, 172u8, 12u8, 152u8, 147u8, 183u8, 172u8, 85u8, - 26u8, 243u8, 250u8, 248u8, 104u8, 76u8, 88u8, 150u8, 197u8, - 130u8, 221u8, 234u8, 53u8, 174u8, - ] - { - let call = RenounceCandidacy { renouncing }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] - #[doc = "the outgoing member is slashed."] - #[doc = ""] - #[doc = "If a runner-up is available, then the best runner-up will be removed and replaces the"] - #[doc = "outgoing member. Otherwise, a new phragmen election is started."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be root."] - #[doc = ""] - #[doc = "Note that this does not affect the designated block number of the next election."] - #[doc = ""] - #[doc = "# "] - #[doc = "If we have a replacement, we use a small weight. Else, since this is a root call and"] - #[doc = "will go into phragmen, we assume full block for now."] - #[doc = "# "] - pub fn remove_member( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - has_replacement: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 0u8, 99u8, 154u8, 250u8, 4u8, 102u8, 172u8, 220u8, 86u8, - 147u8, 113u8, 248u8, 152u8, 189u8, 179u8, 149u8, 73u8, 97u8, - 201u8, 143u8, 83u8, 11u8, 94u8, 123u8, 149u8, 253u8, 179u8, - 154u8, 132u8, 42u8, 70u8, 189u8, - ] - { - let call = RemoveMember { - who, - has_replacement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] - #[doc = "deposit of the removed voters are returned."] - #[doc = ""] - #[doc = "This is an root function to be used only for cleaning the state."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be root."] - #[doc = ""] - #[doc = "# "] - #[doc = "The total number of voters and those that are defunct must be provided as witness data."] - #[doc = "# "] - pub fn clean_defunct_voters( - &self, - num_voters: ::core::primitive::u32, - num_defunct: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CleanDefunctVoters, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 80u8, 248u8, 122u8, 6u8, 88u8, 255u8, 17u8, 206u8, 104u8, - 208u8, 66u8, 191u8, 118u8, 163u8, 154u8, 9u8, 37u8, 106u8, - 232u8, 178u8, 17u8, 177u8, 225u8, 101u8, 76u8, 207u8, 175u8, - 117u8, 21u8, 203u8, 229u8, 140u8, - ] - { - let call = CleanDefunctVoters { - num_voters, - num_defunct, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] - #[doc = "the election, not that enough have has been elected. The inner value must be examined"] - #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] - #[doc = "slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to"] - #[doc = "begin with."] - pub struct NewTerm { - pub new_members: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - } - impl ::subxt::Event for NewTerm { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "NewTerm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "No (or not enough) candidates existed for this round. This is different from"] - #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] - pub struct EmptyTerm; - impl ::subxt::Event for EmptyTerm { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "EmptyTerm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Internal error happened while trying to perform election."] - pub struct ElectionError; - impl ::subxt::Event for ElectionError { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "ElectionError"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] - #[doc = "`EmptyTerm`."] - pub struct MemberKicked { - pub member: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for MemberKicked { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "MemberKicked"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Someone has renounced their candidacy."] - pub struct Renounced { - pub candidate: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Renounced { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "Renounced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] - #[doc = "runner-up."] - #[doc = ""] - #[doc = "Note that old members and runners-up are also candidates."] - pub struct CandidateSlashed { - pub candidate: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for CandidateSlashed { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "CandidateSlashed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] - pub struct SeatHolderSlashed { - pub seat_holder: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for SeatHolderSlashed { - const PALLET: &'static str = "PhragmenElection"; - const EVENT: &'static str = "SeatHolderSlashed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct RunnersUp; - impl ::subxt::StorageEntry for RunnersUp { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "RunnersUp"; - type Value = ::std::vec::Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Candidates; - impl ::subxt::StorageEntry for Candidates { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "Candidates"; - type Value = ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ElectionRounds; - impl ::subxt::StorageEntry for ElectionRounds { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "ElectionRounds"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "PhragmenElection"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current elected members."] - #[doc = ""] - #[doc = " Invariant: Always sorted based on account id."] - pub async 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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The present candidate list. A current member or runner-up can never enter this vector"] - #[doc = " and is always implicitly assumed to be a candidate."] - #[doc = ""] - #[doc = " Second element is the deposit."] - #[doc = ""] - #[doc = " Invariant: Always sorted based on account id."] - pub async fn candidates( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The total number of vote rounds that have happened, excluding the upcoming one."] - pub async fn election_rounds( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Votes and locked stake of a particular voter."] - #[doc = ""] - #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] - pub async fn voting( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Identifier for the elections-phragmen pallet's lock"] - pub fn pallet_id( - &self, - ) -> ::core::result::Result< - [::core::primitive::u8; 8usize], - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "PalletId")? - == [ - 224u8, 197u8, 247u8, 125u8, 62u8, 180u8, 69u8, 91u8, 226u8, - 36u8, 82u8, 148u8, 70u8, 147u8, 209u8, 40u8, 210u8, 229u8, - 181u8, 191u8, 170u8, 205u8, 138u8, 97u8, 127u8, 59u8, 124u8, - 244u8, 252u8, 30u8, 213u8, 179u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("PalletId")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " How much should be locked up in order to submit one's candidacy."] - pub fn candidacy_bond( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "CandidacyBond")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("CandidacyBond")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Base deposit associated with voting."] - #[doc = ""] - #[doc = " This should be sensibly high to economically ensure the pallet cannot be attacked by"] - #[doc = " creating a gigantic number of votes."] - pub fn voting_bond_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "VotingBondBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("VotingBondBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of bond that need to be locked for each vote (32 bytes)."] - pub fn voting_bond_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "VotingBondFactor")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("VotingBondFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of members to elect."] - pub fn desired_members( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "DesiredMembers")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("DesiredMembers")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of runners_up to keep."] - pub fn desired_runners_up( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "DesiredRunnersUp")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("DesiredRunnersUp")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " How long each seat is kept. This defines the next block number at which an election"] - #[doc = " round will happen. If set to zero, no elections are ever triggered and the module will"] - #[doc = " be in passive mode."] - pub fn term_duration( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("PhragmenElection", "TermDuration")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("PhragmenElection")?; - let constant = pallet.constant("TermDuration")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod technical_membership { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for AddMember { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "add_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "remove_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SwapMember { - pub remove: ::subxt::sp_core::crypto::AccountId32, - pub add: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SwapMember { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "swap_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ResetMembers { - pub members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for ResetMembers { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "reset_members"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ChangeKey { - pub new: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChangeKey { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "change_key"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetPrime { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetPrime { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "set_prime"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClearPrime; - impl ::subxt::Call for ClearPrime { - const PALLET: &'static str = "TechnicalMembership"; - const FUNCTION: &'static str = "clear_prime"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Add a member `who` to the set."] - #[doc = ""] - #[doc = "May only be called from `T::AddOrigin`."] - pub fn add_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 1u8, 149u8, 115u8, 222u8, 93u8, 9u8, 208u8, 58u8, 22u8, - 148u8, 215u8, 141u8, 204u8, 48u8, 107u8, 210u8, 202u8, 165u8, - 43u8, 159u8, 45u8, 161u8, 255u8, 127u8, 225u8, 100u8, 161u8, - 195u8, 197u8, 206u8, 57u8, 166u8, - ] - { - let call = AddMember { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a member `who` from the set."] - #[doc = ""] - #[doc = "May only be called from `T::RemoveOrigin`."] - pub fn remove_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 137u8, 249u8, 148u8, 139u8, 147u8, 47u8, 226u8, 228u8, 139u8, - 219u8, 109u8, 128u8, 254u8, 51u8, 227u8, 154u8, 105u8, 91u8, - 229u8, 69u8, 217u8, 241u8, 107u8, 229u8, 41u8, 202u8, 228u8, - 227u8, 160u8, 162u8, 45u8, 211u8, - ] - { - let call = RemoveMember { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Swap out one member `remove` for another `add`."] - #[doc = ""] - #[doc = "May only be called from `T::SwapOrigin`."] - #[doc = ""] - #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] - pub fn swap_member( - &self, - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SwapMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 159u8, 62u8, 254u8, 117u8, 56u8, 185u8, 99u8, 29u8, 146u8, - 210u8, 40u8, 77u8, 169u8, 224u8, 215u8, 34u8, 106u8, 95u8, - 204u8, 109u8, 72u8, 67u8, 11u8, 183u8, 33u8, 84u8, 133u8, - 4u8, 5u8, 13u8, 188u8, 123u8, - ] - { - let call = SwapMember { remove, add }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] - #[doc = "pass `members` pre-sorted."] - #[doc = ""] - #[doc = "May only be called from `T::ResetOrigin`."] - pub fn reset_members( - &self, - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ResetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 246u8, 84u8, 91u8, 191u8, 61u8, 245u8, 171u8, 80u8, 18u8, - 120u8, 61u8, 86u8, 23u8, 115u8, 161u8, 203u8, 128u8, 34u8, - 166u8, 128u8, 33u8, 28u8, 229u8, 81u8, 103u8, 217u8, 173u8, - 151u8, 31u8, 118u8, 151u8, 217u8, - ] - { - let call = ResetMembers { members }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Swap out the sending member for some other key `new`."] - #[doc = ""] - #[doc = "May only be called from `Signed` origin of a current member."] - #[doc = ""] - #[doc = "Prime membership is passed from the origin account to `new`, if extant."] - pub fn change_key( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ChangeKey, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 198u8, 93u8, 41u8, 52u8, 241u8, 11u8, 225u8, 82u8, 30u8, - 114u8, 111u8, 204u8, 13u8, 31u8, 34u8, 82u8, 171u8, 58u8, - 180u8, 65u8, 3u8, 246u8, 33u8, 167u8, 200u8, 23u8, 150u8, - 235u8, 130u8, 172u8, 202u8, 216u8, - ] - { - let call = ChangeKey { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the prime member. Must be a current member."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - pub fn set_prime( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPrime, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 185u8, 53u8, 61u8, 154u8, 234u8, 77u8, 195u8, 126u8, 19u8, - 39u8, 78u8, 205u8, 109u8, 210u8, 137u8, 245u8, 128u8, 110u8, - 2u8, 201u8, 20u8, 153u8, 146u8, 177u8, 4u8, 144u8, 229u8, - 125u8, 91u8, 131u8, 199u8, 15u8, - ] - { - let call = SetPrime { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the prime member if it exists."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - pub fn clear_prime( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearPrime, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 186u8, 182u8, 225u8, 90u8, 71u8, 124u8, 69u8, 100u8, 234u8, - 25u8, 53u8, 23u8, 182u8, 32u8, 176u8, 81u8, 54u8, 140u8, - 235u8, 126u8, 247u8, 7u8, 155u8, 62u8, 35u8, 135u8, 48u8, - 61u8, 88u8, 160u8, 183u8, 72u8, - ] - { - let call = ClearPrime {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_membership::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The given member was added; see the transaction for who."] - pub struct MemberAdded; - impl ::subxt::Event for MemberAdded { - const PALLET: &'static str = "TechnicalMembership"; - const EVENT: &'static str = "MemberAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The given member was removed; see the transaction for who."] - pub struct MemberRemoved; - impl ::subxt::Event for MemberRemoved { - const PALLET: &'static str = "TechnicalMembership"; - const EVENT: &'static str = "MemberRemoved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Two members were swapped; see the transaction for who."] - pub struct MembersSwapped; - impl ::subxt::Event for MembersSwapped { - const PALLET: &'static str = "TechnicalMembership"; - const EVENT: &'static str = "MembersSwapped"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The membership was reset; see the transaction for who the new set is."] - pub struct MembersReset; - impl ::subxt::Event for MembersReset { - const PALLET: &'static str = "TechnicalMembership"; - const EVENT: &'static str = "MembersReset"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "One of the members' keys changed."] - pub struct KeyChanged; - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "TechnicalMembership"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Phantom member, never used."] - pub struct Dummy; - impl ::subxt::Event for Dummy { - const PALLET: &'static str = "TechnicalMembership"; - const EVENT: &'static str = "Dummy"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "TechnicalMembership"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "TechnicalMembership"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current membership, stored as an ordered Vec."] - pub async fn members( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The current prime member, if one exists."] - pub async fn prime( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - } - pub mod treasury { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProposeSpend { - #[codec(compact)] - pub value: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for ProposeSpend { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "propose_spend"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RejectProposal { - #[codec(compact)] - pub proposal_id: ::core::primitive::u32, - } - impl ::subxt::Call for RejectProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "reject_proposal"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ApproveProposal { - #[codec(compact)] - pub proposal_id: ::core::primitive::u32, - } - impl ::subxt::Call for ApproveProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "approve_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] - #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] - #[doc = "proposal is awarded."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(1)"] - #[doc = "- DbReads: `ProposalCount`, `origin account`"] - #[doc = "- DbWrites: `ProposalCount`, `Proposals`, `origin account`"] - #[doc = "# "] - pub fn propose_spend( - &self, - value: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeSpend, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 117u8, 11u8, 194u8, 76u8, 160u8, 114u8, 119u8, 94u8, 47u8, - 239u8, 193u8, 54u8, 42u8, 208u8, 225u8, 47u8, 22u8, 90u8, - 166u8, 169u8, 192u8, 145u8, 159u8, 38u8, 209u8, 134u8, 102u8, - 91u8, 65u8, 129u8, 251u8, 3u8, - ] - { - let call = ProposeSpend { value, beneficiary }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Reject a proposed spend. The original deposit will be slashed."] - #[doc = ""] - #[doc = "May only be called from `T::RejectOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(1)"] - #[doc = "- DbReads: `Proposals`, `rejected proposer account`"] - #[doc = "- DbWrites: `Proposals`, `rejected proposer account`"] - #[doc = "# "] - pub fn reject_proposal( - &self, - proposal_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RejectProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 153u8, 238u8, 223u8, 212u8, 86u8, 178u8, 184u8, 150u8, 117u8, - 91u8, 69u8, 30u8, 196u8, 134u8, 56u8, 54u8, 236u8, 145u8, - 202u8, 139u8, 135u8, 254u8, 80u8, 189u8, 40u8, 56u8, 148u8, - 108u8, 42u8, 118u8, 74u8, 242u8, - ] - { - let call = RejectProposal { proposal_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] - #[doc = "and the original deposit will be returned."] - #[doc = ""] - #[doc = "May only be called from `T::ApproveOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(1)."] - #[doc = "- DbReads: `Proposals`, `Approvals`"] - #[doc = "- DbWrite: `Approvals`"] - #[doc = "# "] - pub fn approve_proposal( - &self, - proposal_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 191u8, 81u8, 78u8, 230u8, 230u8, 192u8, 144u8, 232u8, 81u8, - 70u8, 227u8, 212u8, 194u8, 228u8, 231u8, 147u8, 57u8, 222u8, - 156u8, 77u8, 173u8, 60u8, 92u8, 84u8, 255u8, 64u8, 240u8, - 45u8, 131u8, 200u8, 206u8, 231u8, - ] - { - let call = ApproveProposal { proposal_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_treasury::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "New proposal."] - pub struct Proposed { - pub proposal_index: ::core::primitive::u32, - } - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Proposed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "We have ended a spend period and will now allocate funds."] - pub struct Spending { - pub budget_remaining: ::core::primitive::u128, - } - impl ::subxt::Event for Spending { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Spending"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some funds have been allocated."] - pub struct Awarded { - pub proposal_index: ::core::primitive::u32, - pub award: ::core::primitive::u128, - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Awarded { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Awarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proposal was rejected; funds were slashed."] - pub struct Rejected { - pub proposal_index: ::core::primitive::u32, - pub slashed: ::core::primitive::u128, - } - impl ::subxt::Event for Rejected { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rejected"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "Some of our funds have been burnt."] - pub struct Burnt { - pub burnt_funds: ::core::primitive::u128, - } - impl ::subxt::Event for Burnt { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Burnt"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "Spending has finished; this is the amount that rolls over until next spend."] - pub struct Rollover { - pub rollover_balance: ::core::primitive::u128, - } - impl ::subxt::Event for Rollover { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rollover"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "Some funds have been deposited."] - pub struct Deposit { - pub value: ::core::primitive::u128, - } - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Deposit"; - } - } - pub mod storage { - use super::runtime_types; - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Proposals<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Proposals<'_> { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "Proposals"; - type Value = runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Approvals; - impl ::subxt::StorageEntry for Approvals { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "Approvals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Number of proposals that have been made."] - pub async fn proposal_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Proposals that have been made."] - pub async fn proposals( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Proposal indices that have been approved but not yet awarded."] - pub async fn approvals( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Fraction of a proposal's value that should be bonded in order to place the proposal."] - #[doc = " An accepted proposal gets these back. A rejected proposal does not."] - pub fn proposal_bond( - &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Permill, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Treasury", "ProposalBond")? - == [ - 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, - 91u8, 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, - 74u8, 83u8, 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, - 161u8, 119u8, 2u8, 38u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("ProposalBond")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] - pub fn proposal_bond_minimum( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Treasury", "ProposalBondMinimum")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("ProposalBondMinimum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] - pub fn proposal_bond_maximum( - &self, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Treasury", "ProposalBondMaximum")? - == [ - 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, - 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, - 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, - 43u8, 243u8, 122u8, 60u8, 216u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("ProposalBondMaximum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Period between successive spends."] - pub fn spend_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Treasury", "SpendPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("SpendPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] - pub fn burn( - &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Permill, - ::subxt::BasicError, - > { - if self.client.metadata().constant_hash("Treasury", "Burn")? - == [ - 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, - 91u8, 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, - 74u8, 83u8, 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, - 161u8, 119u8, 2u8, 38u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("Burn")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( - &self, - ) -> ::core::result::Result< - runtime_types::frame_support::PalletId, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Treasury", "PalletId")? - == [ - 11u8, 72u8, 189u8, 18u8, 254u8, 229u8, 67u8, 29u8, 4u8, - 241u8, 192u8, 5u8, 210u8, 194u8, 124u8, 31u8, 19u8, 174u8, - 240u8, 245u8, 169u8, 141u8, 67u8, 251u8, 106u8, 103u8, 15u8, - 167u8, 107u8, 31u8, 121u8, 239u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("PalletId")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of approvals that can wait in the spending queue."] - #[doc = ""] - #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] - pub fn max_approvals( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Treasury", "MaxApprovals")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Treasury")?; - let constant = pallet.constant("MaxApprovals")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod claims { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Claim { - pub dest: ::subxt::sp_core::crypto::AccountId32, - pub ethereum_signature: - runtime_types::polkadot_runtime_common::claims::EcdsaSignature, - } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "claim"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct MintClaim { - pub who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub value: ::core::primitive::u128, - pub vesting_schedule: ::core::option::Option<( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - )>, - pub statement: ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, - >, - } - impl ::subxt::Call for MintClaim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "mint_claim"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClaimAttest { - pub dest: ::subxt::sp_core::crypto::AccountId32, - pub ethereum_signature: - runtime_types::polkadot_runtime_common::claims::EcdsaSignature, - pub statement: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for ClaimAttest { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "claim_attest"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Attest { - pub statement: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Attest { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "attest"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct MoveClaim { - pub old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub maybe_preclaim: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for MoveClaim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "move_claim"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Make a claim to collect your DOTs."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to claim is deemed valid if the signature provided matches"] - #[doc = "the expected signed message of:"] - #[doc = ""] - #[doc = "> Ethereum Signed Message:"] - #[doc = "> (configured prefix string)(address)"] - #[doc = ""] - #[doc = "and `address` matches the `dest` account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `dest`: The destination account to payout the claim."] - #[doc = "- `ethereum_signature`: The signature of an ethereum signed message"] - #[doc = " matching the format described above."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to validate unsigned `claim` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn claim( - &self, - dest: ::subxt::sp_core::crypto::AccountId32, - ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Claim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 8u8, 205u8, 188u8, 57u8, 197u8, 203u8, 156u8, 65u8, 246u8, - 236u8, 199u8, 6u8, 152u8, 34u8, 251u8, 178u8, 206u8, 127u8, - 167u8, 59u8, 43u8, 162u8, 154u8, 89u8, 215u8, 192u8, 18u8, - 100u8, 66u8, 7u8, 97u8, 229u8, - ] - { - let call = Claim { - dest, - ethereum_signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Mint a new claim to collect DOTs."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `who`: The Ethereum address allowed to collect this claim."] - #[doc = "- `value`: The number of DOTs that will be claimed."] - #[doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "We assume worst case that both vesting and statement is being inserted."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn mint_claim( - &self, - who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - value: ::core::primitive::u128, - vesting_schedule: ::core::option::Option<( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - )>, - statement: ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - MintClaim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 10u8, 141u8, 200u8, 102u8, 21u8, 205u8, 178u8, 247u8, 154u8, - 245u8, 172u8, 178u8, 26u8, 249u8, 179u8, 236u8, 198u8, 4u8, - 183u8, 239u8, 39u8, 188u8, 146u8, 231u8, 244u8, 6u8, 31u8, - 180u8, 101u8, 157u8, 53u8, 59u8, - ] - { - let call = MintClaim { - who, - value, - vesting_schedule, - statement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make a claim to collect your DOTs by signing a statement."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _None_."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] - #[doc = "the expected signed message of:"] - #[doc = ""] - #[doc = "> Ethereum Signed Message:"] - #[doc = "> (configured prefix string)(address)(statement)"] - #[doc = ""] - #[doc = "and `address` matches the `dest` account; the `statement` must match that which is"] - #[doc = "expected according to your purchase arrangement."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `dest`: The destination account to payout the claim."] - #[doc = "- `ethereum_signature`: The signature of an ethereum signed message"] - #[doc = " matching the format described above."] - #[doc = "- `statement`: The identity of the statement which is being attested to in the signature."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to validate unsigned `claim_attest` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn claim_attest( - &self, - dest: ::subxt::sp_core::crypto::AccountId32, - ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, - statement: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClaimAttest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 116u8, 181u8, 28u8, 215u8, 245u8, 86u8, 215u8, 114u8, 201u8, - 250u8, 168u8, 43u8, 91u8, 74u8, 0u8, 61u8, 40u8, 135u8, 6u8, - 241u8, 18u8, 24u8, 153u8, 152u8, 22u8, 165u8, 172u8, 94u8, - 200u8, 53u8, 92u8, 212u8, - ] - { - let call = ClaimAttest { - dest, - ethereum_signature, - statement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Attest to a statement, needed to finalize the claims process."] - #[doc = ""] - #[doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] - #[doc = ""] - #[doc = "Unsigned Validation:"] - #[doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] - #[doc = "and provides a `statement` which is expected for the account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `statement`: The identity of the statement which is being attested to in the signature."] - #[doc = ""] - #[doc = ""] - #[doc = "The weight of this call is invariant over the input parameters."] - #[doc = "Weight includes logic to do pre-validation on `attest` call."] - #[doc = ""] - #[doc = "Total Complexity: O(1)"] - #[doc = ""] - pub fn attest( - &self, - statement: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Attest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 7u8, 206u8, 87u8, 155u8, 225u8, 220u8, 145u8, 206u8, 87u8, - 132u8, 171u8, 67u8, 104u8, 91u8, 247u8, 39u8, 114u8, 156u8, - 185u8, 28u8, 194u8, 104u8, 32u8, 25u8, 50u8, 94u8, 249u8, - 196u8, 83u8, 36u8, 123u8, 106u8, - ] - { - let call = Attest { statement }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub fn move_claim( - &self, - old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - maybe_preclaim: ::core::option::Option< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - MoveClaim, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 7u8, 59u8, 57u8, 165u8, 149u8, 105u8, 40u8, 11u8, 62u8, - 212u8, 35u8, 185u8, 38u8, 244u8, 14u8, 170u8, 73u8, 160u8, - 100u8, 124u8, 20u8, 147u8, 12u8, 208u8, 124u8, 122u8, 148u8, - 12u8, 173u8, 61u8, 137u8, 20u8, - ] - { - let call = MoveClaim { - old, - new, - maybe_preclaim, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for Claimed { - const PALLET: &'static str = "Claims"; - const EVENT: &'static str = "Claimed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Claims<'a>( - pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Claims<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Claims"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Total; - impl ::subxt::StorageEntry for Total { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Total"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Vesting<'a>( - pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Vesting<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Vesting"; - type Value = ( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Signing<'a>( - pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Signing<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Signing"; - type Value = - runtime_types::polkadot_runtime_common::claims::StatementKind; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Preclaims<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Preclaims<'_> { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Preclaims"; - type Value = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub 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, - > { - if self.client.metadata().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 async fn claims_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Claims<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - pub async fn total( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The statement kind that must be signed, if any."] - pub async fn signing( - &self, - _0: &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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 async fn preclaims_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Preclaims<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn prefix( - &self, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - if self.client.metadata().constant_hash("Claims", "Prefix")? - == [ - 106u8, 50u8, 57u8, 116u8, 43u8, 202u8, 37u8, 248u8, 102u8, - 22u8, 62u8, 22u8, 242u8, 54u8, 152u8, 168u8, 107u8, 64u8, - 72u8, 172u8, 124u8, 40u8, 42u8, 110u8, 104u8, 145u8, 31u8, - 144u8, 242u8, 189u8, 145u8, 208u8, - ] - { - let pallet = self.client.metadata().pallet("Claims")?; - let constant = pallet.constant("Prefix")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod vesting { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Vest; - impl ::subxt::Call for Vest { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct VestOther { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for VestOther { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest_other"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct VestedTransfer { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for VestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vested_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceVestedTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for ForceVestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "force_vested_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct MergeSchedules { - pub schedule1_index: ::core::primitive::u32, - pub schedule2_index: ::core::primitive::u32, - } - impl ::subxt::Call for MergeSchedules { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "merge_schedules"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 2 Reads, 2 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] - #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] - #[doc = "# "] - pub fn vest( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Vest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 123u8, 54u8, 10u8, 208u8, 154u8, 24u8, 39u8, 166u8, 64u8, - 27u8, 74u8, 29u8, 243u8, 97u8, 155u8, 5u8, 130u8, 155u8, - 65u8, 181u8, 196u8, 125u8, 45u8, 133u8, 25u8, 33u8, 3u8, - 34u8, 21u8, 167u8, 172u8, 54u8, - ] - { - let call = Vest {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 3 Reads, 3 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account"] - #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] - #[doc = "# "] - pub fn vest_other( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - VestOther, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 220u8, 214u8, 201u8, 84u8, 89u8, 137u8, 126u8, 80u8, 57u8, - 1u8, 178u8, 144u8, 1u8, 79u8, 232u8, 136u8, 62u8, 227u8, - 26u8, 148u8, 78u8, 92u8, 222u8, 210u8, 5u8, 108u8, 245u8, - 51u8, 208u8, 98u8, 184u8, 8u8, - ] - { - let call = VestOther { target }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 3 Reads, 3 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] - #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] - #[doc = "# "] - pub fn vested_transfer( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - VestedTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 117u8, 107u8, 28u8, 234u8, 240u8, 253u8, 122u8, 25u8, 134u8, - 41u8, 162u8, 36u8, 157u8, 82u8, 214u8, 174u8, 132u8, 24u8, - 241u8, 68u8, 126u8, 122u8, 162u8, 130u8, 62u8, 43u8, 145u8, - 90u8, 49u8, 200u8, 25u8, 137u8, - ] - { - let call = VestedTransfer { target, schedule }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 4 Reads, 4 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, Source Account"] - #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] - #[doc = "# "] - pub fn force_vested_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceVestedTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 32u8, 195u8, 99u8, 57u8, 6u8, 182u8, 106u8, 47u8, 9u8, 19u8, - 255u8, 80u8, 244u8, 205u8, 129u8, 78u8, 6u8, 215u8, 224u8, - 151u8, 14u8, 219u8, 46u8, 11u8, 200u8, 160u8, 79u8, 193u8, - 49u8, 252u8, 180u8, 151u8, - ] - { - let call = ForceVestedTransfer { - source, - target, - schedule, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - pub fn merge_schedules( - &self, - schedule1_index: ::core::primitive::u32, - schedule2_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - MergeSchedules, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 185u8, 253u8, 214u8, 24u8, 208u8, 226u8, 0u8, 212u8, 92u8, - 174u8, 252u8, 44u8, 250u8, 96u8, 66u8, 55u8, 88u8, 252u8, - 152u8, 238u8, 186u8, 85u8, 45u8, 213u8, 49u8, 42u8, 50u8, - 127u8, 30u8, 53u8, 73u8, 7u8, - ] - { - let call = MergeSchedules { - schedule1_index, - schedule2_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_vesting::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The amount vested has been updated. This could indicate a change in funds available."] - #[doc = "The balance given is the amount which is left unvested (and thus locked)."] - pub struct VestingUpdated { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub unvested: ::core::primitive::u128, - } - impl ::subxt::Event for VestingUpdated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An \\[account\\] has become fully vested."] - pub struct VestingCompleted { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for VestingCompleted { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingCompleted"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Vesting<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Vesting<'_> { - const PALLET: &'static str = "Vesting"; - const STORAGE: &'static str = "Vesting"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Vesting"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_vesting::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Information regarding the vesting of a given account."] - pub async fn vesting( - &self, - _0: &::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, - >, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The minimum amount transferred to call `vested_transfer`."] - pub fn min_vested_transfer( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Vesting", "MinVestedTransfer")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Vesting")?; - let constant = pallet.constant("MinVestedTransfer")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub fn max_vesting_schedules( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Vesting", "MaxVestingSchedules")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Vesting")?; - let constant = pallet.constant("MaxVestingSchedules")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod utility { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Batch { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for Batch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AsDerivative { - pub index: ::core::primitive::u16, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct BatchAll { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct DispatchAs { - pub as_origin: - ::std::boxed::Box, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for DispatchAs { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "dispatch_as"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub fn batch( - &self, - calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Batch, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 102u8, 106u8, 179u8, 188u8, 99u8, 111u8, 210u8, 69u8, 179u8, - 206u8, 207u8, 163u8, 116u8, 184u8, 55u8, 228u8, 157u8, 241u8, - 23u8, 78u8, 112u8, 158u8, 56u8, 192u8, 79u8, 222u8, 0u8, - 104u8, 21u8, 13u8, 54u8, 184u8, - ] - { - let call = Batch { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] - #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn as_derivative( - &self, - index: ::core::primitive::u16, - call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsDerivative, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 195u8, 145u8, 176u8, 37u8, 226u8, 104u8, 213u8, 93u8, 246u8, - 7u8, 117u8, 101u8, 123u8, 125u8, 244u8, 74u8, 67u8, 118u8, - 106u8, 181u8, 172u8, 83u8, 17u8, 60u8, 133u8, 136u8, 219u8, - 67u8, 43u8, 93u8, 38u8, 89u8, - ] - { - let call = AsDerivative { - index, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - pub fn batch_all( - &self, - calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - BatchAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 199u8, 220u8, 25u8, 148u8, 69u8, 105u8, 234u8, 113u8, 221u8, - 220u8, 186u8, 34u8, 184u8, 101u8, 41u8, 87u8, 134u8, 92u8, - 134u8, 241u8, 44u8, 116u8, 95u8, 81u8, 174u8, 253u8, 214u8, - 191u8, 88u8, 24u8, 211u8, 135u8, - ] - { - let call = BatchAll { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] - #[doc = "# "] - pub fn dispatch_as( - &self, - as_origin: runtime_types::polkadot_runtime::OriginCaller, - call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DispatchAs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 188u8, 19u8, 178u8, 56u8, 121u8, 41u8, 46u8, 232u8, 118u8, - 56u8, 66u8, 6u8, 174u8, 184u8, 92u8, 66u8, 178u8, 213u8, - 220u8, 88u8, 109u8, 223u8, 186u8, 2u8, 68u8, 152u8, 137u8, - 131u8, 191u8, 194u8, 221u8, 254u8, - ] - { - let call = DispatchAs { - as_origin: ::std::boxed::Box::new(as_origin), - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_utility::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] - #[doc = "well as the error."] - pub struct BatchInterrupted { - pub index: ::core::primitive::u32, - pub error: runtime_types::sp_runtime::DispatchError, - } - impl ::subxt::Event for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Batch of dispatches completed fully with no error."] - pub struct BatchCompleted; - impl ::subxt::Event for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A single item within a Batch of dispatches has completed with no error."] - pub struct ItemCompleted; - impl ::subxt::Event for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A call was dispatched."] - pub struct DispatchedAs { - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for DispatchedAs { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "DispatchedAs"; - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The limit on the number of batched calls."] - pub fn batched_calls_limit( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Utility", "batched_calls_limit")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Utility")?; - let constant = pallet.constant("batched_calls_limit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod identity { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddRegistrar { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for AddRegistrar { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "add_registrar"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetIdentity { - pub info: ::std::boxed::Box< - runtime_types::pallet_identity::types::IdentityInfo, - >, - } - impl ::subxt::Call for SetIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_identity"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetSubs { - pub subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - } - impl ::subxt::Call for SetSubs { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_subs"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClearIdentity; - impl ::subxt::Call for ClearIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "clear_identity"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RequestJudgement { - #[codec(compact)] - pub reg_index: ::core::primitive::u32, - #[codec(compact)] - pub max_fee: ::core::primitive::u128, - } - impl ::subxt::Call for RequestJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "request_judgement"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct CancelRequest { - pub reg_index: ::core::primitive::u32, - } - impl ::subxt::Call for CancelRequest { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "cancel_request"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetFee { - #[codec(compact)] - pub index: ::core::primitive::u32, - #[codec(compact)] - pub fee: ::core::primitive::u128, - } - impl ::subxt::Call for SetFee { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_fee"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetAccountId { - #[codec(compact)] - pub index: ::core::primitive::u32, - pub new: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetAccountId { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_account_id"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetFields { - #[codec(compact)] - pub index: ::core::primitive::u32, - pub fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - } - impl ::subxt::Call for SetFields { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_fields"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProvideJudgement { - #[codec(compact)] - pub reg_index: ::core::primitive::u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub judgement: runtime_types::pallet_identity::types::Judgement< - ::core::primitive::u128, - >, - } - impl ::subxt::Call for ProvideJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "provide_judgement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct KillIdentity { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for KillIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "kill_identity"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub data: runtime_types::pallet_identity::types::Data, - } - impl ::subxt::Call for AddSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "add_sub"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RenameSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub data: runtime_types::pallet_identity::types::Data, - } - impl ::subxt::Call for RenameSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "rename_sub"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for RemoveSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "remove_sub"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct QuitSub; - impl ::subxt::Call for QuitSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "quit_sub"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Add a registrar to the system."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] - #[doc = ""] - #[doc = "- `account`: the account of the registrar."] - #[doc = ""] - #[doc = "Emits `RegistrarAdded` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)` where `R` registrar-count (governance-bounded and code-bounded)."] - #[doc = "- One storage mutation (codec `O(R)`)."] - #[doc = "- One event."] - #[doc = "# "] - pub fn add_registrar( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddRegistrar, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 252u8, 233u8, 148u8, 186u8, 42u8, 127u8, 183u8, 107u8, 205u8, - 34u8, 63u8, 170u8, 82u8, 218u8, 141u8, 136u8, 174u8, 45u8, - 3u8, 226u8, 175u8, 22u8, 18u8, 120u8, 70u8, 4u8, 164u8, - 147u8, 228u8, 52u8, 199u8, 196u8, - ] - { - let call = AddRegistrar { account }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set an account's identity information and reserve the appropriate deposit."] - #[doc = ""] - #[doc = "If the account already has identity information, the deposit is taken as part payment"] - #[doc = "for the new deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `info`: The identity information."] - #[doc = ""] - #[doc = "Emits `IdentitySet` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(X + X' + R)`"] - #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)"] - #[doc = " - where `R` judgements-count (registrar-count-bounded)"] - #[doc = "- One balance reserve operation."] - #[doc = "- One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`)."] - #[doc = "- One event."] - #[doc = "# "] - pub fn set_identity( - &self, - info: runtime_types::pallet_identity::types::IdentityInfo, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetIdentity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 174u8, 5u8, 84u8, 201u8, 219u8, 147u8, 45u8, 241u8, 46u8, - 192u8, 221u8, 20u8, 233u8, 128u8, 206u8, 1u8, 71u8, 244u8, - 153u8, 167u8, 150u8, 164u8, 16u8, 58u8, 51u8, 168u8, 58u8, - 184u8, 204u8, 229u8, 135u8, 91u8, - ] - { - let call = SetIdentity { - info: ::std::boxed::Box::new(info), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the sub-accounts of the sender."] - #[doc = ""] - #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] - #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "- `subs`: The identity's (new) sub-accounts."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(P + S)`"] - #[doc = " - where `P` old-subs-count (hard- and deposit-bounded)."] - #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] - #[doc = "- At most one balance operations."] - #[doc = "- DB:"] - #[doc = " - `P + S` storage mutations (codec complexity `O(1)`)"] - #[doc = " - One storage read (codec complexity `O(P)`)."] - #[doc = " - One storage write (codec complexity `O(S)`)."] - #[doc = " - One storage-exists (`IdentityOf::contains_key`)."] - #[doc = "# "] - pub fn set_subs( - &self, - subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetSubs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 157u8, 141u8, 52u8, 45u8, 109u8, 252u8, 84u8, 0u8, 38u8, - 209u8, 193u8, 212u8, 177u8, 47u8, 219u8, 132u8, 254u8, 234u8, - 43u8, 200u8, 104u8, 149u8, 250u8, 169u8, 119u8, 208u8, 111u8, - 184u8, 70u8, 161u8, 245u8, 33u8, - ] - { - let call = SetSubs { subs }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] - #[doc = ""] - #[doc = "Payment: All reserved balances on the account are returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "Emits `IdentityCleared` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + S + X)`"] - #[doc = " - where `R` registrar-count (governance-bounded)."] - #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] - #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)."] - #[doc = "- One balance-unreserve operation."] - #[doc = "- `2` storage reads and `S + 2` storage deletions."] - #[doc = "- One event."] - #[doc = "# "] - pub fn clear_identity( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearIdentity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 75u8, 44u8, 74u8, 122u8, 149u8, 202u8, 114u8, 230u8, 0u8, - 255u8, 140u8, 122u8, 14u8, 196u8, 205u8, 249u8, 220u8, 94u8, - 216u8, 34u8, 63u8, 14u8, 8u8, 205u8, 74u8, 23u8, 181u8, - 129u8, 252u8, 110u8, 231u8, 114u8, - ] - { - let call = ClearIdentity {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Request a judgement from a registrar."] - #[doc = ""] - #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] - #[doc = "given."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] - #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] - #[doc = ""] - #[doc = "```nocompile"] - #[doc = "Self::registrars().get(reg_index).unwrap().fee"] - #[doc = "```"] - #[doc = ""] - #[doc = "Emits `JudgementRequested` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + X)`."] - #[doc = "- One balance-reserve operation."] - #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(X + R)`."] - #[doc = "- One event."] - #[doc = "# "] - pub fn request_judgement( - &self, - reg_index: ::core::primitive::u32, - max_fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RequestJudgement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 90u8, 137u8, 162u8, 2u8, 124u8, 245u8, 7u8, 200u8, 235u8, - 138u8, 217u8, 247u8, 77u8, 87u8, 152u8, 2u8, 13u8, 175u8, - 106u8, 202u8, 204u8, 113u8, 24u8, 127u8, 105u8, 136u8, 191u8, - 133u8, 212u8, 138u8, 22u8, 173u8, - ] - { - let call = RequestJudgement { reg_index, max_fee }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a previous request."] - #[doc = ""] - #[doc = "Payment: A previously reserved deposit is returned on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] - #[doc = ""] - #[doc = "Emits `JudgementUnrequested` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + X)`."] - #[doc = "- One balance-reserve operation."] - #[doc = "- One storage mutation `O(R + X)`."] - #[doc = "- One event"] - #[doc = "# "] - pub fn cancel_request( - &self, - reg_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelRequest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 153u8, 44u8, 7u8, 70u8, 91u8, 44u8, 138u8, 219u8, 118u8, - 67u8, 166u8, 133u8, 90u8, 234u8, 248u8, 42u8, 108u8, 51u8, - 229u8, 196u8, 74u8, 167u8, 40u8, 229u8, 168u8, 159u8, 2u8, - 231u8, 236u8, 58u8, 109u8, 32u8, - ] - { - let call = CancelRequest { reg_index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the fee required for a judgement to be requested from a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fee`: the new fee."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)`."] - #[doc = "- One storage mutation `O(R)`."] - #[doc = "- Benchmark: 7.315 + R * 0.329 µs (min squares analysis)"] - #[doc = "# "] - pub fn set_fee( - &self, - index: ::core::primitive::u32, - fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetFee, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 222u8, 115u8, 155u8, 44u8, 68u8, 179u8, 201u8, 247u8, 141u8, - 226u8, 124u8, 20u8, 188u8, 47u8, 190u8, 21u8, 212u8, 192u8, - 213u8, 76u8, 241u8, 75u8, 87u8, 142u8, 157u8, 229u8, 136u8, - 254u8, 250u8, 28u8, 69u8, 218u8, - ] - { - let call = SetFee { index, fee }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Change the account associated with a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `new`: the new account ID."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)`."] - #[doc = "- One storage mutation `O(R)`."] - #[doc = "- Benchmark: 8.823 + R * 0.32 µs (min squares analysis)"] - #[doc = "# "] - pub fn set_account_id( - &self, - index: ::core::primitive::u32, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetAccountId, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 191u8, 243u8, 30u8, 116u8, 109u8, 235u8, 23u8, 106u8, 24u8, - 23u8, 80u8, 203u8, 68u8, 40u8, 116u8, 38u8, 68u8, 161u8, - 219u8, 64u8, 249u8, 179u8, 203u8, 113u8, 55u8, 7u8, 180u8, - 161u8, 37u8, 66u8, 6u8, 90u8, - ] - { - let call = SetAccountId { index, new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the field information for a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fields`: the fields that the registrar concerns themselves with."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)`."] - #[doc = "- One storage mutation `O(R)`."] - #[doc = "- Benchmark: 7.464 + R * 0.325 µs (min squares analysis)"] - #[doc = "# "] - pub fn set_fields( - &self, - index: ::core::primitive::u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetFields, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 253u8, 43u8, 154u8, 17u8, 161u8, 187u8, 72u8, 96u8, 20u8, - 240u8, 97u8, 43u8, 242u8, 79u8, 115u8, 38u8, 130u8, 243u8, - 176u8, 46u8, 16u8, 126u8, 191u8, 32u8, 106u8, 200u8, 134u8, - 72u8, 244u8, 189u8, 165u8, 125u8, - ] - { - let call = SetFields { index, fields }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Provide a judgement for an account's identity."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `reg_index`."] - #[doc = ""] - #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] - #[doc = ""] - #[doc = "Emits `JudgementGiven` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + X)`."] - #[doc = "- One balance-transfer operation."] - #[doc = "- Up to one account-lookup operation."] - #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(R + X)`."] - #[doc = "- One event."] - #[doc = "# "] - pub fn provide_judgement( - &self, - reg_index: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - judgement: runtime_types::pallet_identity::types::Judgement< - ::core::primitive::u128, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProvideJudgement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 238u8, 210u8, 71u8, 239u8, 251u8, 52u8, 145u8, 71u8, 68u8, - 185u8, 103u8, 82u8, 21u8, 164u8, 128u8, 189u8, 123u8, 141u8, - 213u8, 77u8, 139u8, 10u8, 6u8, 229u8, 227u8, 58u8, 236u8, - 123u8, 139u8, 192u8, 200u8, 170u8, - ] - { - let call = ProvideJudgement { - reg_index, - target, - judgement, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove an account's identity and sub-account information and slash the deposits."] - #[doc = ""] - #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] - #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] - #[doc = "manually using `cancel_request`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - #[doc = ""] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = ""] - #[doc = "Emits `IdentityKilled` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + S + X)`."] - #[doc = "- One balance-reserve operation."] - #[doc = "- `S + 2` storage mutations."] - #[doc = "- One event."] - #[doc = "# "] - pub fn kill_identity( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillIdentity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 91u8, 164u8, 242u8, 44u8, 253u8, 203u8, 102u8, 89u8, 218u8, - 150u8, 227u8, 56u8, 179u8, 135u8, 93u8, 107u8, 166u8, 157u8, - 187u8, 180u8, 215u8, 129u8, 56u8, 110u8, 5u8, 243u8, 219u8, - 205u8, 11u8, 229u8, 29u8, 188u8, - ] - { - let call = KillIdentity { target }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add the given account to the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub fn add_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 105u8, 38u8, 167u8, 99u8, 224u8, 183u8, 88u8, 133u8, 180u8, - 78u8, 211u8, 239u8, 49u8, 128u8, 224u8, 61u8, 23u8, 249u8, - 91u8, 16u8, 216u8, 40u8, 240u8, 77u8, 209u8, 91u8, 174u8, - 211u8, 175u8, 238u8, 131u8, 208u8, - ] - { - let call = AddSub { sub, data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Alter the associated name of the given sub-account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub fn rename_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RenameSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 17u8, 110u8, 213u8, 124u8, 4u8, 76u8, 182u8, 53u8, 102u8, - 224u8, 240u8, 250u8, 94u8, 96u8, 181u8, 107u8, 114u8, 127u8, - 37u8, 15u8, 95u8, 7u8, 238u8, 172u8, 30u8, 125u8, 70u8, 7u8, - 97u8, 182u8, 3u8, 197u8, - ] - { - let call = RenameSub { sub, data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the given account from the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - pub fn remove_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 161u8, 114u8, 68u8, 57u8, 166u8, 240u8, 150u8, 95u8, 176u8, - 93u8, 62u8, 67u8, 185u8, 226u8, 117u8, 97u8, 119u8, 139u8, - 86u8, 52u8, 161u8, 88u8, 30u8, 20u8, 123u8, 20u8, 130u8, - 17u8, 44u8, 17u8, 47u8, 14u8, - ] - { - let call = RemoveSub { sub }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the sender as a sub-account."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender (*not* the original depositor)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "super-identity."] - #[doc = ""] - #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] - #[doc = "controller of an account is maliciously registered as a sub-account."] - pub fn quit_sub( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - QuitSub, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 62u8, 57u8, 73u8, 72u8, 119u8, 216u8, 250u8, 155u8, 57u8, - 169u8, 157u8, 44u8, 87u8, 51u8, 63u8, 231u8, 77u8, 7u8, 0u8, - 119u8, 244u8, 42u8, 179u8, 51u8, 254u8, 240u8, 55u8, 25u8, - 142u8, 38u8, 87u8, 44u8, - ] - { - let call = QuitSub {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_identity::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A name was set or reset (which will remove all judgements)."] - pub struct IdentitySet { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for IdentitySet { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentitySet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A name was cleared, and the given balance returned."] - pub struct IdentityCleared { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for IdentityCleared { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A name was removed and the given balance slashed."] - pub struct IdentityKilled { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for IdentityKilled { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityKilled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A judgement was asked from a registrar."] - pub struct JudgementRequested { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub registrar_index: ::core::primitive::u32, - } - impl ::subxt::Event for JudgementRequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementRequested"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A judgement request was retracted."] - pub struct JudgementUnrequested { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub registrar_index: ::core::primitive::u32, - } - impl ::subxt::Event for JudgementUnrequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementUnrequested"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A judgement was given by a registrar."] - pub struct JudgementGiven { - pub target: ::subxt::sp_core::crypto::AccountId32, - pub registrar_index: ::core::primitive::u32, - } - impl ::subxt::Event for JudgementGiven { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementGiven"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A registrar was added."] - pub struct RegistrarAdded { - pub registrar_index: ::core::primitive::u32, - } - impl ::subxt::Event for RegistrarAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "RegistrarAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A sub-identity was added to an identity and the deposit paid."] - pub struct SubIdentityAdded { - pub sub: ::subxt::sp_core::crypto::AccountId32, - pub main: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for SubIdentityAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A sub-identity was removed from an identity and the deposit freed."] - pub struct SubIdentityRemoved { - pub sub: ::subxt::sp_core::crypto::AccountId32, - pub main: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for SubIdentityRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRemoved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] - #[doc = "main identity account to the sub-identity account."] - pub struct SubIdentityRevoked { - pub sub: ::subxt::sp_core::crypto::AccountId32, - pub main: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for SubIdentityRevoked { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRevoked"; - } - } - pub mod storage { - use super::runtime_types; - pub struct IdentityOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for IdentityOf<'_> { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "IdentityOf"; - type Value = runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct SuperOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SuperOf<'_> { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "SuperOf"; - type Value = ( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct SubsOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SubsOf<'_> { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "SubsOf"; - type Value = ( - ::core::primitive::u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Registrars; - 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, - >, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " 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( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Alternative \"sub\" identities of this account."] - #[doc = ""] - #[doc = " The first item is the deposit, the second is a vector of the accounts."] - #[doc = ""] - #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub async fn subs_of( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Alternative \"sub\" identities of this account."] - #[doc = ""] - #[doc = " The first item is the deposit, the second is a vector of the accounts."] - #[doc = ""] - #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub async fn subs_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SubsOf<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &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, - >, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The amount held on deposit for a registered identity"] - pub fn basic_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Identity", "BasicDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Identity")?; - let constant = pallet.constant("BasicDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount held on deposit per additional field for a registered identity."] - pub fn field_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Identity", "FieldDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Identity")?; - let constant = pallet.constant("FieldDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount held on deposit for a registered subaccount. This should account for the fact"] - #[doc = " that one storage item's value will increase by the size of an account ID, and there will"] - #[doc = " be another trie item whose value is the size of an account ID plus 32 bytes."] - pub fn sub_account_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Identity", "SubAccountDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Identity")?; - let constant = pallet.constant("SubAccountDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of sub-accounts allowed per identified account."] - pub fn max_sub_accounts( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Identity", "MaxSubAccounts")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Identity")?; - let constant = pallet.constant("MaxSubAccounts")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O"] - #[doc = " required to access an identity, but can be pretty high."] - pub fn max_additional_fields( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Identity", "MaxAdditionalFields")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Identity")?; - let constant = pallet.constant("MaxAdditionalFields")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maxmimum number of registrars allowed in the system. Needed to bound the complexity"] - #[doc = " of, e.g., updating judgements."] - pub fn max_registrars( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Identity", "MaxRegistrars")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Identity")?; - let constant = pallet.constant("MaxRegistrars")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod proxy { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: - ::core::option::Option, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Call for AddProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "add_proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Call for RemoveProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveProxies; - impl ::subxt::Call for RemoveProxies { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxies"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Anonymous { - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: ::core::primitive::u32, - pub index: ::core::primitive::u16, - } - impl ::subxt::Call for Anonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "anonymous"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct KillAnonymous { - pub spawner: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub index: ::core::primitive::u16, - #[codec(compact)] - pub height: ::core::primitive::u32, - #[codec(compact)] - pub ext_index: ::core::primitive::u32, - } - impl ::subxt::Call for KillAnonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "kill_anonymous"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Announce { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for Announce { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "announce"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RemoveAnnouncement { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RemoveAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_announcement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RejectAnnouncement { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RejectAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "reject_announcement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProxyAnnounced { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: - ::core::option::Option, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn proxy( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::polkadot_runtime::ProxyType, - >, - call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Proxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 182u8, 110u8, 37u8, 47u8, 200u8, 93u8, 71u8, 195u8, 61u8, - 58u8, 197u8, 39u8, 17u8, 203u8, 192u8, 222u8, 55u8, 103u8, - 91u8, 226u8, 255u8, 253u8, 20u8, 71u8, 59u8, 53u8, 11u8, - 193u8, 239u8, 216u8, 100u8, 47u8, - ] - { - let call = Proxy { - real, - force_proxy_type, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] - #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn add_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddProxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 97u8, 149u8, 34u8, 218u8, 51u8, 242u8, 47u8, 167u8, 203u8, - 128u8, 248u8, 193u8, 156u8, 141u8, 184u8, 221u8, 209u8, 79u8, - 162u8, 36u8, 48u8, 110u8, 208u8, 62u8, 105u8, 117u8, 192u8, - 18u8, 37u8, 185u8, 136u8, 66u8, - ] - { - let call = AddProxy { - delegate, - proxy_type, - delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unregister a proxy account for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] - #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn remove_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveProxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 246u8, 251u8, 192u8, 17u8, 128u8, 248u8, 24u8, 118u8, 127u8, - 101u8, 140u8, 72u8, 248u8, 161u8, 187u8, 89u8, 193u8, 44u8, - 0u8, 86u8, 16u8, 116u8, 28u8, 227u8, 108u8, 120u8, 177u8, - 213u8, 218u8, 20u8, 196u8, 7u8, - ] - { - let call = RemoveProxy { - delegate, - proxy_type, - delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unregister all proxy accounts for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] - #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn remove_proxies( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveProxies, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 15u8, 237u8, 27u8, 166u8, 254u8, 218u8, 92u8, 5u8, 213u8, - 239u8, 99u8, 59u8, 1u8, 26u8, 73u8, 252u8, 81u8, 94u8, 214u8, - 227u8, 169u8, 58u8, 40u8, 253u8, 187u8, 225u8, 192u8, 26u8, - 19u8, 23u8, 121u8, 129u8, - ] - { - let call = RemoveProxies {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] - #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] - #[doc = ""] - #[doc = "Requires a `Signed` origin."] - #[doc = ""] - #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] - #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] - #[doc = "allow for maximum flexibility."] - #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] - #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] - #[doc = "want to use `0`."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] - #[doc = "same sender, with the same parameters."] - #[doc = ""] - #[doc = "Fails if there are insufficient funds to pay for deposit."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - #[doc = "TODO: Might be over counting 1 read"] - pub fn anonymous( - &self, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Anonymous, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 159u8, 186u8, 126u8, 58u8, 255u8, 163u8, 207u8, 66u8, 165u8, - 182u8, 248u8, 28u8, 134u8, 186u8, 1u8, 122u8, 40u8, 64u8, - 0u8, 124u8, 0u8, 5u8, 140u8, 131u8, 21u8, 66u8, 182u8, 216u8, - 202u8, 29u8, 75u8, 180u8, - ] - { - let call = Anonymous { - proxy_type, - delay, - index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Removes a previously spawned anonymous proxy."] - #[doc = ""] - #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] - #[doc = "inaccessible."] - #[doc = ""] - #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`anonymous` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] - #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] - #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] - #[doc = "account whose `anonymous` call has corresponding parameters."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn kill_anonymous( - &self, - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - index: ::core::primitive::u16, - height: ::core::primitive::u32, - ext_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillAnonymous, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 59u8, 188u8, 45u8, 180u8, 9u8, 242u8, 36u8, 245u8, 25u8, - 57u8, 66u8, 216u8, 82u8, 220u8, 144u8, 233u8, 83u8, 1u8, - 182u8, 185u8, 27u8, 106u8, 33u8, 5u8, 22u8, 171u8, 222u8, - 130u8, 125u8, 73u8, 127u8, 156u8, - ] - { - let call = KillAnonymous { - spawner, - proxy_type, - index, - height, - ext_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Publish the hash of a proxy-call that will be made in the future."] - #[doc = ""] - #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] - #[doc = "if the delay associated with the proxy relationship is greater than zero."] - #[doc = ""] - #[doc = "No more than `MaxPending` announcements may be made at any one time."] - #[doc = ""] - #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] - #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn announce( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Announce, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 102u8, 8u8, 136u8, 179u8, 13u8, 47u8, 158u8, 24u8, 93u8, - 196u8, 52u8, 22u8, 118u8, 98u8, 17u8, 8u8, 12u8, 51u8, 181u8, - 75u8, 215u8, 133u8, 201u8, 180u8, 231u8, 122u8, 198u8, 190u8, - 188u8, 127u8, 228u8, 218u8, - ] - { - let call = Announce { real, call_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a given announcement."] - #[doc = ""] - #[doc = "May be called by a proxy account to remove a call they previously announced and return"] - #[doc = "the deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn remove_announcement( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveAnnouncement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 209u8, 156u8, 215u8, 188u8, 225u8, 230u8, 171u8, 228u8, - 241u8, 105u8, 43u8, 183u8, 234u8, 18u8, 170u8, 239u8, 232u8, - 188u8, 37u8, 84u8, 156u8, 50u8, 241u8, 170u8, 9u8, 148u8, - 185u8, 172u8, 204u8, 63u8, 187u8, 253u8, - ] - { - let call = RemoveAnnouncement { real, call_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the given announcement of a delegate."] - #[doc = ""] - #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] - #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `delegate`: The account that previously announced the call."] - #[doc = "- `call_hash`: The hash of the call to be made."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn reject_announcement( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RejectAnnouncement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 26u8, 67u8, 197u8, 169u8, 243u8, 11u8, 94u8, 153u8, 50u8, - 22u8, 176u8, 103u8, 88u8, 2u8, 13u8, 10u8, 96u8, 7u8, 121u8, - 148u8, 13u8, 96u8, 20u8, 67u8, 76u8, 51u8, 81u8, 54u8, 244u8, - 44u8, 94u8, 52u8, - ] - { - let call = RejectAnnouncement { - delegate, - call_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn proxy_announced( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::polkadot_runtime::ProxyType, - >, - call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProxyAnnounced, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 4u8, 205u8, 80u8, 128u8, 70u8, 110u8, 11u8, 69u8, 145u8, - 61u8, 218u8, 229u8, 208u8, 105u8, 190u8, 234u8, 189u8, 169u8, - 188u8, 10u8, 142u8, 144u8, 23u8, 200u8, 215u8, 180u8, 128u8, - 37u8, 95u8, 163u8, 205u8, 87u8, - ] - { - let call = ProxyAnnounced { - delegate, - real, - force_proxy_type, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_proxy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proxy was executed correctly, with the given."] - pub struct ProxyExecuted { - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for ProxyExecuted { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyExecuted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Anonymous account has been created by new proxy with given"] - #[doc = "disambiguation index and proxy type."] - pub struct AnonymousCreated { - pub anonymous: ::subxt::sp_core::crypto::AccountId32, - pub who: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub disambiguation_index: ::core::primitive::u16, - } - impl ::subxt::Event for AnonymousCreated { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "AnonymousCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An announcement was placed to make a call in the future."] - pub struct Announced { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub proxy: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Announced { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "Announced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proxy was added."] - pub struct ProxyAdded { - pub delegator: ::subxt::sp_core::crypto::AccountId32, - pub delegatee: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Event for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A proxy was removed."] - pub struct ProxyRemoved { - pub delegator: ::subxt::sp_core::crypto::AccountId32, - pub delegatee: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Event for ProxyRemoved { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyRemoved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proxies<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Proxies<'_> { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Proxies"; - type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Announcements<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Announcements<'_> { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Announcements"; - type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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( - &self, - _0: &::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, - >, - >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The announcements made by the proxy (key)."] - pub async fn announcements( - &self, - _0: &::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, - >, - >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The base amount of currency needed to reserve for creating a proxy."] - #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes."] - pub fn proxy_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Proxy", "ProxyDepositBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Proxy")?; - let constant = pallet.constant("ProxyDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of currency needed per proxy added."] - #[doc = ""] - #[doc = " This is held for adding 32 bytes plus an instance of `ProxyType` more into a"] - #[doc = " pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take"] - #[doc = " into account `32 + proxy_type.encode().len()` bytes of data."] - pub fn proxy_deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Proxy", "ProxyDepositFactor")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Proxy")?; - let constant = pallet.constant("ProxyDepositFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum amount of proxies allowed for a single account."] - pub fn max_proxies( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Proxy", "MaxProxies")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Proxy")?; - let constant = pallet.constant("MaxProxies")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum amount of time-delayed announcements that are allowed to be pending."] - pub fn max_pending( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Proxy", "MaxPending")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Proxy")?; - let constant = pallet.constant("MaxPending")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The base amount of currency needed to reserve for creating an announcement."] - #[doc = ""] - #[doc = " This is held when a new storage item holding a `Balance` is created (typically 16"] - #[doc = " bytes)."] - pub fn announcement_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Proxy", "AnnouncementDepositBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Proxy")?; - let constant = pallet.constant("AnnouncementDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of currency needed per announcement made."] - #[doc = ""] - #[doc = " This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)"] - #[doc = " into a pre-existing storage value."] - pub fn announcement_deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Proxy", "AnnouncementDepositFactor")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Proxy")?; - let constant = pallet.constant("AnnouncementDepositFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod multisig { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AsMultiThreshold1 { - pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold_1"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AsMulti { - pub threshold: ::core::primitive::u16, - pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - pub call: - ::subxt::WrapperKeepOpaque, - pub store_call: ::core::primitive::bool, - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for AsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ApproveAsMulti { - pub threshold: ::core::primitive::u16, - pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - pub call_hash: [::core::primitive::u8; 32usize], - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for ApproveAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "approve_as_multi"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CancelAsMulti { - pub threshold: ::core::primitive::u16, - pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Call for CancelAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "cancel_as_multi"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = "multi-signature, but do not participate in the approval process."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result."] - #[doc = ""] - #[doc = "# "] - #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight: None"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - pub fn as_multi_threshold_1( - &self, - other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, - >, - call: runtime_types::polkadot_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsMultiThreshold1, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 95u8, 132u8, 202u8, 110u8, 113u8, 89u8, 78u8, 7u8, 190u8, - 143u8, 107u8, 158u8, 56u8, 3u8, 41u8, 167u8, 115u8, 34u8, - 214u8, 63u8, 135u8, 154u8, 60u8, 181u8, 71u8, 157u8, 189u8, - 37u8, 215u8, 212u8, 66u8, 186u8, - ] - { - let call = AsMultiThreshold1 { - other_signatories, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "If there are enough, then dispatch the call."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] - #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] - #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] - #[doc = "may be found in the deposited `MultisigExecuted` event."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S + Z + Call)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- The weight of the `call`."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - pub fn as_multi( - &self, - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, - >, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - call: ::subxt::WrapperKeepOpaque< - runtime_types::polkadot_runtime::Call, - >, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 248u8, 250u8, 144u8, 85u8, 79u8, 224u8, 92u8, 55u8, 76u8, - 55u8, 171u8, 48u8, 122u8, 6u8, 62u8, 155u8, 69u8, 41u8, - 121u8, 233u8, 40u8, 29u8, 224u8, 61u8, 245u8, 80u8, 50u8, - 30u8, 185u8, 92u8, 250u8, 160u8, - ] - { - let call = AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call, - store_call, - max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account]"] - #[doc = " - Write: Multisig Storage, [Caller Account]"] - #[doc = "# "] - pub fn approve_as_multi( - &self, - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, - >, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - call_hash: [::core::primitive::u8; 32usize], - max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveAsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 114u8, 29u8, 118u8, 154u8, 91u8, 4u8, 127u8, 126u8, 190u8, - 180u8, 57u8, 112u8, 72u8, 8u8, 248u8, 126u8, 25u8, 190u8, - 130u8, 86u8, 160u8, 164u8, 76u8, 64u8, 25u8, 175u8, 132u8, - 225u8, 147u8, 166u8, 12u8, 38u8, - ] - { - let call = ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] - #[doc = "for this operation will be unreserved on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] - #[doc = "transaction for this dispatch."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- One event."] - #[doc = "- I/O: 1 read `O(S)`, one remove."] - #[doc = "- Storage: removes one item."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = "# "] - pub fn cancel_as_multi( - &self, - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, - >, - timepoint: runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - call_hash: [::core::primitive::u8; 32usize], - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelAsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 195u8, 216u8, 37u8, 179u8, 9u8, 19u8, 238u8, 94u8, 156u8, - 5u8, 120u8, 78u8, 129u8, 99u8, 239u8, 142u8, 68u8, 12u8, - 254u8, 46u8, 251u8, 8u8, 193u8, 43u8, 37u8, 68u8, 249u8, - 85u8, 163u8, 85u8, 193u8, 47u8, - ] - { - let call = CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_multisig::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new multisig operation has begun."] - pub struct NewMultisig { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Event for NewMultisig { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "NewMultisig"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A multisig operation has been approved by someone."] - pub struct MultisigApproval { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Event for MultisigApproval { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigApproval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A multisig operation has been executed."] - pub struct MultisigExecuted { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for MultisigExecuted { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigExecuted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A multisig operation has been cancelled."] - pub struct MultisigCancelled { - pub cancelling: ::subxt::sp_core::crypto::AccountId32, - pub timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Event for MultisigCancelled { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigCancelled"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Multisigs<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a [::core::primitive::u8; 32usize], - ); - impl ::subxt::StorageEntry for Multisigs<'_> { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Multisigs"; - type Value = runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Calls<'a>(pub &'a [::core::primitive::u8; 32usize]); - impl ::subxt::StorageEntry for Calls<'_> { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = ( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The set of open multisig operations."] - pub async fn multisigs( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &[::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 async fn calls( - &self, - _0: &[::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, - > { - if self.client.metadata().storage_hash::()? - == [ - 51u8, 122u8, 79u8, 127u8, 1u8, 182u8, 39u8, 88u8, 57u8, - 227u8, 141u8, 253u8, 217u8, 23u8, 89u8, 94u8, 37u8, 244u8, - 136u8, 246u8, 87u8, 146u8, 97u8, 23u8, 135u8, 13u8, 32u8, - 14u8, 191u8, 15u8, 2u8, 51u8, - ] - { - let entry = Calls(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn calls_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Calls<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().storage_hash::()? - == [ - 51u8, 122u8, 79u8, 127u8, 1u8, 182u8, 39u8, 88u8, 57u8, - 227u8, 141u8, 253u8, 217u8, 23u8, 89u8, 94u8, 37u8, 244u8, - 136u8, 246u8, 87u8, 146u8, 97u8, 23u8, 135u8, 13u8, 32u8, - 14u8, 191u8, 15u8, 2u8, 51u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The base amount of currency needed to reserve for creating a multisig execution or to"] - #[doc = " store a dispatch call for later."] - #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is"] - #[doc = " `32 + sizeof(AccountId)` bytes."] - pub fn deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Multisig", "DepositBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Multisig")?; - let constant = pallet.constant("DepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of currency needed per unit threshold when creating a multisig execution."] - #[doc = ""] - #[doc = " This is held for adding 32 bytes more into a pre-existing storage value."] - pub fn deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Multisig", "DepositFactor")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Multisig")?; - let constant = pallet.constant("DepositFactor")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum amount of signatories allowed in the multisig."] - pub fn max_signatories( - &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Multisig", "MaxSignatories")? - == [ - 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, - 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, - 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, - 123u8, 128u8, 193u8, 29u8, 70u8, - ] - { - let pallet = self.client.metadata().pallet("Multisig")?; - let constant = pallet.constant("MaxSignatories")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod bounties { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProposeBounty { - #[codec(compact)] - pub value: ::core::primitive::u128, - pub description: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for ProposeBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ApproveBounty { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for ApproveBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "approve_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProposeCurator { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub fee: ::core::primitive::u128, - } - impl ::subxt::Call for ProposeCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct UnassignCurator { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for UnassignCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "unassign_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AcceptCurator { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for AcceptCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "accept_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AwardBounty { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for AwardBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "award_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClaimBounty { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for ClaimBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "claim_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CloseBounty { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for CloseBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "close_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ExtendBountyExpiry { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - pub remark: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for ExtendBountyExpiry { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "extend_bounty_expiry"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Propose a new bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] - #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] - #[doc = "or slashed when rejected."] - #[doc = ""] - #[doc = "- `curator`: The curator account whom will manage this bounty."] - #[doc = "- `fee`: The curator fee."] - #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] - #[doc = "- `description`: The description of this bounty."] - pub fn propose_bounty( - &self, - value: ::core::primitive::u128, - description: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 208u8, 22u8, 157u8, 134u8, 214u8, 95u8, 249u8, 10u8, 67u8, - 223u8, 190u8, 192u8, 69u8, 32u8, 7u8, 235u8, 205u8, 145u8, - 90u8, 80u8, 60u8, 4u8, 16u8, 189u8, 59u8, 180u8, 68u8, 77u8, - 69u8, 121u8, 92u8, 33u8, - ] - { - let call = ProposeBounty { value, description }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] - #[doc = "and the original deposit will be returned."] - #[doc = ""] - #[doc = "May only be called from `T::ApproveOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn approve_bounty( - &self, - bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 127u8, 220u8, 25u8, 197u8, 19u8, 183u8, 177u8, 17u8, 164u8, - 29u8, 250u8, 136u8, 125u8, 90u8, 247u8, 177u8, 37u8, 180u8, - 77u8, 75u8, 164u8, 32u8, 195u8, 207u8, 58u8, 249u8, 141u8, - 11u8, 53u8, 184u8, 224u8, 135u8, - ] - { - let call = ApproveBounty { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Assign a curator to a funded bounty."] - #[doc = ""] - #[doc = "May only be called from `T::ApproveOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn propose_curator( - &self, - bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 180u8, 13u8, 171u8, 39u8, 160u8, 233u8, 162u8, 39u8, 100u8, - 144u8, 156u8, 212u8, 139u8, 128u8, 105u8, 49u8, 157u8, 16u8, - 125u8, 72u8, 36u8, 45u8, 199u8, 139u8, 165u8, 100u8, 40u8, - 163u8, 117u8, 32u8, 164u8, 23u8, - ] - { - let call = ProposeCurator { - bounty_id, - curator, - fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unassign curator from a bounty."] - #[doc = ""] - #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] - #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] - #[doc = ""] - #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] - #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] - #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] - #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] - #[doc = "we should pick a new curator. In this case the curator should also be slashed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn unassign_curator( - &self, - bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnassignCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 156u8, 163u8, 248u8, 148u8, 22u8, 231u8, 232u8, 182u8, 48u8, - 87u8, 85u8, 118u8, 169u8, 249u8, 123u8, 199u8, 248u8, 206u8, - 221u8, 196u8, 69u8, 69u8, 52u8, 116u8, 65u8, 165u8, 172u8, - 242u8, 61u8, 109u8, 143u8, 69u8, - ] - { - let call = UnassignCurator { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Accept the curator role for a bounty."] - #[doc = "A deposit will be reserved from curator and refund upon successful payout."] - #[doc = ""] - #[doc = "May only be called from the curator."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn accept_curator( - &self, - bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AcceptCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 50u8, 149u8, 252u8, 40u8, 169u8, 113u8, 60u8, 153u8, 123u8, - 146u8, 40u8, 196u8, 176u8, 195u8, 95u8, 94u8, 14u8, 81u8, - 136u8, 225u8, 24u8, 59u8, 87u8, 118u8, 77u8, 60u8, 150u8, - 102u8, 206u8, 219u8, 241u8, 99u8, - ] - { - let call = AcceptCurator { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] - #[doc = "after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to award."] - #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn award_bounty( - &self, - bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AwardBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 42u8, 49u8, 134u8, 134u8, 5u8, 98u8, 72u8, 95u8, 227u8, - 156u8, 224u8, 249u8, 209u8, 42u8, 160u8, 15u8, 239u8, 195u8, - 128u8, 251u8, 217u8, 132u8, 15u8, 221u8, 191u8, 105u8, 39u8, - 228u8, 189u8, 174u8, 115u8, 53u8, - ] - { - let call = AwardBounty { - bounty_id, - beneficiary, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Claim the payout from an awarded bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to claim."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn claim_bounty( - &self, - bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClaimBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 119u8, 9u8, 122u8, 55u8, 224u8, 139u8, 26u8, 186u8, 3u8, - 178u8, 78u8, 41u8, 91u8, 183u8, 222u8, 197u8, 189u8, 172u8, - 154u8, 47u8, 2u8, 164u8, 141u8, 163u8, 211u8, 117u8, 186u8, - 121u8, 130u8, 91u8, 13u8, 241u8, - ] - { - let call = ClaimBounty { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] - #[doc = "the curator deposit will be unreserved if possible."] - #[doc = ""] - #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to cancel."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn close_bounty( - &self, - bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CloseBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 119u8, 47u8, 246u8, 188u8, 235u8, 22u8, 53u8, 70u8, 182u8, - 15u8, 247u8, 153u8, 208u8, 191u8, 144u8, 132u8, 30u8, 200u8, - 36u8, 186u8, 194u8, 225u8, 140u8, 160u8, 152u8, 194u8, 38u8, - 223u8, 33u8, 130u8, 120u8, 254u8, - ] - { - let call = CloseBounty { bounty_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Extend the expiry time of an active bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to extend."] - #[doc = "- `remark`: additional information."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - pub fn extend_bounty_expiry( - &self, - bounty_id: ::core::primitive::u32, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ExtendBountyExpiry, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 127u8, 142u8, 138u8, 230u8, 147u8, 187u8, 201u8, 210u8, - 216u8, 61u8, 62u8, 125u8, 168u8, 188u8, 16u8, 73u8, 157u8, - 53u8, 165u8, 236u8, 181u8, 26u8, 28u8, 67u8, 59u8, 234u8, - 189u8, 167u8, 92u8, 242u8, 138u8, 35u8, - ] - { - let call = ExtendBountyExpiry { bounty_id, remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_bounties::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "New bounty proposal."] - pub struct BountyProposed { - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for BountyProposed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyProposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A bounty proposal was rejected; funds were slashed."] - pub struct BountyRejected { - pub index: ::core::primitive::u32, - pub bond: ::core::primitive::u128, - } - impl ::subxt::Event for BountyRejected { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyRejected"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A bounty proposal is funded and became active."] - pub struct BountyBecameActive { - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for BountyBecameActive { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyBecameActive"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A bounty is awarded to a beneficiary."] - pub struct BountyAwarded { - pub index: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for BountyAwarded { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyAwarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A bounty is claimed by beneficiary."] - pub struct BountyClaimed { - pub index: ::core::primitive::u32, - pub payout: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for BountyClaimed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyClaimed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A bounty is cancelled."] - pub struct BountyCanceled { - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for BountyCanceled { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyCanceled"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A bounty expiry is extended."] - pub struct BountyExtended { - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for BountyExtended { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyExtended"; - } - } - pub mod storage { - use super::runtime_types; - pub struct BountyCount; - impl ::subxt::StorageEntry for BountyCount { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bounties<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Bounties<'_> { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "Bounties"; - type Value = runtime_types::pallet_bounties::Bounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BountyDescriptions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for BountyDescriptions<'_> { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyDescriptions"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BountyApprovals; - impl ::subxt::StorageEntry for BountyApprovals { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyApprovals"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Number of bounty proposals that have been made."] - pub async fn bounty_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Bounties that have been made."] - pub async fn bounties( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The description of each bounty."] - pub async fn bounty_descriptions( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Bounty indices that have been approved but not yet funded."] - pub async 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, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The amount held on deposit for placing a bounty proposal."] - pub fn bounty_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Bounties", "BountyDepositBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("BountyDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The delay period for which a bounty beneficiary need to wait before claim the payout."] - pub fn bounty_deposit_payout_delay( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Bounties", "BountyDepositPayoutDelay")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("BountyDepositPayoutDelay")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Bounty duration in blocks."] - pub fn bounty_update_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Bounties", "BountyUpdatePeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("BountyUpdatePeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The curator deposit is calculated as a percentage of the curator fee."] - #[doc = ""] - #[doc = " This deposit has optional upper and lower bounds with `CuratorDepositMax` and"] - #[doc = " `CuratorDepositMin`."] - pub fn curator_deposit_multiplier( - &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Permill, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Bounties", "CuratorDepositMultiplier")? - == [ - 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, - 91u8, 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, - 74u8, 83u8, 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, - 161u8, 119u8, 2u8, 38u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("CuratorDepositMultiplier")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] - pub fn curator_deposit_max( - &self, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Bounties", "CuratorDepositMax")? - == [ - 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, - 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, - 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, - 43u8, 243u8, 122u8, 60u8, 216u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("CuratorDepositMax")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] - pub fn curator_deposit_min( - &self, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Bounties", "CuratorDepositMin")? - == [ - 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, - 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, - 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, - 43u8, 243u8, 122u8, 60u8, 216u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("CuratorDepositMin")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Minimum value for a bounty."] - pub fn bounty_value_minimum( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Bounties", "BountyValueMinimum")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("BountyValueMinimum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] - pub fn data_deposit_per_byte( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Bounties", "DataDepositPerByte")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum acceptable reason length."] - #[doc = ""] - #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] - pub fn maximum_reason_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Bounties", "MaximumReasonLength")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Bounties")?; - let constant = pallet.constant("MaximumReasonLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod child_bounties { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddChildBounty { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub value: ::core::primitive::u128, - pub description: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for AddChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "add_child_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProposeCurator { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub child_bounty_id: ::core::primitive::u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub fee: ::core::primitive::u128, - } - impl ::subxt::Call for ProposeCurator { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "propose_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AcceptCurator { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub child_bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for AcceptCurator { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "accept_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct UnassignCurator { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub child_bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for UnassignCurator { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "unassign_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AwardChildBounty { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub child_bounty_id: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - } - impl ::subxt::Call for AwardChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "award_child_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClaimChildBounty { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub child_bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for ClaimChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "claim_child_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CloseChildBounty { - #[codec(compact)] - pub parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - pub child_bounty_id: ::core::primitive::u32, - } - impl ::subxt::Call for CloseChildBounty { - const PALLET: &'static str = "ChildBounties"; - const FUNCTION: &'static str = "close_child_bounty"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Add a new child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of parent"] - #[doc = "bounty and the parent bounty must be in \"active\" state."] - #[doc = ""] - #[doc = "Child-bounty gets added successfully & fund gets transferred from"] - #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] - #[doc = "funds, else the call fails."] - #[doc = ""] - #[doc = "Upper bound to maximum number of active child-bounties that can be"] - #[doc = "added are managed via runtime trait config"] - #[doc = "[`Config::MaxActiveChildBountyCount`]."] - #[doc = ""] - #[doc = "If the call is success, the status of child-bounty is updated to"] - #[doc = "\"Added\"."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] - #[doc = "- `value`: Value for executing the proposal."] - #[doc = "- `description`: Text description for the child-bounty."] - pub fn add_child_bounty( - &self, - parent_bounty_id: ::core::primitive::u32, - value: ::core::primitive::u128, - description: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 235u8, 216u8, 166u8, 226u8, 107u8, 159u8, 235u8, 35u8, 207u8, - 154u8, 124u8, 226u8, 242u8, 241u8, 4u8, 20u8, 1u8, 215u8, - 110u8, 127u8, 19u8, 211u8, 36u8, 159u8, 110u8, 146u8, 58u8, - 23u8, 210u8, 51u8, 193u8, 228u8, - ] - { - let call = AddChildBounty { - parent_bounty_id, - value, - description, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Propose curator for funded child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be curator of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `curator`: Address of child-bounty curator."] - #[doc = "- `fee`: payment fee to child-bounty curator for execution."] - pub fn propose_curator( - &self, - parent_bounty_id: ::core::primitive::u32, - child_bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProposeCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 34u8, 219u8, 159u8, 152u8, 29u8, 12u8, 222u8, 91u8, 193u8, - 218u8, 28u8, 0u8, 102u8, 15u8, 180u8, 155u8, 135u8, 175u8, - 182u8, 51u8, 220u8, 97u8, 169u8, 97u8, 135u8, 26u8, 237u8, - 22u8, 100u8, 8u8, 203u8, 229u8, - ] - { - let call = ProposeCurator { - parent_bounty_id, - child_bounty_id, - curator, - fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Accept the curator role for the child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this"] - #[doc = "child-bounty."] - #[doc = ""] - #[doc = "A deposit will be reserved from the curator and refund upon"] - #[doc = "successful payout or cancellation."] - #[doc = ""] - #[doc = "Fee for curator is deducted from curator fee of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] - #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn accept_curator( - &self, - parent_bounty_id: ::core::primitive::u32, - child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AcceptCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 115u8, 24u8, 36u8, 188u8, 30u8, 11u8, 184u8, 102u8, 151u8, - 96u8, 41u8, 162u8, 104u8, 54u8, 76u8, 251u8, 189u8, 50u8, - 190u8, 50u8, 15u8, 171u8, 231u8, 218u8, 45u8, 129u8, 137u8, - 69u8, 130u8, 39u8, 190u8, 223u8, - ] - { - let call = AcceptCurator { - parent_bounty_id, - child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unassign curator from a child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] - #[doc = "the curator of the parent bounty, or any signed origin."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] - #[doc = "curator, parent-bounty must be in active state, for this call to"] - #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] - #[doc = "this call irrespective of the parent-bounty state."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin` or the"] - #[doc = "parent-bounty curator, we assume that the child-bounty curator is"] - #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] - #[doc = "slashed."] - #[doc = ""] - #[doc = "If the origin is the child-bounty curator, we take this as a sign"] - #[doc = "that they are unable to do their job, and are willingly giving up."] - #[doc = "We could slash the deposit, but for now we allow them to unreserve"] - #[doc = "their deposit and exit without issue. (We may want to change this if"] - #[doc = "it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] - #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] - #[doc = "inactive state of child-bounty curator."] - #[doc = ""] - #[doc = "This allows anyone in the community to call out that a child-bounty"] - #[doc = "curator is not doing their due diligence, and we should pick a new"] - #[doc = "one. In this case the child-bounty curator deposit is slashed."] - #[doc = ""] - #[doc = "State of child-bounty is moved to Added state on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn unassign_curator( - &self, - parent_bounty_id: ::core::primitive::u32, - child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnassignCurator, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 210u8, 24u8, 20u8, 200u8, 106u8, 200u8, 33u8, 43u8, 169u8, - 133u8, 157u8, 108u8, 220u8, 36u8, 110u8, 172u8, 218u8, 1u8, - 209u8, 254u8, 69u8, 117u8, 70u8, 173u8, 66u8, 177u8, 54u8, - 128u8, 239u8, 83u8, 60u8, 118u8, - ] - { - let call = UnassignCurator { - parent_bounty_id, - child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Award child-bounty to a beneficiary."] - #[doc = ""] - #[doc = "The beneficiary will be able to claim the funds after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the master curator or"] - #[doc = "curator of this child-bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in active state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `beneficiary`: Beneficiary account."] - pub fn award_child_bounty( - &self, - parent_bounty_id: ::core::primitive::u32, - child_bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AwardChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 135u8, 134u8, 237u8, 216u8, 152u8, 75u8, 11u8, 209u8, 152u8, - 99u8, 166u8, 78u8, 162u8, 34u8, 37u8, 158u8, 95u8, 74u8, - 137u8, 50u8, 43u8, 117u8, 166u8, 91u8, 212u8, 30u8, 243u8, - 67u8, 140u8, 66u8, 56u8, 206u8, - ] - { - let call = AwardChildBounty { - parent_bounty_id, - child_bounty_id, - beneficiary, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Claim the payout from an awarded child-bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call may be any signed origin."] - #[doc = ""] - #[doc = "Call works independent of parent bounty state, No need for parent"] - #[doc = "bounty to be in active state."] - #[doc = ""] - #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] - #[doc = "paid & curator deposit is unreserved."] - #[doc = ""] - #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] - #[doc = "call. And instance of child-bounty is removed from the state on"] - #[doc = "successful call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn claim_child_bounty( - &self, - parent_bounty_id: ::core::primitive::u32, - child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClaimChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 54u8, 194u8, 203u8, 13u8, 230u8, 207u8, 25u8, 249u8, 203u8, - 199u8, 123u8, 79u8, 255u8, 85u8, 40u8, 125u8, 73u8, 5u8, - 126u8, 103u8, 205u8, 222u8, 232u8, 161u8, 178u8, 206u8, 39u8, - 5u8, 16u8, 167u8, 198u8, 93u8, - ] - { - let call = ClaimChildBounty { - parent_bounty_id, - child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] - #[doc = "are transferred to parent bounty account. The child-bounty curator"] - #[doc = "deposit may be unreserved if possible."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be either parent curator or"] - #[doc = "`T::RejectOrigin`."] - #[doc = ""] - #[doc = "If the state of child-bounty is `Active`, curator deposit is"] - #[doc = "unreserved."] - #[doc = ""] - #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] - #[doc = "returns `PendingPayout` error."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] - #[doc = "active state, for this child-bounty call to work. For origin"] - #[doc = "T::RejectOrigin execution is forced."] - #[doc = ""] - #[doc = "Instance of child-bounty is removed from the state on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - pub fn close_child_bounty( - &self, - parent_bounty_id: ::core::primitive::u32, - child_bounty_id: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CloseChildBounty, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 123u8, 201u8, 206u8, 242u8, 80u8, 37u8, 113u8, 182u8, 237u8, - 187u8, 51u8, 229u8, 226u8, 250u8, 129u8, 203u8, 196u8, 22u8, - 91u8, 154u8, 118u8, 233u8, 254u8, 240u8, 113u8, 86u8, 55u8, - 5u8, 59u8, 15u8, 160u8, 204u8, - ] - { - let call = CloseChildBounty { - parent_bounty_id, - child_bounty_id, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_child_bounties::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A child-bounty is added."] - pub struct Added { - pub index: ::core::primitive::u32, - pub child_index: ::core::primitive::u32, - } - impl ::subxt::Event for Added { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Added"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A child-bounty is awarded to a beneficiary."] - pub struct Awarded { - pub index: ::core::primitive::u32, - pub child_index: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Awarded { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Awarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A child-bounty is claimed by beneficiary."] - pub struct Claimed { - pub index: ::core::primitive::u32, - pub child_index: ::core::primitive::u32, - pub payout: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Claimed { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Claimed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A child-bounty is cancelled."] - pub struct Canceled { - pub index: ::core::primitive::u32, - pub child_index: ::core::primitive::u32, - } - impl ::subxt::Event for Canceled { - const PALLET: &'static str = "ChildBounties"; - const EVENT: &'static str = "Canceled"; - } - } - pub mod storage { - use super::runtime_types; - pub struct ChildBountyCount; - impl ::subxt::StorageEntry for ChildBountyCount { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildBountyCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParentChildBounties<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ParentChildBounties<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ParentChildBounties"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ChildBounties<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for ChildBounties<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildBounties"; - type Value = runtime_types::pallet_child_bounties::ChildBounty< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct ChildBountyDescriptions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ChildBountyDescriptions<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildBountyDescriptions"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ChildrenCuratorFees<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ChildrenCuratorFees<'_> { - const PALLET: &'static str = "ChildBounties"; - const STORAGE: &'static str = "ChildrenCuratorFees"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Number of total child bounties."] - pub async fn child_bounty_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Child-bounties that have been added."] - pub async fn child_bounties( - &self, - _0: &::core::primitive::u32, - _1: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The description of each child-bounty."] - pub async fn child_bounty_descriptions( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The cumulative child-bounty curator fee for each parent bounty."] - pub async fn children_curator_fees( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Maximum number of child-bounties that can be added to a parent bounty."] - pub fn max_active_child_bounty_count( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ChildBounties", "MaxActiveChildBountyCount")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("ChildBounties")?; - let constant = pallet.constant("MaxActiveChildBountyCount")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Minimum value for a child-bounty."] - pub fn child_bounty_value_minimum( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ChildBounties", "ChildBountyValueMinimum")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("ChildBounties")?; - let constant = pallet.constant("ChildBountyValueMinimum")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod tips { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReportAwesome { - pub reason: ::std::vec::Vec<::core::primitive::u8>, - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ReportAwesome { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "report_awesome"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RetractTip { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RetractTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "retract_tip"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TipNew { - pub reason: ::std::vec::Vec<::core::primitive::u8>, - pub who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - pub tip_value: ::core::primitive::u128, - } - impl ::subxt::Call for TipNew { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip_new"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Tip { - pub hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub tip_value: ::core::primitive::u128, - } - impl ::subxt::Call for Tip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CloseTip { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for CloseTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "close_tip"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SlashTip { - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for SlashTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "slash_tip"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] - #[doc = "`DataDepositPerByte` for each byte in `reason`."] - #[doc = ""] - #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] - #[doc = " a UTF-8-encoded URL."] - #[doc = "- `who`: The account which should be credited for the tip."] - #[doc = ""] - #[doc = "Emits `NewTip` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(R)` where `R` length of `reason`."] - #[doc = " - encoding and hashing of 'reason'"] - #[doc = "- DbReads: `Reasons`, `Tips`"] - #[doc = "- DbWrites: `Reasons`, `Tips`"] - #[doc = "# "] - pub fn report_awesome( - &self, - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportAwesome, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 90u8, 58u8, 149u8, 226u8, 88u8, 237u8, 150u8, 165u8, 172u8, - 179u8, 195u8, 226u8, 200u8, 20u8, 152u8, 103u8, 157u8, 208u8, - 86u8, 101u8, 178u8, 54u8, 42u8, 171u8, 172u8, 201u8, 20u8, - 254u8, 165u8, 7u8, 15u8, 197u8, - ] - { - let call = ReportAwesome { reason, who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] - #[doc = ""] - #[doc = "If successful, the original deposit will be unreserved."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the tip identified by `hash`"] - #[doc = "must have been reported by the signing account through `report_awesome` (and not"] - #[doc = "through `tip_new`)."] - #[doc = ""] - #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] - #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] - #[doc = ""] - #[doc = "Emits `TipRetracted` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)`"] - #[doc = " - Depends on the length of `T::Hash` which is fixed."] - #[doc = "- DbReads: `Tips`, `origin account`"] - #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] - #[doc = "# "] - pub fn retract_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RetractTip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 213u8, 70u8, 11u8, 81u8, 39u8, 125u8, 42u8, 247u8, 80u8, - 55u8, 123u8, 247u8, 45u8, 18u8, 86u8, 205u8, 26u8, 229u8, - 21u8, 106u8, 196u8, 125u8, 63u8, 65u8, 117u8, 219u8, 138u8, - 163u8, 161u8, 115u8, 157u8, 231u8, - ] - { - let call = RetractTip { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Give a tip for something new; no finder's fee will be taken."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] - #[doc = "member of the `Tippers` set."] - #[doc = ""] - #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] - #[doc = " a UTF-8-encoded URL."] - #[doc = "- `who`: The account which should be credited for the tip."] - #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] - #[doc = " value of active tippers will be given to the `who`."] - #[doc = ""] - #[doc = "Emits `NewTip` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(R + T)` where `R` length of `reason`, `T` is the number of tippers."] - #[doc = " - `O(T)`: decoding `Tipper` vec of length `T`. `T` is charged as upper bound given by"] - #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of"] - #[doc = " `T::Tippers`."] - #[doc = " - `O(R)`: hashing and encoding of reason of length `R`"] - #[doc = "- DbReads: `Tippers`, `Reasons`"] - #[doc = "- DbWrites: `Reasons`, `Tips`"] - #[doc = "# "] - pub fn tip_new( - &self, - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - tip_value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TipNew, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 137u8, 119u8, 91u8, 139u8, 238u8, 180u8, 247u8, 5u8, 194u8, - 35u8, 33u8, 151u8, 50u8, 212u8, 208u8, 134u8, 98u8, 133u8, - 83u8, 212u8, 27u8, 218u8, 186u8, 188u8, 111u8, 102u8, 34u8, - 211u8, 112u8, 48u8, 98u8, 206u8, - ] - { - let call = TipNew { - reason, - who, - tip_value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Declare a tip value for an already-open tip."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] - #[doc = "member of the `Tippers` set."] - #[doc = ""] - #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] - #[doc = " as the hash of the tuple of the hash of the original tip `reason` and the beneficiary"] - #[doc = " account ID."] - #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] - #[doc = " value of active tippers will be given to the `who`."] - #[doc = ""] - #[doc = "Emits `TipClosing` if the threshold of tippers has been reached and the countdown period"] - #[doc = "has started."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] - #[doc = " `T`, insert tip and check closing, `T` is charged as upper bound given by"] - #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of `T::Tippers`."] - #[doc = ""] - #[doc = " Actually weight could be lower as it depends on how many tips are in `OpenTip` but it"] - #[doc = " is weighted as if almost full i.e of length `T-1`."] - #[doc = "- DbReads: `Tippers`, `Tips`"] - #[doc = "- DbWrites: `Tips`"] - #[doc = "# "] - pub fn tip( - &self, - hash: ::subxt::sp_core::H256, - tip_value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Tip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 2u8, 38u8, 219u8, 220u8, 183u8, 243u8, 108u8, 40u8, 179u8, - 21u8, 218u8, 158u8, 126u8, 19u8, 22u8, 115u8, 95u8, 17u8, - 73u8, 219u8, 179u8, 69u8, 60u8, 115u8, 196u8, 170u8, 23u8, - 218u8, 75u8, 9u8, 227u8, 204u8, - ] - { - let call = Tip { hash, tip_value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Close and payout a tip."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "The tip identified by `hash` must have finished its countdown period."] - #[doc = ""] - #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] - #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] - #[doc = " `T`. `T` is charged as upper bound given by `ContainsLengthBound`. The actual cost"] - #[doc = " depends on the implementation of `T::Tippers`."] - #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] - #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] - #[doc = "# "] - pub fn close_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CloseTip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 85u8, 180u8, 115u8, 177u8, 2u8, 252u8, 139u8, 37u8, 233u8, - 127u8, 115u8, 4u8, 169u8, 169u8, 214u8, 223u8, 181u8, 150u8, - 137u8, 226u8, 99u8, 23u8, 205u8, 31u8, 160u8, 185u8, 97u8, - 128u8, 197u8, 110u8, 142u8, 160u8, - ] - { - let call = CloseTip { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove and slash an already-open tip."] - #[doc = ""] - #[doc = "May only be called from `T::RejectOrigin`."] - #[doc = ""] - #[doc = "As a result, the finder is slashed and the deposits are lost."] - #[doc = ""] - #[doc = "Emits `TipSlashed` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] - #[doc = " The actual cost depends on the implementation of `T::Tippers`."] - #[doc = "# "] - pub fn slash_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SlashTip, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 135u8, 7u8, 55u8, 167u8, 26u8, 108u8, 43u8, 20u8, 162u8, - 185u8, 209u8, 88u8, 148u8, 181u8, 51u8, 102u8, 17u8, 105u8, - 162u8, 223u8, 126u8, 46u8, 254u8, 79u8, 64u8, 248u8, 193u8, - 10u8, 110u8, 40u8, 5u8, 199u8, - ] - { - let call = SlashTip { hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_tips::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new tip suggestion has been opened."] - pub struct NewTip { - pub tip_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for NewTip { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "NewTip"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A tip suggestion has reached threshold and is closing."] - pub struct TipClosing { - pub tip_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for TipClosing { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosing"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A tip suggestion has been closed."] - pub struct TipClosed { - pub tip_hash: ::subxt::sp_core::H256, - pub who: ::subxt::sp_core::crypto::AccountId32, - pub payout: ::core::primitive::u128, - } - impl ::subxt::Event for TipClosed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A tip suggestion has been retracted."] - pub struct TipRetracted { - pub tip_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for TipRetracted { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipRetracted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A tip suggestion has been slashed."] - pub struct TipSlashed { - pub tip_hash: ::subxt::sp_core::H256, - pub finder: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::Event for TipSlashed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipSlashed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Tips<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Tips<'_> { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Tips"; - type Value = runtime_types::pallet_tips::OpenTip< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Reasons<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reasons<'_> { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Reasons"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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( - &self, - _0: &::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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Maximum acceptable reason length."] - #[doc = ""] - #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] - pub fn maximum_reason_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Tips", "MaximumReasonLength")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Tips")?; - let constant = pallet.constant("MaximumReasonLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] - pub fn data_deposit_per_byte( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Tips", "DataDepositPerByte")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Tips")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The period for which a tip remains open after is has achieved threshold tippers."] - pub fn tip_countdown( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Tips", "TipCountdown")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Tips")?; - let constant = pallet.constant("TipCountdown")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The percent of the final tip which goes to the original reporter of the tip."] - pub fn tip_finders_fee( - &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Percent, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Tips", "TipFindersFee")? - == [ - 51u8, 95u8, 57u8, 159u8, 25u8, 64u8, 29u8, 36u8, 82u8, 174u8, - 29u8, 154u8, 123u8, 113u8, 231u8, 89u8, 161u8, 252u8, 237u8, - 17u8, 50u8, 5u8, 239u8, 138u8, 157u8, 114u8, 246u8, 90u8, - 225u8, 146u8, 157u8, 192u8, - ] - { - let pallet = self.client.metadata().pallet("Tips")?; - let constant = pallet.constant("TipFindersFee")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount held on deposit for placing a tip report."] - pub fn tip_report_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Tips", "TipReportDepositBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Tips")?; - let constant = pallet.constant("TipReportDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod election_provider_multi_phase { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SubmitUnsigned { pub raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , pub witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } - impl ::subxt::Call for SubmitUnsigned { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit_unsigned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetMinimumUntrustedScore { - pub maybe_next_score: ::core::option::Option< - runtime_types::sp_npos_elections::ElectionScore, - >, - } - impl ::subxt::Call for SetMinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_minimum_untrusted_score"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetEmergencyElectionResult { - pub supports: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, - } - impl ::subxt::Call for SetEmergencyElectionResult { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_emergency_election_result"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Submit { - pub raw_solution: ::std::boxed::Box< - runtime_types::pallet_election_provider_multi_phase::RawSolution< - runtime_types::polkadot_runtime::NposCompactSolution16, - >, - >, - } - impl ::subxt::Call for Submit { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct GovernanceFallback { - pub maybe_max_voters: ::core::option::Option<::core::primitive::u32>, - pub maybe_max_targets: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for GovernanceFallback { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "governance_fallback"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Submit a solution for the unsigned phase."] - #[doc = ""] - #[doc = "The dispatch origin fo this call must be __none__."] - #[doc = ""] - #[doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] - #[doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] - #[doc = "that only active validators can submit this transaction when authoring a block (similar"] - #[doc = "to an inherent)."] - #[doc = ""] - #[doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] - #[doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] - #[doc = "putting their authoring reward at risk."] - #[doc = ""] - #[doc = "No deposit or reward is associated with this submission."] - pub fn submit_unsigned( - &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, - witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SubmitUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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, - ] - { - let call = SubmitUnsigned { - raw_solution: ::std::boxed::Box::new(raw_solution), - witness, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set a new value for `MinimumUntrustedScore`."] - #[doc = ""] - #[doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] - #[doc = ""] - #[doc = "This check can be turned off by setting the value to `None`."] - pub fn set_minimum_untrusted_score( - &self, - maybe_next_score: ::core::option::Option< - runtime_types::sp_npos_elections::ElectionScore, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMinimumUntrustedScore, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 207u8, 31u8, 247u8, 72u8, 55u8, 18u8, 99u8, 157u8, 155u8, - 89u8, 59u8, 156u8, 254u8, 3u8, 181u8, 85u8, 48u8, 42u8, 73u8, - 243u8, 35u8, 90u8, 142u8, 14u8, 62u8, 48u8, 15u8, 125u8, - 194u8, 103u8, 2u8, 175u8, - ] - { - let call = SetMinimumUntrustedScore { maybe_next_score }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] - #[doc = "call to `ElectionProvider::elect`."] - #[doc = ""] - #[doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] - #[doc = ""] - #[doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] - #[doc = "feasibility check itself can in principle cause the election process to fail (due to"] - #[doc = "memory/weight constrains)."] - pub fn set_emergency_election_result( - &self, - supports: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetEmergencyElectionResult, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 195u8, 164u8, 133u8, 193u8, 58u8, 154u8, 182u8, 83u8, 231u8, - 217u8, 199u8, 27u8, 239u8, 143u8, 60u8, 103u8, 139u8, 253u8, - 49u8, 242u8, 8u8, 41u8, 160u8, 192u8, 123u8, 98u8, 137u8, - 13u8, 170u8, 167u8, 246u8, 175u8, - ] - { - let call = SetEmergencyElectionResult { supports }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Submit a solution for the signed phase."] - #[doc = ""] - #[doc = "The dispatch origin fo this call must be __signed__."] - #[doc = ""] - #[doc = "The solution is potentially queued, based on the claimed score and processed at the end"] - #[doc = "of the signed phase."] - #[doc = ""] - #[doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] - #[doc = "might be rewarded, slashed, or get all or a part of the deposit back."] - pub fn submit( - &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Submit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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, - ] - { - let call = Submit { - raw_solution: ::std::boxed::Box::new(raw_solution), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Trigger the governance fallback."] - #[doc = ""] - #[doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] - #[doc = "calling [`Call::set_emergency_election_result`]."] - pub fn governance_fallback( - &self, - maybe_max_voters: ::core::option::Option<::core::primitive::u32>, - maybe_max_targets: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - GovernanceFallback, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 195u8, 190u8, 140u8, 94u8, 209u8, 100u8, 92u8, 194u8, 78u8, - 226u8, 16u8, 168u8, 52u8, 117u8, 88u8, 178u8, 84u8, 248u8, - 117u8, 38u8, 152u8, 71u8, 37u8, 158u8, 77u8, 204u8, 59u8, - 184u8, 22u8, 239u8, 92u8, 209u8, - ] - { - let call = GovernanceFallback { - maybe_max_voters, - maybe_max_targets, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = - runtime_types::pallet_election_provider_multi_phase::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A solution was stored with the given compute."] - #[doc = ""] - #[doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] - #[doc = "solution is unsigned, this means that it has also been processed."] - #[doc = ""] - #[doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] - pub struct SolutionStored { - pub election_compute: - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - pub prev_ejected: ::core::primitive::bool, - } - impl ::subxt::Event for SolutionStored { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SolutionStored"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The election has been finalized, with `Some` of the given computation, or else if the"] - #[doc = "election failed, `None`."] - pub struct ElectionFinalized { - pub election_compute: ::core::option::Option< - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - >, - } - impl ::subxt::Event for ElectionFinalized { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "ElectionFinalized"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has been rewarded for their signed submission being finalized."] - pub struct Rewarded { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub value: ::core::primitive::u128, - } - impl ::subxt::Event for Rewarded { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Rewarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An account has been slashed for submitting an invalid signed submission."] - pub struct Slashed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub value: ::core::primitive::u128, - } - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Slashed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "The signed phase of the given round has started."] - pub struct SignedPhaseStarted { - pub round: ::core::primitive::u32, - } - impl ::subxt::Event for SignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SignedPhaseStarted"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "The unsigned phase of the given round has started."] - pub struct UnsignedPhaseStarted { - pub round: ::core::primitive::u32, - } - impl ::subxt::Event for UnsignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "UnsignedPhaseStarted"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Round; - impl ::subxt::StorageEntry for Round { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "Round"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentPhase; - impl ::subxt::StorageEntry for CurrentPhase { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "CurrentPhase"; - type Value = runtime_types::pallet_election_provider_multi_phase::Phase< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedSolution; - impl ::subxt::StorageEntry for QueuedSolution { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "QueuedSolution"; - type Value = - runtime_types::pallet_election_provider_multi_phase::ReadySolution< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Snapshot; - impl ::subxt::StorageEntry for Snapshot { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "Snapshot"; - type Value = - runtime_types::pallet_election_provider_multi_phase::RoundSnapshot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DesiredTargets; - impl ::subxt::StorageEntry for DesiredTargets { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "DesiredTargets"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SnapshotMetadata; - impl ::subxt::StorageEntry for SnapshotMetadata { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SnapshotMetadata"; - type Value = runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionNextIndex; - impl ::subxt::StorageEntry for SignedSubmissionNextIndex { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionNextIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionIndices; - impl ::subxt::StorageEntry for SignedSubmissionIndices { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionIndices"; - type Value = runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionsMap<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for SignedSubmissionsMap<'_> { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionsMap"; - type Value = runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MinimumUntrustedScore; - impl ::subxt::StorageEntry for MinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "MinimumUntrustedScore"; - type Value = runtime_types::sp_npos_elections::ElectionScore; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Internal counter for the number of rounds."] - #[doc = ""] - #[doc = " This is useful for de-duplication of transactions submitted to the pool, and general"] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Current phase."] - pub async 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, - > { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " 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 >{ - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " The next index to be assigned to an incoming signed submission."] - #[doc = ""] - #[doc = " Every accepted submission is assigned a unique index; that index is bound to that particular"] - #[doc = " submission for the duration of the election. On election finalization, the next index is"] - #[doc = " reset to 0."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[doc = " A sorted, bounded set of `(score, index)`, where each `index` points to a value in"] - #[doc = " `SignedSubmissions`."] - #[doc = ""] - #[doc = " We never need to process more than a single signed submission at a time. Signed submissions"] - #[doc = " can be quite large, so we're willing to pay the cost of multiple database accesses to access"] - #[doc = " them one at a time instead of reading and decoding all of them at once."] pub 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 >{ - if self - .client - .metadata() - .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 = " Unchecked, signed solutions."] - #[doc = ""] - #[doc = " Together with `SubmissionIndices`, this stores a bounded set of `SignedSubmissions` while"] - #[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 >{ - if self - .client - .metadata() - .storage_hash::()? - == [ - 94u8, 51u8, 117u8, 215u8, 100u8, 250u8, 9u8, 70u8, 131u8, - 21u8, 2u8, 142u8, 177u8, 117u8, 21u8, 190u8, 10u8, 15u8, - 183u8, 214u8, 6u8, 169u8, 141u8, 169u8, 23u8, 136u8, 231u8, - 130u8, 48u8, 126u8, 198u8, 173u8, - ] - { - let entry = SignedSubmissionsMap(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Unchecked, signed solutions."] - #[doc = ""] - #[doc = " Together with `SubmissionIndices`, this stores a bounded set of `SignedSubmissions` while"] - #[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_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SignedSubmissionsMap<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .storage_hash::()? - == [ - 94u8, 51u8, 117u8, 215u8, 100u8, 250u8, 9u8, 70u8, 131u8, - 21u8, 2u8, 142u8, 177u8, 117u8, 21u8, 190u8, 10u8, 15u8, - 183u8, 214u8, 6u8, 169u8, 141u8, 169u8, 23u8, 136u8, 231u8, - 130u8, 48u8, 126u8, 198u8, 173u8, - ] - { - self.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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_npos_elections::ElectionScore, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Duration of the unsigned phase."] - pub fn unsigned_phase( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "UnsignedPhase")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("UnsignedPhase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Duration of the signed phase."] - pub fn signed_phase( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "SignedPhase")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedPhase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The minimum amount of improvement to the solution score that defines a solution as"] - #[doc = " \"better\" (in any phase)."] - pub fn solution_improvement_threshold( - &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - > { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "SolutionImprovementThreshold", - )? == [ - 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, 91u8, - 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, 74u8, 83u8, - 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, 161u8, 119u8, - 2u8, 38u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SolutionImprovementThreshold")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The repeat threshold of the offchain worker."] - #[doc = ""] - #[doc = " For example, if it is 5, that means that at least 5 blocks will elapse between attempts"] - #[doc = " to submit the worker's solution."] - pub fn offchain_repeat( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "OffchainRepeat")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("OffchainRepeat")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The priority of the unsigned transaction submitted in the unsigned-phase"] - pub fn miner_tx_priority( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "MinerTxPriority")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MinerTxPriority")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "MinerMaxWeight")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self - .client - .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"] - #[doc = " structures. In particular, `SignedSubmissionIndices` is bounded on this value. If you"] - #[doc = " update this value during an election, you _must_ ensure that"] - #[doc = " `SignedSubmissionIndices.len()` is less than or equal to the new value. Otherwise,"] - #[doc = " attempts to submit new solutions may cause a runtime panic."] - pub fn signed_max_submissions( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "SignedMaxSubmissions", - )? == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, - 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, - 41u8, 145u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedMaxSubmissions")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum weight of a signed solution."] - #[doc = ""] - #[doc = " This should probably be similar to [`Config::MinerMaxWeight`]."] - pub fn signed_max_weight( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "SignedMaxWeight")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedMaxWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Base reward for a signed solution"] - pub fn signed_reward_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "SignedRewardBase")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedRewardBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Base deposit for a signed solution."] - pub fn signed_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "SignedDepositBase", - )? == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, - 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, - 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, - 98u8, 148u8, 156u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedDepositBase")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Per-byte deposit for a signed solution."] - pub fn signed_deposit_byte( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "SignedDepositByte", - )? == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, - 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, - 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, - 98u8, 148u8, 156u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedDepositByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Per-weight deposit for a signed solution."] - pub fn signed_deposit_weight( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "SignedDepositWeight", - )? == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, - 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, - 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, - 98u8, 148u8, 156u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("SignedDepositWeight")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of electing voters to put in the snapshot. At the moment, snapshots"] - #[doc = " are only over a single block, but once multi-block elections are introduced they will"] - #[doc = " take place over multiple blocks."] - pub fn max_electing_voters( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "MaxElectingVoters", - )? == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, - 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, - 41u8, 145u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MaxElectingVoters")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of electable targets to put in the snapshot."] - pub fn max_electable_targets( - &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - if self.client.metadata().constant_hash( - "ElectionProviderMultiPhase", - "MaxElectableTargets", - )? == [ - 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, - 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, - 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, - 193u8, 29u8, 70u8, - ] { - let pallet = self - .client - .metadata() - .pallet("ElectionProviderMultiPhase")?; - let constant = pallet.constant("MaxElectableTargets")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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> - { - if self - .client - .metadata() - .constant_hash("ElectionProviderMultiPhase", "MinerMaxLength")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self - .client - .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 { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Rebag { - pub dislocated: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for Rebag { - const PALLET: &'static str = "BagsList"; - const FUNCTION: &'static str = "rebag"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PutInFrontOf { - pub lighter: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for PutInFrontOf { - const PALLET: &'static str = "BagsList"; - const FUNCTION: &'static str = "put_in_front_of"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] - #[doc = "changed its score that it should properly fall into a different bag than its current"] - #[doc = "one."] - #[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`."] - pub fn rebag( - &self, - dislocated: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Rebag, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 46u8, 138u8, 28u8, 6u8, 58u8, 153u8, 5u8, 41u8, 44u8, 7u8, - 228u8, 72u8, 135u8, 184u8, 185u8, 132u8, 146u8, 181u8, 47u8, - 166u8, 149u8, 21u8, 155u8, 29u8, 159u8, 79u8, 83u8, 137u8, - 156u8, 17u8, 60u8, 23u8, - ] - { - let call = Rebag { dislocated }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Move the caller's Id directly in front of `lighter`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and can only be called by the Id of"] - #[doc = "the account going in front of `lighter`."] - #[doc = ""] - #[doc = "Only works if"] - #[doc = "- both nodes are within the same bag,"] - #[doc = "- and `origin` has a greater `Score` than `lighter`."] - pub fn put_in_front_of( - &self, - lighter: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PutInFrontOf, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 79u8, 254u8, 222u8, 19u8, 17u8, 80u8, 7u8, 68u8, 54u8, 9u8, - 23u8, 133u8, 108u8, 29u8, 166u8, 177u8, 230u8, 247u8, 226u8, - 189u8, 3u8, 241u8, 100u8, 178u8, 234u8, 204u8, 118u8, 215u8, - 84u8, 28u8, 21u8, 136u8, - ] - { - let call = PutInFrontOf { lighter }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_bags_list::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Moved an account from one bag to another."] - pub struct Rebagged { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub from: ::core::primitive::u64, - pub to: ::core::primitive::u64, - } - impl ::subxt::Event for Rebagged { - const PALLET: &'static str = "BagsList"; - const EVENT: &'static str = "Rebagged"; - } - } - 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 STORAGE: &'static str = "ListNodes"; - type Value = runtime_types::pallet_bags_list::list::Node; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CounterForListNodes; - impl ::subxt::StorageEntry for CounterForListNodes { - const PALLET: &'static str = "BagsList"; - const STORAGE: &'static str = "CounterForListNodes"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ListBags<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for ListBags<'_> { - const PALLET: &'static str = "BagsList"; - const STORAGE: &'static str = "ListBags"; - type Value = runtime_types::pallet_bags_list::list::Bag; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " A single node, within some bag."] - #[doc = ""] - #[doc = " Nodes store links forward and back within their respective bags."] - pub async fn list_nodes( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = "Counter for the related counted storage map"] - pub async fn counter_for_list_nodes( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The list of thresholds separating the various bags."] - #[doc = ""] - #[doc = " Ids are separated into unsorted bags according to their score. This specifies the"] - #[doc = " thresholds separating the bags. An id's bag is the largest bag for which the id's score"] - #[doc = " is less than or equal to its upper threshold."] - #[doc = ""] - #[doc = " When ids are iterated, higher bags are iterated completely before lower bags. This means"] - #[doc = " that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower"] - #[doc = " score, but peer ids within a particular bag are sorted in insertion order."] - #[doc = ""] - #[doc = " # Expressing the constant"] - #[doc = ""] - #[doc = " This constant must be sorted in strictly increasing order. Duplicate items are not"] - #[doc = " permitted."] - #[doc = ""] - #[doc = " There is an implied upper limit of `Score::MAX`; that value does not need to be"] - #[doc = " specified within the bag. For any two threshold lists, if one ends with"] - #[doc = " `Score::MAX`, the other one does not, and they are otherwise equal, the two"] - #[doc = " lists will behave identically."] - #[doc = ""] - #[doc = " # Calculation"] - #[doc = ""] - #[doc = " It is recommended to generate the set of thresholds in a geometric series, such that"] - #[doc = " there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *"] - #[doc = " constant_ratio).max(threshold[k] + 1)` for all `k`."] - #[doc = ""] - #[doc = " The helpers in the `/utils/frame/generate-bags` module can simplify this calculation."] - #[doc = ""] - #[doc = " # Examples"] - #[doc = ""] - #[doc = " - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and"] - #[doc = " iteration is strictly in insertion order."] - #[doc = " - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to"] - #[doc = " the procedure given above, then the constant ratio is equal to 2."] - #[doc = " - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to"] - #[doc = " the procedure given above, then the constant ratio is approximately equal to 1.248."] - #[doc = " - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall"] - #[doc = " into bag 0, an id with score 2 will fall into bag 1, etc."] - #[doc = ""] - #[doc = " # Migration"] - #[doc = ""] - #[doc = " In the event that this list ever changes, a copy of the old bags list must be retained."] - #[doc = " With that `List::migrate` can be called, which will perform the appropriate migration."] - pub fn bag_thresholds( - &self, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u64>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("BagsList", "BagThresholds")? - == [ - 103u8, 102u8, 255u8, 165u8, 124u8, 54u8, 5u8, 172u8, 112u8, - 234u8, 25u8, 175u8, 178u8, 19u8, 251u8, 73u8, 91u8, 192u8, - 227u8, 81u8, 249u8, 45u8, 126u8, 116u8, 7u8, 37u8, 9u8, - 200u8, 167u8, 182u8, 12u8, 131u8, - ] - { - let pallet = self.client.metadata().pallet("BagsList")?; - let constant = pallet.constant("BagThresholds")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod parachains_origin { - use super::{ - root_mod, - runtime_types, - }; - } - pub mod configuration { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetValidationUpgradeCooldown { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetValidationUpgradeCooldown { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_cooldown"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetValidationUpgradeDelay { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_delay"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetCodeRetentionPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetCodeRetentionPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_code_retention_period"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxCodeSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxCodeSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_code_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxPovSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxPovSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_pov_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxHeadDataSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxHeadDataSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_head_data_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetParathreadCores { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetParathreadCores { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_cores"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetParathreadRetries { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetParathreadRetries { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_retries"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetGroupRotationFrequency { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetGroupRotationFrequency { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_group_rotation_frequency"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetChainAvailabilityPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetChainAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_chain_availability_period"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetThreadAvailabilityPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetThreadAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_thread_availability_period"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetSchedulingLookahead { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetSchedulingLookahead { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_scheduling_lookahead"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetMaxValidatorsPerCore { - pub new: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for SetMaxValidatorsPerCore { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators_per_core"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetMaxValidators { - pub new: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for SetMaxValidators { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetDisputePeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_period"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetDisputePostConclusionAcceptancePeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputePostConclusionAcceptancePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_dispute_post_conclusion_acceptance_period"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetDisputeMaxSpamSlots { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputeMaxSpamSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_max_spam_slots"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetDisputeConclusionByTimeOutPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputeConclusionByTimeOutPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_dispute_conclusion_by_time_out_period"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetNoShowSlots { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetNoShowSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_no_show_slots"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetNDelayTranches { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetNDelayTranches { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_n_delay_tranches"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetZerothDelayTrancheWidth { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetZerothDelayTrancheWidth { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetNeededApprovals { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetNeededApprovals { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_needed_approvals"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetRelayVrfModuloSamples { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetRelayVrfModuloSamples { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxUpwardQueueCount { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardQueueCount { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_count"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxUpwardQueueSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardQueueSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxDownwardMessageSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxDownwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_downward_message_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetUmpServiceTotalWeight { - pub new: ::core::primitive::u64, - } - impl ::subxt::Call for SetUmpServiceTotalWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_service_total_weight"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxUpwardMessageSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMaxUpwardMessageNumPerCandidate { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_num_per_candidate"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpOpenRequestTtl { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpOpenRequestTtl { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_open_request_ttl"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpSenderDeposit { - pub new: ::core::primitive::u128, - } - impl ::subxt::Call for SetHrmpSenderDeposit { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_sender_deposit"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpRecipientDeposit { - pub new: ::core::primitive::u128, - } - impl ::subxt::Call for SetHrmpRecipientDeposit { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_recipient_deposit"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpChannelMaxCapacity { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpChannelMaxCapacity { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_capacity"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpChannelMaxTotalSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpChannelMaxTotalSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_total_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpMaxParachainInboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParachainInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpMaxParathreadInboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParathreadInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpChannelMaxMessageSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpChannelMaxMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpMaxParachainOutboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParachainOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpMaxParathreadOutboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParathreadOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_hrmp_max_parathread_outbound_channels"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetHrmpMaxMessageNumPerCandidate { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetUmpMaxIndividualWeight { - pub new: ::core::primitive::u64, - } - impl ::subxt::Call for SetUmpMaxIndividualWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_max_individual_weight"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetPvfCheckingEnabled { - pub new: ::core::primitive::bool, - } - impl ::subxt::Call for SetPvfCheckingEnabled { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_pvf_checking_enabled"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetPvfVotingTtl { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetPvfVotingTtl { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_pvf_voting_ttl"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SetMinimumValidationUpgradeDelay { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMinimumValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_minimum_validation_upgrade_delay"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetBypassConsistencyCheck { - pub new: ::core::primitive::bool, - } - impl ::subxt::Call for SetBypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_bypass_consistency_check"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the validation upgrade cooldown."] - pub fn set_validation_upgrade_cooldown( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidationUpgradeCooldown, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 153u8, 60u8, 171u8, 164u8, 241u8, 214u8, 235u8, 141u8, 4u8, - 32u8, 129u8, 253u8, 128u8, 148u8, 185u8, 51u8, 65u8, 34u8, - 68u8, 72u8, 202u8, 159u8, 74u8, 243u8, 35u8, 138u8, 208u8, - 26u8, 182u8, 189u8, 41u8, 11u8, - ] - { - let call = SetValidationUpgradeCooldown { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the validation upgrade delay."] - pub fn set_validation_upgrade_delay( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidationUpgradeDelay, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 136u8, 220u8, 63u8, 166u8, 202u8, 19u8, 241u8, 32u8, 100u8, - 14u8, 101u8, 244u8, 241u8, 141u8, 144u8, 213u8, 185u8, 88u8, - 193u8, 2u8, 55u8, 154u8, 24u8, 77u8, 66u8, 167u8, 69u8, - 245u8, 224u8, 63u8, 196u8, 200u8, - ] - { - let call = SetValidationUpgradeDelay { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the acceptance period for an included candidate."] - pub fn set_code_retention_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCodeRetentionPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 94u8, 104u8, 13u8, 127u8, 95u8, 137u8, 66u8, 224u8, 22u8, - 53u8, 14u8, 161u8, 67u8, 85u8, 78u8, 161u8, 92u8, 81u8, - 190u8, 213u8, 113u8, 235u8, 64u8, 19u8, 112u8, 164u8, 71u8, - 88u8, 183u8, 234u8, 237u8, 9u8, - ] - { - let call = SetCodeRetentionPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the max validation code size for incoming upgrades."] - pub fn set_max_code_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxCodeSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 74u8, 39u8, 190u8, 155u8, 121u8, 60u8, 233u8, 95u8, 177u8, - 57u8, 116u8, 107u8, 200u8, 44u8, 2u8, 215u8, 209u8, 50u8, - 37u8, 112u8, 136u8, 107u8, 202u8, 142u8, 114u8, 25u8, 43u8, - 134u8, 250u8, 15u8, 81u8, 13u8, - ] - { - let call = SetMaxCodeSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the max POV block size for incoming upgrades."] - pub fn set_max_pov_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxPovSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 77u8, 199u8, 18u8, 53u8, 223u8, 107u8, 57u8, 141u8, 8u8, - 138u8, 180u8, 175u8, 73u8, 88u8, 205u8, 185u8, 56u8, 106u8, - 43u8, 87u8, 109u8, 9u8, 103u8, 103u8, 50u8, 158u8, 11u8, - 77u8, 162u8, 38u8, 57u8, 27u8, - ] - { - let call = SetMaxPovSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the max head data size for paras."] - pub fn set_max_head_data_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxHeadDataSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 30u8, 132u8, 5u8, 207u8, 126u8, 145u8, 187u8, 129u8, 36u8, - 235u8, 179u8, 61u8, 243u8, 87u8, 178u8, 107u8, 8u8, 21u8, - 43u8, 39u8, 119u8, 138u8, 146u8, 146u8, 109u8, 189u8, 56u8, - 160u8, 14u8, 78u8, 230u8, 149u8, - ] - { - let call = SetMaxHeadDataSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of parathread execution cores."] - pub fn set_parathread_cores( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetParathreadCores, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 5u8, 198u8, 156u8, 226u8, 125u8, 16u8, 2u8, 64u8, 28u8, - 189u8, 213u8, 85u8, 6u8, 112u8, 173u8, 183u8, 174u8, 207u8, - 129u8, 110u8, 201u8, 161u8, 163u8, 191u8, 20u8, 14u8, 65u8, - 106u8, 234u8, 203u8, 39u8, 75u8, - ] - { - let call = SetParathreadCores { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of retries for a particular parathread."] - pub fn set_parathread_retries( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetParathreadRetries, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 146u8, 134u8, 204u8, 109u8, 167u8, 35u8, 255u8, 245u8, 98u8, - 24u8, 213u8, 33u8, 144u8, 194u8, 196u8, 196u8, 66u8, 220u8, - 168u8, 156u8, 171u8, 179u8, 154u8, 30u8, 221u8, 45u8, 65u8, - 192u8, 194u8, 130u8, 87u8, 100u8, - ] - { - let call = SetParathreadRetries { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the parachain validator-group rotation frequency"] - pub fn set_group_rotation_frequency( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetGroupRotationFrequency, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 102u8, 192u8, 226u8, 120u8, 69u8, 117u8, 239u8, 156u8, 111u8, - 239u8, 197u8, 191u8, 221u8, 18u8, 140u8, 214u8, 154u8, 212u8, - 151u8, 35u8, 176u8, 2u8, 162u8, 131u8, 115u8, 102u8, 177u8, - 106u8, 35u8, 214u8, 151u8, 227u8, - ] - { - let call = SetGroupRotationFrequency { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the availability period for parachains."] - pub fn set_chain_availability_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetChainAvailabilityPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 3u8, 83u8, 31u8, 241u8, 73u8, 137u8, 18u8, 95u8, 119u8, - 143u8, 28u8, 110u8, 151u8, 229u8, 172u8, 208u8, 50u8, 25u8, - 89u8, 222u8, 128u8, 125u8, 112u8, 25u8, 204u8, 141u8, 175u8, - 69u8, 57u8, 161u8, 189u8, 167u8, - ] - { - let call = SetChainAvailabilityPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the availability period for parathreads."] - pub fn set_thread_availability_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetThreadAvailabilityPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 242u8, 204u8, 158u8, 5u8, 123u8, 163u8, 6u8, 209u8, 44u8, - 73u8, 112u8, 249u8, 96u8, 160u8, 188u8, 151u8, 107u8, 21u8, - 9u8, 100u8, 104u8, 184u8, 97u8, 77u8, 122u8, 254u8, 88u8, - 94u8, 22u8, 15u8, 57u8, 44u8, - ] - { - let call = SetThreadAvailabilityPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] - pub fn set_scheduling_lookahead( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetSchedulingLookahead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 146u8, 149u8, 10u8, 57u8, 122u8, 116u8, 61u8, 181u8, 97u8, - 240u8, 87u8, 37u8, 227u8, 233u8, 123u8, 26u8, 243u8, 58u8, - 54u8, 93u8, 111u8, 204u8, 108u8, 18u8, 167u8, 20u8, 255u8, - 173u8, 46u8, 212u8, 246u8, 201u8, - ] - { - let call = SetSchedulingLookahead { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the maximum number of validators to assign to any core."] - pub fn set_max_validators_per_core( - &self, - new: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxValidatorsPerCore, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 27u8, 160u8, 153u8, 252u8, 121u8, 42u8, 94u8, 131u8, 199u8, - 216u8, 15u8, 65u8, 94u8, 69u8, 127u8, 130u8, 179u8, 236u8, - 49u8, 32u8, 239u8, 37u8, 58u8, 0u8, 50u8, 5u8, 255u8, 30u8, - 203u8, 230u8, 135u8, 202u8, - ] - { - let call = SetMaxValidatorsPerCore { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the maximum number of validators to use in parachain consensus."] - pub fn set_max_validators( - &self, - new: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxValidators, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 192u8, 156u8, 115u8, 10u8, 225u8, 94u8, 190u8, 180u8, 242u8, - 131u8, 202u8, 13u8, 82u8, 27u8, 8u8, 144u8, 70u8, 92u8, - 136u8, 206u8, 205u8, 3u8, 242u8, 130u8, 77u8, 114u8, 242u8, - 111u8, 99u8, 24u8, 238u8, 55u8, - ] - { - let call = SetMaxValidators { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the dispute period, in number of sessions to keep for disputes."] - pub fn set_dispute_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputePeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 232u8, 96u8, 104u8, 249u8, 183u8, 148u8, 126u8, 80u8, 64u8, - 39u8, 2u8, 208u8, 183u8, 189u8, 139u8, 201u8, 61u8, 63u8, - 42u8, 155u8, 215u8, 32u8, 212u8, 158u8, 90u8, 80u8, 159u8, - 23u8, 249u8, 204u8, 218u8, 217u8, - ] - { - let call = SetDisputePeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the dispute post conclusion acceptance period."] - pub fn set_dispute_post_conclusion_acceptance_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputePostConclusionAcceptancePeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 45u8, 140u8, 213u8, 62u8, 212u8, 31u8, 126u8, 94u8, 102u8, - 176u8, 203u8, 240u8, 28u8, 25u8, 116u8, 77u8, 187u8, 147u8, - 32u8, 20u8, 25u8, 124u8, 164u8, 162u8, 246u8, 223u8, 146u8, - 28u8, 35u8, 4u8, 174u8, 47u8, - ] - { - let call = SetDisputePostConclusionAcceptancePeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the maximum number of dispute spam slots."] - pub fn set_dispute_max_spam_slots( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputeMaxSpamSlots, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 180u8, 195u8, 6u8, 141u8, 89u8, 252u8, 245u8, 202u8, 36u8, - 123u8, 105u8, 35u8, 161u8, 60u8, 233u8, 213u8, 191u8, 65u8, - 68u8, 4u8, 19u8, 201u8, 226u8, 103u8, 124u8, 181u8, 201u8, - 91u8, 84u8, 170u8, 48u8, 154u8, - ] - { - let call = SetDisputeMaxSpamSlots { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the dispute conclusion by time out period."] - pub fn set_dispute_conclusion_by_time_out_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputeConclusionByTimeOutPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 50u8, 221u8, 129u8, 199u8, 147u8, 98u8, 11u8, 104u8, 133u8, - 161u8, 53u8, 163u8, 100u8, 155u8, 228u8, 167u8, 146u8, 87u8, - 186u8, 228u8, 147u8, 44u8, 142u8, 160u8, 119u8, 146u8, 10u8, - 155u8, 5u8, 35u8, 8u8, 165u8, - ] - { - let call = SetDisputeConclusionByTimeOutPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the no show slots, in number of number of consensus slots."] - #[doc = "Must be at least 1."] - pub fn set_no_show_slots( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNoShowSlots, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 235u8, 5u8, 35u8, 159u8, 200u8, 58u8, 171u8, 179u8, 78u8, - 70u8, 161u8, 47u8, 237u8, 245u8, 77u8, 81u8, 1u8, 138u8, - 145u8, 137u8, 45u8, 126u8, 255u8, 227u8, 130u8, 217u8, 36u8, - 251u8, 72u8, 235u8, 16u8, 231u8, - ] - { - let call = SetNoShowSlots { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the total number of delay tranches."] - pub fn set_n_delay_tranches( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNDelayTranches, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 109u8, 208u8, 13u8, 18u8, 178u8, 117u8, 101u8, 169u8, 162u8, - 255u8, 28u8, 88u8, 199u8, 89u8, 83u8, 59u8, 46u8, 105u8, - 186u8, 4u8, 7u8, 171u8, 78u8, 122u8, 197u8, 110u8, 63u8, - 164u8, 140u8, 59u8, 179u8, 236u8, - ] - { - let call = SetNDelayTranches { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the zeroth delay tranche width."] - pub fn set_zeroth_delay_tranche_width( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetZerothDelayTrancheWidth, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 162u8, 20u8, 162u8, 90u8, 59u8, 194u8, 147u8, 255u8, 198u8, - 203u8, 50u8, 13u8, 134u8, 142u8, 6u8, 156u8, 205u8, 128u8, - 222u8, 225u8, 150u8, 68u8, 198u8, 212u8, 198u8, 238u8, 3u8, - 209u8, 224u8, 19u8, 118u8, 147u8, - ] - { - let call = SetZerothDelayTrancheWidth { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of validators needed to approve a block."] - pub fn set_needed_approvals( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNeededApprovals, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 83u8, 164u8, 204u8, 168u8, 93u8, 165u8, 118u8, 111u8, 149u8, - 129u8, 126u8, 250u8, 95u8, 148u8, 193u8, 173u8, 239u8, 1u8, - 14u8, 102u8, 77u8, 150u8, 149u8, 55u8, 82u8, 179u8, 2u8, - 117u8, 19u8, 34u8, 223u8, 173u8, - ] - { - let call = SetNeededApprovals { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] - pub fn set_relay_vrf_modulo_samples( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetRelayVrfModuloSamples, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 22u8, 11u8, 132u8, 96u8, 58u8, 253u8, 183u8, 31u8, 137u8, - 231u8, 187u8, 145u8, 119u8, 164u8, 55u8, 142u8, 37u8, 151u8, - 227u8, 112u8, 113u8, 18u8, 200u8, 247u8, 238u8, 10u8, 223u8, - 74u8, 4u8, 132u8, 115u8, 119u8, - ] - { - let call = SetRelayVrfModuloSamples { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] - pub fn set_max_upward_queue_count( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardQueueCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 16u8, 31u8, 245u8, 94u8, 243u8, 122u8, 55u8, 155u8, 161u8, - 239u8, 5u8, 59u8, 186u8, 207u8, 136u8, 253u8, 255u8, 176u8, - 135u8, 242u8, 199u8, 96u8, 226u8, 150u8, 15u8, 160u8, 60u8, - 101u8, 66u8, 143u8, 93u8, 104u8, - ] - { - let call = SetMaxUpwardQueueCount { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] - pub fn set_max_upward_queue_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardQueueSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 203u8, 170u8, 21u8, 149u8, 170u8, 246u8, 91u8, 54u8, 197u8, - 91u8, 41u8, 114u8, 210u8, 239u8, 73u8, 236u8, 68u8, 194u8, - 157u8, 116u8, 229u8, 1u8, 34u8, 135u8, 144u8, 191u8, 56u8, - 77u8, 13u8, 92u8, 221u8, 4u8, - ] - { - let call = SetMaxUpwardQueueSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the critical downward message size."] - pub fn set_max_downward_message_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxDownwardMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 55u8, 181u8, 6u8, 126u8, 31u8, 154u8, 42u8, 194u8, 64u8, - 23u8, 34u8, 255u8, 151u8, 186u8, 52u8, 32u8, 168u8, 233u8, - 44u8, 35u8, 152u8, 78u8, 230u8, 242u8, 169u8, 85u8, 103u8, - 133u8, 177u8, 239u8, 175u8, 119u8, - ] - { - let call = SetMaxDownwardMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] - pub fn set_ump_service_total_weight( - &self, - new: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUmpServiceTotalWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 14u8, 179u8, 217u8, 169u8, 84u8, 45u8, 193u8, 3u8, 7u8, - 196u8, 56u8, 209u8, 50u8, 148u8, 32u8, 205u8, 99u8, 202u8, - 72u8, 246u8, 151u8, 230u8, 145u8, 98u8, 188u8, 1u8, 136u8, - 241u8, 217u8, 37u8, 6u8, 101u8, - ] - { - let call = SetUmpServiceTotalWeight { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] - pub fn set_max_upward_message_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 134u8, 232u8, 5u8, 70u8, 81u8, 177u8, 81u8, 235u8, 93u8, - 145u8, 193u8, 42u8, 150u8, 61u8, 236u8, 20u8, 38u8, 176u8, - 124u8, 170u8, 248u8, 149u8, 57u8, 88u8, 17u8, 46u8, 202u8, - 74u8, 35u8, 82u8, 190u8, 223u8, - ] - { - let call = SetMaxUpwardMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of messages that a candidate can contain."] - pub fn set_max_upward_message_num_per_candidate( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardMessageNumPerCandidate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 14u8, 79u8, 128u8, 66u8, 119u8, 24u8, 26u8, 116u8, 249u8, - 254u8, 86u8, 228u8, 248u8, 75u8, 111u8, 90u8, 101u8, 96u8, - 124u8, 25u8, 245u8, 115u8, 119u8, 14u8, 213u8, 180u8, 224u8, - 224u8, 188u8, 172u8, 152u8, 16u8, - ] - { - let call = SetMaxUpwardMessageNumPerCandidate { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] - pub fn set_hrmp_open_request_ttl( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpOpenRequestTtl, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 168u8, 254u8, 189u8, 22u8, 61u8, 90u8, 131u8, 1u8, 103u8, - 208u8, 179u8, 85u8, 80u8, 215u8, 9u8, 3u8, 34u8, 73u8, 130u8, - 19u8, 166u8, 77u8, 131u8, 148u8, 183u8, 86u8, 186u8, 148u8, - 109u8, 173u8, 74u8, 94u8, - ] - { - let call = SetHrmpOpenRequestTtl { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] - pub fn set_hrmp_sender_deposit( - &self, - new: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpSenderDeposit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 250u8, 23u8, 196u8, 206u8, 34u8, 86u8, 28u8, 14u8, 110u8, - 189u8, 38u8, 39u8, 2u8, 16u8, 212u8, 32u8, 65u8, 249u8, - 120u8, 163u8, 89u8, 232u8, 3u8, 49u8, 155u8, 174u8, 96u8, - 21u8, 240u8, 185u8, 140u8, 243u8, - ] - { - let call = SetHrmpSenderDeposit { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] - #[doc = "channel."] - pub fn set_hrmp_recipient_deposit( - &self, - new: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpRecipientDeposit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 104u8, 35u8, 129u8, 31u8, 111u8, 57u8, 190u8, 42u8, 159u8, - 220u8, 86u8, 136u8, 200u8, 4u8, 62u8, 241u8, 141u8, 90u8, - 200u8, 132u8, 141u8, 154u8, 117u8, 206u8, 79u8, 160u8, 124u8, - 186u8, 231u8, 250u8, 86u8, 87u8, - ] - { - let call = SetHrmpRecipientDeposit { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] - pub fn set_hrmp_channel_max_capacity( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxCapacity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 211u8, 49u8, 82u8, 59u8, 16u8, 97u8, 253u8, 64u8, 185u8, - 216u8, 235u8, 10u8, 84u8, 194u8, 231u8, 115u8, 153u8, 20u8, - 31u8, 86u8, 47u8, 226u8, 245u8, 214u8, 134u8, 194u8, 13u8, - 254u8, 230u8, 66u8, 54u8, 240u8, - ] - { - let call = SetHrmpChannelMaxCapacity { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] - pub fn set_hrmp_channel_max_total_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxTotalSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 254u8, 196u8, 171u8, 29u8, 208u8, 179u8, 204u8, 58u8, 64u8, - 41u8, 52u8, 73u8, 153u8, 245u8, 29u8, 132u8, 129u8, 29u8, - 94u8, 241u8, 136u8, 20u8, 12u8, 20u8, 255u8, 244u8, 252u8, - 98u8, 136u8, 222u8, 7u8, 19u8, - ] - { - let call = SetHrmpChannelMaxTotalSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] - pub fn set_hrmp_max_parachain_inbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParachainInboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 219u8, 88u8, 3u8, 249u8, 16u8, 182u8, 182u8, 233u8, 152u8, - 24u8, 29u8, 96u8, 227u8, 50u8, 156u8, 98u8, 71u8, 196u8, - 158u8, 103u8, 114u8, 55u8, 65u8, 199u8, 211u8, 225u8, 235u8, - 172u8, 218u8, 123u8, 158u8, 57u8, - ] - { - let call = SetHrmpMaxParachainInboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] - pub fn set_hrmp_max_parathread_inbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParathreadInboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 153u8, 169u8, 153u8, 141u8, 45u8, 21u8, 26u8, 33u8, 207u8, - 234u8, 186u8, 154u8, 12u8, 148u8, 2u8, 226u8, 55u8, 125u8, - 58u8, 127u8, 154u8, 176u8, 3u8, 47u8, 164u8, 63u8, 25u8, - 42u8, 66u8, 131u8, 143u8, 254u8, - ] - { - let call = SetHrmpMaxParathreadInboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] - pub fn set_hrmp_channel_max_message_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 237u8, 103u8, 126u8, 197u8, 164u8, 247u8, 67u8, 144u8, 30u8, - 192u8, 161u8, 243u8, 254u8, 26u8, 254u8, 33u8, 59u8, 216u8, - 159u8, 105u8, 166u8, 138u8, 38u8, 124u8, 248u8, 81u8, 11u8, - 223u8, 120u8, 75u8, 176u8, 177u8, - ] - { - let call = SetHrmpChannelMaxMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] - pub fn set_hrmp_max_parachain_outbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParachainOutboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 173u8, 184u8, 49u8, 66u8, 158u8, 142u8, 95u8, 225u8, 90u8, - 171u8, 4u8, 20u8, 210u8, 180u8, 54u8, 236u8, 60u8, 5u8, 76u8, - 173u8, 226u8, 203u8, 7u8, 156u8, 54u8, 9u8, 198u8, 171u8, - 250u8, 1u8, 120u8, 240u8, - ] - { - let call = SetHrmpMaxParachainOutboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] - pub fn set_hrmp_max_parathread_outbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParathreadOutboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 166u8, 73u8, 121u8, 53u8, 27u8, 77u8, 150u8, 115u8, 29u8, - 202u8, 34u8, 4u8, 35u8, 161u8, 113u8, 15u8, 66u8, 60u8, - 214u8, 129u8, 157u8, 143u8, 227u8, 134u8, 213u8, 9u8, 231u8, - 224u8, 187u8, 36u8, 16u8, 68u8, - ] - { - let call = SetHrmpMaxParathreadOutboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] - pub fn set_hrmp_max_message_num_per_candidate( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxMessageNumPerCandidate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 235u8, 47u8, 114u8, 29u8, 87u8, 198u8, 62u8, 200u8, 235u8, - 184u8, 204u8, 35u8, 251u8, 210u8, 88u8, 150u8, 22u8, 61u8, - 242u8, 196u8, 240u8, 76u8, 45u8, 54u8, 155u8, 111u8, 244u8, - 31u8, 158u8, 48u8, 68u8, 233u8, - ] - { - let call = SetHrmpMaxMessageNumPerCandidate { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum amount of weight any individual upward message may consume."] - pub fn set_ump_max_individual_weight( - &self, - new: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUmpMaxIndividualWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 61u8, 174u8, 42u8, 53u8, 120u8, 56u8, 252u8, 117u8, 173u8, - 223u8, 100u8, 141u8, 209u8, 29u8, 173u8, 240u8, 180u8, 113u8, - 27u8, 24u8, 4u8, 157u8, 107u8, 247u8, 235u8, 121u8, 152u8, - 6u8, 176u8, 254u8, 18u8, 70u8, - ] - { - let call = SetUmpMaxIndividualWeight { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] - pub fn set_pvf_checking_enabled( - &self, - new: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPvfCheckingEnabled, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 224u8, 199u8, 197u8, 208u8, 178u8, 211u8, 14u8, 102u8, 174u8, - 205u8, 207u8, 181u8, 75u8, 125u8, 209u8, 69u8, 85u8, 1u8, - 98u8, 251u8, 17u8, 42u8, 73u8, 9u8, 252u8, 184u8, 81u8, - 202u8, 132u8, 236u8, 97u8, 121u8, - ] - { - let call = SetPvfCheckingEnabled { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] - pub fn set_pvf_voting_ttl( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPvfVotingTtl, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 179u8, 71u8, 42u8, 140u8, 187u8, 43u8, 138u8, 16u8, 104u8, - 41u8, 30u8, 220u8, 131u8, 179u8, 200u8, 184u8, 105u8, 58u8, - 131u8, 225u8, 169u8, 253u8, 46u8, 186u8, 102u8, 52u8, 147u8, - 244u8, 22u8, 255u8, 41u8, 6u8, - ] - { - let call = SetPvfVotingTtl { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] - #[doc = "upgrade taking place."] - #[doc = ""] - #[doc = "See the field documentation for information and constraints for the new value."] - pub fn set_minimum_validation_upgrade_delay( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMinimumValidationUpgradeDelay, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 225u8, 178u8, 41u8, 194u8, 154u8, 222u8, 247u8, 129u8, 35u8, - 102u8, 248u8, 144u8, 21u8, 74u8, 42u8, 239u8, 135u8, 205u8, - 173u8, 190u8, 112u8, 30u8, 240u8, 106u8, 10u8, 217u8, 208u8, - 11u8, 79u8, 47u8, 198u8, 37u8, - ] - { - let call = SetMinimumValidationUpgradeDelay { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Setting this to true will disable consistency checks for the configuration setters."] - #[doc = "Use with caution."] - pub fn set_bypass_consistency_check( - &self, - new: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetBypassConsistencyCheck, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 5u8, 54u8, 178u8, 218u8, 46u8, 61u8, 99u8, 23u8, 227u8, - 202u8, 201u8, 164u8, 121u8, 226u8, 65u8, 253u8, 29u8, 164u8, - 170u8, 130u8, 32u8, 85u8, 222u8, 10u8, 232u8, 252u8, 73u8, - 23u8, 69u8, 30u8, 1u8, 87u8, - ] - { - let call = SetBypassConsistencyCheck { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct ActiveConfig; - impl ::subxt::StorageEntry for ActiveConfig { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "ActiveConfig"; - type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingConfig<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for PendingConfig<'_> { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "PendingConfig"; - type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: migration :: v1 :: HostConfiguration < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingConfigs; - impl ::subxt::StorageEntry for PendingConfigs { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "PendingConfigs"; - type Value = :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BypassConsistencyCheck; - impl ::subxt::StorageEntry for BypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "BypassConsistencyCheck"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The active configuration for the current session."] pub 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 >{ - if self.client.metadata().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 = " Pending configuration (if any) for the next session."] - #[doc = ""] - #[doc = " DEPRECATED: This is no longer used, and will be removed in the future."] pub async fn pending_config (& self , _0 : & :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: configuration :: migration :: v1 :: HostConfiguration < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - if self.client.metadata().storage_hash::()? - == [ - 152u8, 192u8, 135u8, 74u8, 174u8, 47u8, 192u8, 95u8, 147u8, - 137u8, 41u8, 219u8, 149u8, 198u8, 186u8, 16u8, 158u8, 160u8, - 51u8, 31u8, 187u8, 244u8, 112u8, 238u8, 194u8, 85u8, 198u8, - 73u8, 148u8, 62u8, 74u8, 6u8, - ] - { - let entry = PendingConfig(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Pending configuration (if any) for the next session."] - #[doc = ""] - #[doc = " DEPRECATED: This is no longer used, and will be removed in the future."] - pub async fn pending_config_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingConfig<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().storage_hash::()? - == [ - 152u8, 192u8, 135u8, 74u8, 174u8, 47u8, 192u8, 95u8, 147u8, - 137u8, 41u8, 219u8, 149u8, 198u8, 186u8, 16u8, 158u8, 160u8, - 51u8, 31u8, 187u8, 244u8, 112u8, 238u8, 194u8, 85u8, 198u8, - 73u8, 148u8, 62u8, 74u8, 6u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Pending configuration changes."] - #[doc = ""] - #[doc = " This is a list of configuration changes, each with a session index at which it should"] - #[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 >{ - if self.client.metadata().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 = " 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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - } - } - } - pub mod paras_shared { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct CurrentSessionIndex; - impl ::subxt::StorageEntry for CurrentSessionIndex { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "CurrentSessionIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveValidatorIndices; - impl ::subxt::StorageEntry for ActiveValidatorIndices { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "ActiveValidatorIndices"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveValidatorKeys; - impl ::subxt::StorageEntry for ActiveValidatorKeys { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "ActiveValidatorKeys"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current session index."] - pub async fn current_session_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[doc = " All the validators actively participating in parachain consensus."] - #[doc = " Indices are into the broader validator set."] - pub async fn active_validator_indices( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - } - } - } - pub mod para_inclusion { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub type Event = - runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A candidate was backed. `[candidate, head_data]`"] - pub struct CandidateBacked( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - pub runtime_types::polkadot_primitives::v2::GroupIndex, - ); - impl ::subxt::Event for CandidateBacked { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateBacked"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A candidate was included. `[candidate, head_data]`"] - pub struct CandidateIncluded( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - pub runtime_types::polkadot_primitives::v2::GroupIndex, - ); - impl ::subxt::Event for CandidateIncluded { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateIncluded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A candidate timed out. `[candidate, head_data]`"] - pub struct CandidateTimedOut( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - ); - impl ::subxt::Event for CandidateTimedOut { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateTimedOut"; - } - } - pub mod storage { - use super::runtime_types; - pub struct AvailabilityBitfields<'a>( - pub &'a runtime_types::polkadot_primitives::v2::ValidatorIndex, - ); - impl ::subxt::StorageEntry for AvailabilityBitfields<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "AvailabilityBitfields"; - type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailability<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingAvailability<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "PendingAvailability"; - type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailabilityCommitments<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingAvailabilityCommitments<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "PendingAvailabilityCommitments"; - type Value = runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] pub 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 >{ - if self - .client - .metadata() - .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 async fn availability_bitfields_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AvailabilityBitfields<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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 >{ - if self - .client - .metadata() - .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 async fn pending_availability_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailability<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The commitments of candidates pending availability, by `ParaId`."] - pub async fn pending_availability_commitments( - &self, - _0: &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, - >, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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 mod para_inherent { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Enter { - pub data: runtime_types::polkadot_primitives::v2::InherentData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for Enter { - const PALLET: &'static str = "ParaInherent"; - const FUNCTION: &'static str = "enter"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] - pub fn enter( - &self, - data: runtime_types::polkadot_primitives::v2::InherentData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Enter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 208u8, 134u8, 126u8, 30u8, 50u8, 219u8, 225u8, 133u8, 3u8, - 2u8, 121u8, 154u8, 133u8, 141u8, 159u8, 193u8, 66u8, 252u8, - 236u8, 234u8, 38u8, 169u8, 202u8, 154u8, 28u8, 171u8, 248u8, - 77u8, 31u8, 114u8, 21u8, 215u8, - ] - { - let call = Enter { data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Included; - impl ::subxt::StorageEntry for Included { - const PALLET: &'static str = "ParaInherent"; - const STORAGE: &'static str = "Included"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct OnChainVotes; - impl ::subxt::StorageEntry for OnChainVotes { - const PALLET: &'static str = "ParaInherent"; - const STORAGE: &'static str = "OnChainVotes"; - type Value = runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Whether the paras inherent was included within this block."] - #[doc = ""] - #[doc = " The `Option<()>` is effectively a `bool`, but it never hits storage in the `None` variant"] - #[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> - { - if self.client.metadata().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()) - } - } - #[doc = " Scraped on chain data for extracting resolved disputes as well as backing votes."] - pub async 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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - } - pub mod para_scheduler { - use super::{ - root_mod, - runtime_types, - }; - pub mod storage { - use super::runtime_types; - pub struct ValidatorGroups; - impl ::subxt::StorageEntry for ValidatorGroups { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ValidatorGroups"; - type Value = ::std::vec::Vec< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParathreadQueue; - impl ::subxt::StorageEntry for ParathreadQueue { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadQueue"; - type Value = runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AvailabilityCores; - impl ::subxt::StorageEntry for AvailabilityCores { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "AvailabilityCores"; - type Value = ::std::vec::Vec< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CoreOccupied, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParathreadClaimIndex; - impl ::subxt::StorageEntry for ParathreadClaimIndex { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadClaimIndex"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SessionStartBlock; - impl ::subxt::StorageEntry for SessionStartBlock { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "SessionStartBlock"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Scheduled; - impl ::subxt::StorageEntry for Scheduled { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "Scheduled"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " All the validator groups. One for each core. Indices are into `ActiveValidators` - not the"] - #[doc = " broader set of Polkadot validators, but instead just the subset used for parachains during"] - #[doc = " this session."] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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 >{ - if self.client.metadata().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 = " One entry for each availability core. Entries are `None` if the core is not currently occupied. Can be"] - #[doc = " temporarily `Some` if scheduled but not occupied."] - #[doc = " The i'th parachain belongs to the i'th core, with the remaining cores all being"] - #[doc = " parathread-multiplexers."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CoreOccupied, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The block number where the session start occurred. Used to track how many group rotations have occurred."] - #[doc = ""] - #[doc = " Note that in the context of parachains modules the session change is signaled during"] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Currently scheduled cores - free but up to be occupied."] - #[doc = ""] - #[doc = " Bounded by the number of cores: one for each parachain and parathread multiplexer."] - #[doc = ""] - #[doc = " The value contained here will not be valid after the end of a block. Runtime APIs should be used to determine scheduled cores/"] - #[doc = " for the upcoming block."] pub 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 >{ - if self.client.metadata().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()) - } - } - } - } - } - pub mod paras { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceSetCurrentCode { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for ForceSetCurrentCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_set_current_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceSetCurrentHead { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, - } - impl ::subxt::Call for ForceSetCurrentHead { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_set_current_head"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceScheduleCodeUpgrade { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - pub relay_parent_number: ::core::primitive::u32, - } - impl ::subxt::Call for ForceScheduleCodeUpgrade { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_schedule_code_upgrade"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceNoteNewHead { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, - } - impl ::subxt::Call for ForceNoteNewHead { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_note_new_head"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceQueueAction { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ForceQueueAction { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_queue_action"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddTrustedValidationCode { - pub validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for AddTrustedValidationCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "add_trusted_validation_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PokeUnusedValidationCode { - pub validation_code_hash: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - } - impl ::subxt::Call for PokeUnusedValidationCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "poke_unused_validation_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct IncludePvfCheckStatement { - pub stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, - pub signature: - runtime_types::polkadot_primitives::v2::validator_app::Signature, - } - impl ::subxt::Call for IncludePvfCheckStatement { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "include_pvf_check_statement"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the storage for the parachain validation code immediately."] - pub fn force_set_current_code( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSetCurrentCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 100u8, 36u8, 105u8, 246u8, 77u8, 252u8, 162u8, 139u8, 60u8, - 37u8, 12u8, 148u8, 206u8, 160u8, 134u8, 105u8, 50u8, 52u8, - 156u8, 252u8, 217u8, 174u8, 211u8, 208u8, 88u8, 81u8, 236u8, - 66u8, 27u8, 59u8, 126u8, 5u8, - ] - { - let call = ForceSetCurrentCode { para, new_code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the storage for the current parachain head data immediately."] - pub fn force_set_current_head( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSetCurrentHead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 119u8, 46u8, 120u8, 202u8, 138u8, 190u8, 179u8, 78u8, 155u8, - 167u8, 220u8, 233u8, 170u8, 248u8, 202u8, 92u8, 73u8, 246u8, - 224u8, 56u8, 208u8, 124u8, 215u8, 19u8, 235u8, 246u8, 89u8, - 189u8, 19u8, 205u8, 22u8, 70u8, - ] - { - let call = ForceSetCurrentHead { para, new_head }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] - pub fn force_schedule_code_upgrade( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - relay_parent_number: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceScheduleCodeUpgrade, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 254u8, 60u8, 105u8, 37u8, 116u8, 190u8, 30u8, 255u8, 210u8, - 24u8, 120u8, 99u8, 174u8, 215u8, 233u8, 83u8, 57u8, 200u8, - 24u8, 49u8, 220u8, 12u8, 103u8, 30u8, 165u8, 10u8, 125u8, - 255u8, 88u8, 134u8, 199u8, 3u8, - ] - { - let call = ForceScheduleCodeUpgrade { - para, - new_code, - relay_parent_number, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Note a new block head for para within the context of the current block."] - pub fn force_note_new_head( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNoteNewHead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 203u8, 31u8, 68u8, 125u8, 105u8, 218u8, 177u8, 205u8, 248u8, - 131u8, 25u8, 170u8, 140u8, 56u8, 183u8, 106u8, 2u8, 118u8, - 79u8, 22u8, 228u8, 91u8, 33u8, 66u8, 245u8, 144u8, 147u8, - 142u8, 14u8, 171u8, 125u8, 233u8, - ] - { - let call = ForceNoteNewHead { para, new_head }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Put a parachain directly into the next session's action queue."] - #[doc = "We can't queue it any sooner than this without going into the"] - #[doc = "initializer..."] - pub fn force_queue_action( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceQueueAction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 141u8, 235u8, 245u8, 93u8, 24u8, 155u8, 106u8, 136u8, 190u8, - 236u8, 216u8, 131u8, 245u8, 5u8, 186u8, 131u8, 159u8, 240u8, - 95u8, 139u8, 231u8, 12u8, 255u8, 74u8, 194u8, 13u8, 112u8, - 78u8, 110u8, 95u8, 26u8, 133u8, - ] - { - let call = ForceQueueAction { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Adds the validation code to the storage."] - #[doc = ""] - #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] - #[doc = "is running for that code, it will be instantly accepted."] - #[doc = ""] - #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] - #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] - #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] - #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] - #[doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] - #[doc = ""] - #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] - #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] - pub fn add_trusted_validation_code( - &self, - validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddTrustedValidationCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 110u8, 255u8, 249u8, 176u8, 109u8, 54u8, 87u8, 19u8, 7u8, - 62u8, 220u8, 143u8, 196u8, 99u8, 66u8, 49u8, 18u8, 225u8, - 14u8, 42u8, 243u8, 228u8, 232u8, 207u8, 246u8, 34u8, 179u8, - 127u8, 246u8, 239u8, 30u8, 214u8, - ] - { - let call = AddTrustedValidationCode { validation_code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the validation code from the storage iff the reference count is 0."] - #[doc = ""] - #[doc = "This is better than removing the storage directly, because it will not remove the code"] - #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] - #[doc = "dispatching."] - pub fn poke_unused_validation_code( - &self, - validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PokeUnusedValidationCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 159u8, 142u8, 14u8, 7u8, 29u8, 74u8, 213u8, 165u8, 206u8, - 45u8, 135u8, 121u8, 0u8, 146u8, 217u8, 59u8, 189u8, 120u8, - 169u8, 227u8, 225u8, 135u8, 15u8, 45u8, 197u8, 201u8, 29u8, - 128u8, 49u8, 165u8, 106u8, 80u8, - ] - { - let call = PokeUnusedValidationCode { - validation_code_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] - #[doc = "enacts the results if that was the last vote before achieving the supermajority."] - pub fn include_pvf_check_statement( - &self, - stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, - signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncludePvfCheckStatement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 187u8, 231u8, 113u8, 29u8, 177u8, 92u8, 2u8, 116u8, 88u8, - 114u8, 19u8, 170u8, 167u8, 254u8, 149u8, 142u8, 24u8, 57u8, - 187u8, 210u8, 72u8, 239u8, 32u8, 75u8, 39u8, 47u8, 158u8, - 205u8, 82u8, 50u8, 175u8, 31u8, - ] - { - let call = IncludePvfCheckStatement { stmt, signature }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Current code has been updated for a Para. `para_id`"] - pub struct CurrentCodeUpdated( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for CurrentCodeUpdated { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CurrentCodeUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Current head has been updated for a Para. `para_id`"] - pub struct CurrentHeadUpdated( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for CurrentHeadUpdated { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CurrentHeadUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A code upgrade has been scheduled for a Para. `para_id`"] - pub struct CodeUpgradeScheduled( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for CodeUpgradeScheduled { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CodeUpgradeScheduled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A new head has been noted for a Para. `para_id`"] - pub struct NewHeadNoted( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for NewHeadNoted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "NewHeadNoted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A para has been queued to execute pending actions. `para_id`"] - pub struct ActionQueued( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for ActionQueued { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "ActionQueued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] - #[doc = "code. `code_hash` `para_id`"] - pub struct PvfCheckStarted( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckStarted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckStarted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The given validation code was accepted by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - pub struct PvfCheckAccepted( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckAccepted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckAccepted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The given validation code was rejected by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - pub struct PvfCheckRejected( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckRejected { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckRejected"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PvfActiveVoteMap<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for PvfActiveVoteMap<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PvfActiveVoteMap"; - type Value = runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PvfActiveVoteList; - impl ::subxt::StorageEntry for PvfActiveVoteList { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PvfActiveVoteList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Parachains; - impl ::subxt::StorageEntry for Parachains { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Parachains"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParaLifecycles<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ParaLifecycles<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ParaLifecycles"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Heads<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Heads<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Heads"; - type Value = runtime_types::polkadot_parachain::primitives::HeadData; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CurrentCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for CurrentCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CurrentCodeHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for PastCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodeHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeMeta<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PastCodeMeta<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodeMeta"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodePruning; - impl ::subxt::StorageEntry for PastCodePruning { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodePruning"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct FutureCodeUpgrades<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeUpgrades<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeUpgrades"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct FutureCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeGoAheadSignal<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpgradeGoAheadSignal<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeGoAheadSignal"; - type Value = runtime_types::polkadot_primitives::v2::UpgradeGoAhead; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeRestrictionSignal<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpgradeRestrictionSignal<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeRestrictionSignal"; - type Value = runtime_types::polkadot_primitives::v2::UpgradeRestriction; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeCooldowns; - impl ::subxt::StorageEntry for UpgradeCooldowns { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeCooldowns"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpcomingUpgrades; - impl ::subxt::StorageEntry for UpcomingUpgrades { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpcomingUpgrades"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActionsQueue<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ActionsQueue<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ActionsQueue"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpcomingParasGenesis<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpcomingParasGenesis<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpcomingParasGenesis"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CodeByHashRefs<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for CodeByHashRefs<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHashRefs"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct CodeByHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for CodeByHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHash"; - type Value = - runtime_types::polkadot_parachain::primitives::ValidationCode; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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 >{ - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 = " All parachains. Ordered ascending by `ParaId`. Parathreads are not included."] - #[doc = ""] - #[doc = " Consider using the [`ParachainsCache`] type of modifying."] - pub async fn parachains( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 async fn para_lifecycles_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ParaLifecycles<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The head-data of every registered para."] - pub async fn heads( - &self, - _0: &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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Which paras have past code that needs pruning and the relay-chain block at which the code was replaced."] - #[doc = " Note that this is the actual height of the included block, not the expected height at which the"] - #[doc = " code upgrade would be applied, although they may be equal."] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] - #[doc = ""] - #[doc = " This value is absent when there are no upgrades scheduled or during the time the relay chain"] - #[doc = " performs the checks. It is set at the first relay-chain block when the corresponding parachain"] - #[doc = " can switch its upgrade function. As soon as the parachain's block is included, the value"] - #[doc = " gets reset to `None`."] - #[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( - &self, - _0: &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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] - #[doc = ""] - #[doc = " This value is absent when there are no upgrades scheduled or during the time the relay chain"] - #[doc = " performs the checks. It is set at the first relay-chain block when the corresponding parachain"] - #[doc = " can switch its upgrade function. As soon as the parachain's block is included, the value"] - #[doc = " gets reset to `None`."] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] - #[doc = " an upgrade for this parachain."] - #[doc = ""] - #[doc = " This may be a because the parachain waits for the upgrade cooldown to expire. Another"] - #[doc = " potential use case is when we want to perform some maintenance (such as storage migration)"] - #[doc = " we could restrict upgrades to make the process simpler."] - #[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( - &self, - _0: &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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] - #[doc = " an upgrade for this parachain."] - #[doc = ""] - #[doc = " This may be a because the parachain waits for the upgrade cooldown to expire. Another"] - #[doc = " potential use case is when we want to perform some maintenance (such as storage migration)"] - #[doc = " we could restrict upgrades to make the process simpler."] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The actions to perform during the start of a specific session index."] - pub async fn actions_queue( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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 >{ - if self - .client - .metadata() - .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 = " 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub async fn code_by_hash_refs( - &self, - _0 : & runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0 : & 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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn unsigned_priority( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Paras", "UnsignedPriority")? - == [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, - 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, - 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, - 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ] - { - let pallet = self.client.metadata().pallet("Paras")?; - let constant = pallet.constant("UnsignedPriority")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod initializer { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct ForceApprove { - pub up_to: ::core::primitive::u32, - } - impl ::subxt::Call for ForceApprove { - const PALLET: &'static str = "Initializer"; - const FUNCTION: &'static str = "force_approve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] - #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] - #[doc = "chain are valid and should be finalized."] - pub fn force_approve( - &self, - up_to: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceApprove, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 61u8, 29u8, 75u8, 222u8, 82u8, 250u8, 124u8, 164u8, 70u8, - 114u8, 150u8, 28u8, 103u8, 53u8, 185u8, 147u8, 168u8, 239u8, - 207u8, 197u8, 23u8, 158u8, 16u8, 255u8, 139u8, 18u8, 214u8, - 174u8, 53u8, 191u8, 49u8, 73u8, - ] - { - let call = ForceApprove { up_to }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct HasInitialized; - impl ::subxt::StorageEntry for HasInitialized { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "HasInitialized"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BufferedSessionChanges; - impl ::subxt::StorageEntry for BufferedSessionChanges { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "BufferedSessionChanges"; - type Value = :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Whether the parachains modules have been initialized within this block."] - #[doc = ""] - #[doc = " Semantically a `bool`, but this guarantees it should never hit the trie,"] - #[doc = " as this is cleared in `on_finalize` and Frame optimizes `None` values to be empty values."] - #[doc = ""] - #[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> - { - if self.client.metadata().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()) - } - } - #[doc = " Buffered session changes along with the block number at which they should be applied."] - #[doc = ""] - #[doc = " Typically this will be empty or one element long. Apart from that this item never hits"] - #[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 >{ - if self - .client - .metadata() - .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()) - } - } - } - } - } - pub mod dmp { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct DownwardMessageQueues<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueues<'_> { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueues"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct DownwardMessageQueueHeads<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueueHeads<'_> { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueueHeads"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The downward messages addressed for a certain para."] - pub 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, - > { - if self - .client - .metadata() - .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 async fn downward_message_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueues<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " A mapping that stores the downward message queue MQC head for each para."] - #[doc = ""] - #[doc = " Each link in this chain has a form:"] - #[doc = " `(prev_head, B, H(M))`, where"] - #[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( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[doc = " A mapping that stores the downward message queue MQC head for each para."] - #[doc = ""] - #[doc = " Each link in this chain has a form:"] - #[doc = " `(prev_head, B, H(M))`, where"] - #[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, - > { - if self - .client - .metadata() - .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 mod ump { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ServiceOverweight { - pub index: ::core::primitive::u64, - pub weight_limit: ::core::primitive::u64, - } - impl ::subxt::Call for ServiceOverweight { - const PALLET: &'static str = "Ump"; - const FUNCTION: &'static str = "service_overweight"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Service a single overweight upward message."] - #[doc = ""] - #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] - #[doc = "- `index`: The index of the overweight message to service."] - #[doc = "- `weight_limit`: The amount of weight that message execution may take."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `UnknownMessageIndex`: Message of `index` is unknown."] - #[doc = "- `WeightOverLimit`: Message execution may use greater than `weight_limit`."] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OverweightServiced`: On success."] - pub fn service_overweight( - &self, - index: ::core::primitive::u64, - weight_limit: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ServiceOverweight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 229u8, 167u8, 106u8, 63u8, 141u8, 80u8, 8u8, 201u8, 156u8, - 34u8, 47u8, 104u8, 116u8, 57u8, 35u8, 216u8, 132u8, 3u8, - 201u8, 169u8, 38u8, 107u8, 149u8, 120u8, 42u8, 130u8, 100u8, - 133u8, 214u8, 48u8, 99u8, 146u8, - ] - { - let call = ServiceOverweight { - index, - weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Upward message is invalid XCM."] - #[doc = "\\[ id \\]"] - pub struct InvalidFormat(pub [::core::primitive::u8; 32usize]); - impl ::subxt::Event for InvalidFormat { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "InvalidFormat"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Upward message is unsupported version of XCM."] - #[doc = "\\[ id \\]"] - pub struct UnsupportedVersion(pub [::core::primitive::u8; 32usize]); - impl ::subxt::Event for UnsupportedVersion { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "UnsupportedVersion"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Upward message executed with the given outcome."] - #[doc = "\\[ id, outcome \\]"] - pub struct ExecutedUpward( - pub [::core::primitive::u8; 32usize], - pub runtime_types::xcm::v2::traits::Outcome, - ); - impl ::subxt::Event for ExecutedUpward { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "ExecutedUpward"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The weight limit for handling upward messages was reached."] - #[doc = "\\[ id, remaining, required \\]"] - pub struct WeightExhausted( - pub [::core::primitive::u8; 32usize], - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for WeightExhausted { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "WeightExhausted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some upward messages have been received and will be processed."] - #[doc = "\\[ para, count, size \\]"] - pub struct UpwardMessagesReceived( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for UpwardMessagesReceived { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "UpwardMessagesReceived"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The weight budget was exceeded for an individual upward message."] - #[doc = ""] - #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] - #[doc = "using the assigned `overweight_index`."] - #[doc = ""] - #[doc = "\\[ para, id, overweight_index, required \\]"] - pub struct OverweightEnqueued( - pub runtime_types::polkadot_parachain::primitives::Id, - pub [::core::primitive::u8; 32usize], - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for OverweightEnqueued { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "OverweightEnqueued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Upward message from the overweight queue was executed with the given actual weight"] - #[doc = "used."] - #[doc = ""] - #[doc = "\\[ overweight_index, used \\]"] - pub struct OverweightServiced( - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for OverweightServiced { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "OverweightServiced"; - } - } - pub mod storage { - use super::runtime_types; - pub struct RelayDispatchQueues<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueues<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueues"; - type Value = ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct RelayDispatchQueueSize<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueueSize<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueueSize"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NeedsDispatch; - impl ::subxt::StorageEntry for NeedsDispatch { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NeedsDispatch"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextDispatchRoundStartWith; - impl ::subxt::StorageEntry for NextDispatchRoundStartWith { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NextDispatchRoundStartWith"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Overweight<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Overweight<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "Overweight"; - type Value = ( - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct OverweightCount; - impl ::subxt::StorageEntry for OverweightCount { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "OverweightCount"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] - #[doc = ""] - #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] - #[doc = " channel management messages."] - #[doc = ""] - #[doc = " The messages are processed in FIFO order."] - pub async fn relay_dispatch_queues( - &self, - _0: &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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] - #[doc = ""] - #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] - #[doc = ""] - #[doc = " First item in the tuple is the count of messages and second"] - #[doc = " is the total length (in bytes) of the message payloads."] - #[doc = ""] - #[doc = " Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of"] - #[doc = " messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of"] - #[doc = " loading the whole message queue if only the total size and count are required."] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] - #[doc = ""] - #[doc = " First item in the tuple is the count of messages and second"] - #[doc = " is the total length (in bytes) of the message payloads."] - #[doc = ""] - #[doc = " Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of"] - #[doc = " messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of"] - #[doc = " loading the whole message queue if only the total size and count are required."] - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " This is the para that gets will get dispatched first during the next upward dispatchable queue"] - #[doc = " execution round."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - If `Some(para)`, then `para` must be present in `NeedsDispatch`."] - pub async 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The messages that exceeded max individual message weight budget."] - #[doc = ""] - #[doc = " These messages stay there until manually dispatched."] - pub async fn overweight( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The number of overweight messages ever recorded in `Overweight` (and thus the lowest free"] - #[doc = " index)."] - pub async fn overweight_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - } - } - } - pub mod hrmp { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct HrmpInitOpenChannel { - pub recipient: runtime_types::polkadot_parachain::primitives::Id, - pub proposed_max_capacity: ::core::primitive::u32, - pub proposed_max_message_size: ::core::primitive::u32, - } - impl ::subxt::Call for HrmpInitOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_init_open_channel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct HrmpAcceptOpenChannel { - pub sender: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for HrmpAcceptOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_accept_open_channel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct HrmpCloseChannel { - pub channel_id: - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - } - impl ::subxt::Call for HrmpCloseChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_close_channel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceCleanHrmp { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub inbound: ::core::primitive::u32, - pub outbound: ::core::primitive::u32, - } - impl ::subxt::Call for ForceCleanHrmp { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_clean_hrmp"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct ForceProcessHrmpOpen { - pub channels: ::core::primitive::u32, - } - impl ::subxt::Call for ForceProcessHrmpOpen { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_open"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct ForceProcessHrmpClose { - pub channels: ::core::primitive::u32, - } - impl ::subxt::Call for ForceProcessHrmpClose { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_close"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct HrmpCancelOpenRequest { - pub channel_id: - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - pub open_requests: ::core::primitive::u32, - } - impl ::subxt::Call for HrmpCancelOpenRequest { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_cancel_open_request"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] - #[doc = "parameters."] - #[doc = ""] - #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] - #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] - #[doc = ""] - #[doc = "These numbers are a subject to the relay-chain configuration limits."] - #[doc = ""] - #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] - #[doc = "change."] - pub fn hrmp_init_open_channel( - &self, - recipient: runtime_types::polkadot_parachain::primitives::Id, - proposed_max_capacity: ::core::primitive::u32, - proposed_max_message_size: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpInitOpenChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 244u8, 142u8, 161u8, 144u8, 109u8, 104u8, 164u8, 198u8, - 201u8, 79u8, 178u8, 136u8, 107u8, 104u8, 83u8, 11u8, 167u8, - 164u8, 223u8, 147u8, 135u8, 35u8, 133u8, 176u8, 236u8, 112u8, - 107u8, 131u8, 184u8, 105u8, 174u8, 12u8, - ] - { - let call = HrmpInitOpenChannel { - recipient, - proposed_max_capacity, - proposed_max_message_size, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Accept a pending open channel request from the given sender."] - #[doc = ""] - #[doc = "The channel will be opened only on the next session boundary."] - pub fn hrmp_accept_open_channel( - &self, - sender: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpAcceptOpenChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 95u8, 196u8, 155u8, 220u8, 235u8, 120u8, 67u8, 247u8, 245u8, - 20u8, 162u8, 41u8, 4u8, 204u8, 125u8, 16u8, 224u8, 72u8, - 198u8, 237u8, 84u8, 46u8, 201u8, 17u8, 172u8, 55u8, 115u8, - 51u8, 16u8, 140u8, 4u8, 253u8, - ] - { - let call = HrmpAcceptOpenChannel { sender }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] - #[doc = "recipient in the channel being closed."] - #[doc = ""] - #[doc = "The closure can only happen on a session change."] - pub fn hrmp_close_channel( - &self, - channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpCloseChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 199u8, 9u8, 55u8, 184u8, 196u8, 45u8, 46u8, 251u8, 48u8, - 23u8, 132u8, 74u8, 188u8, 121u8, 41u8, 18u8, 71u8, 65u8, - 129u8, 14u8, 38u8, 48u8, 253u8, 119u8, 171u8, 202u8, 9u8, - 65u8, 250u8, 98u8, 185u8, 220u8, - ] - { - let call = HrmpCloseChannel { channel_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] - #[doc = "a para may have. Normally this happens once per session, but this allows"] - #[doc = "you to trigger the cleanup immediately for a specific parachain."] - #[doc = ""] - #[doc = "Origin must be Root."] - #[doc = ""] - #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] - pub fn force_clean_hrmp( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - inbound: ::core::primitive::u32, - outbound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceCleanHrmp, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 182u8, 231u8, 99u8, 129u8, 130u8, 109u8, 97u8, 108u8, 37u8, - 107u8, 203u8, 70u8, 133u8, 106u8, 226u8, 77u8, 110u8, 189u8, - 227u8, 26u8, 129u8, 189u8, 234u8, 215u8, 112u8, 22u8, 127u8, - 185u8, 152u8, 157u8, 14u8, 66u8, - ] - { - let call = ForceCleanHrmp { - para, - inbound, - outbound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force process HRMP open channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP open channel requests, you can use this"] - #[doc = "function process all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of opening channels must be provided as witness data of weighing."] - pub fn force_process_hrmp_open( - &self, - channels: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceProcessHrmpOpen, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 162u8, 53u8, 194u8, 175u8, 117u8, 32u8, 217u8, 177u8, 9u8, - 255u8, 88u8, 40u8, 8u8, 174u8, 8u8, 11u8, 26u8, 82u8, 213u8, - 40u8, 20u8, 89u8, 227u8, 209u8, 95u8, 162u8, 221u8, 97u8, - 230u8, 98u8, 110u8, 85u8, - ] - { - let call = ForceProcessHrmpOpen { channels }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force process HRMP close channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP close channel requests, you can use this"] - #[doc = "function process all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of closing channels must be provided as witness data of weighing."] - pub fn force_process_hrmp_close( - &self, - channels: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceProcessHrmpClose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 128u8, 141u8, 191u8, 255u8, 204u8, 137u8, 27u8, 170u8, 180u8, - 166u8, 93u8, 144u8, 70u8, 56u8, 132u8, 100u8, 5u8, 114u8, - 252u8, 163u8, 164u8, 246u8, 234u8, 152u8, 193u8, 79u8, 89u8, - 137u8, 46u8, 171u8, 32u8, 119u8, - ] - { - let call = ForceProcessHrmpClose { channels }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] - #[doc = "or the recipient for that request. The origin must be either of those."] - #[doc = ""] - #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] - #[doc = "already accepted."] - #[doc = ""] - #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] - #[doc = "witness data."] - pub fn hrmp_cancel_open_request( - &self, - channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - open_requests: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpCancelOpenRequest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 8u8, 83u8, 32u8, 187u8, 220u8, 1u8, 212u8, 226u8, 72u8, 61u8, - 110u8, 211u8, 238u8, 119u8, 95u8, 48u8, 150u8, 51u8, 177u8, - 182u8, 209u8, 174u8, 245u8, 25u8, 194u8, 199u8, 212u8, 131u8, - 77u8, 72u8, 9u8, 120u8, - ] - { - let call = HrmpCancelOpenRequest { - channel_id, - open_requests, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Open HRMP channel requested."] - #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] - pub struct OpenChannelRequested( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for OpenChannelRequested { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelRequested"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] - #[doc = "`[by_parachain, channel_id]`"] - pub struct OpenChannelCanceled( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::Event for OpenChannelCanceled { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelCanceled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] - pub struct OpenChannelAccepted( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for OpenChannelAccepted { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelAccepted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] - pub struct ChannelClosed( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::Event for ChannelClosed { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "ChannelClosed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct HrmpOpenChannelRequests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequests"; - type Value = runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpOpenChannelRequestsList; - impl ::subxt::StorageEntry for HrmpOpenChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestsList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct HrmpOpenChannelRequestCount<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequestCount<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpAcceptedChannelRequestCount<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpAcceptedChannelRequestCount<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpAcceptedChannelRequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpCloseChannelRequests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpCloseChannelRequests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequests"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpCloseChannelRequestsList; - impl ::subxt::StorageEntry for HrmpCloseChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequestsList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct HrmpWatermarks<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpWatermarks<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpWatermarks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannels<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpChannels<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannels"; - type Value = - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpIngressChannelsIndex<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpIngressChannelsIndex<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpIngressChannelsIndex"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpEgressChannelsIndex<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpEgressChannelsIndex<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpEgressChannelsIndex"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannelContents<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpChannelContents<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelContents"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannelDigests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpChannelDigests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelDigests"; - type Value = ::std::vec::Vec<( - ::core::primitive::u32, - ::std::vec::Vec, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The set of pending HRMP open channel requests."] - #[doc = ""] - #[doc = " The set is accompanied by a list for iteration."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub 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 >{ - if self - .client - .metadata() - .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 = " The set of pending HRMP open channel requests."] - #[doc = ""] - #[doc = " The set is accompanied by a list for iteration."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub async fn hrmp_open_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequests<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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 async 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] - #[doc = " change. Used for checking if a given channel is registered for closure."] - #[doc = ""] - #[doc = " The set is accompanied by a list for iteration."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub 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> - { - if self - .client - .metadata() - .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()) - } - } - #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] - #[doc = " change. Used for checking if a given channel is registered for closure."] - #[doc = ""] - #[doc = " The set is accompanied by a list for iteration."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub async fn hrmp_close_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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 async 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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] - #[doc = " I.e."] - #[doc = ""] - #[doc = " (a) ingress index allows to find all the senders for a given recipient."] - #[doc = " (b) egress index allows to find all the recipients for a given sender."] - #[doc = ""] - #[doc = " Invariants:"] - #[doc = " - for each ingress index entry for `P` each item `I` in the index should present in"] - #[doc = " `HrmpChannels` as `(I, P)`."] - #[doc = " - for each egress index entry for `P` each item `E` in the index should present in"] - #[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( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] - #[doc = " I.e."] - #[doc = ""] - #[doc = " (a) ingress index allows to find all the senders for a given recipient."] - #[doc = " (b) egress index allows to find all the recipients for a given sender."] - #[doc = ""] - #[doc = " Invariants:"] - #[doc = " - for each ingress index entry for `P` each item `I` in the index should present in"] - #[doc = " `HrmpChannels` as `(I, P)`."] - #[doc = " - for each egress index entry for `P` each item `E` in the index should present in"] - #[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, - > { - if self - .client - .metadata() - .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 async fn hrmp_egress_channels_index( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - pub async fn hrmp_egress_channels_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &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, - >, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] - #[doc = " the given block number for a given receiver. Invariants:"] - #[doc = " - The inner `Vec` is never empty."] - #[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( - &self, - _0: &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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] - #[doc = " the given block number for a given receiver. Invariants:"] - #[doc = " - The inner `Vec` is never empty."] - #[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, - > { - if self - .client - .metadata() - .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 mod para_session_info { - use super::{ - root_mod, - runtime_types, - }; - pub mod storage { - use super::runtime_types; - pub struct AssignmentKeysUnsafe; - impl ::subxt::StorageEntry for AssignmentKeysUnsafe { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "AssignmentKeysUnsafe"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::assignment_app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EarliestStoredSession; - impl ::subxt::StorageEntry for EarliestStoredSession { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "EarliestStoredSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Sessions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Sessions<'_> { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "Sessions"; - type Value = runtime_types::polkadot_primitives::v2::SessionInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " 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, - > { - if self - .client - .metadata() - .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 = " The earliest session for which previous session info is stored."] - pub async fn earliest_stored_session( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::SessionInfo, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Sessions<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - } - pub mod paras_disputes { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceUnfreeze; - impl ::subxt::Call for ForceUnfreeze { - const PALLET: &'static str = "ParasDisputes"; - const FUNCTION: &'static str = "force_unfreeze"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - pub fn force_unfreeze( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnfreeze, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 212u8, 211u8, 58u8, 159u8, 23u8, 220u8, 64u8, 175u8, 65u8, - 50u8, 192u8, 122u8, 113u8, 189u8, 74u8, 191u8, 48u8, 93u8, - 251u8, 50u8, 237u8, 240u8, 91u8, 139u8, 193u8, 114u8, 131u8, - 125u8, 124u8, 236u8, 191u8, 190u8, - ] - { - let call = ForceUnfreeze {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = - runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] - pub struct DisputeInitiated( - pub runtime_types::polkadot_core_primitives::CandidateHash, - pub runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation, - ); - impl ::subxt::Event for DisputeInitiated { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeInitiated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A dispute has concluded for or against a candidate."] - #[doc = "`\\[para id, candidate hash, dispute result\\]`"] - pub struct DisputeConcluded( - pub runtime_types::polkadot_core_primitives::CandidateHash, - pub runtime_types::polkadot_runtime_parachains::disputes::DisputeResult, - ); - impl ::subxt::Event for DisputeConcluded { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeConcluded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A dispute has timed out due to insufficient participation."] - #[doc = "`\\[para id, candidate hash\\]`"] - pub struct DisputeTimedOut( - pub runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::Event for DisputeTimedOut { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeTimedOut"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A dispute has concluded with supermajority against a candidate."] - #[doc = "Block authors should no longer build on top of this head and should"] - #[doc = "instead revert the block at the given height. This should be the"] - #[doc = "number of the child of the last known valid block in the chain."] - pub struct Revert(pub ::core::primitive::u32); - impl ::subxt::Event for Revert { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "Revert"; - } - } - pub mod storage { - use super::runtime_types; - pub struct LastPrunedSession; - impl ::subxt::StorageEntry for LastPrunedSession { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "LastPrunedSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Disputes<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::StorageEntry for Disputes<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Disputes"; - type Value = runtime_types::polkadot_primitives::v2::DisputeState< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Included<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::StorageEntry for Included<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Included"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct SpamSlots<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for SpamSlots<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "SpamSlots"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Frozen; - impl ::subxt::StorageEntry for Frozen { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Frozen"; - type Value = ::core::option::Option<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub async fn disputes( - &self, - _0: &::core::primitive::u32, - _1: &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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] - #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] - #[doc = " fewer than `byzantine_threshold + 1` validators."] - #[doc = ""] - #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] - pub 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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] - #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] - #[doc = " fewer than `byzantine_threshold + 1` validators."] - #[doc = ""] - #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] - pub async fn spam_slots_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpamSlots<'a>>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod registrar { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Register { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for Register { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "register"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceRegister { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for ForceRegister { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "force_register"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Deregister { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Deregister { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "deregister"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Swap { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub other: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Swap { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "swap"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceRemoveLock { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ForceRemoveLock { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "force_remove_lock"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Reserve; - impl ::subxt::Call for Reserve { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "reserve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Register head data and validation code for a reserved Para Id."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin."] - #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] - #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] - #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] - #[doc = "reserved previously for this para ID is accounted for."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Registered` event is emitted in case of success."] - pub fn register( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Register, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 180u8, 21u8, 142u8, 73u8, 21u8, 31u8, 64u8, 210u8, 196u8, - 4u8, 142u8, 153u8, 172u8, 207u8, 95u8, 209u8, 177u8, 75u8, - 202u8, 85u8, 95u8, 208u8, 123u8, 237u8, 190u8, 148u8, 5u8, - 64u8, 65u8, 191u8, 221u8, 203u8, - ] - { - let call = Register { - id, - genesis_head, - validation_code, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force the registration of a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function must be called by a Root origin."] - #[doc = ""] - #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] - #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] - pub fn force_register( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceRegister, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 191u8, 198u8, 172u8, 68u8, 118u8, 126u8, 110u8, 47u8, 193u8, - 147u8, 61u8, 27u8, 122u8, 107u8, 49u8, 222u8, 87u8, 199u8, - 184u8, 247u8, 153u8, 137u8, 205u8, 153u8, 6u8, 15u8, 246u8, - 8u8, 36u8, 76u8, 54u8, 63u8, - ] - { - let call = ForceRegister { - who, - deposit, - id, - genesis_head, - validation_code, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] - #[doc = ""] - #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] - pub fn deregister( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Deregister, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 147u8, 4u8, 172u8, 215u8, 67u8, 142u8, 93u8, 245u8, 108u8, - 83u8, 5u8, 250u8, 87u8, 138u8, 231u8, 10u8, 159u8, 216u8, - 85u8, 233u8, 244u8, 200u8, 37u8, 33u8, 160u8, 143u8, 119u8, - 11u8, 70u8, 177u8, 8u8, 123u8, - ] - { - let call = Deregister { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Swap a parachain with another parachain or parathread."] - #[doc = ""] - #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] - #[doc = ""] - #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] - #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] - #[doc = ""] - #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] - #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] - #[doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] - #[doc = "and the auction deposit are switched."] - pub fn swap( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - other: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Swap, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 145u8, 163u8, 246u8, 239u8, 241u8, 209u8, 58u8, 241u8, 63u8, - 134u8, 102u8, 55u8, 217u8, 125u8, 176u8, 91u8, 27u8, 32u8, - 220u8, 236u8, 18u8, 20u8, 7u8, 187u8, 100u8, 116u8, 161u8, - 133u8, 127u8, 187u8, 86u8, 109u8, - ] - { - let call = Swap { id, other }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a manager lock from a para. This will allow the manager of a"] - #[doc = "previously locked para to deregister or swap a para without using governance."] - #[doc = ""] - #[doc = "Can only be called by the Root origin."] - pub fn force_remove_lock( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceRemoveLock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 205u8, 174u8, 132u8, 188u8, 1u8, 59u8, 82u8, 135u8, 123u8, - 55u8, 144u8, 39u8, 205u8, 171u8, 13u8, 252u8, 65u8, 56u8, - 98u8, 216u8, 23u8, 175u8, 16u8, 200u8, 198u8, 252u8, 133u8, - 238u8, 81u8, 142u8, 254u8, 124u8, - ] - { - let call = ForceRemoveLock { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Reserve a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] - #[doc = "The origin account is able to register head data and validation code using `register` to create"] - #[doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] - pub fn reserve( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Reserve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 22u8, 210u8, 13u8, 54u8, 253u8, 13u8, 89u8, 174u8, 232u8, - 119u8, 148u8, 206u8, 130u8, 133u8, 199u8, 127u8, 201u8, - 205u8, 8u8, 213u8, 108u8, 93u8, 135u8, 88u8, 238u8, 171u8, - 31u8, 193u8, 23u8, 113u8, 106u8, 135u8, - ] - { - let call = Reserve {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = - runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Registered( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Registered { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Registered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Deregistered( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for Deregistered { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Deregistered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Reserved( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Reserved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PendingSwap<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingSwap<'_> { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "PendingSwap"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Paras<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Paras<'_> { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "Paras"; - type Value = - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NextFreeParaId; - impl ::subxt::StorageEntry for NextFreeParaId { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "NextFreeParaId"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Pending swap operations."] - pub async fn pending_swap( - &self, - _0: &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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 = " 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, - > { - if self.client.metadata().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()) - } - } - #[doc = " The next free `ParaId`."] - pub async fn next_free_para_id( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The deposit to be paid to run a parathread."] - #[doc = " This should include the cost for storing the genesis head and validation code."] - pub fn para_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Registrar", "ParaDeposit")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Registrar")?; - let constant = pallet.constant("ParaDeposit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The deposit to be paid per byte stored on chain."] - pub fn data_deposit_per_byte( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Registrar", "DataDepositPerByte")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Registrar")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod slots { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceLease { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub leaser: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - pub period_begin: ::core::primitive::u32, - pub period_count: ::core::primitive::u32, - } - impl ::subxt::Call for ForceLease { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "force_lease"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ClearAllLeases { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ClearAllLeases { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "clear_all_leases"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TriggerOnboard { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for TriggerOnboard { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "trigger_onboard"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] - #[doc = "independently of any other on-chain mechanism to use it."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub fn force_lease( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - period_begin: ::core::primitive::u32, - period_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceLease, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 110u8, 205u8, 106u8, 226u8, 3u8, 177u8, 198u8, 116u8, 52u8, - 161u8, 90u8, 240u8, 43u8, 160u8, 144u8, 63u8, 97u8, 231u8, - 232u8, 176u8, 92u8, 253u8, 16u8, 243u8, 187u8, 94u8, 20u8, - 114u8, 23u8, 46u8, 231u8, 249u8, - ] - { - let call = ForceLease { - para, - leaser, - amount, - period_begin, - period_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub fn clear_all_leases( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearAllLeases, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 101u8, 225u8, 10u8, 139u8, 34u8, 12u8, 48u8, 76u8, 97u8, - 178u8, 5u8, 110u8, 19u8, 3u8, 237u8, 183u8, 54u8, 113u8, 7u8, - 138u8, 180u8, 201u8, 245u8, 151u8, 61u8, 40u8, 69u8, 31u8, - 28u8, 172u8, 253u8, 227u8, - ] - { - let call = ClearAllLeases { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Try to onboard a parachain that has a lease for the current lease period."] - #[doc = ""] - #[doc = "This function can be useful if there was some state issue with a para that should"] - #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] - #[doc = "let them onboard from here."] - #[doc = ""] - #[doc = "Origin must be signed, but can be called by anyone."] - pub fn trigger_onboard( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TriggerOnboard, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 85u8, 246u8, 247u8, 252u8, 46u8, 143u8, 200u8, 102u8, 105u8, - 51u8, 148u8, 164u8, 27u8, 25u8, 139u8, 167u8, 150u8, 129u8, - 131u8, 187u8, 153u8, 6u8, 169u8, 153u8, 192u8, 116u8, 130u8, - 12u8, 22u8, 199u8, 52u8, 8u8, - ] - { - let call = TriggerOnboard { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "A new `[lease_period]` is beginning."] - pub struct NewLeasePeriod(pub ::core::primitive::u32); - impl ::subxt::Event for NewLeasePeriod { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "NewLeasePeriod"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A para has won the right to a continuous set of lease periods as a parachain."] - #[doc = "First balance is any extra amount reserved on top of the para's existing deposit."] - #[doc = "Second balance is the total amount reserved."] - #[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, - ); - impl ::subxt::Event for Leased { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "Leased"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Leases<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Leases<'_> { - const PALLET: &'static str = "Slots"; - const STORAGE: &'static str = "Leases"; - type Value = ::std::vec::Vec< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] - #[doc = ""] - #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the second values"] - #[doc = " of the items in this list whose first value is the account."] - #[doc = ""] - #[doc = " The first item in the list is the amount locked for the current Lease Period. Following"] - #[doc = " items are for the subsequent lease periods."] - #[doc = ""] - #[doc = " The default value (an empty list) implies that the parachain no longer exists (or never"] - #[doc = " existed) as far as this pallet is concerned."] - #[doc = ""] - #[doc = " If a parachain doesn't exist *yet* but is scheduled to exist in the future, then it"] - #[doc = " will be left-padded with one or more `None`s to denote the fact that nothing is held on"] - #[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( - &self, - _0: &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, - > { - if self.client.metadata().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()) - } - } - #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] - #[doc = ""] - #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the second values"] - #[doc = " of the items in this list whose first value is the account."] - #[doc = ""] - #[doc = " The first item in the list is the amount locked for the current Lease Period. Following"] - #[doc = " items are for the subsequent lease periods."] - #[doc = ""] - #[doc = " The default value (an empty list) implies that the parachain no longer exists (or never"] - #[doc = " existed) as far as this pallet is concerned."] - #[doc = ""] - #[doc = " If a parachain doesn't exist *yet* but is scheduled to exist in the future, then it"] - #[doc = " will be left-padded with one or more `None`s to denote the fact that nothing is held on"] - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of blocks over which a single period lasts."] - pub fn lease_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Slots", "LeasePeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Slots")?; - let constant = pallet.constant("LeasePeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of blocks to offset each lease period by."] - pub fn lease_offset( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Slots", "LeaseOffset")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Slots")?; - let constant = pallet.constant("LeaseOffset")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod auctions { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NewAuction { - #[codec(compact)] - pub duration: ::core::primitive::u32, - #[codec(compact)] - pub lease_period_index: ::core::primitive::u32, - } - impl ::subxt::Call for NewAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "new_auction"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Bid { - #[codec(compact)] - pub para: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub auction_index: ::core::primitive::u32, - #[codec(compact)] - pub first_slot: ::core::primitive::u32, - #[codec(compact)] - pub last_slot: ::core::primitive::u32, - #[codec(compact)] - pub amount: ::core::primitive::u128, - } - impl ::subxt::Call for Bid { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CancelAuction; - impl ::subxt::Call for CancelAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "cancel_auction"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Create a new auction."] - #[doc = ""] - #[doc = "This can only happen when there isn't already an auction in progress and may only be"] - #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] - #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] - pub fn new_auction( - &self, - duration: ::core::primitive::u32, - lease_period_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NewAuction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 12u8, 43u8, 152u8, 0u8, 229u8, 15u8, 32u8, 205u8, 208u8, - 71u8, 57u8, 169u8, 201u8, 177u8, 52u8, 10u8, 93u8, 183u8, - 5u8, 156u8, 231u8, 188u8, 77u8, 238u8, 119u8, 238u8, 87u8, - 251u8, 121u8, 199u8, 18u8, 129u8, - ] - { - let call = NewAuction { - duration, - lease_period_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] - #[doc = "parachain."] - #[doc = ""] - #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] - #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] - #[doc = ""] - #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] - #[doc = "funded by) the same account."] - #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] - #[doc = "value of `AuctionCounter`."] - #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] - #[doc = "bid win. This amount is held throughout the range."] - pub fn bid( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - auction_index: ::core::primitive::u32, - first_slot: ::core::primitive::u32, - last_slot: ::core::primitive::u32, - amount: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Bid, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 206u8, 22u8, 15u8, 251u8, 222u8, 193u8, 192u8, 125u8, 160u8, - 131u8, 209u8, 129u8, 105u8, 46u8, 77u8, 204u8, 107u8, 112u8, - 13u8, 188u8, 193u8, 73u8, 225u8, 232u8, 179u8, 205u8, 39u8, - 69u8, 242u8, 79u8, 36u8, 121u8, - ] - { - let call = Bid { - para, - auction_index, - first_slot, - last_slot, - amount, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel an in-progress auction."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub fn cancel_auction( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelAuction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 182u8, 223u8, 178u8, 136u8, 1u8, 115u8, 229u8, 78u8, 166u8, - 128u8, 28u8, 106u8, 6u8, 248u8, 46u8, 55u8, 110u8, 120u8, - 213u8, 11u8, 90u8, 217u8, 42u8, 120u8, 47u8, 83u8, 126u8, - 216u8, 236u8, 251u8, 255u8, 50u8, - ] - { - let call = CancelAuction {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for AuctionStarted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionStarted"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] - pub struct AuctionClosed(pub ::core::primitive::u32); - impl ::subxt::Event for AuctionClosed { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionClosed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Reserved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for Unreserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Unreserved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for ReserveConfiscated { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "ReserveConfiscated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for BidAccepted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "BidAccepted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for WinningOffset { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "WinningOffset"; - } - } - pub mod storage { - use super::runtime_types; - pub struct AuctionCounter; - impl ::subxt::StorageEntry for AuctionCounter { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionCounter"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AuctionInfo; - impl ::subxt::StorageEntry for AuctionInfo { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionInfo"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReservedAmounts<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ReservedAmounts<'_> { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "ReservedAmounts"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Winning<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Winning<'_> { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "Winning"; - type Value = [::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - )>; 36usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Number of auctions started so far."] - pub async fn auction_counter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Information relating to the current auction, if there is one."] - #[doc = ""] - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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 mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of blocks over which an auction may be retroactively ended."] - pub fn ending_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Auctions", "EndingPeriod")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Auctions")?; - let constant = pallet.constant("EndingPeriod")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The length of each sample to take during the ending period."] - #[doc = ""] - #[doc = " `EndingPeriod` / `SampleLength` = Total # of Samples"] - pub fn sample_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Auctions", "SampleLength")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Auctions")?; - let constant = pallet.constant("SampleLength")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub fn slot_range_count( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Auctions", "SlotRangeCount")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Auctions")?; - let constant = pallet.constant("SlotRangeCount")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub fn lease_periods_per_slot( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Auctions", "LeasePeriodsPerSlot")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Auctions")?; - let constant = pallet.constant("LeasePeriodsPerSlot")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod crowdloan { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Create { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub cap: ::core::primitive::u128, - #[codec(compact)] - pub first_period: ::core::primitive::u32, - #[codec(compact)] - pub last_period: ::core::primitive::u32, - #[codec(compact)] - pub end: ::core::primitive::u32, - pub verifier: - ::core::option::Option, - } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Contribute { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub value: ::core::primitive::u128, - pub signature: - ::core::option::Option, - } - impl ::subxt::Call for Contribute { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Withdraw { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "withdraw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Refund { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Refund { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "refund"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Dissolve { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Dissolve { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "dissolve"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Edit { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub cap: ::core::primitive::u128, - #[codec(compact)] - pub first_period: ::core::primitive::u32, - #[codec(compact)] - pub last_period: ::core::primitive::u32, - #[codec(compact)] - pub end: ::core::primitive::u32, - pub verifier: - ::core::option::Option, - } - impl ::subxt::Call for Edit { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "edit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AddMemo { - pub index: runtime_types::polkadot_parachain::primitives::Id, - pub memo: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for AddMemo { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "add_memo"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Poke { - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Poke { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "poke"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ContributeAll { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - pub signature: - ::core::option::Option, - } - impl ::subxt::Call for ContributeAll { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute_all"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] - #[doc = ""] - #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] - #[doc = "by the parachain manager."] - pub fn create( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - cap: ::core::primitive::u128, - first_period: ::core::primitive::u32, - last_period: ::core::primitive::u32, - end: ::core::primitive::u32, - verifier: ::core::option::Option< - runtime_types::sp_runtime::MultiSigner, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Create, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 94u8, 115u8, 154u8, 239u8, 215u8, 180u8, 175u8, 240u8, 137u8, - 240u8, 74u8, 159u8, 67u8, 54u8, 69u8, 199u8, 161u8, 155u8, - 243u8, 222u8, 205u8, 163u8, 142u8, 251u8, 156u8, 94u8, 65u8, - 153u8, 39u8, 226u8, 79u8, 195u8, - ] - { - let call = Create { - index, - cap, - first_period, - last_period, - end, - verifier, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - pub fn contribute( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - value: ::core::primitive::u128, - signature: ::core::option::Option< - runtime_types::sp_runtime::MultiSignature, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Contribute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 95u8, 255u8, 35u8, 30u8, 44u8, 150u8, 10u8, 166u8, 0u8, - 204u8, 106u8, 59u8, 150u8, 254u8, 216u8, 128u8, 232u8, 129u8, - 30u8, 101u8, 196u8, 198u8, 180u8, 156u8, 122u8, 252u8, 139u8, - 28u8, 164u8, 115u8, 153u8, 109u8, - ] - { - let call = Contribute { - index, - value, - signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Withdraw full balance of a specific contributor."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - #[doc = ""] - #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement, then the retirement"] - #[doc = "flag must be set. For a fund to be ready for retirement, then:"] - #[doc = "- it must not already be in retirement;"] - #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] - #[doc = "- and either:"] - #[doc = " - the block number must be at least `end`; or"] - #[doc = " - the current lease period must be greater than the fund's `last_period`."] - #[doc = ""] - #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current block"] - #[doc = "number."] - #[doc = ""] - #[doc = "- `who`: The account whose contribution should be withdrawn."] - #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] - pub fn withdraw( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Withdraw, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 67u8, 65u8, 89u8, 108u8, 193u8, 99u8, 74u8, 32u8, 163u8, - 13u8, 81u8, 131u8, 64u8, 107u8, 72u8, 23u8, 35u8, 177u8, - 130u8, 171u8, 70u8, 232u8, 246u8, 254u8, 67u8, 219u8, 84u8, - 96u8, 165u8, 20u8, 183u8, 209u8, - ] - { - let call = Withdraw { who, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Automatically refund contributors of an ended crowdloan."] - #[doc = "Due to weight restrictions, this function may need to be called multiple"] - #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - pub fn refund( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Refund, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 202u8, 206u8, 79u8, 226u8, 114u8, 228u8, 110u8, 18u8, 178u8, - 173u8, 23u8, 83u8, 64u8, 11u8, 201u8, 19u8, 57u8, 75u8, - 181u8, 241u8, 231u8, 189u8, 211u8, 48u8, 82u8, 64u8, 220u8, - 22u8, 247u8, 7u8, 68u8, 211u8, - ] - { - let call = Refund { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] - pub fn dissolve( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Dissolve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 210u8, 3u8, 221u8, 185u8, 64u8, 178u8, 56u8, 132u8, 72u8, - 127u8, 105u8, 31u8, 167u8, 107u8, 127u8, 224u8, 174u8, 221u8, - 111u8, 105u8, 47u8, 247u8, 10u8, 5u8, 37u8, 180u8, 61u8, - 180u8, 3u8, 164u8, 196u8, 194u8, - ] - { - let call = Dissolve { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Edit the configuration for an in-progress crowdloan."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub fn edit( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - cap: ::core::primitive::u128, - first_period: ::core::primitive::u32, - last_period: ::core::primitive::u32, - end: ::core::primitive::u32, - verifier: ::core::option::Option< - runtime_types::sp_runtime::MultiSigner, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Edit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 34u8, 43u8, 47u8, 39u8, 106u8, 245u8, 49u8, 40u8, 191u8, - 195u8, 202u8, 113u8, 137u8, 98u8, 143u8, 172u8, 191u8, 55u8, - 240u8, 75u8, 234u8, 180u8, 90u8, 206u8, 93u8, 214u8, 115u8, - 215u8, 140u8, 144u8, 105u8, 89u8, - ] - { - let call = Edit { - index, - cap, - first_period, - last_period, - end, - verifier, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add an optional memo to an existing crowdloan contribution."] - #[doc = ""] - #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] - pub fn add_memo( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - memo: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddMemo, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 97u8, 218u8, 115u8, 187u8, 167u8, 70u8, 229u8, 231u8, 148u8, - 77u8, 169u8, 139u8, 16u8, 15u8, 116u8, 128u8, 32u8, 59u8, - 154u8, 146u8, 12u8, 65u8, 36u8, 36u8, 69u8, 19u8, 74u8, 79u8, - 66u8, 25u8, 215u8, 57u8, - ] - { - let call = AddMemo { index, memo }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Poke the fund into `NewRaise`"] - #[doc = ""] - #[doc = "Origin must be Signed, and the fund has non-zero raise."] - pub fn poke( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Poke, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 99u8, 158u8, 48u8, 3u8, 228u8, 210u8, 249u8, 42u8, 44u8, - 49u8, 24u8, 212u8, 69u8, 69u8, 189u8, 194u8, 124u8, 251u8, - 25u8, 123u8, 234u8, 3u8, 184u8, 227u8, 1u8, 195u8, 219u8, - 118u8, 235u8, 237u8, 11u8, 159u8, - ] - { - let call = Poke { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - pub fn contribute_all( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - signature: ::core::option::Option< - runtime_types::sp_runtime::MultiSignature, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ContributeAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 64u8, 224u8, 233u8, 196u8, 182u8, 109u8, 69u8, 220u8, 46u8, - 60u8, 189u8, 125u8, 17u8, 28u8, 207u8, 63u8, 129u8, 56u8, - 32u8, 239u8, 182u8, 214u8, 237u8, 95u8, 228u8, 171u8, 209u8, - 233u8, 205u8, 212u8, 147u8, 176u8, - ] - { - let call = ContributeAll { index, signature }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] - pub struct Created(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Created { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Created"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for Contributed { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Contributed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for Withdrew { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Withdrew"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, - ); - impl ::subxt::Event for PartiallyRefunded { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "PartiallyRefunded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "All loans in a fund have been refunded. `[fund_index]`"] - pub struct AllRefunded(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for AllRefunded { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "AllRefunded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Fund is dissolved. `[fund_index]`"] - pub struct Dissolved(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Dissolved { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Dissolved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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>, - ); - impl ::subxt::Event for HandleBidResult { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "HandleBidResult"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The configuration to a crowdloan has been edited. `[fund_index]`"] - pub struct Edited(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Edited { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Edited"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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>, - ); - impl ::subxt::Event for MemoUpdated { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "MemoUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A parachain has been moved to `NewRaise`"] - pub struct AddedToNewRaise( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for AddedToNewRaise { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "AddedToNewRaise"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Funds<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for Funds<'_> { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "Funds"; - type Value = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NewRaise; - impl ::subxt::StorageEntry for NewRaise { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NewRaise"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EndingsCount; - impl ::subxt::StorageEntry for EndingsCount { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "EndingsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextFundIndex; - impl ::subxt::StorageEntry for NextFundIndex { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NextFundIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Info on all of the funds."] - pub async fn funds( - &self, - _0: &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, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[doc = " The number of auctions that have entered into their ending period so far."] - pub async fn endings_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " Tracker for the next available fund index"] - pub async fn next_fund_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b\"py/cfund\")`"] - pub fn pallet_id( - &self, - ) -> ::core::result::Result< - runtime_types::frame_support::PalletId, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .constant_hash("Crowdloan", "PalletId")? - == [ - 11u8, 72u8, 189u8, 18u8, 254u8, 229u8, 67u8, 29u8, 4u8, - 241u8, 192u8, 5u8, 210u8, 194u8, 124u8, 31u8, 19u8, 174u8, - 240u8, 245u8, 169u8, 141u8, 67u8, 251u8, 106u8, 103u8, 15u8, - 167u8, 107u8, 31u8, 121u8, 239u8, - ] - { - let pallet = self.client.metadata().pallet("Crowdloan")?; - let constant = pallet.constant("PalletId")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The minimum amount that may be contributed into a crowdloan. Should almost certainly be at"] - #[doc = " least `ExistentialDeposit`."] - pub fn min_contribution( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Crowdloan", "MinContribution")? - == [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ] - { - let pallet = self.client.metadata().pallet("Crowdloan")?; - let constant = pallet.constant("MinContribution")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Max number of storage keys to remove per extrinsic call."] - pub fn remove_keys_limit( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self - .client - .metadata() - .constant_hash("Crowdloan", "RemoveKeysLimit")? - == [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, - 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, - 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, - 90u8, 203u8, 100u8, 41u8, 145u8, - ] - { - let pallet = self.client.metadata().pallet("Crowdloan")?; - let constant = pallet.constant("RemoveKeysLimit")?; - let value = - ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod xcm_pallet { - use super::{ - root_mod, - runtime_types, - }; - pub mod calls { - use super::{ - root_mod, - runtime_types, - }; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Send { - pub dest: ::std::boxed::Box, - pub message: ::std::boxed::Box, - } - impl ::subxt::Call for Send { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "send"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TeleportAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: - ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - } - impl ::subxt::Call for TeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "teleport_assets"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReserveTransferAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: - ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - } - impl ::subxt::Call for ReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "reserve_transfer_assets"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Execute { - pub message: ::std::boxed::Box, - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceXcmVersion { - pub location: ::std::boxed::Box< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - pub xcm_version: ::core::primitive::u32, - } - impl ::subxt::Call for ForceXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_xcm_version"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceDefaultXcmVersion { - pub maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for ForceDefaultXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_default_xcm_version"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceSubscribeVersionNotify { - pub location: - ::std::boxed::Box, - } - impl ::subxt::Call for ForceSubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_subscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceUnsubscribeVersionNotify { - pub location: - ::std::boxed::Box, - } - impl ::subxt::Call for ForceUnsubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_unsubscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct LimitedReserveTransferAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: - ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - pub weight_limit: runtime_types::xcm::v2::WeightLimit, - } - impl ::subxt::Call for LimitedReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "limited_reserve_transfer_assets"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct LimitedTeleportAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: - ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - pub weight_limit: runtime_types::xcm::v2::WeightLimit, - } - impl ::subxt::Call for LimitedTeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "limited_teleport_assets"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - pub fn send( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - message: runtime_types::xcm::VersionedXcm, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Send, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 232u8, 188u8, 205u8, 27u8, 92u8, 141u8, 251u8, 24u8, 90u8, - 155u8, 20u8, 139u8, 7u8, 160u8, 39u8, 85u8, 205u8, 11u8, - 111u8, 1u8, 250u8, 168u8, 134u8, 61u8, 19u8, 216u8, 239u8, - 127u8, 137u8, 136u8, 48u8, 19u8, - ] - { - let call = Send { - dest: ::std::boxed::Box::new(dest), - message: ::std::boxed::Box::new(message), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub fn teleport_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TeleportAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 55u8, 192u8, 217u8, 186u8, 230u8, 234u8, 26u8, 194u8, 243u8, - 199u8, 16u8, 227u8, 225u8, 88u8, 130u8, 219u8, 228u8, 110u8, - 20u8, 255u8, 233u8, 147u8, 121u8, 173u8, 126u8, 248u8, 192u8, - 243u8, 211u8, 91u8, 115u8, 148u8, - ] - { - let call = TeleportAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub fn reserve_transfer_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReserveTransferAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 134u8, 229u8, 104u8, 209u8, 160u8, 7u8, 99u8, 175u8, 128u8, - 110u8, 189u8, 225u8, 141u8, 1u8, 10u8, 17u8, 247u8, 233u8, - 146u8, 19u8, 31u8, 145u8, 217u8, 144u8, 85u8, 223u8, 197u8, - 249u8, 1u8, 222u8, 98u8, 13u8, - ] - { - let call = ReserveTransferAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Execute an XCM message from a local, signed, origin."] - #[doc = ""] - #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] - #[doc = "partially."] - #[doc = ""] - #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than the"] - #[doc = "maximum amount of weight that the message could take to be executed, then no execution"] - #[doc = "attempt will be made."] - #[doc = ""] - #[doc = "NOTE: A successful return to this does *not* imply that the `msg` was executed successfully"] - #[doc = "to completion; only that *some* of it was executed."] - pub fn execute( - &self, - message: runtime_types::xcm::VersionedXcm, - max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 95u8, 48u8, 201u8, 232u8, 83u8, 23u8, 20u8, 126u8, 116u8, - 116u8, 176u8, 206u8, 145u8, 9u8, 155u8, 109u8, 141u8, 226u8, - 253u8, 196u8, 37u8, 230u8, 243u8, 68u8, 39u8, 133u8, 233u8, - 108u8, 226u8, 87u8, 5u8, 247u8, - ] - { - let call = Execute { - message: ::std::boxed::Box::new(message), - max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Extoll that a particular destination can be communicated with through a particular"] - #[doc = "version of XCM."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The destination that is being described."] - #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] - pub fn force_xcm_version( - &self, - location: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm_version: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceXcmVersion, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self.client.metadata().call_hash::()? - == [ - 32u8, 219u8, 213u8, 152u8, 203u8, 73u8, 121u8, 64u8, 78u8, - 53u8, 110u8, 23u8, 87u8, 93u8, 34u8, 166u8, 205u8, 189u8, - 25u8, 160u8, 172u8, 178u8, 125u8, 182u8, 37u8, 254u8, 220u8, - 179u8, 70u8, 252u8, 63u8, 94u8, - ] - { - let call = ForceXcmVersion { - location: ::std::boxed::Box::new(location), - xcm_version, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] - #[doc = "version a destination can accept is unknown)."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] - pub fn force_default_xcm_version( - &self, - maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceDefaultXcmVersion, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 44u8, 161u8, 28u8, 189u8, 162u8, 221u8, 14u8, 31u8, 8u8, - 211u8, 181u8, 51u8, 197u8, 14u8, 87u8, 198u8, 3u8, 240u8, - 90u8, 78u8, 141u8, 131u8, 205u8, 250u8, 211u8, 150u8, 237u8, - 160u8, 239u8, 226u8, 233u8, 29u8, - ] - { - let call = ForceDefaultXcmVersion { maybe_xcm_version }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] - pub fn force_subscribe_version_notify( - &self, - location: runtime_types::xcm::VersionedMultiLocation, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSubscribeVersionNotify, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 41u8, 248u8, 187u8, 195u8, 146u8, 143u8, 0u8, 246u8, 248u8, - 38u8, 128u8, 200u8, 143u8, 149u8, 127u8, 73u8, 3u8, 247u8, - 106u8, 6u8, 56u8, 50u8, 207u8, 234u8, 137u8, 201u8, 16u8, - 21u8, 226u8, 148u8, 181u8, 44u8, - ] - { - let call = ForceSubscribeVersionNotify { - location: ::std::boxed::Box::new(location), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] - #[doc = "version changes."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] - #[doc = " notifications which we no longer desire."] - pub fn force_unsubscribe_version_notify( - &self, - location: runtime_types::xcm::VersionedMultiLocation, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnsubscribeVersionNotify, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 150u8, 202u8, 148u8, 13u8, 187u8, 169u8, 5u8, 60u8, 25u8, - 144u8, 43u8, 196u8, 35u8, 215u8, 184u8, 72u8, 143u8, 220u8, - 176u8, 27u8, 100u8, 245u8, 31u8, 243u8, 0u8, 83u8, 165u8, - 7u8, 102u8, 172u8, 218u8, 133u8, - ] - { - let call = ForceUnsubscribeVersionNotify { - location: ::std::boxed::Box::new(location), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn limited_reserve_transfer_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - LimitedReserveTransferAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 242u8, 206u8, 126u8, 164u8, 44u8, 116u8, 181u8, 90u8, 121u8, - 124u8, 120u8, 240u8, 129u8, 217u8, 131u8, 100u8, 248u8, - 149u8, 56u8, 154u8, 35u8, 91u8, 210u8, 118u8, 207u8, 110u8, - 42u8, 249u8, 160u8, 155u8, 251u8, 68u8, - ] - { - let call = LimitedReserveTransferAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn limited_teleport_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - LimitedTeleportAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - if self - .client - .metadata() - .call_hash::()? - == [ - 189u8, 233u8, 43u8, 16u8, 158u8, 114u8, 154u8, 233u8, 179u8, - 144u8, 81u8, 179u8, 169u8, 38u8, 4u8, 130u8, 95u8, 237u8, - 172u8, 167u8, 2u8, 169u8, 53u8, 252u8, 159u8, 42u8, 143u8, - 216u8, 112u8, 155u8, 48u8, 129u8, - ] - { - let call = LimitedTeleportAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_xcm::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Execution of an XCM message was attempted."] - #[doc = ""] - #[doc = "\\[ outcome \\]"] - pub struct Attempted(pub runtime_types::xcm::v2::traits::Outcome); - impl ::subxt::Event for Attempted { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Attempted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A XCM message was sent."] - #[doc = ""] - #[doc = "\\[ origin, destination, message \\]"] - pub struct Sent( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub runtime_types::xcm::v2::Xcm, - ); - impl ::subxt::Event for Sent { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Sent"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Query response received which does not match a registered query. This may be because a"] - #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] - #[doc = "because the query timed out."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - pub struct UnexpectedResponse( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for UnexpectedResponse { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "UnexpectedResponse"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] - #[doc = "no registered notification call."] - #[doc = ""] - #[doc = "\\[ id, response \\]"] - pub struct ResponseReady( - pub ::core::primitive::u64, - pub runtime_types::xcm::v2::Response, - ); - impl ::subxt::Event for ResponseReady { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ResponseReady"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Query response has been received and query is removed. The registered notification has"] - #[doc = "been dispatched and executed successfully."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - pub struct Notified( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - ); - impl ::subxt::Event for Notified { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Notified"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Query response has been received and query is removed. The registered notification could"] - #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] - #[doc = "originally budgeted by this runtime for the query result."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index, actual weight, max budgeted weight \\]"] - pub struct NotifyOverweight( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for NotifyOverweight { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyOverweight"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Query response has been received and query is removed. There was a general error with"] - #[doc = "dispatching the notification call."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - pub struct NotifyDispatchError( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - ); - impl ::subxt::Event for NotifyDispatchError { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyDispatchError"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] - #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] - #[doc = "is not `(origin, QueryId, Response)`."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - pub struct NotifyDecodeFailed( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - ); - impl ::subxt::Event for NotifyDecodeFailed { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyDecodeFailed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Expected query response has been received but the origin location of the response does"] - #[doc = "not match that expected. The query remains registered for a later, valid, response to"] - #[doc = "be received and acted upon."] - #[doc = ""] - #[doc = "\\[ origin location, id, expected location \\]"] - pub struct InvalidResponder( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - pub ::core::option::Option< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - ); - impl ::subxt::Event for InvalidResponder { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponder"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Expected query response has been received but the expected origin location placed in"] - #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] - #[doc = ""] - #[doc = "This is unexpected (since a location placed in storage in a previously executing"] - #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] - #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] - #[doc = "needed."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - pub struct InvalidResponderVersion( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for InvalidResponderVersion { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponderVersion"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - #[doc = "Received query response has been read and removed."] - #[doc = ""] - #[doc = "\\[ id \\]"] - pub struct ResponseTaken(pub ::core::primitive::u64); - impl ::subxt::Event for ResponseTaken { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ResponseTaken"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "Some assets have been placed in an asset trap."] - #[doc = ""] - #[doc = "\\[ hash, origin, assets \\]"] - pub struct AssetsTrapped( - pub ::subxt::sp_core::H256, - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub runtime_types::xcm::VersionedMultiAssets, - ); - impl ::subxt::Event for AssetsTrapped { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AssetsTrapped"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "An XCM version change notification message has been attempted to be sent."] - #[doc = ""] - #[doc = "\\[ destination, result \\]"] - pub struct VersionChangeNotified( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for VersionChangeNotified { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionChangeNotified"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "The supported version of a location has been changed. This might be through an"] - #[doc = "automatic notification or a manual intervention."] - #[doc = ""] - #[doc = "\\[ location, XCM version \\]"] - pub struct SupportedVersionChanged( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for SupportedVersionChanged { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "SupportedVersionChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "sending the notification to it."] - #[doc = ""] - #[doc = "\\[ location, query ID, error \\]"] - pub struct NotifyTargetSendFail( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - pub runtime_types::xcm::v2::traits::Error, - ); - impl ::subxt::Event for NotifyTargetSendFail { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyTargetSendFail"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "migrating the location to our new XCM format."] - #[doc = ""] - #[doc = "\\[ location, query ID \\]"] - pub struct NotifyTargetMigrationFail( - pub runtime_types::xcm::VersionedMultiLocation, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for NotifyTargetMigrationFail { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyTargetMigrationFail"; - } - } - pub mod storage { - use super::runtime_types; - pub struct QueryCounter; - impl ::subxt::StorageEntry for QueryCounter { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "QueryCounter"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Queries<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Queries<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "Queries"; - type Value = runtime_types::pallet_xcm::pallet::QueryStatus< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct AssetTraps<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for AssetTraps<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "AssetTraps"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct SafeXcmVersion; - impl ::subxt::StorageEntry for SafeXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "SafeXcmVersion"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SupportedVersion<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for SupportedVersion<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "SupportedVersion"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionNotifiers<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for VersionNotifiers<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionNotifiers"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionNotifyTargets<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for VersionNotifyTargets<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionNotifyTargets"; - type Value = ( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionDiscoveryQueue; - impl ::subxt::StorageEntry for VersionDiscoveryQueue { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionDiscoveryQueue"; - type Value = - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentMigration; - impl ::subxt::StorageEntry for CurrentMigration { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "CurrentMigration"; - type Value = runtime_types::pallet_xcm::pallet::VersionMigrationStage; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The latest available query index."] - pub async fn query_counter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[doc = " The ongoing queries."] - pub async fn queries( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::QueryStatus< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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, - > { - if self.client.metadata().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()) - } - } - #[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( - &self, - _0: &::core::primitive::u32, - _1: &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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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, - > { - if self - .client - .metadata() - .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()) - } - } - #[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( - &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, - > { - if self - .client - .metadata() - .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()) - } - } - #[doc = " The current migration's stage, if any."] - pub async fn current_migration( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::VersionMigrationStage, - >, - ::subxt::BasicError, - > { - if self.client.metadata().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()) - } - } - } - } - } - pub mod runtime_types { - use super::runtime_types; - pub mod bitvec { - use super::runtime_types; - pub mod order { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Lsb0; - } - } - pub mod finality_grandpa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Equivocation<_0, _1, _2> { - pub round_number: ::core::primitive::u64, - pub identity: _0, - pub first: (_1, _2), - pub second: (_1, _2), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Precommit<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Prevote<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - } - pub mod frame_support { - use super::runtime_types; - pub mod dispatch { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum RawOrigin<_0> { - #[codec(index = 0)] - Root, - #[codec(index = 1)] - Signed(_0), - #[codec(index = 2)] - None, - } - } - pub mod storage { - use super::runtime_types; - pub mod bounded_btree_map { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BoundedBTreeMap<_0, _1>(pub ::subxt::KeyedVec<_0, _1>); - } - pub mod bounded_vec { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BoundedVec<_0>(pub ::std::vec::Vec<_0>); - } - pub mod weak_bounded_vec { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); - } - } - pub mod traits { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct WrapperKeepOpaque<_0>( - #[codec(compact)] pub ::core::primitive::u32, - pub _0, - ); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct WrapperOpaque<_0>( - #[codec(compact)] pub ::core::primitive::u32, - pub _0, - ); - } - pub mod schedule { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum LookupError { - #[codec(index = 0)] - Unknown, - #[codec(index = 1)] - BadFormat, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum MaybeHashed<_0, _1> { - #[codec(index = 0)] - Value(_0), - #[codec(index = 1)] - Hash(_1), - } - } - pub mod tokens { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - )] - pub enum BalanceStatus { - #[codec(index = 0)] - Free, - #[codec(index = 1)] - Reserved, - } - } - } - } - pub mod weights { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum DispatchClass { - #[codec(index = 0)] - Normal, - #[codec(index = 1)] - Operational, - #[codec(index = 2)] - Mandatory, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct DispatchInfo { - pub weight: ::core::primitive::u64, - pub class: runtime_types::frame_support::weights::DispatchClass, - pub pays_fee: runtime_types::frame_support::weights::Pays, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Pays { - #[codec(index = 0)] - Yes, - #[codec(index = 1)] - No, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct PerDispatchClass<_0> { - pub normal: _0, - pub operational: _0, - pub mandatory: _0, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct RuntimeDbWeight { - pub read: ::core::primitive::u64, - pub write: ::core::primitive::u64, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PalletId(pub [::core::primitive::u8; 8usize]); - } - pub mod frame_system { - use super::runtime_types; - pub mod extensions { - use super::runtime_types; - pub mod check_genesis { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckGenesis; - } - pub mod check_mortality { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckMortality( - pub runtime_types::sp_runtime::generic::era::Era, - ); - } - pub mod check_non_zero_sender { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckNonZeroSender; - } - pub mod check_nonce { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); - } - pub mod check_spec_version { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckSpecVersion; - } - pub mod check_tx_version { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckTxVersion; - } - pub mod check_weight { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CheckWeight; - } - } - pub mod limits { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BlockLength { - pub max: runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u32, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BlockWeights { - pub base_block: ::core::primitive::u64, - pub max_block: ::core::primitive::u64, - pub per_class: - runtime_types::frame_support::weights::PerDispatchClass< - runtime_types::frame_system::limits::WeightsPerClass, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct WeightsPerClass { - pub base_extrinsic: ::core::primitive::u64, - pub max_extrinsic: ::core::option::Option<::core::primitive::u64>, - pub max_total: ::core::option::Option<::core::primitive::u64>, - pub reserved: ::core::option::Option<::core::primitive::u64>, - } - } - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "A dispatch that will fill the block weight up to the given ratio."] - fill_block { - ratio: runtime_types::sp_arithmetic::per_things::Perbill, - }, - #[codec(index = 1)] - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`"] - #[doc = "# "] - remark { - remark: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 2)] - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - set_heap_pages { pages: ::core::primitive::u64 }, - #[codec(index = 3)] - #[doc = "Set the new runtime code."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] - #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] - #[doc = " expensive)."] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] - #[doc = "expensive. We will treat this as a full block."] - #[doc = "# "] - set_code { - code: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 4)] - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C)` where `C` length of `code`"] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] - #[doc = "block. # "] - set_code_without_checks { - code: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 5)] - #[doc = "Set some items of storage."] - set_storage { - items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - }, - #[codec(index = 6)] - #[doc = "Kill some items from storage."] - kill_storage { - keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - }, - #[codec(index = 7)] - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - kill_prefix { - prefix: ::std::vec::Vec<::core::primitive::u8>, - subkeys: ::core::primitive::u32, - }, - #[codec(index = 8)] - #[doc = "Make some on-chain remark and emit event."] - remark_with_event { - remark: ::std::vec::Vec<::core::primitive::u8>, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The name of specification does not match between the current runtime"] - #[doc = "and the new runtime."] - InvalidSpecName, - #[codec(index = 1)] - #[doc = "The specification version is not allowed to decrease between the current runtime"] - #[doc = "and the new runtime."] - SpecVersionNeedsToIncrease, - #[codec(index = 2)] - #[doc = "Failed to extract the runtime version from the new runtime."] - #[doc = ""] - #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] - FailedToExtractRuntimeVersion, - #[codec(index = 3)] - #[doc = "Suicide called when the account has non-default composite data."] - NonDefaultComposite, - #[codec(index = 4)] - #[doc = "There is a non-zero reference count preventing the account from being purged."] - NonZeroRefCount, - #[codec(index = 5)] - #[doc = "The origin filter prevent the call to be dispatched."] - CallFiltered, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "An extrinsic completed successfully."] - ExtrinsicSuccess { - dispatch_info: - runtime_types::frame_support::weights::DispatchInfo, - }, - #[codec(index = 1)] - #[doc = "An extrinsic failed."] - ExtrinsicFailed { - dispatch_error: runtime_types::sp_runtime::DispatchError, - dispatch_info: - runtime_types::frame_support::weights::DispatchInfo, - }, - #[codec(index = 2)] - #[doc = "`:code` was updated."] - CodeUpdated, - #[codec(index = 3)] - #[doc = "A new account was created."] - NewAccount { - account: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 4)] - #[doc = "An account was reaped."] - KilledAccount { - account: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 5)] - #[doc = "On on-chain remark happened."] - Remarked { - sender: ::subxt::sp_core::crypto::AccountId32, - hash: ::subxt::sp_core::H256, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AccountInfo<_0, _1> { - pub nonce: _0, - pub consumers: _0, - pub providers: _0, - pub sufficients: _0, - pub data: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct EventRecord<_0, _1> { - pub phase: runtime_types::frame_system::Phase, - pub event: _0, - pub topics: ::std::vec::Vec<_1>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct LastRuntimeUpgradeInfo { - #[codec(compact)] - pub spec_version: ::core::primitive::u32, - pub spec_name: ::std::string::String, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Phase { - #[codec(index = 0)] - ApplyExtrinsic(::core::primitive::u32), - #[codec(index = 1)] - Finalization, - #[codec(index = 2)] - Initialization, - } - } - pub mod pallet_authorship { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Provide a set of uncles."] - set_uncles { - new_uncles: ::std::vec::Vec< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The uncle parent not in the chain."] - InvalidUncleParent, - #[codec(index = 1)] - #[doc = "Uncles already set in the block."] - UnclesAlreadySet, - #[codec(index = 2)] - #[doc = "Too many uncles."] - TooManyUncles, - #[codec(index = 3)] - #[doc = "The uncle is genesis."] - GenesisUncle, - #[codec(index = 4)] - #[doc = "The uncle is too high in chain."] - TooHighUncle, - #[codec(index = 5)] - #[doc = "The uncle is already included."] - UncleAlreadyIncluded, - #[codec(index = 6)] - #[doc = "The uncle isn't recent enough to be included."] - OldUncle, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum UncleEntryItem<_0, _1, _2> { - #[codec(index = 0)] - InclusionHeight(_0), - #[codec(index = 1)] - Uncle(_1, ::core::option::Option<_2>), - } - } - pub mod pallet_babe { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] report_equivocation { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 1)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] # [doc = "This extrinsic must be called unsigned and it is expected that only"] # [doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] # [doc = "if the block author is defined it will be defined as the equivocation"] # [doc = "reporter."] report_equivocation_unsigned { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 2)] # [doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] # [doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] # [doc = "Multiple calls to this method will replace any existing planned config change that had"] # [doc = "not been enacted yet."] plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] - InvalidEquivocationProof, - #[codec(index = 1)] - #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] - InvalidKeyOwnershipProof, - #[codec(index = 2)] - #[doc = "A given equivocation report is valid but already previously reported."] - DuplicateOffenceReport, - } - } - } - pub mod pallet_bags_list { - use super::runtime_types; - pub mod list { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Bag { - pub head: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub tail: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Node { - pub id: ::subxt::sp_core::crypto::AccountId32, - pub prev: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub next: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub bag_upper: ::core::primitive::u64, - } - } - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] - #[doc = "changed its score that it should properly fall into a different bag than its current"] - #[doc = "one."] - #[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`."] - rebag { - dislocated: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 1)] - #[doc = "Move the caller's Id directly in front of `lighter`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and can only be called by the Id of"] - #[doc = "the account going in front of `lighter`."] - #[doc = ""] - #[doc = "Only works if"] - #[doc = "- both nodes are within the same bag,"] - #[doc = "- and `origin` has a greater `Score` than `lighter`."] - put_in_front_of { - lighter: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Attempted to place node in front of a node in another bag."] - NotInSameBag, - #[codec(index = 1)] - #[doc = "Id not found in list."] - IdNotFound, - #[codec(index = 2)] - #[doc = "An Id does not have a greater score than another Id."] - NotHeavier, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Moved an account from one bag to another."] - Rebagged { - who: ::subxt::sp_core::crypto::AccountId32, - from: ::core::primitive::u64, - to: ::core::primitive::u64, - }, - } - } - } - pub mod pallet_balances { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] - #[doc = " types. See related functions below."] - #[doc = "- It contains a limited number of reads and writes internally and no complex"] - #[doc = " computation."] - #[doc = ""] - #[doc = "Related functions:"] - #[doc = ""] - #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] - #[doc = " - Transferring balances to accounts that did not exist before will cause"] - #[doc = " `T::OnNewAccount::on_new_account` to be called."] - #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] - #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] - #[doc = " that the transfer will not kill the origin account."] - #[doc = "---------------------------------"] - #[doc = "- Origin account is already in memory, so no DB operations for them."] - #[doc = "# "] - transfer { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "Set the balances of a given account."] - #[doc = ""] - #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] - #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] - #[doc = "If the new free or reserved balance is below the existential deposit,"] - #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - set_balance { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - new_free: ::core::primitive::u128, - #[codec(compact)] - new_reserved: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] - #[doc = "specified."] - #[doc = "# "] - #[doc = "- Same as transfer, but additional read and write because the source account is not"] - #[doc = " assumed to be in the overlay."] - #[doc = "# "] - force_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] - #[doc = "origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer`] instead."] - #[doc = ""] - #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] - transfer_keep_alive { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 4)] - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true). # "] - #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] - #[doc = " #"] - transfer_all { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - keep_alive: ::core::primitive::bool, - }, - #[codec(index = 5)] - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - force_unreserve { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - amount: ::core::primitive::u128, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Vesting balance too high to send value"] - VestingBalance, - #[codec(index = 1)] - #[doc = "Account liquidity restrictions prevent withdrawal"] - LiquidityRestrictions, - #[codec(index = 2)] - #[doc = "Balance too low to send value"] - InsufficientBalance, - #[codec(index = 3)] - #[doc = "Value too low to create account due to existential deposit"] - ExistentialDeposit, - #[codec(index = 4)] - #[doc = "Transfer/payment would kill account"] - KeepAlive, - #[codec(index = 5)] - #[doc = "A vesting schedule already exists for this account"] - ExistingVestingSchedule, - #[codec(index = 6)] - #[doc = "Beneficiary account must pre-exist"] - DeadAccount, - #[codec(index = 7)] - #[doc = "Number of named reserves exceed MaxReserves"] - TooManyReserves, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - # [codec (index = 0)] # [doc = "An account was created with some free balance."] Endowed { account : :: subxt :: sp_core :: crypto :: AccountId32 , free_balance : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] # [doc = "resulting in an outright loss."] DustLost { account : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 2)] # [doc = "Transfer succeeded."] Transfer { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "A balance was set by root."] BalanceSet { who : :: subxt :: sp_core :: crypto :: AccountId32 , free : :: core :: primitive :: u128 , reserved : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Some balance was reserved (moved from free to reserved)."] Reserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 5)] # [doc = "Some balance was unreserved (moved from reserved to free)."] Unreserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 6)] # [doc = "Some balance was moved from the reserve of the first account to the second account."] # [doc = "Final argument indicates the destination balance type."] ReserveRepatriated { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , destination_status : runtime_types :: frame_support :: traits :: tokens :: misc :: BalanceStatus , } , # [codec (index = 7)] # [doc = "Some amount was deposited (e.g. for transaction fees)."] Deposit { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 8)] # [doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] Withdraw { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 9)] # [doc = "Some amount was removed from the account (e.g. for misbehavior)."] Slashed { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct AccountData<_0> { - pub free: _0, - pub reserved: _0, - pub misc_frozen: _0, - pub fee_frozen: _0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct BalanceLock<_0> { - pub id: [::core::primitive::u8; 8usize], - pub amount: _0, - pub reasons: runtime_types::pallet_balances::Reasons, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Reasons { - #[codec(index = 0)] - Fee, - #[codec(index = 1)] - Misc, - #[codec(index = 2)] - All, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1_0_0, - #[codec(index = 1)] - V2_0_0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReserveData<_0, _1> { - pub id: _0, - pub amount: _1, - } - } - pub mod pallet_bounties { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Propose a new bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] - #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] - #[doc = "or slashed when rejected."] - #[doc = ""] - #[doc = "- `curator`: The curator account whom will manage this bounty."] - #[doc = "- `fee`: The curator fee."] - #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] - #[doc = "- `description`: The description of this bounty."] - propose_bounty { - #[codec(compact)] - value: ::core::primitive::u128, - description: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] - #[doc = "and the original deposit will be returned."] - #[doc = ""] - #[doc = "May only be called from `T::ApproveOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - approve_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Assign a curator to a funded bounty."] - #[doc = ""] - #[doc = "May only be called from `T::ApproveOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - propose_curator { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - fee: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "Unassign curator from a bounty."] - #[doc = ""] - #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] - #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] - #[doc = ""] - #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] - #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] - #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] - #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] - #[doc = "we should pick a new curator. In this case the curator should also be slashed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - unassign_curator { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "Accept the curator role for a bounty."] - #[doc = "A deposit will be reserved from curator and refund upon successful payout."] - #[doc = ""] - #[doc = "May only be called from the curator."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - accept_curator { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] - #[doc = "after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to award."] - #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - award_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 6)] - #[doc = "Claim the payout from an awarded bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to claim."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - claim_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - #[codec(index = 7)] - #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] - #[doc = "the curator deposit will be unreserved if possible."] - #[doc = ""] - #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to cancel."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - close_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - #[codec(index = 8)] - #[doc = "Extend the expiry time of an active bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this bounty."] - #[doc = ""] - #[doc = "- `bounty_id`: Bounty ID to extend."] - #[doc = "- `remark`: additional information."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "# "] - extend_bounty_expiry { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - remark: ::std::vec::Vec<::core::primitive::u8>, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Proposer's balance is too low."] - InsufficientProposersBalance, - #[codec(index = 1)] - #[doc = "No proposal or bounty at that index."] - InvalidIndex, - #[codec(index = 2)] - #[doc = "The reason given is just too big."] - ReasonTooBig, - #[codec(index = 3)] - #[doc = "The bounty status is unexpected."] - UnexpectedStatus, - #[codec(index = 4)] - #[doc = "Require bounty curator."] - RequireCurator, - #[codec(index = 5)] - #[doc = "Invalid bounty value."] - InvalidValue, - #[codec(index = 6)] - #[doc = "Invalid bounty fee."] - InvalidFee, - #[codec(index = 7)] - #[doc = "A bounty payout is pending."] - #[doc = "To cancel the bounty, you must unassign and slash the curator."] - PendingPayout, - #[codec(index = 8)] - #[doc = "The bounties cannot be claimed/closed because it's still in the countdown period."] - Premature, - #[codec(index = 9)] - #[doc = "The bounty cannot be closed because it has active child-bounties."] - HasActiveChildBounty, - #[codec(index = 10)] - #[doc = "Too many approvals are already queued."] - TooManyQueued, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "New bounty proposal."] - BountyProposed { index: ::core::primitive::u32 }, - #[codec(index = 1)] - #[doc = "A bounty proposal was rejected; funds were slashed."] - BountyRejected { - index: ::core::primitive::u32, - bond: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "A bounty proposal is funded and became active."] - BountyBecameActive { index: ::core::primitive::u32 }, - #[codec(index = 3)] - #[doc = "A bounty is awarded to a beneficiary."] - BountyAwarded { - index: ::core::primitive::u32, - beneficiary: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 4)] - #[doc = "A bounty is claimed by beneficiary."] - BountyClaimed { - index: ::core::primitive::u32, - payout: ::core::primitive::u128, - beneficiary: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 5)] - #[doc = "A bounty is cancelled."] - BountyCanceled { index: ::core::primitive::u32 }, - #[codec(index = 6)] - #[doc = "A bounty expiry is extended."] - BountyExtended { index: ::core::primitive::u32 }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Bounty<_0, _1, _2> { - pub proposer: _0, - pub value: _1, - pub fee: _1, - pub curator_deposit: _1, - pub bond: _1, - pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum BountyStatus<_0, _1> { - #[codec(index = 0)] - Proposed, - #[codec(index = 1)] - Approved, - #[codec(index = 2)] - Funded, - #[codec(index = 3)] - CuratorProposed { curator: _0 }, - #[codec(index = 4)] - Active { curator: _0, update_due: _1 }, - #[codec(index = 5)] - PendingPayout { - curator: _0, - beneficiary: _0, - unlock_at: _1, - }, - } - } - pub mod pallet_child_bounties { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Add a new child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of parent"] - #[doc = "bounty and the parent bounty must be in \"active\" state."] - #[doc = ""] - #[doc = "Child-bounty gets added successfully & fund gets transferred from"] - #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] - #[doc = "funds, else the call fails."] - #[doc = ""] - #[doc = "Upper bound to maximum number of active child-bounties that can be"] - #[doc = "added are managed via runtime trait config"] - #[doc = "[`Config::MaxActiveChildBountyCount`]."] - #[doc = ""] - #[doc = "If the call is success, the status of child-bounty is updated to"] - #[doc = "\"Added\"."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] - #[doc = "- `value`: Value for executing the proposal."] - #[doc = "- `description`: Text description for the child-bounty."] - add_child_bounty { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - value: ::core::primitive::u128, - description: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Propose curator for funded child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be curator of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `curator`: Address of child-bounty curator."] - #[doc = "- `fee`: payment fee to child-bounty curator for execution."] - propose_curator { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - child_bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - fee: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Accept the curator role for the child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the curator of this"] - #[doc = "child-bounty."] - #[doc = ""] - #[doc = "A deposit will be reserved from the curator and refund upon"] - #[doc = "successful payout or cancellation."] - #[doc = ""] - #[doc = "Fee for curator is deducted from curator fee of parent bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] - #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - accept_curator { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - child_bounty_id: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Unassign curator from a child-bounty."] - #[doc = ""] - #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] - #[doc = "the curator of the parent bounty, or any signed origin."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] - #[doc = "curator, parent-bounty must be in active state, for this call to"] - #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] - #[doc = "this call irrespective of the parent-bounty state."] - #[doc = ""] - #[doc = "If this function is called by the `RejectOrigin` or the"] - #[doc = "parent-bounty curator, we assume that the child-bounty curator is"] - #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] - #[doc = "slashed."] - #[doc = ""] - #[doc = "If the origin is the child-bounty curator, we take this as a sign"] - #[doc = "that they are unable to do their job, and are willingly giving up."] - #[doc = "We could slash the deposit, but for now we allow them to unreserve"] - #[doc = "their deposit and exit without issue. (We may want to change this if"] - #[doc = "it is abused.)"] - #[doc = ""] - #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] - #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] - #[doc = "inactive state of child-bounty curator."] - #[doc = ""] - #[doc = "This allows anyone in the community to call out that a child-bounty"] - #[doc = "curator is not doing their due diligence, and we should pick a new"] - #[doc = "one. In this case the child-bounty curator deposit is slashed."] - #[doc = ""] - #[doc = "State of child-bounty is moved to Added state on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - unassign_curator { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - child_bounty_id: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "Award child-bounty to a beneficiary."] - #[doc = ""] - #[doc = "The beneficiary will be able to claim the funds after a delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be the master curator or"] - #[doc = "curator of this child-bounty."] - #[doc = ""] - #[doc = "Parent bounty must be in active state, for this child-bounty call to"] - #[doc = "work."] - #[doc = ""] - #[doc = "Child-bounty must be in active state, for processing the call. And"] - #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] - #[doc = "completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - #[doc = "- `beneficiary`: Beneficiary account."] - award_child_bounty { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - child_bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 5)] - #[doc = "Claim the payout from an awarded child-bounty after payout delay."] - #[doc = ""] - #[doc = "The dispatch origin for this call may be any signed origin."] - #[doc = ""] - #[doc = "Call works independent of parent bounty state, No need for parent"] - #[doc = "bounty to be in active state."] - #[doc = ""] - #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] - #[doc = "paid & curator deposit is unreserved."] - #[doc = ""] - #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] - #[doc = "call. And instance of child-bounty is removed from the state on"] - #[doc = "successful call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - claim_child_bounty { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - child_bounty_id: ::core::primitive::u32, - }, - #[codec(index = 6)] - #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] - #[doc = "are transferred to parent bounty account. The child-bounty curator"] - #[doc = "deposit may be unreserved if possible."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be either parent curator or"] - #[doc = "`T::RejectOrigin`."] - #[doc = ""] - #[doc = "If the state of child-bounty is `Active`, curator deposit is"] - #[doc = "unreserved."] - #[doc = ""] - #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] - #[doc = "returns `PendingPayout` error."] - #[doc = ""] - #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] - #[doc = "active state, for this child-bounty call to work. For origin"] - #[doc = "T::RejectOrigin execution is forced."] - #[doc = ""] - #[doc = "Instance of child-bounty is removed from the state on successful"] - #[doc = "call completion."] - #[doc = ""] - #[doc = "- `parent_bounty_id`: Index of parent bounty."] - #[doc = "- `child_bounty_id`: Index of child bounty."] - close_child_bounty { - #[codec(compact)] - parent_bounty_id: ::core::primitive::u32, - #[codec(compact)] - child_bounty_id: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The parent bounty is not in active state."] - ParentBountyNotActive, - #[codec(index = 1)] - #[doc = "The bounty balance is not enough to add new child-bounty."] - InsufficientBountyBalance, - #[codec(index = 2)] - #[doc = "Number of child-bounties exceeds limit `MaxActiveChildBountyCount`."] - TooManyChildBounties, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A child-bounty is added."] - Added { - index: ::core::primitive::u32, - child_index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "A child-bounty is awarded to a beneficiary."] - Awarded { - index: ::core::primitive::u32, - child_index: ::core::primitive::u32, - beneficiary: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 2)] - #[doc = "A child-bounty is claimed by beneficiary."] - Claimed { - index: ::core::primitive::u32, - child_index: ::core::primitive::u32, - payout: ::core::primitive::u128, - beneficiary: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 3)] - #[doc = "A child-bounty is cancelled."] - Canceled { - index: ::core::primitive::u32, - child_index: ::core::primitive::u32, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ChildBounty<_0, _1, _2> { - pub parent_bounty: _2, - pub value: _1, - pub fee: _1, - pub curator_deposit: _1, - pub status: - runtime_types::pallet_child_bounties::ChildBountyStatus<_0, _2>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum ChildBountyStatus<_0, _1> { - #[codec(index = 0)] - Added, - #[codec(index = 1)] - CuratorProposed { curator: _0 }, - #[codec(index = 2)] - Active { curator: _0 }, - #[codec(index = 3)] - PendingPayout { - curator: _0, - beneficiary: _0, - unlock_at: _1, - }, - } - } - pub mod pallet_collective { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the collective's membership."] - #[doc = ""] - #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] - #[doc = "- `prime`: The prime member whose vote sets the default."] - #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] - #[doc = " weight estimation."] - #[doc = ""] - #[doc = "Requires root origin."] - #[doc = ""] - #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] - #[doc = " the weight estimations rely on it to estimate dispatchable weight."] - #[doc = ""] - #[doc = "# WARNING:"] - #[doc = ""] - #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] - #[doc = "implementation of the trait [`ChangeMembers`]."] - #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] - #[doc = "with other logic managing the member set."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(MP + N)` where:"] - #[doc = " - `M` old-members-count (code- and governance-bounded)"] - #[doc = " - `N` new-members-count (code- and governance-bounded)"] - #[doc = " - `P` proposals-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] - #[doc = " members"] - #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] - #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] - #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] - #[doc = "# "] - set_members { - new_members: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - old_count: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Dispatch a proposal from a member using the `Member` origin."] - #[doc = ""] - #[doc = "Origin must be a member of the collective."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] - #[doc = " `proposal`"] - #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] - #[doc = "- 1 event"] - #[doc = "# "] - execute { - proposal: - ::std::boxed::Box, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Add a new proposal to either be voted on or executed directly."] - #[doc = ""] - #[doc = "Requires the sender to be member."] - #[doc = ""] - #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] - #[doc = "or put up for voting."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - branching is influenced by `threshold` where:"] - #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] - #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] - #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] - #[doc = " - DB accesses influenced by `threshold`:"] - #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] - #[doc = " - OR proposal insertion (`threshold <= 2`)"] - #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] - #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] - #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] - #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] - #[doc = " - 1 event"] - #[doc = "# "] - propose { - #[codec(compact)] - threshold: ::core::primitive::u32, - proposal: - ::std::boxed::Box, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "Requires the sender to be a member."] - #[doc = ""] - #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `Members` (codec `O(M)`)"] - #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] - #[doc = "- 1 event"] - #[doc = "# "] - vote { - proposal: ::subxt::sp_core::H256, - #[codec(compact)] - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - }, - #[codec(index = 4)] - #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] - #[doc = ""] - #[doc = "May be called by any signed account in order to finish voting and close the proposal."] - #[doc = ""] - #[doc = "If called before the end of the voting period it will only close the vote if it is"] - #[doc = "has enough votes to be approved or disapproved."] - #[doc = ""] - #[doc = "If called after the end of the voting period abstentions are counted as rejections"] - #[doc = "unless there is a prime member set and the prime member cast an approval."] - #[doc = ""] - #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] - #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] - #[doc = ""] - #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] - #[doc = "proposal."] - #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] - #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1 + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - `P1` is the complexity of `proposal` preimage."] - #[doc = " - `P2` is proposal-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] - #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] - #[doc = " `O(P2)`)"] - #[doc = " - any mutations done while executing `proposal` (`P1`)"] - #[doc = "- up to 3 events"] - #[doc = "# "] - close { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - index: ::core::primitive::u32, - #[codec(compact)] - proposal_weight_bound: ::core::primitive::u64, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] - #[doc = "state."] - #[doc = ""] - #[doc = "Must be called by the Root origin."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity: O(P) where P is the number of max proposals"] - #[doc = "DB Weight:"] - #[doc = "* Reads: Proposals"] - #[doc = "* Writes: Voting, Proposals, ProposalOf"] - #[doc = "# "] - disapprove_proposal { - proposal_hash: ::subxt::sp_core::H256, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Account is not a member"] - NotMember, - #[codec(index = 1)] - #[doc = "Duplicate proposals not allowed"] - DuplicateProposal, - #[codec(index = 2)] - #[doc = "Proposal must exist"] - ProposalMissing, - #[codec(index = 3)] - #[doc = "Mismatched index"] - WrongIndex, - #[codec(index = 4)] - #[doc = "Duplicate vote ignored"] - DuplicateVote, - #[codec(index = 5)] - #[doc = "Members are already initialized!"] - AlreadyInitialized, - #[codec(index = 6)] - #[doc = "The close call was made too early, before the end of the voting."] - TooEarly, - #[codec(index = 7)] - #[doc = "There can only be a maximum of `MaxProposals` active proposals."] - TooManyProposals, - #[codec(index = 8)] - #[doc = "The given weight bound for the proposal was too low."] - WrongProposalWeight, - #[codec(index = 9)] - #[doc = "The given length bound for the proposal was too low."] - WrongProposalLength, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] - #[doc = "`MemberCount`)."] - Proposed { - account: ::subxt::sp_core::crypto::AccountId32, - proposal_index: ::core::primitive::u32, - proposal_hash: ::subxt::sp_core::H256, - threshold: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "A motion (given hash) has been voted on by given account, leaving"] - #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] - Voted { - account: ::subxt::sp_core::crypto::AccountId32, - proposal_hash: ::subxt::sp_core::H256, - voted: ::core::primitive::bool, - yes: ::core::primitive::u32, - no: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "A motion was approved by the required threshold."] - Approved { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 3)] - #[doc = "A motion was not approved by the required threshold."] - Disapproved { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 4)] - #[doc = "A motion was executed; result will be `Ok` if it returned without error."] - Executed { - proposal_hash: ::subxt::sp_core::H256, - result: ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - }, - #[codec(index = 5)] - #[doc = "A single member did some action; result will be `Ok` if it returned without error."] - MemberExecuted { - proposal_hash: ::subxt::sp_core::H256, - result: ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - }, - #[codec(index = 6)] - #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] - Closed { - proposal_hash: ::subxt::sp_core::H256, - yes: ::core::primitive::u32, - no: ::core::primitive::u32, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum RawOrigin<_0> { - #[codec(index = 0)] - Members(::core::primitive::u32, ::core::primitive::u32), - #[codec(index = 1)] - Member(_0), - #[codec(index = 2)] - _Phantom, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Votes<_0, _1> { - pub index: _1, - pub threshold: _1, - pub ayes: ::std::vec::Vec<_0>, - pub nays: ::std::vec::Vec<_0>, - pub end: _1, - } - } - pub mod pallet_democracy { - use super::runtime_types; - pub mod conviction { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Conviction { - #[codec(index = 0)] - None, - #[codec(index = 1)] - Locked1x, - #[codec(index = 2)] - Locked2x, - #[codec(index = 3)] - Locked3x, - #[codec(index = 4)] - Locked4x, - #[codec(index = 5)] - Locked5x, - #[codec(index = 6)] - Locked6x, - } - } - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Propose a sensitive action to be taken."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] - #[doc = "have funds to cover the deposit."] - #[doc = ""] - #[doc = "- `proposal_hash`: The hash of the proposal preimage."] - #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] - #[doc = ""] - #[doc = "Emits `Proposed`."] - #[doc = ""] - #[doc = "Weight: `O(p)`"] - propose { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "Signals agreement with a particular proposal."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the sender"] - #[doc = "must have funds to cover the deposit, equal to the original deposit."] - #[doc = ""] - #[doc = "- `proposal`: The index of the proposal to second."] - #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] - #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] - #[doc = ""] - #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] - second { - #[codec(compact)] - proposal: ::core::primitive::u32, - #[codec(compact)] - seconds_upper_bound: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `ref_index`: The index of the referendum to vote for."] - #[doc = "- `vote`: The vote configuration."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] - vote { - #[codec(compact)] - ref_index: ::core::primitive::u32, - vote: runtime_types::pallet_democracy::vote::AccountVote< - ::core::primitive::u128, - >, - }, - #[codec(index = 3)] - #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] - #[doc = "referendum."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `CancellationOrigin`."] - #[doc = ""] - #[doc = "-`ref_index`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "Weight: `O(1)`."] - emergency_cancel { ref_index: ::core::primitive::u32 }, - #[codec(index = 4)] - #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] - #[doc = "referendum."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] - #[doc = " Decoding vec of length V. Charged as maximum"] - external_propose { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 5)] - #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] - #[doc = "an external referendum."] - #[doc = ""] - #[doc = "The dispatch of this call must be `ExternalMajorityOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] - #[doc = "pre-scheduled `external_propose` call."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - external_propose_majority { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 6)] - #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] - #[doc = "schedule an external referendum."] - #[doc = ""] - #[doc = "The dispatch of this call must be `ExternalDefaultOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] - #[doc = "pre-scheduled `external_propose` call."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - external_propose_default { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 7)] - #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] - #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] - #[doc = "but it is not a majority-carries referendum then it fails."] - #[doc = ""] - #[doc = "The dispatch of this call must be `FastTrackOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The hash of the current external proposal."] - #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] - #[doc = " `FastTrackVotingPeriod` if too low."] - #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] - #[doc = " enacted. This doesn't have a minimum amount."] - #[doc = ""] - #[doc = "Emits `Started`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - fast_track { - proposal_hash: ::subxt::sp_core::H256, - voting_period: ::core::primitive::u32, - delay: ::core::primitive::u32, - }, - #[codec(index = 8)] - #[doc = "Veto and blacklist the external proposal hash."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `VetoOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of the proposal to veto and blacklist."] - #[doc = ""] - #[doc = "Emits `Vetoed`."] - #[doc = ""] - #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] - veto_external { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 9)] - #[doc = "Remove a referendum."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "- `ref_index`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "# Weight: `O(1)`."] - cancel_referendum { - #[codec(compact)] - ref_index: ::core::primitive::u32, - }, - #[codec(index = 10)] - #[doc = "Cancel a proposal queued for enactment."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "- `which`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] - cancel_queued { which: ::core::primitive::u32 }, - #[codec(index = 11)] - #[doc = "Delegate the voting power (with some given conviction) of the sending account."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed/consolidated"] - #[doc = " through `reap_vote` or `unvote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] - #[doc = " voted on. Weight is charged as if maximum votes."] - delegate { - to: ::subxt::sp_core::crypto::AccountId32, - conviction: - runtime_types::pallet_democracy::conviction::Conviction, - balance: ::core::primitive::u128, - }, - #[codec(index = 12)] - #[doc = "Undelegate the voting power of the sending account."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "Emits `Undelegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] - #[doc = " voted on. Weight is charged as if maximum votes."] - undelegate, - #[codec(index = 13)] - #[doc = "Clears all public proposals."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "Weight: `O(1)`."] - clear_public_proposals, - #[codec(index = 14)] - #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] - #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - note_preimage { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 15)] - #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] - note_preimage_operational { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 16)] - #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] - #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] - #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] - #[doc = "no fee is paid."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - note_imminent_preimage { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 17)] - #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] - note_imminent_preimage_operational { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 18)] - #[doc = "Remove an expired proposal preimage and collect the deposit."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of a proposal."] - #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] - #[doc = " weighted according to this value with no refund."] - #[doc = ""] - #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] - #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] - #[doc = "work an additional `EnactmentPeriod` later."] - #[doc = ""] - #[doc = "Emits `PreimageReaped`."] - #[doc = ""] - #[doc = "Weight: `O(D)` where D is length of proposal."] - reap_preimage { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - proposal_len_upper_bound: ::core::primitive::u32, - }, - #[codec(index = 19)] - #[doc = "Unlock tokens that have an expired lock."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account to remove the lock on."] - #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - unlock { - target: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 20)] - #[doc = "Remove a vote for a referendum."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the referendum was cancelled, or"] - #[doc = "- the referendum is ongoing, or"] - #[doc = "- the referendum has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the referendum has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for referendum `index`."] - #[doc = ""] - #[doc = "- `index`: The index of referendum of the vote to be removed."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - remove_vote { index: ::core::primitive::u32 }, - #[codec(index = 21)] - #[doc = "Remove a vote for a referendum."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the referendum was cancelled, because the voter lost the referendum or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for"] - #[doc = " referendum `index`."] - #[doc = "- `index`: The index of referendum of the vote to be removed."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - remove_other_vote { - target: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - #[codec(index = 22)] - #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] - enact_proposal { - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - }, - #[codec(index = 23)] - #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] - #[doc = "proposed again."] - #[doc = ""] - #[doc = "If called on a queued public or external proposal, then this will result in it being"] - #[doc = "removed. If the `ref_index` supplied is an active referendum with the proposal hash,"] - #[doc = "then it will be cancelled."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `BlacklistOrigin`."] - #[doc = ""] - #[doc = "- `proposal_hash`: The proposal hash to blacklist permanently."] - #[doc = "- `ref_index`: An ongoing referendum whose hash is `proposal_hash`, which will be"] - #[doc = "cancelled."] - #[doc = ""] - #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] - #[doc = " reasonable value)."] - blacklist { - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 24)] - #[doc = "Remove a proposal."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] - #[doc = ""] - #[doc = "- `prop_index`: The index of the proposal to cancel."] - #[doc = ""] - #[doc = "Weight: `O(p)` where `p = PublicProps::::decode_len()`"] - cancel_proposal { - #[codec(compact)] - prop_index: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Value too low"] - ValueLow, - #[codec(index = 1)] - #[doc = "Proposal does not exist"] - ProposalMissing, - #[codec(index = 2)] - #[doc = "Cannot cancel the same proposal twice"] - AlreadyCanceled, - #[codec(index = 3)] - #[doc = "Proposal already made"] - DuplicateProposal, - #[codec(index = 4)] - #[doc = "Proposal still blacklisted"] - ProposalBlacklisted, - #[codec(index = 5)] - #[doc = "Next external proposal not simple majority"] - NotSimpleMajority, - #[codec(index = 6)] - #[doc = "Invalid hash"] - InvalidHash, - #[codec(index = 7)] - #[doc = "No external proposal"] - NoProposal, - #[codec(index = 8)] - #[doc = "Identity may not veto a proposal twice"] - AlreadyVetoed, - #[codec(index = 9)] - #[doc = "Preimage already noted"] - DuplicatePreimage, - #[codec(index = 10)] - #[doc = "Not imminent"] - NotImminent, - #[codec(index = 11)] - #[doc = "Too early"] - TooEarly, - #[codec(index = 12)] - #[doc = "Imminent"] - Imminent, - #[codec(index = 13)] - #[doc = "Preimage not found"] - PreimageMissing, - #[codec(index = 14)] - #[doc = "Vote given for invalid referendum"] - ReferendumInvalid, - #[codec(index = 15)] - #[doc = "Invalid preimage"] - PreimageInvalid, - #[codec(index = 16)] - #[doc = "No proposals waiting"] - NoneWaiting, - #[codec(index = 17)] - #[doc = "The given account did not vote on the referendum."] - NotVoter, - #[codec(index = 18)] - #[doc = "The actor has no permission to conduct the action."] - NoPermission, - #[codec(index = 19)] - #[doc = "The account is already delegating."] - AlreadyDelegating, - #[codec(index = 20)] - #[doc = "Too high a balance was provided that the account cannot afford."] - InsufficientFunds, - #[codec(index = 21)] - #[doc = "The account is not currently delegating."] - NotDelegating, - #[codec(index = 22)] - #[doc = "The account currently has votes attached to it and the operation cannot succeed until"] - #[doc = "these are removed, either through `unvote` or `reap_vote`."] - VotesExist, - #[codec(index = 23)] - #[doc = "The instant referendum origin is currently disallowed."] - InstantNotAllowed, - #[codec(index = 24)] - #[doc = "Delegation to oneself makes no sense."] - Nonsense, - #[codec(index = 25)] - #[doc = "Invalid upper bound."] - WrongUpperBound, - #[codec(index = 26)] - #[doc = "Maximum number of votes reached."] - MaxVotesReached, - #[codec(index = 27)] - #[doc = "Maximum number of proposals reached."] - TooManyProposals, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 , } , } - } - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Delegations<_0> { - pub votes: _0, - pub capital: _0, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum ReferendumInfo<_0, _1, _2> { - #[codec(index = 0)] - Ongoing( - runtime_types::pallet_democracy::types::ReferendumStatus< - _0, - _1, - _2, - >, - ), - #[codec(index = 1)] - Finished { - approved: ::core::primitive::bool, - end: _0, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ReferendumStatus<_0, _1, _2> { - pub end: _0, - pub proposal_hash: _1, - pub threshold: - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - pub delay: _0, - pub tally: runtime_types::pallet_democracy::types::Tally<_2>, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Tally<_0> { - pub ayes: _0, - pub nays: _0, - pub turnout: _0, - } - } - pub mod vote { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum AccountVote<_0> { - #[codec(index = 0)] - Standard { - vote: runtime_types::pallet_democracy::vote::Vote, - balance: _0, - }, - #[codec(index = 1)] - Split { aye: _0, nay: _0 }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct PriorLock<_0, _1>(pub _0, pub _1); - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Vote(pub ::core::primitive::u8); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Voting<_0, _1, _2> { - #[codec(index = 0)] - Direct { - votes: ::std::vec::Vec<( - _2, - runtime_types::pallet_democracy::vote::AccountVote<_0>, - )>, - delegations: - runtime_types::pallet_democracy::types::Delegations<_0>, - prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, - }, - #[codec(index = 1)] - Delegating { - balance: _0, - target: _1, - conviction: - runtime_types::pallet_democracy::conviction::Conviction, - delegations: - runtime_types::pallet_democracy::types::Delegations<_0>, - prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, - }, - } - } - pub mod vote_threshold { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum VoteThreshold { - #[codec(index = 0)] - SuperMajorityApprove, - #[codec(index = 1)] - SuperMajorityAgainst, - #[codec(index = 2)] - SimpleMajority, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum PreimageStatus<_0, _1, _2> { - #[codec(index = 0)] - Missing(_2), - #[codec(index = 1)] - Available { - data: ::std::vec::Vec<::core::primitive::u8>, - provider: _0, - deposit: _1, - since: _2, - expiry: ::core::option::Option<_2>, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1, - } - } - pub mod pallet_election_provider_multi_phase { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "Submit a solution for the unsigned phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __none__."] # [doc = ""] # [doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] # [doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] # [doc = "that only active validators can submit this transaction when authoring a block (similar"] # [doc = "to an inherent)."] # [doc = ""] # [doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] # [doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] # [doc = "putting their authoring reward at risk."] # [doc = ""] # [doc = "No deposit or reward is associated with this submission."] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] # [doc = "Set a new value for `MinimumUntrustedScore`."] # [doc = ""] # [doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] # [doc = ""] # [doc = "This check can be turned off by setting the value to `None`."] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < runtime_types :: sp_npos_elections :: ElectionScore > , } , # [codec (index = 2)] # [doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] # [doc = "call to `ElectionProvider::elect`."] # [doc = ""] # [doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] # [doc = ""] # [doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] # [doc = "feasibility check itself can in principle cause the election process to fail (due to"] # [doc = "memory/weight constrains)."] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] # [doc = "Submit a solution for the signed phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __signed__."] # [doc = ""] # [doc = "The solution is potentially queued, based on the claimed score and processed at the end"] # [doc = "of the signed phase."] # [doc = ""] # [doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] # [doc = "might be rewarded, slashed, or get all or a part of the deposit back."] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , } , # [codec (index = 4)] # [doc = "Trigger the governance fallback."] # [doc = ""] # [doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] # [doc = "calling [`Call::set_emergency_election_result`]."] governance_fallback { maybe_max_voters : :: core :: option :: Option < :: core :: primitive :: u32 > , maybe_max_targets : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Submission was too early."] - PreDispatchEarlySubmission, - #[codec(index = 1)] - #[doc = "Wrong number of winners presented."] - PreDispatchWrongWinnerCount, - #[codec(index = 2)] - #[doc = "Submission was too weak, score-wise."] - PreDispatchWeakSubmission, - #[codec(index = 3)] - #[doc = "The queue was full, and the solution was not better than any of the existing ones."] - SignedQueueFull, - #[codec(index = 4)] - #[doc = "The origin failed to pay the deposit."] - SignedCannotPayDeposit, - #[codec(index = 5)] - #[doc = "Witness data to dispatchable is invalid."] - SignedInvalidWitness, - #[codec(index = 6)] - #[doc = "The signed submission consumes too much weight"] - SignedTooMuchWeight, - #[codec(index = 7)] - #[doc = "OCW submitted solution for wrong round"] - OcwCallWrongEra, - #[codec(index = 8)] - #[doc = "Snapshot metadata should exist but didn't."] - MissingSnapshotMetadata, - #[codec(index = 9)] - #[doc = "`Self::insert_submission` returned an invalid index."] - InvalidSubmissionIndex, - #[codec(index = 10)] - #[doc = "The call is not allowed at this point."] - CallNotAllowed, - #[codec(index = 11)] - #[doc = "The fallback failed"] - FallbackFailed, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - # [codec (index = 0)] # [doc = "A solution was stored with the given compute."] # [doc = ""] # [doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] # [doc = "solution is unsigned, this means that it has also been processed."] # [doc = ""] # [doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] SolutionStored { election_compute : runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , prev_ejected : :: core :: primitive :: bool , } , # [codec (index = 1)] # [doc = "The election has been finalized, with `Some` of the given computation, or else if the"] # [doc = "election failed, `None`."] ElectionFinalized { election_compute : :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > , } , # [codec (index = 2)] # [doc = "An account has been rewarded for their signed submission being finalized."] Rewarded { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "An account has been slashed for submitting an invalid signed submission."] Slashed { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "The signed phase of the given round has started."] SignedPhaseStarted { round : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "The unsigned phase of the given round has started."] UnsignedPhaseStarted { round : :: core :: primitive :: u32 , } , } - } - pub mod signed { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct SignedSubmission<_0, _1, _2> { - pub who: _0, - pub deposit: _1, - pub raw_solution: - runtime_types::pallet_election_provider_multi_phase::RawSolution< - _2, - >, - pub reward: _1, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum ElectionCompute { - #[codec(index = 0)] - OnChain, - #[codec(index = 1)] - Signed, - #[codec(index = 2)] - Unsigned, - #[codec(index = 3)] - Fallback, - #[codec(index = 4)] - Emergency, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Phase<_0> { - #[codec(index = 0)] - Off, - #[codec(index = 1)] - Signed, - #[codec(index = 2)] - Unsigned((::core::primitive::bool, _0)), - #[codec(index = 3)] - Emergency, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RawSolution<_0> { - pub solution: _0, - pub score: runtime_types::sp_npos_elections::ElectionScore, - pub round: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReadySolution<_0> { - pub supports: - ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, - pub score: runtime_types::sp_npos_elections::ElectionScore, - pub compute: - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RoundSnapshot { - pub voters: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, - pub targets: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SolutionOrSnapshotSize { - #[codec(compact)] - pub voters: ::core::primitive::u32, - #[codec(compact)] - pub targets: ::core::primitive::u32, - } - } - pub mod pallet_elections_phragmen { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] - #[doc = "set the initial votes, or update already existing votes."] - #[doc = ""] - #[doc = "Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is"] - #[doc = "reserved. The deposit is based on the number of votes and can be updated over time."] - #[doc = ""] - #[doc = "The `votes` should:"] - #[doc = " - not be empty."] - #[doc = " - be less than the number of possible candidates. Note that all current members and"] - #[doc = " runners-up are also automatically candidates for the next round."] - #[doc = ""] - #[doc = "If `value` is more than `who`'s free balance, then the maximum of the two is used."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed."] - #[doc = ""] - #[doc = "### Warning"] - #[doc = ""] - #[doc = "It is the responsibility of the caller to **NOT** place all of their balance into the"] - #[doc = "lock and keep some for further operations."] - #[doc = ""] - #[doc = "# "] - #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] - #[doc = "# "] - vote { - votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "Remove `origin` as a voter."] - #[doc = ""] - #[doc = "This removes the lock and returns the deposit."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed and be a voter."] - remove_voter, - #[codec(index = 2)] - #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] - #[doc = ""] - #[doc = "All candidates are wiped at the end of the term. They either become a member/runner-up,"] - #[doc = "or leave the system while their deposit is slashed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed."] - #[doc = ""] - #[doc = "### Warning"] - #[doc = ""] - #[doc = "Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]"] - #[doc = "to get their deposit back. Losing the spot in an election will always lead to a slash."] - #[doc = ""] - #[doc = "# "] - #[doc = "The number of current candidates must be provided as witness data."] - #[doc = "# "] - submit_candidacy { - #[codec(compact)] - candidate_count: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] - #[doc = "outcomes exist:"] - #[doc = ""] - #[doc = "- `origin` is a candidate and not elected in any set. In this case, the deposit is"] - #[doc = " unreserved, returned and origin is removed as a candidate."] - #[doc = "- `origin` is a current runner-up. In this case, the deposit is unreserved, returned and"] - #[doc = " origin is removed as a runner-up."] - #[doc = "- `origin` is a current member. In this case, the deposit is unreserved and origin is"] - #[doc = " removed as a member, consequently not being a candidate for the next round anymore."] - #[doc = " Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they"] - #[doc = " are immediately used. If the prime is renouncing, then no prime will exist until the"] - #[doc = " next round."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be signed, and have one of the above roles."] - #[doc = ""] - #[doc = "# "] - #[doc = "The type of renouncing must be provided as witness data."] - #[doc = "# "] - renounce_candidacy { - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - }, - #[codec(index = 4)] - #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] - #[doc = "the outgoing member is slashed."] - #[doc = ""] - #[doc = "If a runner-up is available, then the best runner-up will be removed and replaces the"] - #[doc = "outgoing member. Otherwise, a new phragmen election is started."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be root."] - #[doc = ""] - #[doc = "Note that this does not affect the designated block number of the next election."] - #[doc = ""] - #[doc = "# "] - #[doc = "If we have a replacement, we use a small weight. Else, since this is a root call and"] - #[doc = "will go into phragmen, we assume full block for now."] - #[doc = "# "] - remove_member { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - has_replacement: ::core::primitive::bool, - }, - #[codec(index = 5)] - #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] - #[doc = "deposit of the removed voters are returned."] - #[doc = ""] - #[doc = "This is an root function to be used only for cleaning the state."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be root."] - #[doc = ""] - #[doc = "# "] - #[doc = "The total number of voters and those that are defunct must be provided as witness data."] - #[doc = "# "] - clean_defunct_voters { - num_voters: ::core::primitive::u32, - num_defunct: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Cannot vote when no candidates or members exist."] - UnableToVote, - #[codec(index = 1)] - #[doc = "Must vote for at least one candidate."] - NoVotes, - #[codec(index = 2)] - #[doc = "Cannot vote more than candidates."] - TooManyVotes, - #[codec(index = 3)] - #[doc = "Cannot vote more than maximum allowed."] - MaximumVotesExceeded, - #[codec(index = 4)] - #[doc = "Cannot vote with stake less than minimum balance."] - LowBalance, - #[codec(index = 5)] - #[doc = "Voter can not pay voting bond."] - UnableToPayBond, - #[codec(index = 6)] - #[doc = "Must be a voter."] - MustBeVoter, - #[codec(index = 7)] - #[doc = "Cannot report self."] - ReportSelf, - #[codec(index = 8)] - #[doc = "Duplicated candidate submission."] - DuplicatedCandidate, - #[codec(index = 9)] - #[doc = "Member cannot re-submit candidacy."] - MemberSubmit, - #[codec(index = 10)] - #[doc = "Runner cannot re-submit candidacy."] - RunnerUpSubmit, - #[codec(index = 11)] - #[doc = "Candidate does not have enough funds."] - InsufficientCandidateFunds, - #[codec(index = 12)] - #[doc = "Not a member."] - NotMember, - #[codec(index = 13)] - #[doc = "The provided count of number of candidates is incorrect."] - InvalidWitnessData, - #[codec(index = 14)] - #[doc = "The provided count of number of votes is incorrect."] - InvalidVoteCount, - #[codec(index = 15)] - #[doc = "The renouncing origin presented a wrong `Renouncing` parameter."] - InvalidRenouncing, - #[codec(index = 16)] - #[doc = "Prediction regarding replacement after member removal is wrong."] - InvalidReplacement, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] - #[doc = "the election, not that enough have has been elected. The inner value must be examined"] - #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] - #[doc = "slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to"] - #[doc = "begin with."] - NewTerm { - new_members: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - }, - #[codec(index = 1)] - #[doc = "No (or not enough) candidates existed for this round. This is different from"] - #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] - EmptyTerm, - #[codec(index = 2)] - #[doc = "Internal error happened while trying to perform election."] - ElectionError, - #[codec(index = 3)] - #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] - #[doc = "`EmptyTerm`."] - MemberKicked { - member: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 4)] - #[doc = "Someone has renounced their candidacy."] - Renounced { - candidate: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 5)] - #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] - #[doc = "runner-up."] - #[doc = ""] - #[doc = "Note that old members and runners-up are also candidates."] - CandidateSlashed { - candidate: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 6)] - #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] - SeatHolderSlashed { - seat_holder: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Renouncing { - #[codec(index = 0)] - Member, - #[codec(index = 1)] - RunnerUp, - #[codec(index = 2)] - Candidate(#[codec(compact)] ::core::primitive::u32), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SeatHolder<_0, _1> { - pub who: _0, - pub stake: _1, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Voter<_0, _1> { - pub votes: ::std::vec::Vec<_0>, - pub stake: _1, - pub deposit: _1, - } - } - pub mod pallet_grandpa { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - report_equivocation { - equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - #[codec(index = 1)] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - report_equivocation_unsigned { - equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - 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 = "Only callable by root."] - note_stalled { - delay: ::core::primitive::u32, - best_finalized_block_number: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Attempt to signal GRANDPA pause when the authority set isn't live"] - #[doc = "(either paused or already pending pause)."] - PauseFailed, - #[codec(index = 1)] - #[doc = "Attempt to signal GRANDPA resume when the authority set isn't paused"] - #[doc = "(either live or already pending resume)."] - ResumeFailed, - #[codec(index = 2)] - #[doc = "Attempt to signal GRANDPA change with one already pending."] - ChangePending, - #[codec(index = 3)] - #[doc = "Cannot signal forced change so soon after last."] - TooSoon, - #[codec(index = 4)] - #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] - InvalidKeyOwnershipProof, - #[codec(index = 5)] - #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] - InvalidEquivocationProof, - #[codec(index = 6)] - #[doc = "A given equivocation report is valid but already previously reported."] - DuplicateOffenceReport, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "New authority set has been applied."] - NewAuthorities { - authority_set: ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - }, - #[codec(index = 1)] - #[doc = "Current authority set has been paused."] - Paused, - #[codec(index = 2)] - #[doc = "Current authority set has been resumed."] - Resumed, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 > , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum StoredState<_0> { - #[codec(index = 0)] - Live, - #[codec(index = 1)] - PendingPause { scheduled_at: _0, delay: _0 }, - #[codec(index = 2)] - Paused, - #[codec(index = 3)] - PendingResume { scheduled_at: _0, delay: _0 }, - } - } - pub mod pallet_identity { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Add a registrar to the system."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] - #[doc = ""] - #[doc = "- `account`: the account of the registrar."] - #[doc = ""] - #[doc = "Emits `RegistrarAdded` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)` where `R` registrar-count (governance-bounded and code-bounded)."] - #[doc = "- One storage mutation (codec `O(R)`)."] - #[doc = "- One event."] - #[doc = "# "] - add_registrar { - account: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 1)] - #[doc = "Set an account's identity information and reserve the appropriate deposit."] - #[doc = ""] - #[doc = "If the account already has identity information, the deposit is taken as part payment"] - #[doc = "for the new deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `info`: The identity information."] - #[doc = ""] - #[doc = "Emits `IdentitySet` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(X + X' + R)`"] - #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)"] - #[doc = " - where `R` judgements-count (registrar-count-bounded)"] - #[doc = "- One balance reserve operation."] - #[doc = "- One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`)."] - #[doc = "- One event."] - #[doc = "# "] - set_identity { - info: ::std::boxed::Box< - runtime_types::pallet_identity::types::IdentityInfo, - >, - }, - #[codec(index = 2)] - #[doc = "Set the sub-accounts of the sender."] - #[doc = ""] - #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] - #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "- `subs`: The identity's (new) sub-accounts."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(P + S)`"] - #[doc = " - where `P` old-subs-count (hard- and deposit-bounded)."] - #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] - #[doc = "- At most one balance operations."] - #[doc = "- DB:"] - #[doc = " - `P + S` storage mutations (codec complexity `O(1)`)"] - #[doc = " - One storage read (codec complexity `O(P)`)."] - #[doc = " - One storage write (codec complexity `O(S)`)."] - #[doc = " - One storage-exists (`IdentityOf::contains_key`)."] - #[doc = "# "] - set_subs { - subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - }, - #[codec(index = 3)] - #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] - #[doc = ""] - #[doc = "Payment: All reserved balances on the account are returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "identity."] - #[doc = ""] - #[doc = "Emits `IdentityCleared` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + S + X)`"] - #[doc = " - where `R` registrar-count (governance-bounded)."] - #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] - #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)."] - #[doc = "- One balance-unreserve operation."] - #[doc = "- `2` storage reads and `S + 2` storage deletions."] - #[doc = "- One event."] - #[doc = "# "] - clear_identity, - #[codec(index = 4)] - #[doc = "Request a judgement from a registrar."] - #[doc = ""] - #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] - #[doc = "given."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] - #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] - #[doc = ""] - #[doc = "```nocompile"] - #[doc = "Self::registrars().get(reg_index).unwrap().fee"] - #[doc = "```"] - #[doc = ""] - #[doc = "Emits `JudgementRequested` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + X)`."] - #[doc = "- One balance-reserve operation."] - #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(X + R)`."] - #[doc = "- One event."] - #[doc = "# "] - request_judgement { - #[codec(compact)] - reg_index: ::core::primitive::u32, - #[codec(compact)] - max_fee: ::core::primitive::u128, - }, - #[codec(index = 5)] - #[doc = "Cancel a previous request."] - #[doc = ""] - #[doc = "Payment: A previously reserved deposit is returned on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] - #[doc = "registered identity."] - #[doc = ""] - #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] - #[doc = ""] - #[doc = "Emits `JudgementUnrequested` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + X)`."] - #[doc = "- One balance-reserve operation."] - #[doc = "- One storage mutation `O(R + X)`."] - #[doc = "- One event"] - #[doc = "# "] - cancel_request { reg_index: ::core::primitive::u32 }, - #[codec(index = 6)] - #[doc = "Set the fee required for a judgement to be requested from a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fee`: the new fee."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)`."] - #[doc = "- One storage mutation `O(R)`."] - #[doc = "- Benchmark: 7.315 + R * 0.329 µs (min squares analysis)"] - #[doc = "# "] - set_fee { - #[codec(compact)] - index: ::core::primitive::u32, - #[codec(compact)] - fee: ::core::primitive::u128, - }, - #[codec(index = 7)] - #[doc = "Change the account associated with a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `new`: the new account ID."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)`."] - #[doc = "- One storage mutation `O(R)`."] - #[doc = "- Benchmark: 8.823 + R * 0.32 µs (min squares analysis)"] - #[doc = "# "] - set_account_id { - #[codec(compact)] - index: ::core::primitive::u32, - new: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 8)] - #[doc = "Set the field information for a registrar."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `index`."] - #[doc = ""] - #[doc = "- `index`: the index of the registrar whose fee is to be set."] - #[doc = "- `fields`: the fields that the registrar concerns themselves with."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R)`."] - #[doc = "- One storage mutation `O(R)`."] - #[doc = "- Benchmark: 7.464 + R * 0.325 µs (min squares analysis)"] - #[doc = "# "] - set_fields { - #[codec(compact)] - index: ::core::primitive::u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - }, - #[codec(index = 9)] - #[doc = "Provide a judgement for an account's identity."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] - #[doc = "of the registrar whose index is `reg_index`."] - #[doc = ""] - #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] - #[doc = ""] - #[doc = "Emits `JudgementGiven` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + X)`."] - #[doc = "- One balance-transfer operation."] - #[doc = "- Up to one account-lookup operation."] - #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(R + X)`."] - #[doc = "- One event."] - #[doc = "# "] - provide_judgement { - #[codec(compact)] - reg_index: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - judgement: runtime_types::pallet_identity::types::Judgement< - ::core::primitive::u128, - >, - }, - #[codec(index = 10)] - #[doc = "Remove an account's identity and sub-account information and slash the deposits."] - #[doc = ""] - #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] - #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] - #[doc = "manually using `cancel_request`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - #[doc = ""] - #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] - #[doc = " with a registered identity."] - #[doc = ""] - #[doc = "Emits `IdentityKilled` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(R + S + X)`."] - #[doc = "- One balance-reserve operation."] - #[doc = "- `S + 2` storage mutations."] - #[doc = "- One event."] - #[doc = "# "] - kill_identity { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 11)] - #[doc = "Add the given account to the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - add_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - }, - #[codec(index = 12)] - #[doc = "Alter the associated name of the given sub-account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - rename_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - }, - #[codec(index = 13)] - #[doc = "Remove the given account from the sender's subs."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "sub identity of `sub`."] - remove_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 14)] - #[doc = "Remove the sender as a sub-account."] - #[doc = ""] - #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] - #[doc = "to the sender (*not* the original depositor)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] - #[doc = "super-identity."] - #[doc = ""] - #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] - #[doc = "controller of an account is maliciously registered as a sub-account."] - quit_sub, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Too many subs-accounts."] - TooManySubAccounts, - #[codec(index = 1)] - #[doc = "Account isn't found."] - NotFound, - #[codec(index = 2)] - #[doc = "Account isn't named."] - NotNamed, - #[codec(index = 3)] - #[doc = "Empty index."] - EmptyIndex, - #[codec(index = 4)] - #[doc = "Fee is changed."] - FeeChanged, - #[codec(index = 5)] - #[doc = "No identity found."] - NoIdentity, - #[codec(index = 6)] - #[doc = "Sticky judgement."] - StickyJudgement, - #[codec(index = 7)] - #[doc = "Judgement given."] - JudgementGiven, - #[codec(index = 8)] - #[doc = "Invalid judgement."] - InvalidJudgement, - #[codec(index = 9)] - #[doc = "The index is invalid."] - InvalidIndex, - #[codec(index = 10)] - #[doc = "The target is invalid."] - InvalidTarget, - #[codec(index = 11)] - #[doc = "Too many additional fields."] - TooManyFields, - #[codec(index = 12)] - #[doc = "Maximum amount of registrars reached. Cannot add any more."] - TooManyRegistrars, - #[codec(index = 13)] - #[doc = "Account ID is already named."] - AlreadyClaimed, - #[codec(index = 14)] - #[doc = "Sender is not a sub-account."] - NotSub, - #[codec(index = 15)] - #[doc = "Sub-account isn't owned by sender."] - NotOwned, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A name was set or reset (which will remove all judgements)."] - IdentitySet { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 1)] - #[doc = "A name was cleared, and the given balance returned."] - IdentityCleared { - who: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "A name was removed and the given balance slashed."] - IdentityKilled { - who: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "A judgement was asked from a registrar."] - JudgementRequested { - who: ::subxt::sp_core::crypto::AccountId32, - registrar_index: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "A judgement request was retracted."] - JudgementUnrequested { - who: ::subxt::sp_core::crypto::AccountId32, - registrar_index: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "A judgement was given by a registrar."] - JudgementGiven { - target: ::subxt::sp_core::crypto::AccountId32, - registrar_index: ::core::primitive::u32, - }, - #[codec(index = 6)] - #[doc = "A registrar was added."] - RegistrarAdded { - registrar_index: ::core::primitive::u32, - }, - #[codec(index = 7)] - #[doc = "A sub-identity was added to an identity and the deposit paid."] - SubIdentityAdded { - sub: ::subxt::sp_core::crypto::AccountId32, - main: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, - #[codec(index = 8)] - #[doc = "A sub-identity was removed from an identity and the deposit freed."] - SubIdentityRemoved { - sub: ::subxt::sp_core::crypto::AccountId32, - main: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, - #[codec(index = 9)] - #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] - #[doc = "main identity account to the sub-identity account."] - SubIdentityRevoked { - sub: ::subxt::sp_core::crypto::AccountId32, - main: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, - } - } - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct BitFlags<_0>( - pub ::core::primitive::u64, - #[codec(skip)] pub ::core::marker::PhantomData<_0>, - ); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Data { - #[codec(index = 0)] - None, - #[codec(index = 1)] - Raw0([::core::primitive::u8; 0usize]), - #[codec(index = 2)] - Raw1([::core::primitive::u8; 1usize]), - #[codec(index = 3)] - Raw2([::core::primitive::u8; 2usize]), - #[codec(index = 4)] - Raw3([::core::primitive::u8; 3usize]), - #[codec(index = 5)] - Raw4([::core::primitive::u8; 4usize]), - #[codec(index = 6)] - Raw5([::core::primitive::u8; 5usize]), - #[codec(index = 7)] - Raw6([::core::primitive::u8; 6usize]), - #[codec(index = 8)] - Raw7([::core::primitive::u8; 7usize]), - #[codec(index = 9)] - Raw8([::core::primitive::u8; 8usize]), - #[codec(index = 10)] - Raw9([::core::primitive::u8; 9usize]), - #[codec(index = 11)] - Raw10([::core::primitive::u8; 10usize]), - #[codec(index = 12)] - Raw11([::core::primitive::u8; 11usize]), - #[codec(index = 13)] - Raw12([::core::primitive::u8; 12usize]), - #[codec(index = 14)] - Raw13([::core::primitive::u8; 13usize]), - #[codec(index = 15)] - Raw14([::core::primitive::u8; 14usize]), - #[codec(index = 16)] - Raw15([::core::primitive::u8; 15usize]), - #[codec(index = 17)] - Raw16([::core::primitive::u8; 16usize]), - #[codec(index = 18)] - Raw17([::core::primitive::u8; 17usize]), - #[codec(index = 19)] - Raw18([::core::primitive::u8; 18usize]), - #[codec(index = 20)] - Raw19([::core::primitive::u8; 19usize]), - #[codec(index = 21)] - Raw20([::core::primitive::u8; 20usize]), - #[codec(index = 22)] - Raw21([::core::primitive::u8; 21usize]), - #[codec(index = 23)] - Raw22([::core::primitive::u8; 22usize]), - #[codec(index = 24)] - Raw23([::core::primitive::u8; 23usize]), - #[codec(index = 25)] - Raw24([::core::primitive::u8; 24usize]), - #[codec(index = 26)] - Raw25([::core::primitive::u8; 25usize]), - #[codec(index = 27)] - Raw26([::core::primitive::u8; 26usize]), - #[codec(index = 28)] - Raw27([::core::primitive::u8; 27usize]), - #[codec(index = 29)] - Raw28([::core::primitive::u8; 28usize]), - #[codec(index = 30)] - Raw29([::core::primitive::u8; 29usize]), - #[codec(index = 31)] - Raw30([::core::primitive::u8; 30usize]), - #[codec(index = 32)] - Raw31([::core::primitive::u8; 31usize]), - #[codec(index = 33)] - Raw32([::core::primitive::u8; 32usize]), - #[codec(index = 34)] - BlakeTwo256([::core::primitive::u8; 32usize]), - #[codec(index = 35)] - Sha256([::core::primitive::u8; 32usize]), - #[codec(index = 36)] - Keccak256([::core::primitive::u8; 32usize]), - #[codec(index = 37)] - ShaThree256([::core::primitive::u8; 32usize]), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum IdentityField { - #[codec(index = 1)] - Display, - #[codec(index = 2)] - Legal, - #[codec(index = 4)] - Web, - #[codec(index = 8)] - Riot, - #[codec(index = 16)] - Email, - #[codec(index = 32)] - PgpFingerprint, - #[codec(index = 64)] - Image, - #[codec(index = 128)] - Twitter, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct IdentityInfo { - pub additional: - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - runtime_types::pallet_identity::types::Data, - runtime_types::pallet_identity::types::Data, - )>, - pub display: runtime_types::pallet_identity::types::Data, - pub legal: runtime_types::pallet_identity::types::Data, - pub web: runtime_types::pallet_identity::types::Data, - pub riot: runtime_types::pallet_identity::types::Data, - pub email: runtime_types::pallet_identity::types::Data, - pub pgp_fingerprint: - ::core::option::Option<[::core::primitive::u8; 20usize]>, - pub image: runtime_types::pallet_identity::types::Data, - pub twitter: runtime_types::pallet_identity::types::Data, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Judgement<_0> { - #[codec(index = 0)] - Unknown, - #[codec(index = 1)] - FeePaid(_0), - #[codec(index = 2)] - Reasonable, - #[codec(index = 3)] - KnownGood, - #[codec(index = 4)] - OutOfDate, - #[codec(index = 5)] - LowQuality, - #[codec(index = 6)] - Erroneous, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct RegistrarInfo<_0, _1> { - pub account: _1, - pub fee: _0, - pub fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Registration<_0> { - pub judgements: - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - ::core::primitive::u32, - runtime_types::pallet_identity::types::Judgement<_0>, - )>, - pub deposit: _0, - pub info: runtime_types::pallet_identity::types::IdentityInfo, - } - } - } - pub mod pallet_im_online { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "# "] # [doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] # [doc = " length of `heartbeat.network_state.external_address`"] # [doc = " - `O(K)`: decoding of length `K`"] # [doc = " - `O(E)`: decoding/encoding of length `E`"] # [doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] # [doc = " `ReceivedHeartbeats`"] # [doc = "- DbWrites: `ReceivedHeartbeats`"] # [doc = "# "] heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < :: core :: primitive :: u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Non existent public key."] - InvalidKey, - #[codec(index = 1)] - #[doc = "Duplicated heartbeat."] - DuplicatedHeartbeat, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new heartbeat was received from `AuthorityId`."] - HeartbeatReceived { - authority_id: - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - }, - #[codec(index = 1)] - #[doc = "At the end of the session, no offence was committed."] - AllGood, - #[codec(index = 2)] - #[doc = "At the end of the session, at least one validator was found to be offline."] - SomeOffline { - offline: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - )>, - }, - } - } - pub mod sr25519 { - use super::runtime_types; - pub mod app_sr25519 { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 > > , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Heartbeat<_0> { - pub block_number: _0, - pub network_state: runtime_types::sp_core::offchain::OpaqueNetworkState, - pub session_index: _0, - pub authority_index: _0, - pub validators_len: _0, - } - } - pub mod pallet_indices { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Assign an previously unassigned index."] - #[doc = ""] - #[doc = "Payment: `Deposit` is reserved from the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be claimed. This must not be in use."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - claim { index: ::core::primitive::u32 }, - #[codec(index = 1)] - #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] - #[doc = "is effectively transferred to the new account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One transfer operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (recipient)"] - #[doc = " - Writes: Indices Accounts, System Account (recipient)"] - #[doc = "# "] - transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Free up an index owned by the sender."] - #[doc = ""] - #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] - #[doc = ""] - #[doc = "- `index`: the index to be freed. This must be owned by the sender."] - #[doc = ""] - #[doc = "Emits `IndexFreed` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - free { index: ::core::primitive::u32 }, - #[codec(index = 3)] - #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] - #[doc = "held, then any deposit is reimbursed to its current owner."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `index`: the index to be (re-)assigned."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (original owner)"] - #[doc = " - Writes: Indices Accounts, System Account (original owner)"] - #[doc = "# "] - force_transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - freeze: ::core::primitive::bool, - }, - #[codec(index = 4)] - #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] - #[doc = "deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "- `index`: the index to be frozen in place."] - #[doc = ""] - #[doc = "Emits `IndexFrozen` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one slash operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - freeze { index: ::core::primitive::u32 }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The index was not already assigned."] - NotAssigned, - #[codec(index = 1)] - #[doc = "The index is assigned to another account."] - NotOwner, - #[codec(index = 2)] - #[doc = "The index was not available."] - InUse, - #[codec(index = 3)] - #[doc = "The source and destination accounts are identical."] - NotTransfer, - #[codec(index = 4)] - #[doc = "The index is permanent and may not be freed/changed."] - Permanent, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A account index was assigned."] - IndexAssigned { - who: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "A account index has been freed up (unassigned)."] - IndexFreed { index: ::core::primitive::u32 }, - #[codec(index = 2)] - #[doc = "A account index has been frozen to its current account ID."] - IndexFrozen { - index: ::core::primitive::u32, - who: ::subxt::sp_core::crypto::AccountId32, - }, - } - } - } - pub mod pallet_membership { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Add a member `who` to the set."] - #[doc = ""] - #[doc = "May only be called from `T::AddOrigin`."] - add_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 1)] - #[doc = "Remove a member `who` from the set."] - #[doc = ""] - #[doc = "May only be called from `T::RemoveOrigin`."] - remove_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 2)] - #[doc = "Swap out one member `remove` for another `add`."] - #[doc = ""] - #[doc = "May only be called from `T::SwapOrigin`."] - #[doc = ""] - #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] - swap_member { - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 3)] - #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] - #[doc = "pass `members` pre-sorted."] - #[doc = ""] - #[doc = "May only be called from `T::ResetOrigin`."] - reset_members { - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 4)] - #[doc = "Swap out the sending member for some other key `new`."] - #[doc = ""] - #[doc = "May only be called from `Signed` origin of a current member."] - #[doc = ""] - #[doc = "Prime membership is passed from the origin account to `new`, if extant."] - change_key { - new: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 5)] - #[doc = "Set the prime member. Must be a current member."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - set_prime { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 6)] - #[doc = "Remove the prime member if it exists."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - clear_prime, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Already a member."] - AlreadyMember, - #[codec(index = 1)] - #[doc = "Not a member."] - NotMember, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "The given member was added; see the transaction for who."] - MemberAdded, - #[codec(index = 1)] - #[doc = "The given member was removed; see the transaction for who."] - MemberRemoved, - #[codec(index = 2)] - #[doc = "Two members were swapped; see the transaction for who."] - MembersSwapped, - #[codec(index = 3)] - #[doc = "The membership was reset; see the transaction for who the new set is."] - MembersReset, - #[codec(index = 4)] - #[doc = "One of the members' keys changed."] - KeyChanged, - #[codec(index = 5)] - #[doc = "Phantom member, never used."] - Dummy, - } - } - } - pub mod pallet_multisig { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = "multi-signature, but do not participate in the approval process."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result."] - #[doc = ""] - #[doc = "# "] - #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight: None"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - as_multi_threshold_1 { - other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - call: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "If there are enough, then dispatch the call."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] - #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] - #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] - #[doc = "may be found in the deposited `MultisigExecuted` event."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S + Z + Call)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- The weight of the `call`."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - as_multi { - threshold: ::core::primitive::u16, - other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - >, - call: ::subxt::WrapperKeepOpaque< - runtime_types::polkadot_runtime::Call, - >, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - }, - #[codec(index = 2)] - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account]"] - #[doc = " - Write: Multisig Storage, [Caller Account]"] - #[doc = "# "] - approve_as_multi { - threshold: ::core::primitive::u16, - other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - >, - call_hash: [::core::primitive::u8; 32usize], - max_weight: ::core::primitive::u64, - }, - #[codec(index = 3)] - #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] - #[doc = "for this operation will be unreserved on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] - #[doc = "transaction for this dispatch."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- One event."] - #[doc = "- I/O: 1 read `O(S)`, one remove."] - #[doc = "- Storage: removes one item."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = "# "] - cancel_as_multi { - threshold: ::core::primitive::u16, - other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - call_hash: [::core::primitive::u8; 32usize], - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Threshold must be 2 or greater."] - MinimumThreshold, - #[codec(index = 1)] - #[doc = "Call is already approved by this signatory."] - AlreadyApproved, - #[codec(index = 2)] - #[doc = "Call doesn't need any (more) approvals."] - NoApprovalsNeeded, - #[codec(index = 3)] - #[doc = "There are too few signatories in the list."] - TooFewSignatories, - #[codec(index = 4)] - #[doc = "There are too many signatories in the list."] - TooManySignatories, - #[codec(index = 5)] - #[doc = "The signatories were provided out of order; they should be ordered."] - SignatoriesOutOfOrder, - #[codec(index = 6)] - #[doc = "The sender was contained in the other signatories; it shouldn't be."] - SenderInSignatories, - #[codec(index = 7)] - #[doc = "Multisig operation not found when attempting to cancel."] - NotFound, - #[codec(index = 8)] - #[doc = "Only the account that originally created the multisig is able to cancel it."] - NotOwner, - #[codec(index = 9)] - #[doc = "No timepoint was given, yet the multisig operation is already underway."] - NoTimepoint, - #[codec(index = 10)] - #[doc = "A different timepoint was given to the multisig operation that is underway."] - WrongTimepoint, - #[codec(index = 11)] - #[doc = "A timepoint was given, yet no multisig operation is underway."] - UnexpectedTimepoint, - #[codec(index = 12)] - #[doc = "The maximum weight information provided was too low."] - MaxWeightTooLow, - #[codec(index = 13)] - #[doc = "The data to be stored is already stored."] - AlreadyStored, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new multisig operation has begun."] - NewMultisig { - approving: ::subxt::sp_core::crypto::AccountId32, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - }, - #[codec(index = 1)] - #[doc = "A multisig operation has been approved by someone."] - MultisigApproval { - approving: ::subxt::sp_core::crypto::AccountId32, - timepoint: runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - }, - #[codec(index = 2)] - #[doc = "A multisig operation has been executed."] - MultisigExecuted { - approving: ::subxt::sp_core::crypto::AccountId32, - timepoint: runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - result: ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - }, - #[codec(index = 3)] - #[doc = "A multisig operation has been cancelled."] - MultisigCancelled { - cancelling: ::subxt::sp_core::crypto::AccountId32, - timepoint: runtime_types::pallet_multisig::Timepoint< - ::core::primitive::u32, - >, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Multisig<_0, _1, _2> { - pub when: runtime_types::pallet_multisig::Timepoint<_0>, - pub deposit: _1, - pub depositor: _2, - pub approvals: ::std::vec::Vec<_2>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Timepoint<_0> { - pub height: _0, - pub index: _0, - } - } - pub mod pallet_offences { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] - #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] - #[doc = "\\[kind, timeslot\\]."] - Offence { - kind: [::core::primitive::u8; 16usize], - timeslot: ::std::vec::Vec<::core::primitive::u8>, - }, - } - } - } - pub mod pallet_preimage { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - note_preimage { - bytes: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Clear an unrequested preimage from the runtime storage."] - unnote_preimage { hash: ::subxt::sp_core::H256 }, - #[codec(index = 2)] - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - request_preimage { hash: ::subxt::sp_core::H256 }, - #[codec(index = 3)] - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - unrequest_preimage { hash: ::subxt::sp_core::H256 }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Preimage is too large to store on-chain."] - TooLarge, - #[codec(index = 1)] - #[doc = "Preimage has already been noted on-chain."] - AlreadyNoted, - #[codec(index = 2)] - #[doc = "The user is not authorized to perform this action."] - NotAuthorized, - #[codec(index = 3)] - #[doc = "The preimage cannot be removed since it has not yet been noted."] - NotNoted, - #[codec(index = 4)] - #[doc = "A preimage may not be removed when there are outstanding requests."] - Requested, - #[codec(index = 5)] - #[doc = "The preimage request cannot be removed since no outstanding requests exist."] - NotRequested, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A preimage has been noted."] - Noted { hash: ::subxt::sp_core::H256 }, - #[codec(index = 1)] - #[doc = "A preimage has been requested."] - Requested { hash: ::subxt::sp_core::H256 }, - #[codec(index = 2)] - #[doc = "A preimage has ben cleared."] - Cleared { hash: ::subxt::sp_core::H256 }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum RequestStatus<_0, _1> { - #[codec(index = 0)] - Unrequested(::core::option::Option<(_0, _1)>), - #[codec(index = 1)] - Requested(::core::primitive::u32), - } - } - pub mod pallet_proxy { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - proxy { - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::polkadot_runtime::ProxyType, - >, - call: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] - #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - add_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Unregister a proxy account for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] - #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - remove_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Unregister all proxy accounts for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] - #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - remove_proxies, - #[codec(index = 4)] - #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] - #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] - #[doc = ""] - #[doc = "Requires a `Signed` origin."] - #[doc = ""] - #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] - #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] - #[doc = "allow for maximum flexibility."] - #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] - #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] - #[doc = "want to use `0`."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] - #[doc = "same sender, with the same parameters."] - #[doc = ""] - #[doc = "Fails if there are insufficient funds to pay for deposit."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - #[doc = "TODO: Might be over counting 1 read"] - anonymous { - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - }, - #[codec(index = 5)] - #[doc = "Removes a previously spawned anonymous proxy."] - #[doc = ""] - #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] - #[doc = "inaccessible."] - #[doc = ""] - #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`anonymous` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] - #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] - #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] - #[doc = "account whose `anonymous` call has corresponding parameters."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - kill_anonymous { - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - index: ::core::primitive::u16, - #[codec(compact)] - height: ::core::primitive::u32, - #[codec(compact)] - ext_index: ::core::primitive::u32, - }, - #[codec(index = 6)] - #[doc = "Publish the hash of a proxy-call that will be made in the future."] - #[doc = ""] - #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] - #[doc = "if the delay associated with the proxy relationship is greater than zero."] - #[doc = ""] - #[doc = "No more than `MaxPending` announcements may be made at any one time."] - #[doc = ""] - #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] - #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - announce { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 7)] - #[doc = "Remove a given announcement."] - #[doc = ""] - #[doc = "May be called by a proxy account to remove a call they previously announced and return"] - #[doc = "the deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - remove_announcement { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 8)] - #[doc = "Remove the given announcement of a delegate."] - #[doc = ""] - #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] - #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `delegate`: The account that previously announced the call."] - #[doc = "- `call_hash`: The hash of the call to be made."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - reject_announcement { - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 9)] - #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - proxy_announced { - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::polkadot_runtime::ProxyType, - >, - call: ::std::boxed::Box, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "There are too many proxies registered or too many announcements pending."] - TooMany, - #[codec(index = 1)] - #[doc = "Proxy registration not found."] - NotFound, - #[codec(index = 2)] - #[doc = "Sender is not a proxy of the account to be proxied."] - NotProxy, - #[codec(index = 3)] - #[doc = "A call which is incompatible with the proxy type's filter was attempted."] - Unproxyable, - #[codec(index = 4)] - #[doc = "Account is already a proxy."] - Duplicate, - #[codec(index = 5)] - #[doc = "Call may not be made by proxy because it may escalate its privileges."] - NoPermission, - #[codec(index = 6)] - #[doc = "Announcement, if made at all, was made too recently."] - Unannounced, - #[codec(index = 7)] - #[doc = "Cannot add self as proxy."] - NoSelfProxy, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A proxy was executed correctly, with the given."] - ProxyExecuted { - result: ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - }, - #[codec(index = 1)] - #[doc = "Anonymous account has been created by new proxy with given"] - #[doc = "disambiguation index and proxy type."] - AnonymousCreated { - anonymous: ::subxt::sp_core::crypto::AccountId32, - who: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - disambiguation_index: ::core::primitive::u16, - }, - #[codec(index = 2)] - #[doc = "An announcement was placed to make a call in the future."] - Announced { - real: ::subxt::sp_core::crypto::AccountId32, - proxy: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 3)] - #[doc = "A proxy was added."] - ProxyAdded { - delegator: ::subxt::sp_core::crypto::AccountId32, - delegatee: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "A proxy was removed."] - ProxyRemoved { - delegator: ::subxt::sp_core::crypto::AccountId32, - delegatee: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Announcement<_0, _1, _2> { - pub real: _0, - pub call_hash: _1, - pub height: _2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ProxyDefinition<_0, _1, _2> { - pub delegate: _0, - pub proxy_type: _1, - pub delay: _2, - } - } - pub mod pallet_scheduler { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Anonymously schedule a task."] - schedule { - when: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - }, - #[codec(index = 1)] - #[doc = "Cancel an anonymously scheduled task."] - cancel { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Schedule a named task."] - schedule_named { - id: ::std::vec::Vec<::core::primitive::u8>, - when: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - }, - #[codec(index = 3)] - #[doc = "Cancel a named scheduled task."] - cancel_named { - id: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 4)] - #[doc = "Anonymously schedule a task after a delay."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`schedule`]."] - #[doc = "# "] - schedule_after { - after: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - }, - #[codec(index = 5)] - #[doc = "Schedule a named task after a delay."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`schedule_named`](Self::schedule_named)."] - #[doc = "# "] - schedule_named_after { - id: ::std::vec::Vec<::core::primitive::u8>, - after: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::Call, - ::subxt::sp_core::H256, - >, - >, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Failed to schedule a call"] - FailedToSchedule, - #[codec(index = 1)] - #[doc = "Cannot find the scheduled call."] - NotFound, - #[codec(index = 2)] - #[doc = "Given target block number is in the past."] - TargetBlockNumberInPast, - #[codec(index = 3)] - #[doc = "Reschedule failed because it does not change scheduled time."] - RescheduleNoChange, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Scheduled some task."] - Scheduled { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Canceled some task."] - Canceled { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Dispatched some task."] - Dispatched { - task: (::core::primitive::u32, ::core::primitive::u32), - id: ::core::option::Option< - ::std::vec::Vec<::core::primitive::u8>, - >, - result: ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - }, - #[codec(index = 3)] - #[doc = "The call for the provided hash was not found so the task has been aborted."] - CallLookupFailed { - task: (::core::primitive::u32, ::core::primitive::u32), - id: ::core::option::Option< - ::std::vec::Vec<::core::primitive::u8>, - >, - error: - runtime_types::frame_support::traits::schedule::LookupError, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ScheduledV3<_0, _1, _2, _3> { - pub maybe_id: - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - pub priority: ::core::primitive::u8, - pub call: _0, - pub maybe_periodic: ::core::option::Option<(_1, _1)>, - pub origin: _2, - #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, - } - } - pub mod pallet_session { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Sets the session key(s) of the function caller to `keys`."] - #[doc = "Allows an account to set its session key prior to becoming a validator."] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be signed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] - #[doc = " `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] - #[doc = "- DbWrites: `origin account`, `NextKeys`"] - #[doc = "- DbReads per key id: `KeyOwner`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - set_keys { - keys: runtime_types::polkadot_runtime::SessionKeys, - proof: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Removes any session key(s) of the function caller."] - #[doc = ""] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] - #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] - #[doc = "means being a controller account) or directly convertible into a validator ID (which"] - #[doc = "usually means being a stash account)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] - #[doc = " of `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] - #[doc = "- DbWrites: `NextKeys`, `origin account`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - purge_keys, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Invalid ownership proof."] - InvalidProof, - #[codec(index = 1)] - #[doc = "No associated validator ID for account."] - NoAssociatedValidatorId, - #[codec(index = 2)] - #[doc = "Registered duplicate key."] - DuplicatedKey, - #[codec(index = 3)] - #[doc = "No keys are associated with this account."] - NoKeys, - #[codec(index = 4)] - #[doc = "Key setting account is not live, so it's impossible to associate keys."] - NoAccount, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "New session has happened. Note that the argument is the session index, not the"] - #[doc = "block number as the type might suggest."] - NewSession { - session_index: ::core::primitive::u32, - }, - } - } - } - pub mod pallet_staking { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] - #[doc = "be the account that controls it."] - #[doc = ""] - #[doc = "`value` must be more than the `minimum_balance` specified by `T::Currency`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the stash account."] - #[doc = ""] - #[doc = "Emits `Bonded`."] - #[doc = "# "] - #[doc = "- Independent of the arguments. Moderate complexity."] - #[doc = "- O(1)."] - #[doc = "- Three extra DB entries."] - #[doc = ""] - #[doc = "NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned"] - #[doc = "unless the `origin` falls below _existential deposit_ and gets removed as dust."] - #[doc = "------------------"] - #[doc = "# "] - bond { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - #[codec(index = 1)] - #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] - #[doc = "for staking."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] - #[doc = ""] - #[doc = "Use this if there are additional funds in your stash account that you wish to bond."] - #[doc = "Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose"] - #[doc = "any limitation on the amount that can be added."] - #[doc = ""] - #[doc = "Emits `Bonded`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- O(1)."] - #[doc = "# "] - bond_extra { - #[codec(compact)] - max_additional: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] - #[doc = "period ends. If this leaves an amount actively bonded less than"] - #[doc = "T::Currency::minimum_balance(), then it is increased to the full amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "Once the unlock period is done, you can call `withdraw_unbonded` to actually move"] - #[doc = "the funds out of management ready for transfer."] - #[doc = ""] - #[doc = "No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)"] - #[doc = "can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need"] - #[doc = "to be called first to remove some of the chunks (if possible)."] - #[doc = ""] - #[doc = "If a user encounters the `InsufficientBond` error when calling this extrinsic,"] - #[doc = "they should call `chill` first in order to free up their bonded funds."] - #[doc = ""] - #[doc = "Emits `Unbonded`."] - #[doc = ""] - #[doc = "See also [`Call::withdraw_unbonded`]."] - unbond { - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] - #[doc = ""] - #[doc = "This essentially frees up that balance to be used by the stash account to do"] - #[doc = "whatever it wants."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller."] - #[doc = ""] - #[doc = "Emits `Withdrawn`."] - #[doc = ""] - #[doc = "See also [`Call::unbond`]."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity O(S) where S is the number of slashing spans to remove"] - #[doc = "NOTE: Weight annotation is the kill scenario, we refund otherwise."] - #[doc = "# "] - withdraw_unbonded { - num_slashing_spans: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "Declare the desire to validate for the origin controller."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - validate { - prefs: runtime_types::pallet_staking::ValidatorPrefs, - }, - #[codec(index = 5)] - #[doc = "Declare the desire to nominate `targets` for the origin controller."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "# "] - #[doc = "- The transaction's complexity is proportional to the size of `targets` (N)"] - #[doc = "which is capped at CompactAssignments::LIMIT (T::MaxNominations)."] - #[doc = "- Both the reads and writes follow a similar pattern."] - #[doc = "# "] - nominate { - targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - }, - #[codec(index = 6)] - #[doc = "Declare no desire to either validate or nominate."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- Contains one read."] - #[doc = "- Writes are limited to the `origin` account key."] - #[doc = "# "] - chill, - #[codec(index = 7)] - #[doc = "(Re-)set the payment target for a controller."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- Contains a limited number of reads."] - #[doc = "- Writes are limited to the `origin` account key."] - #[doc = "---------"] - #[doc = "- Weight: O(1)"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Ledger"] - #[doc = " - Write: Payee"] - #[doc = "# "] - set_payee { - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - #[codec(index = 8)] - #[doc = "(Re-)set the controller of a stash."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Independent of the arguments. Insignificant complexity."] - #[doc = "- Contains a limited number of reads."] - #[doc = "- Writes are limited to the `origin` account key."] - #[doc = "----------"] - #[doc = "Weight: O(1)"] - #[doc = "DB Weight:"] - #[doc = "- Read: Bonded, Ledger New Controller, Ledger Old Controller"] - #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] - #[doc = "# "] - set_controller { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 9)] - #[doc = "Sets the ideal number of validators."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight: O(1)"] - #[doc = "Write: Validator Count"] - #[doc = "# "] - set_validator_count { - #[codec(compact)] - new: ::core::primitive::u32, - }, - #[codec(index = 10)] - #[doc = "Increments the ideal number of validators."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`Self::set_validator_count`]."] - #[doc = "# "] - increase_validator_count { - #[codec(compact)] - additional: ::core::primitive::u32, - }, - #[codec(index = 11)] - #[doc = "Scale up the ideal number of validators by a factor."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# "] - #[doc = "Same as [`Self::set_validator_count`]."] - #[doc = "# "] - scale_validator_count { - factor: runtime_types::sp_arithmetic::per_things::Percent, - }, - #[codec(index = 12)] - #[doc = "Force there to be no new eras indefinitely."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# Warning"] - #[doc = ""] - #[doc = "The election process starts multiple blocks before the end of the era."] - #[doc = "Thus the election process may be ongoing when this is called. In this case the"] - #[doc = "election will continue until the next era is triggered."] - #[doc = ""] - #[doc = "# "] - #[doc = "- No arguments."] - #[doc = "- Weight: O(1)"] - #[doc = "- Write: ForceEra"] - #[doc = "# "] - force_no_eras, - #[codec(index = 13)] - #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] - #[doc = "reset to normal (non-forced) behaviour."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# Warning"] - #[doc = ""] - #[doc = "The election process starts multiple blocks before the end of the era."] - #[doc = "If this is called just before a new era is triggered, the election process may not"] - #[doc = "have enough blocks to get a result."] - #[doc = ""] - #[doc = "# "] - #[doc = "- No arguments."] - #[doc = "- Weight: O(1)"] - #[doc = "- Write ForceEra"] - #[doc = "# "] - force_new_era, - #[codec(index = 14)] - #[doc = "Set the validators who cannot be slashed (if any)."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - set_invulnerables { - invulnerables: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 15)] - #[doc = "Force a current staker to become completely unstaked, immediately."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - force_unstake { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - }, - #[codec(index = 16)] - #[doc = "Force there to be a new era at the end of sessions indefinitely."] - #[doc = ""] - #[doc = "The dispatch origin must be Root."] - #[doc = ""] - #[doc = "# Warning"] - #[doc = ""] - #[doc = "The election process starts multiple blocks before the end of the era."] - #[doc = "If this is called just before a new era is triggered, the election process may not"] - #[doc = "have enough blocks to get a result."] - force_new_era_always, - #[codec(index = 17)] - #[doc = "Cancel enactment of a deferred slash."] - #[doc = ""] - #[doc = "Can be called by the `T::SlashCancelOrigin`."] - #[doc = ""] - #[doc = "Parameters: era and indices of the slashes for that era to kill."] - cancel_deferred_slash { - era: ::core::primitive::u32, - slash_indices: ::std::vec::Vec<::core::primitive::u32>, - }, - #[codec(index = 18)] - #[doc = "Pay out all the stakers behind a single validator for a single era."] - #[doc = ""] - #[doc = "- `validator_stash` is the stash account of the validator. Their nominators, up to"] - #[doc = " `T::MaxNominatorRewardedPerValidator`, will also receive their rewards."] - #[doc = "- `era` may be any era between `[current_era - history_depth; current_era]`."] - #[doc = ""] - #[doc = "The origin of this call must be _Signed_. Any account can call this function, even if"] - #[doc = "it is not one of the stakers."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Time complexity: at most O(MaxNominatorRewardedPerValidator)."] - #[doc = "- Contains a limited number of reads and writes."] - #[doc = "-----------"] - #[doc = "N is the Number of payouts for the validator (including the validator)"] - #[doc = "Weight:"] - #[doc = "- Reward Destination Staked: O(N)"] - #[doc = "- Reward Destination Controller (Creating): O(N)"] - #[doc = ""] - #[doc = " NOTE: weights are assuming that payouts are made to alive stash account (Staked)."] - #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] - #[doc = "# "] - payout_stakers { - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: ::core::primitive::u32, - }, - #[codec(index = 19)] - #[doc = "Rebond a portion of the stash scheduled to be unlocked."] - #[doc = ""] - #[doc = "The dispatch origin must be signed by the controller."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Time complexity: O(L), where L is unlocking chunks"] - #[doc = "- Bounded by `MaxUnlockingChunks`."] - #[doc = "- Storage changes: Can't increase storage, only decrease it."] - #[doc = "# "] - rebond { - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 20)] - #[doc = "Set `HistoryDepth` value. This function will delete any history information"] - #[doc = "when `HistoryDepth` is reduced."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `new_history_depth`: The new history depth you would like to set."] - #[doc = "- `era_items_deleted`: The number of items that will be deleted by this dispatch. This"] - #[doc = " should report all the storage items that will be deleted by clearing old era history."] - #[doc = " Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an"] - #[doc = " accurate number."] - #[doc = ""] - #[doc = "Origin must be root."] - #[doc = ""] - #[doc = "# "] - #[doc = "- E: Number of history depths removed, i.e. 10 -> 7 = 3"] - #[doc = "- Weight: O(E)"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Current Era, History Depth"] - #[doc = " - Writes: History Depth"] - #[doc = " - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs"] - #[doc = " - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,"] - #[doc = " ErasStartSessionIndex"] - #[doc = "# "] - set_history_depth { - #[codec(compact)] - new_history_depth: ::core::primitive::u32, - #[codec(compact)] - era_items_deleted: ::core::primitive::u32, - }, - #[codec(index = 21)] - #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] - #[doc = "be considered `dust` in the staking system. The requirements are:"] - #[doc = ""] - #[doc = "1. the `total_balance` of the stash is below existential deposit."] - #[doc = "2. or, the `ledger.total` of the stash is below existential deposit."] - #[doc = ""] - #[doc = "The former can happen in cases like a slash; the latter when a fully unbonded account"] - #[doc = "is still receiving staking rewards in `RewardDestination::Staked`."] - #[doc = ""] - #[doc = "It can be called by anyone, as long as `stash` meets the above requirements."] - #[doc = ""] - #[doc = "Refunds the transaction fees upon successful execution."] - reap_stash { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - }, - #[codec(index = 22)] - #[doc = "Remove the given nominations from the calling validator."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] - #[doc = ""] - #[doc = "- `who`: A list of nominator stash accounts who are nominating this validator which"] - #[doc = " should no longer be nominating this validator."] - #[doc = ""] - #[doc = "Note: Making this call only makes sense if you first set the validator preferences to"] - #[doc = "block any further nominations."] - kick { - who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - }, - #[codec(index = 23)] - #[doc = "Update the various staking configurations ."] - #[doc = ""] - #[doc = "* `min_nominator_bond`: The minimum active bond needed to be a nominator."] - #[doc = "* `min_validator_bond`: The minimum active bond needed to be a validator."] - #[doc = "* `max_nominator_count`: The max number of users who can be a nominator at once. When"] - #[doc = " set to `None`, no limit is enforced."] - #[doc = "* `max_validator_count`: The max number of users who can be a validator at once. When"] - #[doc = " set to `None`, no limit is enforced."] - #[doc = "* `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which"] - #[doc = " should be filled in order for the `chill_other` transaction to work."] - #[doc = "* `min_commission`: The minimum amount of commission that each validators must maintain."] - #[doc = " This is checked only upon calling `validate`. Existing validators are not affected."] - #[doc = ""] - #[doc = "Origin must be Root to call this function."] - #[doc = ""] - #[doc = "NOTE: Existing nominators and validators will not be affected by this update."] - #[doc = "to kick people under the new limits, `chill_other` should be called."] - set_staking_configs { - min_nominator_bond: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u128, - >, - min_validator_bond: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u128, - >, - max_nominator_count: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u32, - >, - max_validator_count: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - ::core::primitive::u32, - >, - chill_threshold: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - runtime_types::sp_arithmetic::per_things::Percent, - >, - min_commission: - runtime_types::pallet_staking::pallet::pallet::ConfigOp< - runtime_types::sp_arithmetic::per_things::Perbill, - >, - }, - #[codec(index = 24)] - #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] - #[doc = ""] - #[doc = "Effects will be felt at the beginning of the next era."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_, but can be called by anyone."] - #[doc = ""] - #[doc = "If the caller is the same as the controller being targeted, then no further checks are"] - #[doc = "enforced, and this function behaves just like `chill`."] - #[doc = ""] - #[doc = "If the caller is different than the controller being targeted, the following conditions"] - #[doc = "must be met:"] - #[doc = ""] - #[doc = "* `controller` must belong to a nominator who has become non-decodable,"] - #[doc = ""] - #[doc = "Or:"] - #[doc = ""] - #[doc = "* A `ChillThreshold` must be set and checked which defines how close to the max"] - #[doc = " nominators or validators we must reach before users can start chilling one-another."] - #[doc = "* A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine"] - #[doc = " how close we are to the threshold."] - #[doc = "* A `MinNominatorBond` and `MinValidatorBond` must be set and checked, which determines"] - #[doc = " if this is a person that should be chilled because they have not met the threshold"] - #[doc = " bond required."] - #[doc = ""] - #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] - #[doc = "who do not satisfy these requirements."] - chill_other { - controller: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 25)] - #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] - #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] - #[doc = "can call this."] - force_apply_min_commission { - validator_stash: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum ConfigOp<_0> { - #[codec(index = 0)] - Noop, - #[codec(index = 1)] - Set(_0), - #[codec(index = 2)] - Remove, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Not a controller account."] - NotController, - #[codec(index = 1)] - #[doc = "Not a stash account."] - NotStash, - #[codec(index = 2)] - #[doc = "Stash is already bonded."] - AlreadyBonded, - #[codec(index = 3)] - #[doc = "Controller is already paired."] - AlreadyPaired, - #[codec(index = 4)] - #[doc = "Targets cannot be empty."] - EmptyTargets, - #[codec(index = 5)] - #[doc = "Duplicate index."] - DuplicateIndex, - #[codec(index = 6)] - #[doc = "Slash record index out of bounds."] - InvalidSlashIndex, - #[codec(index = 7)] - #[doc = "Cannot have a validator or nominator role, with value less than the minimum defined by"] - #[doc = "governance (see `MinValidatorBond` and `MinNominatorBond`). If unbonding is the"] - #[doc = "intention, `chill` first to remove one's role as validator/nominator."] - InsufficientBond, - #[codec(index = 8)] - #[doc = "Can not schedule more unlock chunks."] - NoMoreChunks, - #[codec(index = 9)] - #[doc = "Can not rebond without unlocking chunks."] - NoUnlockChunk, - #[codec(index = 10)] - #[doc = "Attempting to target a stash that still has funds."] - FundedTarget, - #[codec(index = 11)] - #[doc = "Invalid era to reward."] - InvalidEraToReward, - #[codec(index = 12)] - #[doc = "Invalid number of nominations."] - InvalidNumberOfNominations, - #[codec(index = 13)] - #[doc = "Items are not sorted and unique."] - NotSortedAndUnique, - #[codec(index = 14)] - #[doc = "Rewards for this era have already been claimed for this validator."] - AlreadyClaimed, - #[codec(index = 15)] - #[doc = "Incorrect previous history depth input provided."] - IncorrectHistoryDepth, - #[codec(index = 16)] - #[doc = "Incorrect number of slashing spans provided."] - IncorrectSlashingSpans, - #[codec(index = 17)] - #[doc = "Internal state has become somehow corrupted and the operation cannot continue."] - BadState, - #[codec(index = 18)] - #[doc = "Too many nomination targets supplied."] - TooManyTargets, - #[codec(index = 19)] - #[doc = "A nomination target was supplied that was blocked or otherwise not a validator."] - BadTarget, - #[codec(index = 20)] - #[doc = "The user has enough bond and thus cannot be chilled forcefully by an external person."] - CannotChillOther, - #[codec(index = 21)] - #[doc = "There are too many nominators in the system. Governance needs to adjust the staking"] - #[doc = "settings to keep things safe for the runtime."] - TooManyNominators, - #[codec(index = 22)] - #[doc = "There are too many validators in the system. Governance needs to adjust the staking"] - #[doc = "settings to keep things safe for the runtime."] - TooManyValidators, - #[codec(index = 23)] - #[doc = "Commission is too low. Must be at least `MinCommission`."] - CommissionTooLow, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] - #[doc = "the remainder from the maximum amount of reward."] - #[doc = "\\[era_index, validator_payout, remainder\\]"] - EraPaid( - ::core::primitive::u32, - ::core::primitive::u128, - ::core::primitive::u128, - ), - #[codec(index = 1)] - #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] - Rewarded( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 2)] - #[doc = "One validator (and its nominators) has been slashed by the given amount."] - #[doc = "\\[validator, amount\\]"] - Slashed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 3)] - #[doc = "An old slashing report from a prior era was discarded because it could"] - #[doc = "not be processed. \\[session_index\\]"] - OldSlashingReportDiscarded(::core::primitive::u32), - #[codec(index = 4)] - #[doc = "A new set of stakers was elected."] - StakersElected, - #[codec(index = 5)] - #[doc = "An account has bonded this amount. \\[stash, amount\\]"] - #[doc = ""] - #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] - #[doc = "it will not be emitted for staking rewards when they are added to stake."] - Bonded( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 6)] - #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] - Unbonded( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 7)] - #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] - #[doc = "from the unlocking queue. \\[stash, amount\\]"] - Withdrawn( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 8)] - #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] - Kicked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - #[codec(index = 9)] - #[doc = "The election failed. No new era is planned."] - StakingElectionFailed, - #[codec(index = 10)] - #[doc = "An account has stopped participating as either a validator or nominator."] - #[doc = "\\[stash\\]"] - Chilled(::subxt::sp_core::crypto::AccountId32), - #[codec(index = 11)] - #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] - PayoutStarted( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - } - } - } - pub mod slashing { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct SlashingSpans { - pub span_index: ::core::primitive::u32, - pub last_start: ::core::primitive::u32, - pub last_nonzero_slash: ::core::primitive::u32, - pub prior: ::std::vec::Vec<::core::primitive::u32>, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct SpanRecord<_0> { - pub slashed: _0, - pub paid_out: _0, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ActiveEraInfo { - pub index: ::core::primitive::u32, - pub start: ::core::option::Option<::core::primitive::u64>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct EraRewardPoints<_0> { - pub total: ::core::primitive::u32, - pub individual: ::subxt::KeyedVec<_0, ::core::primitive::u32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Exposure<_0, _1> { - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub own: _1, - pub others: ::std::vec::Vec< - runtime_types::pallet_staking::IndividualExposure<_0, _1>, - >, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Forcing { - #[codec(index = 0)] - NotForcing, - #[codec(index = 1)] - ForceNew, - #[codec(index = 2)] - ForceNone, - #[codec(index = 3)] - ForceAlways, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct IndividualExposure<_0, _1> { - pub who: _0, - #[codec(compact)] - pub value: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Nominations { - pub targets: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - pub submitted_in: ::core::primitive::u32, - pub suppressed: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1_0_0Ancient, - #[codec(index = 1)] - V2_0_0, - #[codec(index = 2)] - V3_0_0, - #[codec(index = 3)] - V4_0_0, - #[codec(index = 4)] - V5_0_0, - #[codec(index = 5)] - V6_0_0, - #[codec(index = 6)] - V7_0_0, - #[codec(index = 7)] - V8_0_0, - #[codec(index = 8)] - V9_0_0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum RewardDestination<_0> { - #[codec(index = 0)] - Staked, - #[codec(index = 1)] - Stash, - #[codec(index = 2)] - Controller, - #[codec(index = 3)] - Account(_0), - #[codec(index = 4)] - None, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct StakingLedger<_0, _1> { - pub stash: _0, - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub active: _1, - pub unlocking: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_staking::UnlockChunk<_1>, - >, - pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct UnappliedSlash<_0, _1> { - pub validator: _0, - pub own: _1, - pub others: ::std::vec::Vec<(_0, _1)>, - pub reporters: ::std::vec::Vec<_0>, - pub payout: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct UnlockChunk<_0> { - #[codec(compact)] - pub value: _0, - #[codec(compact)] - pub era: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ValidatorPrefs { - #[codec(compact)] - pub commission: runtime_types::sp_arithmetic::per_things::Perbill, - pub blocked: ::core::primitive::bool, - } - } - pub mod pallet_timestamp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the current time."] - #[doc = ""] - #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] - #[doc = "phase, if this call hasn't been invoked by that time."] - #[doc = ""] - #[doc = "The timestamp should be greater than the previous one by the amount specified by"] - #[doc = "`MinimumPeriod`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Inherent`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] - #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] - #[doc = " `on_finalize`)"] - #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] - #[doc = "# "] - set { - #[codec(compact)] - now: ::core::primitive::u64, - }, - } - } - } - pub mod pallet_tips { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] - #[doc = "`DataDepositPerByte` for each byte in `reason`."] - #[doc = ""] - #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] - #[doc = " a UTF-8-encoded URL."] - #[doc = "- `who`: The account which should be credited for the tip."] - #[doc = ""] - #[doc = "Emits `NewTip` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(R)` where `R` length of `reason`."] - #[doc = " - encoding and hashing of 'reason'"] - #[doc = "- DbReads: `Reasons`, `Tips`"] - #[doc = "- DbWrites: `Reasons`, `Tips`"] - #[doc = "# "] - report_awesome { - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 1)] - #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] - #[doc = ""] - #[doc = "If successful, the original deposit will be unreserved."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the tip identified by `hash`"] - #[doc = "must have been reported by the signing account through `report_awesome` (and not"] - #[doc = "through `tip_new`)."] - #[doc = ""] - #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] - #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] - #[doc = ""] - #[doc = "Emits `TipRetracted` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)`"] - #[doc = " - Depends on the length of `T::Hash` which is fixed."] - #[doc = "- DbReads: `Tips`, `origin account`"] - #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] - #[doc = "# "] - retract_tip { hash: ::subxt::sp_core::H256 }, - #[codec(index = 2)] - #[doc = "Give a tip for something new; no finder's fee will be taken."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] - #[doc = "member of the `Tippers` set."] - #[doc = ""] - #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] - #[doc = " a UTF-8-encoded URL."] - #[doc = "- `who`: The account which should be credited for the tip."] - #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] - #[doc = " value of active tippers will be given to the `who`."] - #[doc = ""] - #[doc = "Emits `NewTip` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(R + T)` where `R` length of `reason`, `T` is the number of tippers."] - #[doc = " - `O(T)`: decoding `Tipper` vec of length `T`. `T` is charged as upper bound given by"] - #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of"] - #[doc = " `T::Tippers`."] - #[doc = " - `O(R)`: hashing and encoding of reason of length `R`"] - #[doc = "- DbReads: `Tippers`, `Reasons`"] - #[doc = "- DbWrites: `Reasons`, `Tips`"] - #[doc = "# "] - tip_new { - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - tip_value: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "Declare a tip value for an already-open tip."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] - #[doc = "member of the `Tippers` set."] - #[doc = ""] - #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] - #[doc = " as the hash of the tuple of the hash of the original tip `reason` and the beneficiary"] - #[doc = " account ID."] - #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] - #[doc = " value of active tippers will be given to the `who`."] - #[doc = ""] - #[doc = "Emits `TipClosing` if the threshold of tippers has been reached and the countdown period"] - #[doc = "has started."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] - #[doc = " `T`, insert tip and check closing, `T` is charged as upper bound given by"] - #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of `T::Tippers`."] - #[doc = ""] - #[doc = " Actually weight could be lower as it depends on how many tips are in `OpenTip` but it"] - #[doc = " is weighted as if almost full i.e of length `T-1`."] - #[doc = "- DbReads: `Tippers`, `Tips`"] - #[doc = "- DbWrites: `Tips`"] - #[doc = "# "] - tip { - hash: ::subxt::sp_core::H256, - #[codec(compact)] - tip_value: ::core::primitive::u128, - }, - #[codec(index = 4)] - #[doc = "Close and payout a tip."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "The tip identified by `hash` must have finished its countdown period."] - #[doc = ""] - #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] - #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] - #[doc = " `T`. `T` is charged as upper bound given by `ContainsLengthBound`. The actual cost"] - #[doc = " depends on the implementation of `T::Tippers`."] - #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] - #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] - #[doc = "# "] - close_tip { hash: ::subxt::sp_core::H256 }, - #[codec(index = 5)] - #[doc = "Remove and slash an already-open tip."] - #[doc = ""] - #[doc = "May only be called from `T::RejectOrigin`."] - #[doc = ""] - #[doc = "As a result, the finder is slashed and the deposits are lost."] - #[doc = ""] - #[doc = "Emits `TipSlashed` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] - #[doc = " The actual cost depends on the implementation of `T::Tippers`."] - #[doc = "# "] - slash_tip { hash: ::subxt::sp_core::H256 }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The reason given is just too big."] - ReasonTooBig, - #[codec(index = 1)] - #[doc = "The tip was already found/started."] - AlreadyKnown, - #[codec(index = 2)] - #[doc = "The tip hash is unknown."] - UnknownTip, - #[codec(index = 3)] - #[doc = "The account attempting to retract the tip is not the finder of the tip."] - NotFinder, - #[codec(index = 4)] - #[doc = "The tip cannot be claimed/closed because there are not enough tippers yet."] - StillOpen, - #[codec(index = 5)] - #[doc = "The tip cannot be claimed/closed because it's still in the countdown period."] - Premature, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new tip suggestion has been opened."] - NewTip { tip_hash: ::subxt::sp_core::H256 }, - #[codec(index = 1)] - #[doc = "A tip suggestion has reached threshold and is closing."] - TipClosing { tip_hash: ::subxt::sp_core::H256 }, - #[codec(index = 2)] - #[doc = "A tip suggestion has been closed."] - TipClosed { - tip_hash: ::subxt::sp_core::H256, - who: ::subxt::sp_core::crypto::AccountId32, - payout: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "A tip suggestion has been retracted."] - TipRetracted { tip_hash: ::subxt::sp_core::H256 }, - #[codec(index = 4)] - #[doc = "A tip suggestion has been slashed."] - TipSlashed { - tip_hash: ::subxt::sp_core::H256, - finder: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct OpenTip<_0, _1, _2, _3> { - pub reason: _3, - pub who: _0, - pub finder: _0, - pub deposit: _1, - pub closes: ::core::option::Option<_2>, - pub tips: ::std::vec::Vec<(_0, _1)>, - pub finders_fee: ::core::primitive::bool, - } - } - pub mod pallet_transaction_payment { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ChargeTransactionPayment( - #[codec(compact)] pub ::core::primitive::u128, - ); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1Ancient, - #[codec(index = 1)] - V2, - } - } - pub mod pallet_treasury { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] - #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] - #[doc = "proposal is awarded."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(1)"] - #[doc = "- DbReads: `ProposalCount`, `origin account`"] - #[doc = "- DbWrites: `ProposalCount`, `Proposals`, `origin account`"] - #[doc = "# "] - propose_spend { - #[codec(compact)] - value: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 1)] - #[doc = "Reject a proposed spend. The original deposit will be slashed."] - #[doc = ""] - #[doc = "May only be called from `T::RejectOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(1)"] - #[doc = "- DbReads: `Proposals`, `rejected proposer account`"] - #[doc = "- DbWrites: `Proposals`, `rejected proposer account`"] - #[doc = "# "] - reject_proposal { - #[codec(compact)] - proposal_id: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] - #[doc = "and the original deposit will be returned."] - #[doc = ""] - #[doc = "May only be called from `T::ApproveOrigin`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(1)."] - #[doc = "- DbReads: `Proposals`, `Approvals`"] - #[doc = "- DbWrite: `Approvals`"] - #[doc = "# "] - approve_proposal { - #[codec(compact)] - proposal_id: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Proposer's balance is too low."] - InsufficientProposersBalance, - #[codec(index = 1)] - #[doc = "No proposal or bounty at that index."] - InvalidIndex, - #[codec(index = 2)] - #[doc = "Too many approvals in the queue."] - TooManyApprovals, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "New proposal."] - Proposed { - proposal_index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "We have ended a spend period and will now allocate funds."] - Spending { - budget_remaining: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Some funds have been allocated."] - Awarded { - proposal_index: ::core::primitive::u32, - award: ::core::primitive::u128, - account: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 3)] - #[doc = "A proposal was rejected; funds were slashed."] - Rejected { - proposal_index: ::core::primitive::u32, - slashed: ::core::primitive::u128, - }, - #[codec(index = 4)] - #[doc = "Some of our funds have been burnt."] - Burnt { - burnt_funds: ::core::primitive::u128, - }, - #[codec(index = 5)] - #[doc = "Spending has finished; this is the amount that rolls over until next spend."] - Rollover { - rollover_balance: ::core::primitive::u128, - }, - #[codec(index = 6)] - #[doc = "Some funds have been deposited."] - Deposit { value: ::core::primitive::u128 }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Proposal<_0, _1> { - pub proposer: _0, - pub value: _1, - pub beneficiary: _0, - pub bond: _1, - } - } - pub mod pallet_utility { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - batch { - calls: ::std::vec::Vec, - }, - #[codec(index = 1)] - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] - #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - as_derivative { - index: ::core::primitive::u16, - call: ::std::boxed::Box, - }, - #[codec(index = 2)] - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - batch_all { - calls: ::std::vec::Vec, - }, - #[codec(index = 3)] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] - #[doc = "# "] - dispatch_as { - as_origin: ::std::boxed::Box< - runtime_types::polkadot_runtime::OriginCaller, - >, - call: ::std::boxed::Box, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Too many calls batched."] - TooManyCalls, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] - #[doc = "well as the error."] - BatchInterrupted { - index: ::core::primitive::u32, - error: runtime_types::sp_runtime::DispatchError, - }, - #[codec(index = 1)] - #[doc = "Batch of dispatches completed fully with no error."] - BatchCompleted, - #[codec(index = 2)] - #[doc = "A single item within a Batch of dispatches has completed with no error."] - ItemCompleted, - #[codec(index = 3)] - #[doc = "A call was dispatched."] - DispatchedAs { - result: ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - }, - } - } - } - pub mod pallet_vesting { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 2 Reads, 2 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] - #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] - #[doc = "# "] - vest, - #[codec(index = 1)] - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 3 Reads, 3 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account"] - #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] - #[doc = "# "] - vest_other { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 2)] - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 3 Reads, 3 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] - #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] - #[doc = "# "] - vested_transfer { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - }, - #[codec(index = 3)] - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- DbWeight: 4 Reads, 4 Writes"] - #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, Source Account"] - #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] - #[doc = "# "] - force_vested_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - }, - #[codec(index = 4)] - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - merge_schedules { - schedule1_index: ::core::primitive::u32, - schedule2_index: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The account given is not vesting."] - NotVesting, - #[codec(index = 1)] - #[doc = "The account already has `MaxVestingSchedules` count of schedules and thus"] - #[doc = "cannot add another one. Consider merging existing schedules in order to add another."] - AtMaxVestingSchedules, - #[codec(index = 2)] - #[doc = "Amount being transferred is too low to create a vesting schedule."] - AmountLow, - #[codec(index = 3)] - #[doc = "An index was out of bounds of the vesting schedules."] - ScheduleIndexOutOfBounds, - #[codec(index = 4)] - #[doc = "Failed to create a new schedule because some parameter was invalid."] - InvalidScheduleParams, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "The amount vested has been updated. This could indicate a change in funds available."] - #[doc = "The balance given is the amount which is left unvested (and thus locked)."] - VestingUpdated { - account: ::subxt::sp_core::crypto::AccountId32, - unvested: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "An \\[account\\] has become fully vested."] - VestingCompleted { - account: ::subxt::sp_core::crypto::AccountId32, - }, - } - } - pub mod vesting_info { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct VestingInfo<_0, _1> { - pub locked: _0, - pub per_block: _0, - pub starting_block: _1, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V0, - #[codec(index = 1)] - V1, - } - } - pub mod pallet_xcm { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - send { - dest: - ::std::boxed::Box, - message: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - teleport_assets { - dest: - ::std::boxed::Box, - beneficiary: - ::std::boxed::Box, - assets: - ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - reserve_transfer_assets { - dest: - ::std::boxed::Box, - beneficiary: - ::std::boxed::Box, - assets: - ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Execute an XCM message from a local, signed, origin."] - #[doc = ""] - #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] - #[doc = "partially."] - #[doc = ""] - #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than the"] - #[doc = "maximum amount of weight that the message could take to be executed, then no execution"] - #[doc = "attempt will be made."] - #[doc = ""] - #[doc = "NOTE: A successful return to this does *not* imply that the `msg` was executed successfully"] - #[doc = "to completion; only that *some* of it was executed."] - execute { - message: ::std::boxed::Box, - max_weight: ::core::primitive::u64, - }, - #[codec(index = 4)] - #[doc = "Extoll that a particular destination can be communicated with through a particular"] - #[doc = "version of XCM."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The destination that is being described."] - #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] - force_xcm_version { - location: ::std::boxed::Box< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - xcm_version: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] - #[doc = "version a destination can accept is unknown)."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] - force_default_xcm_version { - maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 6)] - #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] - force_subscribe_version_notify { - location: - ::std::boxed::Box, - }, - #[codec(index = 7)] - #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] - #[doc = "version changes."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] - #[doc = " notifications which we no longer desire."] - force_unsubscribe_version_notify { - location: - ::std::boxed::Box, - }, - #[codec(index = 8)] - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - limited_reserve_transfer_assets { - dest: - ::std::boxed::Box, - beneficiary: - ::std::boxed::Box, - assets: - ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - }, - #[codec(index = 9)] - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - limited_teleport_assets { - dest: - ::std::boxed::Box, - beneficiary: - ::std::boxed::Box, - assets: - ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The desired destination was unreachable, generally because there is a no way of routing"] - #[doc = "to it."] - Unreachable, - #[codec(index = 1)] - #[doc = "There was some other issue (i.e. not to do with routing) in sending the message. Perhaps"] - #[doc = "a lack of space for buffering the message."] - SendFailure, - #[codec(index = 2)] - #[doc = "The message execution fails the filter."] - Filtered, - #[codec(index = 3)] - #[doc = "The message's weight could not be determined."] - UnweighableMessage, - #[codec(index = 4)] - #[doc = "The destination `MultiLocation` provided cannot be inverted."] - DestinationNotInvertible, - #[codec(index = 5)] - #[doc = "The assets to be sent are empty."] - Empty, - #[codec(index = 6)] - #[doc = "Could not re-anchor the assets to declare the fees for the destination chain."] - CannotReanchor, - #[codec(index = 7)] - #[doc = "Too many assets have been attempted for transfer."] - TooManyAssets, - #[codec(index = 8)] - #[doc = "Origin is invalid for sending."] - InvalidOrigin, - #[codec(index = 9)] - #[doc = "The version of the `Versioned` value used is not able to be interpreted."] - BadVersion, - #[codec(index = 10)] - #[doc = "The given location could not be used (e.g. because it cannot be expressed in the"] - #[doc = "desired version of XCM)."] - BadLocation, - #[codec(index = 11)] - #[doc = "The referenced subscription could not be found."] - NoSubscription, - #[codec(index = 12)] - #[doc = "The location is invalid since it already has a subscription from us."] - AlreadySubscribed, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Execution of an XCM message was attempted."] - #[doc = ""] - #[doc = "\\[ outcome \\]"] - Attempted(runtime_types::xcm::v2::traits::Outcome), - #[codec(index = 1)] - #[doc = "A XCM message was sent."] - #[doc = ""] - #[doc = "\\[ origin, destination, message \\]"] - Sent( - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::v2::Xcm, - ), - #[codec(index = 2)] - #[doc = "Query response received which does not match a registered query. This may be because a"] - #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] - #[doc = "because the query timed out."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - UnexpectedResponse( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ), - #[codec(index = 3)] - #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] - #[doc = "no registered notification call."] - #[doc = ""] - #[doc = "\\[ id, response \\]"] - ResponseReady( - ::core::primitive::u64, - runtime_types::xcm::v2::Response, - ), - #[codec(index = 4)] - #[doc = "Query response has been received and query is removed. The registered notification has"] - #[doc = "been dispatched and executed successfully."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - Notified( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 5)] - #[doc = "Query response has been received and query is removed. The registered notification could"] - #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] - #[doc = "originally budgeted by this runtime for the query result."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index, actual weight, max budgeted weight \\]"] - NotifyOverweight( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 6)] - #[doc = "Query response has been received and query is removed. There was a general error with"] - #[doc = "dispatching the notification call."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - NotifyDispatchError( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 7)] - #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] - #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] - #[doc = "is not `(origin, QueryId, Response)`."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - NotifyDecodeFailed( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 8)] - #[doc = "Expected query response has been received but the origin location of the response does"] - #[doc = "not match that expected. The query remains registered for a later, valid, response to"] - #[doc = "be received and acted upon."] - #[doc = ""] - #[doc = "\\[ origin location, id, expected location \\]"] - InvalidResponder( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ::core::option::Option< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - ), - #[codec(index = 9)] - #[doc = "Expected query response has been received but the expected origin location placed in"] - #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] - #[doc = ""] - #[doc = "This is unexpected (since a location placed in storage in a previously executing"] - #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] - #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] - #[doc = "needed."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - InvalidResponderVersion( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ), - #[codec(index = 10)] - #[doc = "Received query response has been read and removed."] - #[doc = ""] - #[doc = "\\[ id \\]"] - ResponseTaken(::core::primitive::u64), - #[codec(index = 11)] - #[doc = "Some assets have been placed in an asset trap."] - #[doc = ""] - #[doc = "\\[ hash, origin, assets \\]"] - AssetsTrapped( - ::subxt::sp_core::H256, - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::VersionedMultiAssets, - ), - #[codec(index = 12)] - #[doc = "An XCM version change notification message has been attempted to be sent."] - #[doc = ""] - #[doc = "\\[ destination, result \\]"] - VersionChangeNotified( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u32, - ), - #[codec(index = 13)] - #[doc = "The supported version of a location has been changed. This might be through an"] - #[doc = "automatic notification or a manual intervention."] - #[doc = ""] - #[doc = "\\[ location, XCM version \\]"] - SupportedVersionChanged( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u32, - ), - #[codec(index = 14)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "sending the notification to it."] - #[doc = ""] - #[doc = "\\[ location, query ID, error \\]"] - NotifyTargetSendFail( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - runtime_types::xcm::v2::traits::Error, - ), - #[codec(index = 15)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "migrating the location to our new XCM format."] - #[doc = ""] - #[doc = "\\[ location, query ID \\]"] - NotifyTargetMigrationFail( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u64, - ), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Origin { - #[codec(index = 0)] - Xcm(runtime_types::xcm::v1::multilocation::MultiLocation), - #[codec(index = 1)] - Response(runtime_types::xcm::v1::multilocation::MultiLocation), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum QueryStatus<_0> { - #[codec(index = 0)] - Pending { - responder: runtime_types::xcm::VersionedMultiLocation, - maybe_notify: ::core::option::Option<( - ::core::primitive::u8, - ::core::primitive::u8, - )>, - timeout: _0, - }, - #[codec(index = 1)] - VersionNotifier { - origin: runtime_types::xcm::VersionedMultiLocation, - is_active: ::core::primitive::bool, - }, - #[codec(index = 2)] - Ready { - response: runtime_types::xcm::VersionedResponse, - at: _0, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum VersionMigrationStage { - #[codec(index = 0)] - MigrateSupportedVersion, - #[codec(index = 1)] - MigrateVersionNotifiers, - #[codec(index = 2)] - NotifyCurrentTargets( - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ), - #[codec(index = 3)] - MigrateAndNotifyOldTargets, - } - } - } - pub mod polkadot_core_primitives { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CandidateHash(pub ::subxt::sp_core::H256); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct InboundDownwardMessage<_0> { - pub sent_at: _0, - pub msg: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct InboundHrmpMessage<_0> { - pub sent_at: _0, - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct OutboundHrmpMessage<_0> { - pub recipient: _0, - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - } - pub mod polkadot_parachain { - use super::runtime_types; - pub mod primitives { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct HeadData(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct HrmpChannelId { - pub sender: runtime_types::polkadot_parachain::primitives::Id, - pub recipient: runtime_types::polkadot_parachain::primitives::Id, - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Id(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ValidationCode(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); - } - } - pub mod polkadot_primitives { - use super::runtime_types; - pub mod v2 { - use super::runtime_types; - pub mod assignment_app { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod collator_app { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - pub mod signed { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > } - } - pub mod validator_app { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct AvailabilityBitfield( - pub ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - ); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BackedCandidate<_0> { - pub candidate: - runtime_types::polkadot_primitives::v2::CommittedCandidateReceipt< - _0, - >, - pub validity_votes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidityAttestation, - >, - pub validator_indices: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CandidateCommitments<_0> { - pub upward_messages: - ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - pub horizontal_messages: ::std::vec::Vec< - runtime_types::polkadot_core_primitives::OutboundHrmpMessage< - runtime_types::polkadot_parachain::primitives::Id, - >, - >, - pub new_validation_code: ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCode, - >, - pub head_data: - runtime_types::polkadot_parachain::primitives::HeadData, - pub processed_downward_messages: _0, - pub hrmp_watermark: _0, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CandidateDescriptor<_0> { - pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub relay_parent: _0, - pub collator: - runtime_types::polkadot_primitives::v2::collator_app::Public, - pub persisted_validation_data_hash: _0, - pub pov_hash: _0, - pub erasure_root: _0, - pub signature: - runtime_types::polkadot_primitives::v2::collator_app::Signature, - pub para_head: _0, - pub validation_code_hash: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CandidateReceipt<_0> { - pub descriptor: - runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub commitments_hash: _0, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CommittedCandidateReceipt<_0> { - pub descriptor: - runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub commitments: - runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >, - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct CoreIndex(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum CoreOccupied { - #[codec(index = 0)] - Parathread(runtime_types::polkadot_primitives::v2::ParathreadEntry), - #[codec(index = 1)] - Parachain, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct DisputeState<_0> { - pub validators_for: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub validators_against: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub start: _0, - pub concluded_at: ::core::option::Option<_0>, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum DisputeStatement { - # [codec (index = 0)] Valid (runtime_types :: polkadot_primitives :: v2 :: ValidDisputeStatementKind ,) , # [codec (index = 1)] Invalid (runtime_types :: polkadot_primitives :: v2 :: InvalidDisputeStatementKind ,) , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct DisputeStatementSet { - pub candidate_hash: - runtime_types::polkadot_core_primitives::CandidateHash, - pub session: ::core::primitive::u32, - pub statements: ::std::vec::Vec<( - runtime_types::polkadot_primitives::v2::DisputeStatement, - runtime_types::polkadot_primitives::v2::ValidatorIndex, - runtime_types::polkadot_primitives::v2::validator_app::Signature, - )>, - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct GroupIndex(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct InherentData<_0> { - pub bitfields: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::signed::UncheckedSigned< - runtime_types::polkadot_primitives::v2::AvailabilityBitfield, - runtime_types::polkadot_primitives::v2::AvailabilityBitfield, - >, - >, - pub backed_candidates: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::BackedCandidate< - ::subxt::sp_core::H256, - >, - >, - pub disputes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::DisputeStatementSet, - >, - pub parent_header: _0, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum InvalidDisputeStatementKind { - #[codec(index = 0)] - Explicit, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ParathreadClaim( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_primitives::v2::collator_app::Public, - ); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ParathreadEntry { - pub claim: runtime_types::polkadot_primitives::v2::ParathreadClaim, - pub retries: ::core::primitive::u32, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct PvfCheckStatement { - pub accept: ::core::primitive::bool, - pub subject: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub session_index: ::core::primitive::u32, - pub validator_index: - runtime_types::polkadot_primitives::v2::ValidatorIndex, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ScrapedOnChainVotes<_0> { - pub session: ::core::primitive::u32, - pub backing_validators_per_candidate: ::std::vec::Vec<( - runtime_types::polkadot_primitives::v2::CandidateReceipt<_0>, - ::std::vec::Vec<( - runtime_types::polkadot_primitives::v2::ValidatorIndex, - runtime_types::polkadot_primitives::v2::ValidityAttestation, - )>, - )>, - pub disputes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::DisputeStatementSet, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct SessionInfo { - pub active_validator_indices: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - pub random_seed: [::core::primitive::u8; 32usize], - pub dispute_period: ::core::primitive::u32, - pub validators: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - pub discovery_keys: ::std::vec::Vec< - runtime_types::sp_authority_discovery::app::Public, - >, - pub assignment_keys: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::assignment_app::Public, - >, - pub validator_groups: ::std::vec::Vec< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, - >, - >, - pub n_cores: ::core::primitive::u32, - pub zeroth_delay_tranche_width: ::core::primitive::u32, - pub relay_vrf_modulo_samples: ::core::primitive::u32, - pub n_delay_tranches: ::core::primitive::u32, - pub no_show_slots: ::core::primitive::u32, - pub needed_approvals: ::core::primitive::u32, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum UpgradeGoAhead { - #[codec(index = 0)] - Abort, - #[codec(index = 1)] - GoAhead, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum UpgradeRestriction { - #[codec(index = 0)] - Present, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum ValidDisputeStatementKind { - #[codec(index = 0)] - Explicit, - #[codec(index = 1)] - BackingSeconded(::subxt::sp_core::H256), - #[codec(index = 2)] - BackingValid(::subxt::sp_core::H256), - #[codec(index = 3)] - ApprovalChecking, - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct ValidatorIndex(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum ValidityAttestation { - #[codec(index = 1)] - Implicit( - runtime_types::polkadot_primitives::v2::validator_app::Signature, - ), - #[codec(index = 2)] - Explicit( - runtime_types::polkadot_primitives::v2::validator_app::Signature, - ), - } - } - } - pub mod polkadot_runtime { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 ,) , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 ,) , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NposCompactSolution16 { - pub votes1: - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u16)>, - pub votes2: ::std::vec::Vec<( - ::core::primitive::u32, - ( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ), - ::core::primitive::u16, - )>, - pub votes3: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 2usize], - ::core::primitive::u16, - )>, - pub votes4: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 3usize], - ::core::primitive::u16, - )>, - pub votes5: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 4usize], - ::core::primitive::u16, - )>, - pub votes6: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 5usize], - ::core::primitive::u16, - )>, - pub votes7: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 6usize], - ::core::primitive::u16, - )>, - pub votes8: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 7usize], - ::core::primitive::u16, - )>, - pub votes9: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 8usize], - ::core::primitive::u16, - )>, - pub votes10: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 9usize], - ::core::primitive::u16, - )>, - pub votes11: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 10usize], - ::core::primitive::u16, - )>, - pub votes12: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 11usize], - ::core::primitive::u16, - )>, - pub votes13: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 12usize], - ::core::primitive::u16, - )>, - pub votes14: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 13usize], - ::core::primitive::u16, - )>, - pub votes15: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 14usize], - ::core::primitive::u16, - )>, - pub votes16: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 15usize], - ::core::primitive::u16, - )>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum OriginCaller { - #[codec(index = 0)] - system( - runtime_types::frame_support::dispatch::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - #[codec(index = 15)] - Council( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - #[codec(index = 16)] - TechnicalCommittee( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - #[codec(index = 50)] - ParachainsOrigin( - runtime_types::polkadot_runtime_parachains::origin::pallet::Origin, - ), - #[codec(index = 99)] - XcmPallet(runtime_types::pallet_xcm::pallet::Origin), - #[codec(index = 5)] - Void(runtime_types::sp_core::Void), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum ProxyType { - #[codec(index = 0)] - Any, - #[codec(index = 1)] - NonTransfer, - #[codec(index = 2)] - Governance, - #[codec(index = 3)] - Staking, - #[codec(index = 5)] - IdentityJudgement, - #[codec(index = 6)] - CancelProxy, - #[codec(index = 7)] - Auction, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Runtime; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SessionKeys { - pub grandpa: runtime_types::sp_finality_grandpa::app::Public, - pub babe: runtime_types::sp_consensus_babe::app::Public, - pub im_online: - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - pub para_validator: - runtime_types::polkadot_primitives::v2::validator_app::Public, - pub para_assignment: - runtime_types::polkadot_primitives::v2::assignment_app::Public, - pub authority_discovery: - runtime_types::sp_authority_discovery::app::Public, - } - } - pub mod polkadot_runtime_common { - use super::runtime_types; - pub mod auctions { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Create a new auction."] - #[doc = ""] - #[doc = "This can only happen when there isn't already an auction in progress and may only be"] - #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] - #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] - new_auction { - #[codec(compact)] - duration: ::core::primitive::u32, - #[codec(compact)] - lease_period_index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] - #[doc = "parachain."] - #[doc = ""] - #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] - #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] - #[doc = ""] - #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] - #[doc = "funded by) the same account."] - #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] - #[doc = "value of `AuctionCounter`."] - #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] - #[doc = "bid win. This amount is held throughout the range."] - bid { - #[codec(compact)] - para: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - auction_index: ::core::primitive::u32, - #[codec(compact)] - first_slot: ::core::primitive::u32, - #[codec(compact)] - last_slot: ::core::primitive::u32, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Cancel an in-progress auction."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - cancel_auction, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "This auction is already in progress."] - AuctionInProgress, - #[codec(index = 1)] - #[doc = "The lease period is in the past."] - LeasePeriodInPast, - #[codec(index = 2)] - #[doc = "Para is not registered"] - ParaNotRegistered, - #[codec(index = 3)] - #[doc = "Not a current auction."] - NotCurrentAuction, - #[codec(index = 4)] - #[doc = "Not an auction."] - NotAuction, - #[codec(index = 5)] - #[doc = "Auction has already ended."] - AuctionEnded, - #[codec(index = 6)] - #[doc = "The para is already leased out for part of this range."] - AlreadyLeasedOut, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[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, - ), - #[codec(index = 1)] - #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] - AuctionClosed(::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, - ), - #[codec(index = 3)] - #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] - Unreserved( - ::subxt::sp_core::crypto::AccountId32, - ::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, - ), - #[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, - ), - #[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), - } - } - } - pub mod claims { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "Make a claim to collect your DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to claim is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)"] # [doc = ""] # [doc = "and `address` matches the `dest` account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , # [codec (index = 1)] # [doc = "Mint a new claim to collect DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _Root_."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `who`: The Ethereum address allowed to collect this claim."] # [doc = "- `value`: The number of DOTs that will be claimed."] # [doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "We assume worst case that both vesting and statement is being inserted."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : :: core :: primitive :: u128 , vesting_schedule : :: core :: option :: Option < (:: core :: primitive :: u128 , :: core :: primitive :: u128 , :: core :: primitive :: u32 ,) > , statement : :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , # [codec (index = 2)] # [doc = "Make a claim to collect your DOTs by signing a statement."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)(statement)"] # [doc = ""] # [doc = "and `address` matches the `dest` account; the `statement` must match that which is"] # [doc = "expected according to your purchase arrangement."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim_attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 3)] # [doc = "Attest to a statement, needed to finalize the claims process."] # [doc = ""] # [doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] # [doc = "and provides a `statement` which is expected for the account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to do pre-validation on `attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] attest { statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : :: core :: option :: Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Invalid Ethereum signature."] - InvalidEthereumSignature, - #[codec(index = 1)] - #[doc = "Ethereum address has no claim."] - SignerHasNoClaim, - #[codec(index = 2)] - #[doc = "Account ID sending transaction has no claim."] - SenderHasNoClaim, - #[codec(index = 3)] - #[doc = "There's not enough in the pot to pay out some unvested amount. Generally implies a logic"] - #[doc = "error."] - PotUnderflow, - #[codec(index = 4)] - #[doc = "A needed statement was not included."] - InvalidStatement, - #[codec(index = 5)] - #[doc = "The account already has a vested balance."] - VestedBalanceExists, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 ,) , } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct EcdsaSignature(pub [::core::primitive::u8; 65usize]); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct EthereumAddress(pub [::core::primitive::u8; 20usize]); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct PrevalidateAttests; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum StatementKind { - #[codec(index = 0)] - Regular, - #[codec(index = 1)] - Saft, - } - } - pub mod crowdloan { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] - #[doc = ""] - #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] - #[doc = "by the parachain manager."] - create { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - cap: ::core::primitive::u128, - #[codec(compact)] - first_period: ::core::primitive::u32, - #[codec(compact)] - last_period: ::core::primitive::u32, - #[codec(compact)] - end: ::core::primitive::u32, - verifier: ::core::option::Option< - runtime_types::sp_runtime::MultiSigner, - >, - }, - #[codec(index = 1)] - #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - contribute { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - value: ::core::primitive::u128, - signature: ::core::option::Option< - runtime_types::sp_runtime::MultiSignature, - >, - }, - #[codec(index = 2)] - #[doc = "Withdraw full balance of a specific contributor."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - #[doc = ""] - #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement, then the retirement"] - #[doc = "flag must be set. For a fund to be ready for retirement, then:"] - #[doc = "- it must not already be in retirement;"] - #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] - #[doc = "- and either:"] - #[doc = " - the block number must be at least `end`; or"] - #[doc = " - the current lease period must be greater than the fund's `last_period`."] - #[doc = ""] - #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current block"] - #[doc = "number."] - #[doc = ""] - #[doc = "- `who`: The account whose contribution should be withdrawn."] - #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] - withdraw { - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 3)] - #[doc = "Automatically refund contributors of an ended crowdloan."] - #[doc = "Due to weight restrictions, this function may need to be called multiple"] - #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - refund { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 4)] - #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] - dissolve { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 5)] - #[doc = "Edit the configuration for an in-progress crowdloan."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - edit { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - cap: ::core::primitive::u128, - #[codec(compact)] - first_period: ::core::primitive::u32, - #[codec(compact)] - last_period: ::core::primitive::u32, - #[codec(compact)] - end: ::core::primitive::u32, - verifier: ::core::option::Option< - runtime_types::sp_runtime::MultiSigner, - >, - }, - #[codec(index = 6)] - #[doc = "Add an optional memo to an existing crowdloan contribution."] - #[doc = ""] - #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] - add_memo { - index: runtime_types::polkadot_parachain::primitives::Id, - memo: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 7)] - #[doc = "Poke the fund into `NewRaise`"] - #[doc = ""] - #[doc = "Origin must be Signed, and the fund has non-zero raise."] - poke { - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 8)] - #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - contribute_all { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - signature: ::core::option::Option< - runtime_types::sp_runtime::MultiSignature, - >, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The current lease period is more than the first lease period."] - FirstPeriodInPast, - #[codec(index = 1)] - #[doc = "The first lease period needs to at least be less than 3 `max_value`."] - FirstPeriodTooFarInFuture, - #[codec(index = 2)] - #[doc = "Last lease period must be greater than first lease period."] - LastPeriodBeforeFirstPeriod, - #[codec(index = 3)] - #[doc = "The last lease period cannot be more than 3 periods after the first period."] - LastPeriodTooFarInFuture, - #[codec(index = 4)] - #[doc = "The campaign ends before the current block number. The end must be in the future."] - CannotEndInPast, - #[codec(index = 5)] - #[doc = "The end date for this crowdloan is not sensible."] - EndTooFarInFuture, - #[codec(index = 6)] - #[doc = "There was an overflow."] - Overflow, - #[codec(index = 7)] - #[doc = "The contribution was below the minimum, `MinContribution`."] - ContributionTooSmall, - #[codec(index = 8)] - #[doc = "Invalid fund index."] - InvalidParaId, - #[codec(index = 9)] - #[doc = "Contributions exceed maximum amount."] - CapExceeded, - #[codec(index = 10)] - #[doc = "The contribution period has already ended."] - ContributionPeriodOver, - #[codec(index = 11)] - #[doc = "The origin of this call is invalid."] - InvalidOrigin, - #[codec(index = 12)] - #[doc = "This crowdloan does not correspond to a parachain."] - NotParachain, - #[codec(index = 13)] - #[doc = "This parachain lease is still active and retirement cannot yet begin."] - LeaseActive, - #[codec(index = 14)] - #[doc = "This parachain's bid or lease is still active and withdraw cannot yet begin."] - BidOrLeaseActive, - #[codec(index = 15)] - #[doc = "The crowdloan has not yet ended."] - FundNotEnded, - #[codec(index = 16)] - #[doc = "There are no contributions stored in this crowdloan."] - NoContributions, - #[codec(index = 17)] - #[doc = "The crowdloan is not ready to dissolve. Potentially still has a slot or in retirement period."] - NotReadyToDissolve, - #[codec(index = 18)] - #[doc = "Invalid signature."] - InvalidSignature, - #[codec(index = 19)] - #[doc = "The provided memo is too large."] - MemoTooLarge, - #[codec(index = 20)] - #[doc = "The fund is already in `NewRaise`"] - AlreadyInNewRaise, - #[codec(index = 21)] - #[doc = "No contributions allowed during the VRF delay"] - VrfDelayInProgress, - #[codec(index = 22)] - #[doc = "A lease period has not started yet, due to an offset in the starting block."] - NoLeasePeriod, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] - Created(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, - ), - #[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, - ), - #[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, - ), - #[codec(index = 4)] - #[doc = "All loans in a fund have been refunded. `[fund_index]`"] - AllRefunded(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 5)] - #[doc = "Fund is dissolved. `[fund_index]`"] - Dissolved(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< - (), - 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), - #[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>, - ), - #[codec(index = 9)] - #[doc = "A parachain has been moved to `NewRaise`"] - AddedToNewRaise( - runtime_types::polkadot_parachain::primitives::Id, - ), - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : :: core :: option :: Option < runtime_types :: sp_runtime :: MultiSigner > , pub deposit : _1 , pub raised : _1 , pub end : _2 , pub cap : _1 , pub last_contribution : runtime_types :: polkadot_runtime_common :: crowdloan :: LastContribution < _2 > , pub first_period : _2 , pub last_period : _2 , pub fund_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum LastContribution<_0> { - #[codec(index = 0)] - Never, - #[codec(index = 1)] - PreEnding(_0), - #[codec(index = 2)] - Ending(_0), - } - } - pub mod paras_registrar { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin."] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The ID is not registered."] - NotRegistered, - #[codec(index = 1)] - #[doc = "The ID is already registered."] - AlreadyRegistered, - #[codec(index = 2)] - #[doc = "The caller is not the owner of this Id."] - NotOwner, - #[codec(index = 3)] - #[doc = "Invalid para code size."] - CodeTooLarge, - #[codec(index = 4)] - #[doc = "Invalid para head data size."] - HeadDataTooLarge, - #[codec(index = 5)] - #[doc = "Para is not a Parachain."] - NotParachain, - #[codec(index = 6)] - #[doc = "Para is not a Parathread."] - NotParathread, - #[codec(index = 7)] - #[doc = "Cannot deregister para"] - CannotDeregister, - #[codec(index = 8)] - #[doc = "Cannot schedule downgrade of parachain to parathread"] - CannotDowngrade, - #[codec(index = 9)] - #[doc = "Cannot schedule upgrade of parathread to parachain"] - CannotUpgrade, - #[codec(index = 10)] - #[doc = "Para is locked from manipulation by the manager. Must use parachain or relay chain governance."] - ParaLocked, - #[codec(index = 11)] - #[doc = "The ID given for registration has not been reserved."] - NotReserved, - #[codec(index = 12)] - #[doc = "Registering parachain with empty code is not allowed."] - EmptyCode, - #[codec(index = 13)] - #[doc = "Cannot perform a parachain slot / lifecycle swap. Check that the state of both paras are"] - #[doc = "correct for the swap to work."] - CannotSwap, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - Registered( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ), - #[codec(index = 1)] - Deregistered(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 2)] - Reserved( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ), - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ParaInfo<_0, _1> { - pub manager: _0, - pub deposit: _1, - pub locked: ::core::primitive::bool, - } - } - pub mod slots { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] - #[doc = "independently of any other on-chain mechanism to use it."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - force_lease { - para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - period_begin: ::core::primitive::u32, - period_count: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - clear_all_leases { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 2)] - #[doc = "Try to onboard a parachain that has a lease for the current lease period."] - #[doc = ""] - #[doc = "This function can be useful if there was some state issue with a para that should"] - #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] - #[doc = "let them onboard from here."] - #[doc = ""] - #[doc = "Origin must be signed, but can be called by anyone."] - trigger_onboard { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The parachain ID is not onboarding."] - ParaNotOnboarding, - #[codec(index = 1)] - #[doc = "There was an error with the lease."] - LeaseError, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new `[lease_period]` is beginning."] - NewLeasePeriod(::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, - ), - } - } - } - } - pub mod polkadot_runtime_parachains { - use super::runtime_types; - pub mod configuration { - use super::runtime_types; - pub mod migration { - use super::runtime_types; - pub mod v1 { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - )] - pub struct HostConfiguration<_0> { - pub max_code_size: _0, - pub max_head_data_size: _0, - pub max_upward_queue_count: _0, - pub max_upward_queue_size: _0, - pub max_upward_message_size: _0, - pub max_upward_message_num_per_candidate: _0, - pub hrmp_max_message_num_per_candidate: _0, - pub validation_upgrade_frequency: _0, - pub validation_upgrade_delay: _0, - pub max_pov_size: _0, - pub max_downward_message_size: _0, - pub ump_service_total_weight: ::core::primitive::u64, - pub hrmp_max_parachain_outbound_channels: _0, - pub hrmp_max_parathread_outbound_channels: _0, - pub hrmp_sender_deposit: ::core::primitive::u128, - pub hrmp_recipient_deposit: ::core::primitive::u128, - pub hrmp_channel_max_capacity: _0, - pub hrmp_channel_max_total_size: _0, - pub hrmp_max_parachain_inbound_channels: _0, - pub hrmp_max_parathread_inbound_channels: _0, - pub hrmp_channel_max_message_size: _0, - pub code_retention_period: _0, - pub parathread_cores: _0, - pub parathread_retries: _0, - pub group_rotation_frequency: _0, - pub chain_availability_period: _0, - pub thread_availability_period: _0, - pub scheduling_lookahead: _0, - pub max_validators_per_core: ::core::option::Option<_0>, - pub max_validators: ::core::option::Option<_0>, - pub dispute_period: _0, - pub dispute_post_conclusion_acceptance_period: _0, - pub dispute_max_spam_slots: _0, - pub dispute_conclusion_by_time_out_period: _0, - pub no_show_slots: _0, - pub n_delay_tranches: _0, - pub zeroth_delay_tranche_width: _0, - pub needed_approvals: _0, - pub relay_vrf_modulo_samples: _0, - pub ump_max_individual_weight: ::core::primitive::u64, - } - } - } - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the validation upgrade cooldown."] - set_validation_upgrade_cooldown { new: ::core::primitive::u32 }, - #[codec(index = 1)] - #[doc = "Set the validation upgrade delay."] - set_validation_upgrade_delay { new: ::core::primitive::u32 }, - #[codec(index = 2)] - #[doc = "Set the acceptance period for an included candidate."] - set_code_retention_period { new: ::core::primitive::u32 }, - #[codec(index = 3)] - #[doc = "Set the max validation code size for incoming upgrades."] - set_max_code_size { new: ::core::primitive::u32 }, - #[codec(index = 4)] - #[doc = "Set the max POV block size for incoming upgrades."] - set_max_pov_size { new: ::core::primitive::u32 }, - #[codec(index = 5)] - #[doc = "Set the max head data size for paras."] - set_max_head_data_size { new: ::core::primitive::u32 }, - #[codec(index = 6)] - #[doc = "Set the number of parathread execution cores."] - set_parathread_cores { new: ::core::primitive::u32 }, - #[codec(index = 7)] - #[doc = "Set the number of retries for a particular parathread."] - set_parathread_retries { new: ::core::primitive::u32 }, - #[codec(index = 8)] - #[doc = "Set the parachain validator-group rotation frequency"] - set_group_rotation_frequency { new: ::core::primitive::u32 }, - #[codec(index = 9)] - #[doc = "Set the availability period for parachains."] - set_chain_availability_period { new: ::core::primitive::u32 }, - #[codec(index = 10)] - #[doc = "Set the availability period for parathreads."] - set_thread_availability_period { new: ::core::primitive::u32 }, - #[codec(index = 11)] - #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] - set_scheduling_lookahead { new: ::core::primitive::u32 }, - #[codec(index = 12)] - #[doc = "Set the maximum number of validators to assign to any core."] - set_max_validators_per_core { - new: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 13)] - #[doc = "Set the maximum number of validators to use in parachain consensus."] - set_max_validators { - new: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 14)] - #[doc = "Set the dispute period, in number of sessions to keep for disputes."] - set_dispute_period { new: ::core::primitive::u32 }, - #[codec(index = 15)] - #[doc = "Set the dispute post conclusion acceptance period."] - set_dispute_post_conclusion_acceptance_period { - new: ::core::primitive::u32, - }, - #[codec(index = 16)] - #[doc = "Set the maximum number of dispute spam slots."] - set_dispute_max_spam_slots { new: ::core::primitive::u32 }, - #[codec(index = 17)] - #[doc = "Set the dispute conclusion by time out period."] - set_dispute_conclusion_by_time_out_period { - new: ::core::primitive::u32, - }, - #[codec(index = 18)] - #[doc = "Set the no show slots, in number of number of consensus slots."] - #[doc = "Must be at least 1."] - set_no_show_slots { new: ::core::primitive::u32 }, - #[codec(index = 19)] - #[doc = "Set the total number of delay tranches."] - set_n_delay_tranches { new: ::core::primitive::u32 }, - #[codec(index = 20)] - #[doc = "Set the zeroth delay tranche width."] - set_zeroth_delay_tranche_width { new: ::core::primitive::u32 }, - #[codec(index = 21)] - #[doc = "Set the number of validators needed to approve a block."] - set_needed_approvals { new: ::core::primitive::u32 }, - #[codec(index = 22)] - #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] - set_relay_vrf_modulo_samples { new: ::core::primitive::u32 }, - #[codec(index = 23)] - #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] - set_max_upward_queue_count { new: ::core::primitive::u32 }, - #[codec(index = 24)] - #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] - set_max_upward_queue_size { new: ::core::primitive::u32 }, - #[codec(index = 25)] - #[doc = "Set the critical downward message size."] - set_max_downward_message_size { new: ::core::primitive::u32 }, - #[codec(index = 26)] - #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] - set_ump_service_total_weight { new: ::core::primitive::u64 }, - #[codec(index = 27)] - #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] - set_max_upward_message_size { new: ::core::primitive::u32 }, - #[codec(index = 28)] - #[doc = "Sets the maximum number of messages that a candidate can contain."] - set_max_upward_message_num_per_candidate { - new: ::core::primitive::u32, - }, - #[codec(index = 29)] - #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] - set_hrmp_open_request_ttl { new: ::core::primitive::u32 }, - #[codec(index = 30)] - #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] - set_hrmp_sender_deposit { new: ::core::primitive::u128 }, - #[codec(index = 31)] - #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] - #[doc = "channel."] - set_hrmp_recipient_deposit { new: ::core::primitive::u128 }, - #[codec(index = 32)] - #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] - set_hrmp_channel_max_capacity { new: ::core::primitive::u32 }, - #[codec(index = 33)] - #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] - set_hrmp_channel_max_total_size { new: ::core::primitive::u32 }, - #[codec(index = 34)] - #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] - set_hrmp_max_parachain_inbound_channels { - new: ::core::primitive::u32, - }, - #[codec(index = 35)] - #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] - set_hrmp_max_parathread_inbound_channels { - new: ::core::primitive::u32, - }, - #[codec(index = 36)] - #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] - set_hrmp_channel_max_message_size { new: ::core::primitive::u32 }, - #[codec(index = 37)] - #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] - set_hrmp_max_parachain_outbound_channels { - new: ::core::primitive::u32, - }, - #[codec(index = 38)] - #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] - set_hrmp_max_parathread_outbound_channels { - new: ::core::primitive::u32, - }, - #[codec(index = 39)] - #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] - set_hrmp_max_message_num_per_candidate { - new: ::core::primitive::u32, - }, - #[codec(index = 40)] - #[doc = "Sets the maximum amount of weight any individual upward message may consume."] - set_ump_max_individual_weight { new: ::core::primitive::u64 }, - #[codec(index = 41)] - #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] - set_pvf_checking_enabled { new: ::core::primitive::bool }, - #[codec(index = 42)] - #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] - set_pvf_voting_ttl { new: ::core::primitive::u32 }, - #[codec(index = 43)] - #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] - #[doc = "upgrade taking place."] - #[doc = ""] - #[doc = "See the field documentation for information and constraints for the new value."] - set_minimum_validation_upgrade_delay { - new: ::core::primitive::u32, - }, - #[codec(index = 44)] - #[doc = "Setting this to true will disable consistency checks for the configuration setters."] - #[doc = "Use with caution."] - set_bypass_consistency_check { new: ::core::primitive::bool }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The new value for a configuration parameter is invalid."] - InvalidNewValue, - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct HostConfiguration<_0> { - pub max_code_size: _0, - pub max_head_data_size: _0, - pub max_upward_queue_count: _0, - pub max_upward_queue_size: _0, - pub max_upward_message_size: _0, - pub max_upward_message_num_per_candidate: _0, - pub hrmp_max_message_num_per_candidate: _0, - pub validation_upgrade_cooldown: _0, - pub validation_upgrade_delay: _0, - pub max_pov_size: _0, - pub max_downward_message_size: _0, - pub ump_service_total_weight: ::core::primitive::u64, - pub hrmp_max_parachain_outbound_channels: _0, - pub hrmp_max_parathread_outbound_channels: _0, - pub hrmp_sender_deposit: ::core::primitive::u128, - pub hrmp_recipient_deposit: ::core::primitive::u128, - pub hrmp_channel_max_capacity: _0, - pub hrmp_channel_max_total_size: _0, - pub hrmp_max_parachain_inbound_channels: _0, - pub hrmp_max_parathread_inbound_channels: _0, - pub hrmp_channel_max_message_size: _0, - pub code_retention_period: _0, - pub parathread_cores: _0, - pub parathread_retries: _0, - pub group_rotation_frequency: _0, - pub chain_availability_period: _0, - pub thread_availability_period: _0, - pub scheduling_lookahead: _0, - pub max_validators_per_core: ::core::option::Option<_0>, - pub max_validators: ::core::option::Option<_0>, - pub dispute_period: _0, - pub dispute_post_conclusion_acceptance_period: _0, - pub dispute_max_spam_slots: _0, - pub dispute_conclusion_by_time_out_period: _0, - pub no_show_slots: _0, - pub n_delay_tranches: _0, - pub zeroth_delay_tranche_width: _0, - pub needed_approvals: _0, - pub relay_vrf_modulo_samples: _0, - pub ump_max_individual_weight: ::core::primitive::u64, - pub pvf_checking_enabled: ::core::primitive::bool, - pub pvf_voting_ttl: _0, - pub minimum_validation_upgrade_delay: _0, - } - } - pub mod disputes { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - force_unfreeze, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Duplicate dispute statement sets provided."] - DuplicateDisputeStatementSets, - #[codec(index = 1)] - #[doc = "Ancient dispute statement provided."] - AncientDisputeStatement, - #[codec(index = 2)] - #[doc = "Validator index on statement is out of bounds for session."] - ValidatorIndexOutOfBounds, - #[codec(index = 3)] - #[doc = "Invalid signature on statement."] - InvalidSignature, - #[codec(index = 4)] - #[doc = "Validator vote submitted more than once to dispute."] - DuplicateStatement, - #[codec(index = 5)] - #[doc = "Too many spam slots used by some specific validator."] - PotentialSpam, - #[codec(index = 6)] - #[doc = "A dispute where there are only votes on one side."] - SingleSidedDispute, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - # [codec (index = 0)] # [doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] DisputeInitiated (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeLocation ,) , # [codec (index = 1)] # [doc = "A dispute has concluded for or against a candidate."] # [doc = "`\\[para id, candidate hash, dispute result\\]`"] DisputeConcluded (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeResult ,) , # [codec (index = 2)] # [doc = "A dispute has timed out due to insufficient participation."] # [doc = "`\\[para id, candidate hash\\]`"] DisputeTimedOut (runtime_types :: polkadot_core_primitives :: CandidateHash ,) , # [codec (index = 3)] # [doc = "A dispute has concluded with supermajority against a candidate."] # [doc = "Block authors should no longer build on top of this head and should"] # [doc = "instead revert the block at the given height. This should be the"] # [doc = "number of the child of the last known valid block in the chain."] Revert (:: core :: primitive :: u32 ,) , } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum DisputeLocation { - #[codec(index = 0)] - Local, - #[codec(index = 1)] - Remote, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum DisputeResult { - #[codec(index = 0)] - Valid, - #[codec(index = 1)] - Invalid, - } - } - pub mod dmp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call {} - } - } - pub mod hrmp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] # [doc = "a para may have. Normally this happens once per session, but this allows"] # [doc = "you to trigger the cleanup immediately for a specific parachain."] # [doc = ""] # [doc = "Origin must be Root."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data of weighing."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data of weighing."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The sender tried to open a channel to themselves."] - OpenHrmpChannelToSelf, - #[codec(index = 1)] - #[doc = "The recipient is not a valid para."] - OpenHrmpChannelInvalidRecipient, - #[codec(index = 2)] - #[doc = "The requested capacity is zero."] - OpenHrmpChannelZeroCapacity, - #[codec(index = 3)] - #[doc = "The requested capacity exceeds the global limit."] - OpenHrmpChannelCapacityExceedsLimit, - #[codec(index = 4)] - #[doc = "The requested maximum message size is 0."] - OpenHrmpChannelZeroMessageSize, - #[codec(index = 5)] - #[doc = "The open request requested the message size that exceeds the global limit."] - OpenHrmpChannelMessageSizeExceedsLimit, - #[codec(index = 6)] - #[doc = "The channel already exists"] - OpenHrmpChannelAlreadyExists, - #[codec(index = 7)] - #[doc = "There is already a request to open the same channel."] - OpenHrmpChannelAlreadyRequested, - #[codec(index = 8)] - #[doc = "The sender already has the maximum number of allowed outbound channels."] - OpenHrmpChannelLimitExceeded, - #[codec(index = 9)] - #[doc = "The channel from the sender to the origin doesn't exist."] - AcceptHrmpChannelDoesntExist, - #[codec(index = 10)] - #[doc = "The channel is already confirmed."] - AcceptHrmpChannelAlreadyConfirmed, - #[codec(index = 11)] - #[doc = "The recipient already has the maximum number of allowed inbound channels."] - AcceptHrmpChannelLimitExceeded, - #[codec(index = 12)] - #[doc = "The origin tries to close a channel where it is neither the sender nor the recipient."] - CloseHrmpChannelUnauthorized, - #[codec(index = 13)] - #[doc = "The channel to be closed doesn't exist."] - CloseHrmpChannelDoesntExist, - #[codec(index = 14)] - #[doc = "The channel close request is already requested."] - CloseHrmpChannelAlreadyUnderway, - #[codec(index = 15)] - #[doc = "Canceling is requested by neither the sender nor recipient of the open channel request."] - CancelHrmpOpenChannelUnauthorized, - #[codec(index = 16)] - #[doc = "The open request doesn't exist."] - OpenHrmpChannelDoesntExist, - #[codec(index = 17)] - #[doc = "Cannot cancel an HRMP open channel request because it is already confirmed."] - OpenHrmpChannelAlreadyConfirmed, - #[codec(index = 18)] - #[doc = "The provided witness data is wrong."] - WrongWitness, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Open HRMP channel requested."] - #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] - OpenChannelRequested( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 1)] - #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] - #[doc = "`[by_parachain, channel_id]`"] - OpenChannelCanceled( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ), - #[codec(index = 2)] - #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] - OpenChannelAccepted( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::Id, - ), - #[codec(index = 3)] - #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] - ChannelClosed( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ), - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct HrmpChannel { - pub max_capacity: ::core::primitive::u32, - pub max_total_size: ::core::primitive::u32, - pub max_message_size: ::core::primitive::u32, - pub msg_count: ::core::primitive::u32, - pub total_size: ::core::primitive::u32, - pub mqc_head: ::core::option::Option<::subxt::sp_core::H256>, - pub sender_deposit: ::core::primitive::u128, - pub recipient_deposit: ::core::primitive::u128, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct HrmpOpenChannelRequest { - pub confirmed: ::core::primitive::bool, - pub _age: ::core::primitive::u32, - pub sender_deposit: ::core::primitive::u128, - pub max_message_size: ::core::primitive::u32, - pub max_capacity: ::core::primitive::u32, - pub max_total_size: ::core::primitive::u32, - } - } - pub mod inclusion { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call {} - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Validator indices are out of order or contains duplicates."] - UnsortedOrDuplicateValidatorIndices, - #[codec(index = 1)] - #[doc = "Dispute statement sets are out of order or contain duplicates."] - UnsortedOrDuplicateDisputeStatementSet, - #[codec(index = 2)] - #[doc = "Backed candidates are out of order (core index) or contain duplicates."] - UnsortedOrDuplicateBackedCandidates, - #[codec(index = 3)] - #[doc = "A different relay parent was provided compared to the on-chain stored one."] - UnexpectedRelayParent, - #[codec(index = 4)] - #[doc = "Availability bitfield has unexpected size."] - WrongBitfieldSize, - #[codec(index = 5)] - #[doc = "Bitfield consists of zeros only."] - BitfieldAllZeros, - #[codec(index = 6)] - #[doc = "Multiple bitfields submitted by same validator or validators out of order by index."] - BitfieldDuplicateOrUnordered, - #[codec(index = 7)] - #[doc = "Validator index out of bounds."] - ValidatorIndexOutOfBounds, - #[codec(index = 8)] - #[doc = "Invalid signature"] - InvalidBitfieldSignature, - #[codec(index = 9)] - #[doc = "Candidate submitted but para not scheduled."] - UnscheduledCandidate, - #[codec(index = 10)] - #[doc = "Candidate scheduled despite pending candidate already existing for the para."] - CandidateScheduledBeforeParaFree, - #[codec(index = 11)] - #[doc = "Candidate included with the wrong collator."] - WrongCollator, - #[codec(index = 12)] - #[doc = "Scheduled cores out of order."] - ScheduledOutOfOrder, - #[codec(index = 13)] - #[doc = "Head data exceeds the configured maximum."] - HeadDataTooLarge, - #[codec(index = 14)] - #[doc = "Code upgrade prematurely."] - PrematureCodeUpgrade, - #[codec(index = 15)] - #[doc = "Output code is too large"] - NewCodeTooLarge, - #[codec(index = 16)] - #[doc = "Candidate not in parent context."] - CandidateNotInParentContext, - #[codec(index = 17)] - #[doc = "Invalid group index in core assignment."] - InvalidGroupIndex, - #[codec(index = 18)] - #[doc = "Insufficient (non-majority) backing."] - InsufficientBacking, - #[codec(index = 19)] - #[doc = "Invalid (bad signature, unknown validator, etc.) backing."] - InvalidBacking, - #[codec(index = 20)] - #[doc = "Collator did not sign PoV."] - NotCollatorSigned, - #[codec(index = 21)] - #[doc = "The validation data hash does not match expected."] - ValidationDataHashMismatch, - #[codec(index = 22)] - #[doc = "The downward message queue is not processed correctly."] - IncorrectDownwardMessageHandling, - #[codec(index = 23)] - #[doc = "At least one upward message sent does not pass the acceptance criteria."] - InvalidUpwardMessages, - #[codec(index = 24)] - #[doc = "The candidate didn't follow the rules of HRMP watermark advancement."] - HrmpWatermarkMishandling, - #[codec(index = 25)] - #[doc = "The HRMP messages sent by the candidate is not valid."] - InvalidOutboundHrmp, - #[codec(index = 26)] - #[doc = "The validation code hash of the candidate is not valid."] - InvalidValidationCodeHash, - #[codec(index = 27)] - #[doc = "The `para_head` hash in the candidate descriptor doesn't match the hash of the actual para head in the"] - #[doc = "commitments."] - ParaHeadMismatch, - #[codec(index = 28)] - #[doc = "A bitfield that references a freed core,"] - #[doc = "either intentionally or as part of a concluded"] - #[doc = "invalid dispute."] - BitfieldReferencesFreedCore, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "A candidate was backed. `[candidate, head_data]`"] - CandidateBacked( - runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v2::CoreIndex, - runtime_types::polkadot_primitives::v2::GroupIndex, - ), - #[codec(index = 1)] - #[doc = "A candidate was included. `[candidate, head_data]`"] - CandidateIncluded( - runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v2::CoreIndex, - runtime_types::polkadot_primitives::v2::GroupIndex, - ), - #[codec(index = 2)] - #[doc = "A candidate timed out. `[candidate, head_data]`"] - CandidateTimedOut( - runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v2::CoreIndex, - ), - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct AvailabilityBitfieldRecord<_0> { - pub bitfield: - runtime_types::polkadot_primitives::v2::AvailabilityBitfield, - pub submitted_at: _0, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CandidatePendingAvailability<_0, _1> { - pub core: runtime_types::polkadot_primitives::v2::CoreIndex, - pub hash: runtime_types::polkadot_core_primitives::CandidateHash, - pub descriptor: - runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub availability_votes: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub backers: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub relay_parent_number: _1, - pub backed_in_number: _1, - pub backing_group: runtime_types::polkadot_primitives::v2::GroupIndex, - } - } - pub mod initializer { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] - #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] - #[doc = "chain are valid and should be finalized."] - force_approve { up_to: ::core::primitive::u32 }, - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BufferedSessionChange { - pub validators: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - pub queued: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - pub session_index: ::core::primitive::u32, - } - } - pub mod origin { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Origin { - #[codec(index = 0)] - Parachain(runtime_types::polkadot_parachain::primitives::Id), - } - } - } - pub mod paras { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - # [codec (index = 0)] # [doc = "Set the storage for the parachain validation code immediately."] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Set the storage for the current parachain head data immediately."] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] # [doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Note a new block head for para within the context of the current block."] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] # [doc = "Put a parachain directly into the next session's action queue."] # [doc = "We can't queue it any sooner than this without going into the"] # [doc = "initializer..."] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Adds the validation code to the storage."] # [doc = ""] # [doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] # [doc = "is running for that code, it will be instantly accepted."] # [doc = ""] # [doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] # [doc = "into storage with reference count 0. This is to account the fact that there are no users"] # [doc = "for this code yet. The caller will have to make sure that this code eventually gets"] # [doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] # [doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] # [doc = ""] # [doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] # [doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 6)] # [doc = "Remove the validation code from the storage iff the reference count is 0."] # [doc = ""] # [doc = "This is better than removing the storage directly, because it will not remove the code"] # [doc = "that was suddenly got used by some parachain while this dispatchable was pending"] # [doc = "dispatching."] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] # [doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] # [doc = "enacts the results if that was the last vote before achieving the supermajority."] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v2 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , } , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Para is not registered in our system."] - NotRegistered, - #[codec(index = 1)] - #[doc = "Para cannot be onboarded because it is already tracked by our system."] - CannotOnboard, - #[codec(index = 2)] - #[doc = "Para cannot be offboarded at this time."] - CannotOffboard, - #[codec(index = 3)] - #[doc = "Para cannot be upgraded to a parachain."] - CannotUpgrade, - #[codec(index = 4)] - #[doc = "Para cannot be downgraded to a parathread."] - CannotDowngrade, - #[codec(index = 5)] - #[doc = "The statement for PVF pre-checking is stale."] - PvfCheckStatementStale, - #[codec(index = 6)] - #[doc = "The statement for PVF pre-checking is for a future session."] - PvfCheckStatementFuture, - #[codec(index = 7)] - #[doc = "Claimed validator index is out of bounds."] - PvfCheckValidatorIndexOutOfBounds, - #[codec(index = 8)] - #[doc = "The signature for the PVF pre-checking is invalid."] - PvfCheckInvalidSignature, - #[codec(index = 9)] - #[doc = "The given validator already has cast a vote."] - PvfCheckDoubleVote, - #[codec(index = 10)] - #[doc = "The given PVF does not exist at the moment of process a vote."] - PvfCheckSubjectInvalid, - #[codec(index = 11)] - #[doc = "The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism"] - #[doc = "is disabled."] - PvfCheckDisabled, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - # [codec (index = 0)] # [doc = "Current code has been updated for a Para. `para_id`"] CurrentCodeUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 1)] # [doc = "Current head has been updated for a Para. `para_id`"] CurrentHeadUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 2)] # [doc = "A code upgrade has been scheduled for a Para. `para_id`"] CodeUpgradeScheduled (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 3)] # [doc = "A new head has been noted for a Para. `para_id`"] NewHeadNoted (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 4)] # [doc = "A para has been queued to execute pending actions. `para_id`"] ActionQueued (runtime_types :: polkadot_parachain :: primitives :: Id , :: core :: primitive :: u32 ,) , # [codec (index = 5)] # [doc = "The given para either initiated or subscribed to a PVF check for the given validation"] # [doc = "code. `code_hash` `para_id`"] PvfCheckStarted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 6)] # [doc = "The given validation code was accepted by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckAccepted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 7)] # [doc = "The given validation code was rejected by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckRejected (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ParaGenesisArgs { - pub genesis_head: - runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - pub parachain: ::core::primitive::bool, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum ParaLifecycle { - #[codec(index = 0)] - Onboarding, - #[codec(index = 1)] - Parathread, - #[codec(index = 2)] - Parachain, - #[codec(index = 3)] - UpgradingParathread, - #[codec(index = 4)] - DowngradingParachain, - #[codec(index = 5)] - OffboardingParathread, - #[codec(index = 6)] - OffboardingParachain, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ParaPastCodeMeta < _0 > { pub upgrade_times : :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: paras :: ReplacementTimes < _0 > > , pub last_pruned : :: core :: option :: Option < _0 > , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct PvfCheckActiveVoteState<_0> { - pub votes_accept: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub votes_reject: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub age: _0, - pub created_at: _0, - pub causes: ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::paras::PvfCheckCause< - _0, - >, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum PvfCheckCause<_0> { - #[codec(index = 0)] - Onboarding(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 1)] - Upgrade { - id: runtime_types::polkadot_parachain::primitives::Id, - relay_parent_number: _0, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ReplacementTimes<_0> { - pub expected_at: _0, - pub activated_at: _0, - } - } - pub mod paras_inherent { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] - enter { - data: runtime_types::polkadot_primitives::v2::InherentData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "Inclusion inherent called more than once per block."] - TooManyInclusionInherents, - #[codec(index = 1)] - #[doc = "The hash of the submitted parent header doesn't correspond to the saved block hash of"] - #[doc = "the parent."] - InvalidParentHeader, - #[codec(index = 2)] - #[doc = "Disputed candidate that was concluded invalid."] - CandidateConcludedInvalid, - #[codec(index = 3)] - #[doc = "The data given to the inherent will result in an overweight block."] - InherentOverweight, - #[codec(index = 4)] - #[doc = "The ordering of dispute statements was invalid."] - DisputeStatementsUnsortedOrDuplicates, - #[codec(index = 5)] - #[doc = "A dispute statement was invalid."] - DisputeInvalid, - } - } - } - pub mod scheduler { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum AssignmentKind { - #[codec(index = 0)] - Parachain, - #[codec(index = 1)] - Parathread( - runtime_types::polkadot_primitives::v2::collator_app::Public, - ::core::primitive::u32, - ), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v2 :: CoreIndex , pub para_id : runtime_types :: polkadot_parachain :: primitives :: Id , pub kind : runtime_types :: polkadot_runtime_parachains :: scheduler :: AssignmentKind , pub group_idx : runtime_types :: polkadot_primitives :: v2 :: GroupIndex , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct ParathreadClaimQueue { pub queue : :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: QueuedParathread > , pub next_core_offset : :: core :: primitive :: u32 , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct QueuedParathread { - pub claim: runtime_types::polkadot_primitives::v2::ParathreadEntry, - pub core_offset: ::core::primitive::u32, - } - } - pub mod shared { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call {} - } - } - pub mod ump { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Call { - #[codec(index = 0)] - #[doc = "Service a single overweight upward message."] - #[doc = ""] - #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] - #[doc = "- `index`: The index of the overweight message to service."] - #[doc = "- `weight_limit`: The amount of weight that message execution may take."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `UnknownMessageIndex`: Message of `index` is unknown."] - #[doc = "- `WeightOverLimit`: Message execution may use greater than `weight_limit`."] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OverweightServiced`: On success."] - service_overweight { - index: ::core::primitive::u64, - weight_limit: ::core::primitive::u64, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - #[doc = "The message index given is unknown."] - UnknownMessageIndex, - #[codec(index = 1)] - #[doc = "The amount of weight given is possibly not enough for executing the message."] - WeightOverLimit, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Event { - #[codec(index = 0)] - #[doc = "Upward message is invalid XCM."] - #[doc = "\\[ id \\]"] - InvalidFormat([::core::primitive::u8; 32usize]), - #[codec(index = 1)] - #[doc = "Upward message is unsupported version of XCM."] - #[doc = "\\[ id \\]"] - UnsupportedVersion([::core::primitive::u8; 32usize]), - #[codec(index = 2)] - #[doc = "Upward message executed with the given outcome."] - #[doc = "\\[ id, outcome \\]"] - ExecutedUpward( - [::core::primitive::u8; 32usize], - runtime_types::xcm::v2::traits::Outcome, - ), - #[codec(index = 3)] - #[doc = "The weight limit for handling upward messages was reached."] - #[doc = "\\[ id, remaining, required \\]"] - WeightExhausted( - [::core::primitive::u8; 32usize], - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 4)] - #[doc = "Some upward messages have been received and will be processed."] - #[doc = "\\[ para, count, size \\]"] - UpwardMessagesReceived( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 5)] - #[doc = "The weight budget was exceeded for an individual upward message."] - #[doc = ""] - #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] - #[doc = "using the assigned `overweight_index`."] - #[doc = ""] - #[doc = "\\[ para, id, overweight_index, required \\]"] - OverweightEnqueued( - runtime_types::polkadot_parachain::primitives::Id, - [::core::primitive::u8; 32usize], - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 6)] - #[doc = "Upward message from the overweight queue was executed with the given actual weight"] - #[doc = "used."] - #[doc = ""] - #[doc = "\\[ overweight_index, used \\]"] - OverweightServiced( - ::core::primitive::u64, - ::core::primitive::u64, - ), - } - } - } - } - pub mod primitive_types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct H256(pub [::core::primitive::u8; 32usize]); - } - pub mod sp_arithmetic { - use super::runtime_types; - pub mod fixed_point { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct FixedU128(pub ::core::primitive::u128); - } - pub mod per_things { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct PerU16(pub ::core::primitive::u16); - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Perbill(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Percent(pub ::core::primitive::u8); - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Permill(pub ::core::primitive::u32); - } - } - pub mod sp_authority_discovery { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - } - pub mod sp_consensus_babe { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod digests { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum NextConfigDescriptor { - #[codec(index = 1)] - V1 { - c: (::core::primitive::u64, ::core::primitive::u64), - allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum AllowedSlots { - #[codec(index = 0)] - PrimarySlots, - #[codec(index = 1)] - PrimaryAndSecondaryPlainSlots, - #[codec(index = 2)] - PrimaryAndSecondaryVRFSlots, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct BabeEpochConfiguration { - pub c: (::core::primitive::u64, ::core::primitive::u64), - pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, - } - } - pub mod sp_consensus_slots { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct EquivocationProof<_0, _1> { - pub offender: _1, - pub slot: runtime_types::sp_consensus_slots::Slot, - pub first_header: _0, - pub second_header: _0, - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct Slot(pub ::core::primitive::u64); - } - pub mod sp_core { - use super::runtime_types; - pub mod crypto { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct AccountId32(pub [::core::primitive::u8; 32usize]); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); - } - pub mod ecdsa { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub [::core::primitive::u8; 33usize]); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub [::core::primitive::u8; 65usize]); - } - pub mod ed25519 { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub [::core::primitive::u8; 64usize]); - } - pub mod offchain { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct OpaqueNetworkState { - pub peer_id: runtime_types::sp_core::OpaquePeerId, - pub external_addresses: ::std::vec::Vec< - runtime_types::sp_core::offchain::OpaqueMultiaddr, - >, - } - } - pub mod sr25519 { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub [::core::primitive::u8; 64usize]); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Void {} - } - pub mod sp_finality_grandpa { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Public(pub runtime_types::sp_core::ed25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Equivocation<_0, _1> { - #[codec(index = 0)] - Prevote( - runtime_types::finality_grandpa::Equivocation< - runtime_types::sp_finality_grandpa::app::Public, - runtime_types::finality_grandpa::Prevote<_0, _1>, - runtime_types::sp_finality_grandpa::app::Signature, - >, - ), - #[codec(index = 1)] - Precommit( - runtime_types::finality_grandpa::Equivocation< - runtime_types::sp_finality_grandpa::app::Public, - runtime_types::finality_grandpa::Precommit<_0, _1>, - runtime_types::sp_finality_grandpa::app::Signature, - >, - ), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct EquivocationProof<_0, _1> { - pub set_id: ::core::primitive::u64, - pub equivocation: - runtime_types::sp_finality_grandpa::Equivocation<_0, _1>, - } - } - pub mod sp_npos_elections { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ElectionScore { - pub minimal_stake: ::core::primitive::u128, - pub sum_stake: ::core::primitive::u128, - pub sum_stake_squared: ::core::primitive::u128, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Support<_0> { - pub total: ::core::primitive::u128, - pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, - } - } - pub mod sp_runtime { - use super::runtime_types; - pub mod generic { - use super::runtime_types; - pub mod digest { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Digest { - pub logs: ::std::vec::Vec< - runtime_types::sp_runtime::generic::digest::DigestItem, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum DigestItem { - #[codec(index = 6)] - PreRuntime( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 4)] - Consensus( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 5)] - Seal( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 0)] - Other(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 8)] - RuntimeEnvironmentUpdated, - } - } - pub mod era { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Era { - #[codec(index = 0)] - Immortal, - #[codec(index = 1)] - Mortal1(::core::primitive::u8), - #[codec(index = 2)] - Mortal2(::core::primitive::u8), - #[codec(index = 3)] - Mortal3(::core::primitive::u8), - #[codec(index = 4)] - Mortal4(::core::primitive::u8), - #[codec(index = 5)] - Mortal5(::core::primitive::u8), - #[codec(index = 6)] - Mortal6(::core::primitive::u8), - #[codec(index = 7)] - Mortal7(::core::primitive::u8), - #[codec(index = 8)] - Mortal8(::core::primitive::u8), - #[codec(index = 9)] - Mortal9(::core::primitive::u8), - #[codec(index = 10)] - Mortal10(::core::primitive::u8), - #[codec(index = 11)] - Mortal11(::core::primitive::u8), - #[codec(index = 12)] - Mortal12(::core::primitive::u8), - #[codec(index = 13)] - Mortal13(::core::primitive::u8), - #[codec(index = 14)] - Mortal14(::core::primitive::u8), - #[codec(index = 15)] - Mortal15(::core::primitive::u8), - #[codec(index = 16)] - Mortal16(::core::primitive::u8), - #[codec(index = 17)] - Mortal17(::core::primitive::u8), - #[codec(index = 18)] - Mortal18(::core::primitive::u8), - #[codec(index = 19)] - Mortal19(::core::primitive::u8), - #[codec(index = 20)] - Mortal20(::core::primitive::u8), - #[codec(index = 21)] - Mortal21(::core::primitive::u8), - #[codec(index = 22)] - Mortal22(::core::primitive::u8), - #[codec(index = 23)] - Mortal23(::core::primitive::u8), - #[codec(index = 24)] - Mortal24(::core::primitive::u8), - #[codec(index = 25)] - Mortal25(::core::primitive::u8), - #[codec(index = 26)] - Mortal26(::core::primitive::u8), - #[codec(index = 27)] - Mortal27(::core::primitive::u8), - #[codec(index = 28)] - Mortal28(::core::primitive::u8), - #[codec(index = 29)] - Mortal29(::core::primitive::u8), - #[codec(index = 30)] - Mortal30(::core::primitive::u8), - #[codec(index = 31)] - Mortal31(::core::primitive::u8), - #[codec(index = 32)] - Mortal32(::core::primitive::u8), - #[codec(index = 33)] - Mortal33(::core::primitive::u8), - #[codec(index = 34)] - Mortal34(::core::primitive::u8), - #[codec(index = 35)] - Mortal35(::core::primitive::u8), - #[codec(index = 36)] - Mortal36(::core::primitive::u8), - #[codec(index = 37)] - Mortal37(::core::primitive::u8), - #[codec(index = 38)] - Mortal38(::core::primitive::u8), - #[codec(index = 39)] - Mortal39(::core::primitive::u8), - #[codec(index = 40)] - Mortal40(::core::primitive::u8), - #[codec(index = 41)] - Mortal41(::core::primitive::u8), - #[codec(index = 42)] - Mortal42(::core::primitive::u8), - #[codec(index = 43)] - Mortal43(::core::primitive::u8), - #[codec(index = 44)] - Mortal44(::core::primitive::u8), - #[codec(index = 45)] - Mortal45(::core::primitive::u8), - #[codec(index = 46)] - Mortal46(::core::primitive::u8), - #[codec(index = 47)] - Mortal47(::core::primitive::u8), - #[codec(index = 48)] - Mortal48(::core::primitive::u8), - #[codec(index = 49)] - Mortal49(::core::primitive::u8), - #[codec(index = 50)] - Mortal50(::core::primitive::u8), - #[codec(index = 51)] - Mortal51(::core::primitive::u8), - #[codec(index = 52)] - Mortal52(::core::primitive::u8), - #[codec(index = 53)] - Mortal53(::core::primitive::u8), - #[codec(index = 54)] - Mortal54(::core::primitive::u8), - #[codec(index = 55)] - Mortal55(::core::primitive::u8), - #[codec(index = 56)] - Mortal56(::core::primitive::u8), - #[codec(index = 57)] - Mortal57(::core::primitive::u8), - #[codec(index = 58)] - Mortal58(::core::primitive::u8), - #[codec(index = 59)] - Mortal59(::core::primitive::u8), - #[codec(index = 60)] - Mortal60(::core::primitive::u8), - #[codec(index = 61)] - Mortal61(::core::primitive::u8), - #[codec(index = 62)] - Mortal62(::core::primitive::u8), - #[codec(index = 63)] - Mortal63(::core::primitive::u8), - #[codec(index = 64)] - Mortal64(::core::primitive::u8), - #[codec(index = 65)] - Mortal65(::core::primitive::u8), - #[codec(index = 66)] - Mortal66(::core::primitive::u8), - #[codec(index = 67)] - Mortal67(::core::primitive::u8), - #[codec(index = 68)] - Mortal68(::core::primitive::u8), - #[codec(index = 69)] - Mortal69(::core::primitive::u8), - #[codec(index = 70)] - Mortal70(::core::primitive::u8), - #[codec(index = 71)] - Mortal71(::core::primitive::u8), - #[codec(index = 72)] - Mortal72(::core::primitive::u8), - #[codec(index = 73)] - Mortal73(::core::primitive::u8), - #[codec(index = 74)] - Mortal74(::core::primitive::u8), - #[codec(index = 75)] - Mortal75(::core::primitive::u8), - #[codec(index = 76)] - Mortal76(::core::primitive::u8), - #[codec(index = 77)] - Mortal77(::core::primitive::u8), - #[codec(index = 78)] - Mortal78(::core::primitive::u8), - #[codec(index = 79)] - Mortal79(::core::primitive::u8), - #[codec(index = 80)] - Mortal80(::core::primitive::u8), - #[codec(index = 81)] - Mortal81(::core::primitive::u8), - #[codec(index = 82)] - Mortal82(::core::primitive::u8), - #[codec(index = 83)] - Mortal83(::core::primitive::u8), - #[codec(index = 84)] - Mortal84(::core::primitive::u8), - #[codec(index = 85)] - Mortal85(::core::primitive::u8), - #[codec(index = 86)] - Mortal86(::core::primitive::u8), - #[codec(index = 87)] - Mortal87(::core::primitive::u8), - #[codec(index = 88)] - Mortal88(::core::primitive::u8), - #[codec(index = 89)] - Mortal89(::core::primitive::u8), - #[codec(index = 90)] - Mortal90(::core::primitive::u8), - #[codec(index = 91)] - Mortal91(::core::primitive::u8), - #[codec(index = 92)] - Mortal92(::core::primitive::u8), - #[codec(index = 93)] - Mortal93(::core::primitive::u8), - #[codec(index = 94)] - Mortal94(::core::primitive::u8), - #[codec(index = 95)] - Mortal95(::core::primitive::u8), - #[codec(index = 96)] - Mortal96(::core::primitive::u8), - #[codec(index = 97)] - Mortal97(::core::primitive::u8), - #[codec(index = 98)] - Mortal98(::core::primitive::u8), - #[codec(index = 99)] - Mortal99(::core::primitive::u8), - #[codec(index = 100)] - Mortal100(::core::primitive::u8), - #[codec(index = 101)] - Mortal101(::core::primitive::u8), - #[codec(index = 102)] - Mortal102(::core::primitive::u8), - #[codec(index = 103)] - Mortal103(::core::primitive::u8), - #[codec(index = 104)] - Mortal104(::core::primitive::u8), - #[codec(index = 105)] - Mortal105(::core::primitive::u8), - #[codec(index = 106)] - Mortal106(::core::primitive::u8), - #[codec(index = 107)] - Mortal107(::core::primitive::u8), - #[codec(index = 108)] - Mortal108(::core::primitive::u8), - #[codec(index = 109)] - Mortal109(::core::primitive::u8), - #[codec(index = 110)] - Mortal110(::core::primitive::u8), - #[codec(index = 111)] - Mortal111(::core::primitive::u8), - #[codec(index = 112)] - Mortal112(::core::primitive::u8), - #[codec(index = 113)] - Mortal113(::core::primitive::u8), - #[codec(index = 114)] - Mortal114(::core::primitive::u8), - #[codec(index = 115)] - Mortal115(::core::primitive::u8), - #[codec(index = 116)] - Mortal116(::core::primitive::u8), - #[codec(index = 117)] - Mortal117(::core::primitive::u8), - #[codec(index = 118)] - Mortal118(::core::primitive::u8), - #[codec(index = 119)] - Mortal119(::core::primitive::u8), - #[codec(index = 120)] - Mortal120(::core::primitive::u8), - #[codec(index = 121)] - Mortal121(::core::primitive::u8), - #[codec(index = 122)] - Mortal122(::core::primitive::u8), - #[codec(index = 123)] - Mortal123(::core::primitive::u8), - #[codec(index = 124)] - Mortal124(::core::primitive::u8), - #[codec(index = 125)] - Mortal125(::core::primitive::u8), - #[codec(index = 126)] - Mortal126(::core::primitive::u8), - #[codec(index = 127)] - Mortal127(::core::primitive::u8), - #[codec(index = 128)] - Mortal128(::core::primitive::u8), - #[codec(index = 129)] - Mortal129(::core::primitive::u8), - #[codec(index = 130)] - Mortal130(::core::primitive::u8), - #[codec(index = 131)] - Mortal131(::core::primitive::u8), - #[codec(index = 132)] - Mortal132(::core::primitive::u8), - #[codec(index = 133)] - Mortal133(::core::primitive::u8), - #[codec(index = 134)] - Mortal134(::core::primitive::u8), - #[codec(index = 135)] - Mortal135(::core::primitive::u8), - #[codec(index = 136)] - Mortal136(::core::primitive::u8), - #[codec(index = 137)] - Mortal137(::core::primitive::u8), - #[codec(index = 138)] - Mortal138(::core::primitive::u8), - #[codec(index = 139)] - Mortal139(::core::primitive::u8), - #[codec(index = 140)] - Mortal140(::core::primitive::u8), - #[codec(index = 141)] - Mortal141(::core::primitive::u8), - #[codec(index = 142)] - Mortal142(::core::primitive::u8), - #[codec(index = 143)] - Mortal143(::core::primitive::u8), - #[codec(index = 144)] - Mortal144(::core::primitive::u8), - #[codec(index = 145)] - Mortal145(::core::primitive::u8), - #[codec(index = 146)] - Mortal146(::core::primitive::u8), - #[codec(index = 147)] - Mortal147(::core::primitive::u8), - #[codec(index = 148)] - Mortal148(::core::primitive::u8), - #[codec(index = 149)] - Mortal149(::core::primitive::u8), - #[codec(index = 150)] - Mortal150(::core::primitive::u8), - #[codec(index = 151)] - Mortal151(::core::primitive::u8), - #[codec(index = 152)] - Mortal152(::core::primitive::u8), - #[codec(index = 153)] - Mortal153(::core::primitive::u8), - #[codec(index = 154)] - Mortal154(::core::primitive::u8), - #[codec(index = 155)] - Mortal155(::core::primitive::u8), - #[codec(index = 156)] - Mortal156(::core::primitive::u8), - #[codec(index = 157)] - Mortal157(::core::primitive::u8), - #[codec(index = 158)] - Mortal158(::core::primitive::u8), - #[codec(index = 159)] - Mortal159(::core::primitive::u8), - #[codec(index = 160)] - Mortal160(::core::primitive::u8), - #[codec(index = 161)] - Mortal161(::core::primitive::u8), - #[codec(index = 162)] - Mortal162(::core::primitive::u8), - #[codec(index = 163)] - Mortal163(::core::primitive::u8), - #[codec(index = 164)] - Mortal164(::core::primitive::u8), - #[codec(index = 165)] - Mortal165(::core::primitive::u8), - #[codec(index = 166)] - Mortal166(::core::primitive::u8), - #[codec(index = 167)] - Mortal167(::core::primitive::u8), - #[codec(index = 168)] - Mortal168(::core::primitive::u8), - #[codec(index = 169)] - Mortal169(::core::primitive::u8), - #[codec(index = 170)] - Mortal170(::core::primitive::u8), - #[codec(index = 171)] - Mortal171(::core::primitive::u8), - #[codec(index = 172)] - Mortal172(::core::primitive::u8), - #[codec(index = 173)] - Mortal173(::core::primitive::u8), - #[codec(index = 174)] - Mortal174(::core::primitive::u8), - #[codec(index = 175)] - Mortal175(::core::primitive::u8), - #[codec(index = 176)] - Mortal176(::core::primitive::u8), - #[codec(index = 177)] - Mortal177(::core::primitive::u8), - #[codec(index = 178)] - Mortal178(::core::primitive::u8), - #[codec(index = 179)] - Mortal179(::core::primitive::u8), - #[codec(index = 180)] - Mortal180(::core::primitive::u8), - #[codec(index = 181)] - Mortal181(::core::primitive::u8), - #[codec(index = 182)] - Mortal182(::core::primitive::u8), - #[codec(index = 183)] - Mortal183(::core::primitive::u8), - #[codec(index = 184)] - Mortal184(::core::primitive::u8), - #[codec(index = 185)] - Mortal185(::core::primitive::u8), - #[codec(index = 186)] - Mortal186(::core::primitive::u8), - #[codec(index = 187)] - Mortal187(::core::primitive::u8), - #[codec(index = 188)] - Mortal188(::core::primitive::u8), - #[codec(index = 189)] - Mortal189(::core::primitive::u8), - #[codec(index = 190)] - Mortal190(::core::primitive::u8), - #[codec(index = 191)] - Mortal191(::core::primitive::u8), - #[codec(index = 192)] - Mortal192(::core::primitive::u8), - #[codec(index = 193)] - Mortal193(::core::primitive::u8), - #[codec(index = 194)] - Mortal194(::core::primitive::u8), - #[codec(index = 195)] - Mortal195(::core::primitive::u8), - #[codec(index = 196)] - Mortal196(::core::primitive::u8), - #[codec(index = 197)] - Mortal197(::core::primitive::u8), - #[codec(index = 198)] - Mortal198(::core::primitive::u8), - #[codec(index = 199)] - Mortal199(::core::primitive::u8), - #[codec(index = 200)] - Mortal200(::core::primitive::u8), - #[codec(index = 201)] - Mortal201(::core::primitive::u8), - #[codec(index = 202)] - Mortal202(::core::primitive::u8), - #[codec(index = 203)] - Mortal203(::core::primitive::u8), - #[codec(index = 204)] - Mortal204(::core::primitive::u8), - #[codec(index = 205)] - Mortal205(::core::primitive::u8), - #[codec(index = 206)] - Mortal206(::core::primitive::u8), - #[codec(index = 207)] - Mortal207(::core::primitive::u8), - #[codec(index = 208)] - Mortal208(::core::primitive::u8), - #[codec(index = 209)] - Mortal209(::core::primitive::u8), - #[codec(index = 210)] - Mortal210(::core::primitive::u8), - #[codec(index = 211)] - Mortal211(::core::primitive::u8), - #[codec(index = 212)] - Mortal212(::core::primitive::u8), - #[codec(index = 213)] - Mortal213(::core::primitive::u8), - #[codec(index = 214)] - Mortal214(::core::primitive::u8), - #[codec(index = 215)] - Mortal215(::core::primitive::u8), - #[codec(index = 216)] - Mortal216(::core::primitive::u8), - #[codec(index = 217)] - Mortal217(::core::primitive::u8), - #[codec(index = 218)] - Mortal218(::core::primitive::u8), - #[codec(index = 219)] - Mortal219(::core::primitive::u8), - #[codec(index = 220)] - Mortal220(::core::primitive::u8), - #[codec(index = 221)] - Mortal221(::core::primitive::u8), - #[codec(index = 222)] - Mortal222(::core::primitive::u8), - #[codec(index = 223)] - Mortal223(::core::primitive::u8), - #[codec(index = 224)] - Mortal224(::core::primitive::u8), - #[codec(index = 225)] - Mortal225(::core::primitive::u8), - #[codec(index = 226)] - Mortal226(::core::primitive::u8), - #[codec(index = 227)] - Mortal227(::core::primitive::u8), - #[codec(index = 228)] - Mortal228(::core::primitive::u8), - #[codec(index = 229)] - Mortal229(::core::primitive::u8), - #[codec(index = 230)] - Mortal230(::core::primitive::u8), - #[codec(index = 231)] - Mortal231(::core::primitive::u8), - #[codec(index = 232)] - Mortal232(::core::primitive::u8), - #[codec(index = 233)] - Mortal233(::core::primitive::u8), - #[codec(index = 234)] - Mortal234(::core::primitive::u8), - #[codec(index = 235)] - Mortal235(::core::primitive::u8), - #[codec(index = 236)] - Mortal236(::core::primitive::u8), - #[codec(index = 237)] - Mortal237(::core::primitive::u8), - #[codec(index = 238)] - Mortal238(::core::primitive::u8), - #[codec(index = 239)] - Mortal239(::core::primitive::u8), - #[codec(index = 240)] - Mortal240(::core::primitive::u8), - #[codec(index = 241)] - Mortal241(::core::primitive::u8), - #[codec(index = 242)] - Mortal242(::core::primitive::u8), - #[codec(index = 243)] - Mortal243(::core::primitive::u8), - #[codec(index = 244)] - Mortal244(::core::primitive::u8), - #[codec(index = 245)] - Mortal245(::core::primitive::u8), - #[codec(index = 246)] - Mortal246(::core::primitive::u8), - #[codec(index = 247)] - Mortal247(::core::primitive::u8), - #[codec(index = 248)] - Mortal248(::core::primitive::u8), - #[codec(index = 249)] - Mortal249(::core::primitive::u8), - #[codec(index = 250)] - Mortal250(::core::primitive::u8), - #[codec(index = 251)] - Mortal251(::core::primitive::u8), - #[codec(index = 252)] - Mortal252(::core::primitive::u8), - #[codec(index = 253)] - Mortal253(::core::primitive::u8), - #[codec(index = 254)] - Mortal254(::core::primitive::u8), - #[codec(index = 255)] - Mortal255(::core::primitive::u8), - } - } - pub mod header { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Header<_0, _1> { - pub parent_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub number: _0, - pub state_root: ::subxt::sp_core::H256, - pub extrinsics_root: ::subxt::sp_core::H256, - pub digest: runtime_types::sp_runtime::generic::digest::Digest, - #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, - } - } - pub mod unchecked_extrinsic { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - pub ::std::vec::Vec<::core::primitive::u8>, - #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, - ); - } - } - pub mod multiaddress { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum MultiAddress<_0, _1> { - #[codec(index = 0)] - Id(_0), - #[codec(index = 1)] - Index(#[codec(compact)] _1), - #[codec(index = 2)] - Raw(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 3)] - Address32([::core::primitive::u8; 32usize]), - #[codec(index = 4)] - Address20([::core::primitive::u8; 20usize]), - } - } - pub mod traits { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct BlakeTwo256; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum ArithmeticError { - #[codec(index = 0)] - Underflow, - #[codec(index = 1)] - Overflow, - #[codec(index = 2)] - DivisionByZero, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum DispatchError { - #[codec(index = 0)] - Other, - #[codec(index = 1)] - CannotLookup, - #[codec(index = 2)] - BadOrigin, - #[codec(index = 3)] - Module(runtime_types::sp_runtime::ModuleError), - #[codec(index = 4)] - ConsumerRemaining, - #[codec(index = 5)] - NoProviders, - #[codec(index = 6)] - TooManyConsumers, - #[codec(index = 7)] - Token(runtime_types::sp_runtime::TokenError), - #[codec(index = 8)] - Arithmetic(runtime_types::sp_runtime::ArithmeticError), - #[codec(index = 9)] - Transactional(runtime_types::sp_runtime::TransactionalError), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ModuleError { - pub index: ::core::primitive::u8, - pub error: [::core::primitive::u8; 4usize], - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum MultiSignature { - #[codec(index = 0)] - Ed25519(runtime_types::sp_core::ed25519::Signature), - #[codec(index = 1)] - Sr25519(runtime_types::sp_core::sr25519::Signature), - #[codec(index = 2)] - Ecdsa(runtime_types::sp_core::ecdsa::Signature), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum MultiSigner { - #[codec(index = 0)] - Ed25519(runtime_types::sp_core::ed25519::Public), - #[codec(index = 1)] - Sr25519(runtime_types::sp_core::sr25519::Public), - #[codec(index = 2)] - Ecdsa(runtime_types::sp_core::ecdsa::Public), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum TokenError { - #[codec(index = 0)] - NoFunds, - #[codec(index = 1)] - WouldDie, - #[codec(index = 2)] - BelowMinimum, - #[codec(index = 3)] - CannotCreate, - #[codec(index = 4)] - UnknownAsset, - #[codec(index = 5)] - Frozen, - #[codec(index = 6)] - Unsupported, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum TransactionalError { - #[codec(index = 0)] - LimitReached, - #[codec(index = 1)] - NoLayer, - } - } - pub mod sp_session { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct MembershipProof { - pub session: ::core::primitive::u32, - pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - pub validator_count: ::core::primitive::u32, - } - } - pub mod sp_staking { - use super::runtime_types; - pub mod offence { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct OffenceDetails<_0, _1> { - pub offender: _1, - pub reporters: ::std::vec::Vec<_0>, - } - } - } - pub mod sp_version { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RuntimeVersion { - pub spec_name: ::std::string::String, - pub impl_name: ::std::string::String, - pub authoring_version: ::core::primitive::u32, - pub spec_version: ::core::primitive::u32, - pub impl_version: ::core::primitive::u32, - pub apis: ::std::vec::Vec<( - [::core::primitive::u8; 8usize], - ::core::primitive::u32, - )>, - pub transaction_version: ::core::primitive::u32, - pub state_version: ::core::primitive::u8, - } - } - pub mod xcm { - use super::runtime_types; - pub mod double_encoded { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct DoubleEncoded { - pub encoded: ::std::vec::Vec<::core::primitive::u8>, - } - } - pub mod v0 { - use super::runtime_types; - pub mod junction { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum BodyId { - #[codec(index = 0)] - Unit, - #[codec(index = 1)] - Named(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 2)] - Index(#[codec(compact)] ::core::primitive::u32), - #[codec(index = 3)] - Executive, - #[codec(index = 4)] - Technical, - #[codec(index = 5)] - Legislative, - #[codec(index = 6)] - Judicial, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum BodyPart { - #[codec(index = 0)] - Voice, - #[codec(index = 1)] - Members { - #[codec(compact)] - count: ::core::primitive::u32, - }, - #[codec(index = 2)] - Fraction { - #[codec(compact)] - nom: ::core::primitive::u32, - #[codec(compact)] - denom: ::core::primitive::u32, - }, - #[codec(index = 3)] - AtLeastProportion { - #[codec(compact)] - nom: ::core::primitive::u32, - #[codec(compact)] - denom: ::core::primitive::u32, - }, - #[codec(index = 4)] - MoreThanProportion { - #[codec(compact)] - nom: ::core::primitive::u32, - #[codec(compact)] - denom: ::core::primitive::u32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Junction { - #[codec(index = 0)] - Parent, - #[codec(index = 1)] - Parachain(#[codec(compact)] ::core::primitive::u32), - #[codec(index = 2)] - AccountId32 { - network: runtime_types::xcm::v0::junction::NetworkId, - id: [::core::primitive::u8; 32usize], - }, - #[codec(index = 3)] - AccountIndex64 { - network: runtime_types::xcm::v0::junction::NetworkId, - #[codec(compact)] - index: ::core::primitive::u64, - }, - #[codec(index = 4)] - AccountKey20 { - network: runtime_types::xcm::v0::junction::NetworkId, - key: [::core::primitive::u8; 20usize], - }, - #[codec(index = 5)] - PalletInstance(::core::primitive::u8), - #[codec(index = 6)] - GeneralIndex(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 7)] - GeneralKey(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 8)] - OnlyChild, - #[codec(index = 9)] - Plurality { - id: runtime_types::xcm::v0::junction::BodyId, - part: runtime_types::xcm::v0::junction::BodyPart, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum NetworkId { - #[codec(index = 0)] - Any, - #[codec(index = 1)] - Named(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 2)] - Polkadot, - #[codec(index = 3)] - Kusama, - } - } - pub mod multi_asset { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum MultiAsset { - #[codec(index = 0)] - None, - #[codec(index = 1)] - All, - #[codec(index = 2)] - AllFungible, - #[codec(index = 3)] - AllNonFungible, - #[codec(index = 4)] - AllAbstractFungible { - id: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 5)] - AllAbstractNonFungible { - class: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 6)] - AllConcreteFungible { - id: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 7)] - AllConcreteNonFungible { - class: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 8)] - AbstractFungible { - id: ::std::vec::Vec<::core::primitive::u8>, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 9)] - AbstractNonFungible { - class: ::std::vec::Vec<::core::primitive::u8>, - instance: runtime_types::xcm::v1::multiasset::AssetInstance, - }, - #[codec(index = 10)] - ConcreteFungible { - id: runtime_types::xcm::v0::multi_location::MultiLocation, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 11)] - ConcreteNonFungible { - class: runtime_types::xcm::v0::multi_location::MultiLocation, - instance: runtime_types::xcm::v1::multiasset::AssetInstance, - }, - } - } - pub mod multi_location { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum MultiLocation { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - X1(runtime_types::xcm::v0::junction::Junction), - #[codec(index = 2)] - X2( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 3)] - X3( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 4)] - X4( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 5)] - X5( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 6)] - X6( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 7)] - X7( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 8)] - X8( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - } - } - pub mod order { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Order { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - DepositAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 2)] - DepositReserveAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 3)] - ExchangeAsset { - give: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - receive: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - }, - #[codec(index = 4)] - InitiateReserveWithdraw { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - reserve: - runtime_types::xcm::v0::multi_location::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 5)] - InitiateTeleport { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 6)] - QueryHolding { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - }, - #[codec(index = 7)] - BuyExecution { - fees: runtime_types::xcm::v0::multi_asset::MultiAsset, - weight: ::core::primitive::u64, - debt: ::core::primitive::u64, - halt_on_error: ::core::primitive::bool, - xcm: ::std::vec::Vec, - }, - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum OriginKind { - #[codec(index = 0)] - Native, - #[codec(index = 1)] - SovereignAccount, - #[codec(index = 2)] - Superuser, - #[codec(index = 3)] - Xcm, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Response { - #[codec(index = 0)] - Assets( - ::std::vec::Vec, - ), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Xcm { - #[codec(index = 0)] - WithdrawAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - effects: ::std::vec::Vec, - }, - #[codec(index = 1)] - ReserveAssetDeposit { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - effects: ::std::vec::Vec, - }, - #[codec(index = 2)] - TeleportAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - effects: ::std::vec::Vec, - }, - #[codec(index = 3)] - QueryResponse { - #[codec(compact)] - query_id: ::core::primitive::u64, - response: runtime_types::xcm::v0::Response, - }, - #[codec(index = 4)] - TransferAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 6)] - Transact { - origin_type: runtime_types::xcm::v0::OriginKind, - require_weight_at_most: ::core::primitive::u64, - call: runtime_types::xcm::double_encoded::DoubleEncoded, - }, - #[codec(index = 7)] - HrmpNewChannelOpenRequest { - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - max_message_size: ::core::primitive::u32, - #[codec(compact)] - max_capacity: ::core::primitive::u32, - }, - #[codec(index = 8)] - HrmpChannelAccepted { - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 9)] - HrmpChannelClosing { - #[codec(compact)] - initiator: ::core::primitive::u32, - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 10)] - RelayedFrom { - who: runtime_types::xcm::v0::multi_location::MultiLocation, - message: ::std::boxed::Box, - }, - } - } - pub mod v1 { - use super::runtime_types; - pub mod junction { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Junction { - #[codec(index = 0)] - Parachain(#[codec(compact)] ::core::primitive::u32), - #[codec(index = 1)] - AccountId32 { - network: runtime_types::xcm::v0::junction::NetworkId, - id: [::core::primitive::u8; 32usize], - }, - #[codec(index = 2)] - AccountIndex64 { - network: runtime_types::xcm::v0::junction::NetworkId, - #[codec(compact)] - index: ::core::primitive::u64, - }, - #[codec(index = 3)] - AccountKey20 { - network: runtime_types::xcm::v0::junction::NetworkId, - key: [::core::primitive::u8; 20usize], - }, - #[codec(index = 4)] - PalletInstance(::core::primitive::u8), - #[codec(index = 5)] - GeneralIndex(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 6)] - GeneralKey(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 7)] - OnlyChild, - #[codec(index = 8)] - Plurality { - id: runtime_types::xcm::v0::junction::BodyId, - part: runtime_types::xcm::v0::junction::BodyPart, - }, - } - } - pub mod multiasset { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum AssetId { - #[codec(index = 0)] - Concrete(runtime_types::xcm::v1::multilocation::MultiLocation), - #[codec(index = 1)] - Abstract(::std::vec::Vec<::core::primitive::u8>), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum AssetInstance { - #[codec(index = 0)] - Undefined, - #[codec(index = 1)] - Index(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 2)] - Array4([::core::primitive::u8; 4usize]), - #[codec(index = 3)] - Array8([::core::primitive::u8; 8usize]), - #[codec(index = 4)] - Array16([::core::primitive::u8; 16usize]), - #[codec(index = 5)] - Array32([::core::primitive::u8; 32usize]), - #[codec(index = 6)] - Blob(::std::vec::Vec<::core::primitive::u8>), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Fungibility { - #[codec(index = 0)] - Fungible(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 1)] - NonFungible(runtime_types::xcm::v1::multiasset::AssetInstance), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct MultiAsset { - pub id: runtime_types::xcm::v1::multiasset::AssetId, - pub fun: runtime_types::xcm::v1::multiasset::Fungibility, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum MultiAssetFilter { - #[codec(index = 0)] - Definite(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - Wild(runtime_types::xcm::v1::multiasset::WildMultiAsset), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct MultiAssets( - pub ::std::vec::Vec< - runtime_types::xcm::v1::multiasset::MultiAsset, - >, - ); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum WildFungibility { - #[codec(index = 0)] - Fungible, - #[codec(index = 1)] - NonFungible, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum WildMultiAsset { - #[codec(index = 0)] - All, - #[codec(index = 1)] - AllOf { - id: runtime_types::xcm::v1::multiasset::AssetId, - fun: runtime_types::xcm::v1::multiasset::WildFungibility, - }, - } - } - pub mod multilocation { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Junctions { - #[codec(index = 0)] - Here, - #[codec(index = 1)] - X1(runtime_types::xcm::v1::junction::Junction), - #[codec(index = 2)] - X2( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 3)] - X3( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 4)] - X4( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 5)] - X5( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 6)] - X6( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 7)] - X7( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 8)] - X8( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct MultiLocation { - pub parents: ::core::primitive::u8, - pub interior: runtime_types::xcm::v1::multilocation::Junctions, - } - } - pub mod order { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Order { - #[codec(index = 0)] - Noop, - #[codec(index = 1)] - DepositAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - max_assets: ::core::primitive::u32, - beneficiary: - runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 2)] - DepositReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - max_assets: ::core::primitive::u32, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 3)] - ExchangeAsset { - give: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - receive: runtime_types::xcm::v1::multiasset::MultiAssets, - }, - #[codec(index = 4)] - InitiateReserveWithdraw { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - reserve: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 5)] - InitiateTeleport { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 6)] - QueryHolding { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - }, - #[codec(index = 7)] - BuyExecution { - fees: runtime_types::xcm::v1::multiasset::MultiAsset, - weight: ::core::primitive::u64, - debt: ::core::primitive::u64, - halt_on_error: ::core::primitive::bool, - instructions: ::std::vec::Vec, - }, - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Response { - #[codec(index = 0)] - Assets(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - Version(::core::primitive::u32), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Xcm { - #[codec(index = 0)] - WithdrawAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - effects: ::std::vec::Vec, - }, - #[codec(index = 1)] - ReserveAssetDeposited { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - effects: ::std::vec::Vec, - }, - #[codec(index = 2)] - ReceiveTeleportedAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - effects: ::std::vec::Vec, - }, - #[codec(index = 3)] - QueryResponse { - #[codec(compact)] - query_id: ::core::primitive::u64, - response: runtime_types::xcm::v1::Response, - }, - #[codec(index = 4)] - TransferAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 6)] - Transact { - origin_type: runtime_types::xcm::v0::OriginKind, - require_weight_at_most: ::core::primitive::u64, - call: runtime_types::xcm::double_encoded::DoubleEncoded, - }, - #[codec(index = 7)] - HrmpNewChannelOpenRequest { - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - max_message_size: ::core::primitive::u32, - #[codec(compact)] - max_capacity: ::core::primitive::u32, - }, - #[codec(index = 8)] - HrmpChannelAccepted { - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 9)] - HrmpChannelClosing { - #[codec(compact)] - initiator: ::core::primitive::u32, - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 10)] - RelayedFrom { - who: runtime_types::xcm::v1::multilocation::Junctions, - message: ::std::boxed::Box, - }, - #[codec(index = 11)] - SubscribeVersion { - #[codec(compact)] - query_id: ::core::primitive::u64, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 12)] - UnsubscribeVersion, - } - } - pub mod v2 { - use super::runtime_types; - pub mod traits { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Error { - #[codec(index = 0)] - Overflow, - #[codec(index = 1)] - Unimplemented, - #[codec(index = 2)] - UntrustedReserveLocation, - #[codec(index = 3)] - UntrustedTeleportLocation, - #[codec(index = 4)] - MultiLocationFull, - #[codec(index = 5)] - MultiLocationNotInvertible, - #[codec(index = 6)] - BadOrigin, - #[codec(index = 7)] - InvalidLocation, - #[codec(index = 8)] - AssetNotFound, - #[codec(index = 9)] - FailedToTransactAsset, - #[codec(index = 10)] - NotWithdrawable, - #[codec(index = 11)] - LocationCannotHold, - #[codec(index = 12)] - ExceedsMaxMessageSize, - #[codec(index = 13)] - DestinationUnsupported, - #[codec(index = 14)] - Transport, - #[codec(index = 15)] - Unroutable, - #[codec(index = 16)] - UnknownClaim, - #[codec(index = 17)] - FailedToDecode, - #[codec(index = 18)] - MaxWeightInvalid, - #[codec(index = 19)] - NotHoldingFees, - #[codec(index = 20)] - TooExpensive, - #[codec(index = 21)] - Trap(::core::primitive::u64), - #[codec(index = 22)] - UnhandledXcmVersion, - #[codec(index = 23)] - WeightLimitReached(::core::primitive::u64), - #[codec(index = 24)] - Barrier, - #[codec(index = 25)] - WeightNotComputable, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Outcome { - #[codec(index = 0)] - Complete(::core::primitive::u64), - #[codec(index = 1)] - Incomplete( - ::core::primitive::u64, - runtime_types::xcm::v2::traits::Error, - ), - #[codec(index = 2)] - Error(runtime_types::xcm::v2::traits::Error), - } - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Instruction { - #[codec(index = 0)] - WithdrawAsset(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - ReserveAssetDeposited( - runtime_types::xcm::v1::multiasset::MultiAssets, - ), - #[codec(index = 2)] - ReceiveTeleportedAsset( - runtime_types::xcm::v1::multiasset::MultiAssets, - ), - #[codec(index = 3)] - QueryResponse { - #[codec(compact)] - query_id: ::core::primitive::u64, - response: runtime_types::xcm::v2::Response, - #[codec(compact)] - max_weight: ::core::primitive::u64, - }, - #[codec(index = 4)] - TransferAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 6)] - Transact { - origin_type: runtime_types::xcm::v0::OriginKind, - #[codec(compact)] - require_weight_at_most: ::core::primitive::u64, - call: runtime_types::xcm::double_encoded::DoubleEncoded, - }, - #[codec(index = 7)] - HrmpNewChannelOpenRequest { - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - max_message_size: ::core::primitive::u32, - #[codec(compact)] - max_capacity: ::core::primitive::u32, - }, - #[codec(index = 8)] - HrmpChannelAccepted { - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 9)] - HrmpChannelClosing { - #[codec(compact)] - initiator: ::core::primitive::u32, - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 10)] - ClearOrigin, - #[codec(index = 11)] - DescendOrigin(runtime_types::xcm::v1::multilocation::Junctions), - #[codec(index = 12)] - ReportError { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 13)] - DepositAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - #[codec(compact)] - max_assets: ::core::primitive::u32, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 14)] - DepositReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - #[codec(compact)] - max_assets: ::core::primitive::u32, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 15)] - ExchangeAsset { - give: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - receive: runtime_types::xcm::v1::multiasset::MultiAssets, - }, - #[codec(index = 16)] - InitiateReserveWithdraw { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - reserve: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 17)] - InitiateTeleport { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 18)] - QueryHolding { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 19)] - BuyExecution { - fees: runtime_types::xcm::v1::multiasset::MultiAsset, - weight_limit: runtime_types::xcm::v2::WeightLimit, - }, - #[codec(index = 20)] - RefundSurplus, - #[codec(index = 21)] - SetErrorHandler(runtime_types::xcm::v2::Xcm), - #[codec(index = 22)] - SetAppendix(runtime_types::xcm::v2::Xcm), - #[codec(index = 23)] - ClearError, - #[codec(index = 24)] - ClaimAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - ticket: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 25)] - Trap(#[codec(compact)] ::core::primitive::u64), - #[codec(index = 26)] - SubscribeVersion { - #[codec(compact)] - query_id: ::core::primitive::u64, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 27)] - UnsubscribeVersion, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum Response { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - Assets(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 2)] - ExecutionResult( - ::core::option::Option<( - ::core::primitive::u32, - runtime_types::xcm::v2::traits::Error, - )>, - ), - #[codec(index = 3)] - Version(::core::primitive::u32), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum WeightLimit { - #[codec(index = 0)] - Unlimited, - #[codec(index = 1)] - Limited(#[codec(compact)] ::core::primitive::u64), - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Xcm(pub ::std::vec::Vec); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum VersionedMultiAssets { - #[codec(index = 0)] - V0(::std::vec::Vec), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::multiasset::MultiAssets), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum VersionedMultiLocation { - #[codec(index = 0)] - V0(runtime_types::xcm::v0::multi_location::MultiLocation), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::multilocation::MultiLocation), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum VersionedResponse { - #[codec(index = 0)] - V0(runtime_types::xcm::v0::Response), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::Response), - #[codec(index = 2)] - V2(runtime_types::xcm::v2::Response), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum VersionedXcm { - #[codec(index = 0)] - V0(runtime_types::xcm::v0::Xcm), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::Xcm), - #[codec(index = 2)] - V2(runtime_types::xcm::v2::Xcm), - } - } - } - #[doc = r" The default error type returned when there is a runtime issue."] - pub type DispatchError = runtime_types::sp_runtime::DispatchError; - impl ::subxt::HasModuleError for runtime_types::sp_runtime::DispatchError { - fn module_error_data(&self) -> Option<::subxt::ModuleErrorData> { - if let Self::Module(module_error) = self { - Some(::subxt::ModuleErrorData { - pallet_index: module_error.index, - error: module_error.error, - }) - } else { - None - } - } - } - pub struct RuntimeApi { - pub client: ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - fn from(client: ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - impl<'a, T, X> RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn validate_metadata(&'a self) -> Result<(), ::subxt::MetadataError> { - if self.client.metadata().metadata_hash(&PALLETS) - != [ - 222u8, 70u8, 96u8, 67u8, 220u8, 49u8, 147u8, 114u8, 199u8, 254u8, - 88u8, 102u8, 188u8, 14u8, 180u8, 163u8, 55u8, 109u8, 43u8, 71u8, - 135u8, 161u8, 80u8, 151u8, 66u8, 252u8, 126u8, 104u8, 59u8, 80u8, - 140u8, 193u8, - ] - { - Err(::subxt::MetadataError::IncompatibleMetadata) - } else { - Ok(()) - } - } - pub fn constants(&'a self) -> ConstantsApi<'a, T> { - ConstantsApi { - client: &self.client, - } - } - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { - client: &self.client, - } - } - pub fn tx(&'a self) -> TransactionApi<'a, T, X> { - TransactionApi { - client: &self.client, - marker: ::core::marker::PhantomData, - } - } - pub fn events(&'a self) -> EventsApi<'a, T> { - EventsApi { - client: &self.client, - } - } - } - pub struct EventsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> EventsApi<'a, T> { - pub async fn at( - &self, - block_hash: T::Hash, - ) -> Result<::subxt::events::Events<'a, T, Event>, ::subxt::BasicError> { - ::subxt::events::at::(self.client, block_hash).await - } - pub async fn subscribe( - &self, - ) -> Result< - ::subxt::events::EventSubscription< - 'a, - ::subxt::events::EventSub, - T, - Event, - >, - ::subxt::BasicError, - > { - ::subxt::events::subscribe::(self.client).await - } - pub async fn subscribe_finalized( - &self, - ) -> Result< - ::subxt::events::EventSubscription< - 'a, - ::subxt::events::FinalizedEventSub<'a, T::Header>, - T, - Event, - >, - ::subxt::BasicError, - > { - ::subxt::events::subscribe_finalized::(self.client).await - } - } - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn system(&self) -> system::constants::ConstantsApi<'a, T> { - system::constants::ConstantsApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::constants::ConstantsApi<'a, T> { - scheduler::constants::ConstantsApi::new(self.client) - } - pub fn babe(&self) -> babe::constants::ConstantsApi<'a, T> { - babe::constants::ConstantsApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::constants::ConstantsApi<'a, T> { - timestamp::constants::ConstantsApi::new(self.client) - } - pub fn indices(&self) -> indices::constants::ConstantsApi<'a, T> { - indices::constants::ConstantsApi::new(self.client) - } - pub fn balances(&self) -> balances::constants::ConstantsApi<'a, T> { - balances::constants::ConstantsApi::new(self.client) - } - pub fn transaction_payment( - &self, - ) -> transaction_payment::constants::ConstantsApi<'a, T> { - transaction_payment::constants::ConstantsApi::new(self.client) - } - pub fn authorship(&self) -> authorship::constants::ConstantsApi<'a, T> { - authorship::constants::ConstantsApi::new(self.client) - } - pub fn staking(&self) -> staking::constants::ConstantsApi<'a, T> { - staking::constants::ConstantsApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::constants::ConstantsApi<'a, T> { - grandpa::constants::ConstantsApi::new(self.client) - } - pub fn im_online(&self) -> im_online::constants::ConstantsApi<'a, T> { - im_online::constants::ConstantsApi::new(self.client) - } - pub fn democracy(&self) -> democracy::constants::ConstantsApi<'a, T> { - democracy::constants::ConstantsApi::new(self.client) - } - pub fn phragmen_election( - &self, - ) -> phragmen_election::constants::ConstantsApi<'a, T> { - phragmen_election::constants::ConstantsApi::new(self.client) - } - pub fn treasury(&self) -> treasury::constants::ConstantsApi<'a, T> { - treasury::constants::ConstantsApi::new(self.client) - } - pub fn claims(&self) -> claims::constants::ConstantsApi<'a, T> { - claims::constants::ConstantsApi::new(self.client) - } - pub fn vesting(&self) -> vesting::constants::ConstantsApi<'a, T> { - vesting::constants::ConstantsApi::new(self.client) - } - pub fn utility(&self) -> utility::constants::ConstantsApi<'a, T> { - utility::constants::ConstantsApi::new(self.client) - } - pub fn identity(&self) -> identity::constants::ConstantsApi<'a, T> { - identity::constants::ConstantsApi::new(self.client) - } - pub fn proxy(&self) -> proxy::constants::ConstantsApi<'a, T> { - proxy::constants::ConstantsApi::new(self.client) - } - pub fn multisig(&self) -> multisig::constants::ConstantsApi<'a, T> { - multisig::constants::ConstantsApi::new(self.client) - } - pub fn bounties(&self) -> bounties::constants::ConstantsApi<'a, T> { - bounties::constants::ConstantsApi::new(self.client) - } - pub fn child_bounties(&self) -> child_bounties::constants::ConstantsApi<'a, T> { - child_bounties::constants::ConstantsApi::new(self.client) - } - pub fn tips(&self) -> tips::constants::ConstantsApi<'a, T> { - tips::constants::ConstantsApi::new(self.client) - } - pub fn election_provider_multi_phase( - &self, - ) -> 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 paras(&self) -> paras::constants::ConstantsApi<'a, T> { - paras::constants::ConstantsApi::new(self.client) - } - pub fn registrar(&self) -> registrar::constants::ConstantsApi<'a, T> { - registrar::constants::ConstantsApi::new(self.client) - } - pub fn slots(&self) -> slots::constants::ConstantsApi<'a, T> { - slots::constants::ConstantsApi::new(self.client) - } - pub fn auctions(&self) -> auctions::constants::ConstantsApi<'a, T> { - auctions::constants::ConstantsApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::constants::ConstantsApi<'a, T> { - crowdloan::constants::ConstantsApi::new(self.client) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config, - { - pub fn system(&self) -> system::storage::StorageApi<'a, T> { - system::storage::StorageApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { - scheduler::storage::StorageApi::new(self.client) - } - pub fn preimage(&self) -> preimage::storage::StorageApi<'a, T> { - preimage::storage::StorageApi::new(self.client) - } - pub fn babe(&self) -> babe::storage::StorageApi<'a, T> { - babe::storage::StorageApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::storage::StorageApi<'a, T> { - timestamp::storage::StorageApi::new(self.client) - } - pub fn indices(&self) -> indices::storage::StorageApi<'a, T> { - indices::storage::StorageApi::new(self.client) - } - pub fn balances(&self) -> balances::storage::StorageApi<'a, T> { - balances::storage::StorageApi::new(self.client) - } - pub fn transaction_payment( - &self, - ) -> transaction_payment::storage::StorageApi<'a, T> { - transaction_payment::storage::StorageApi::new(self.client) - } - pub fn authorship(&self) -> authorship::storage::StorageApi<'a, T> { - authorship::storage::StorageApi::new(self.client) - } - pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { - staking::storage::StorageApi::new(self.client) - } - pub fn offences(&self) -> offences::storage::StorageApi<'a, T> { - offences::storage::StorageApi::new(self.client) - } - pub fn session(&self) -> session::storage::StorageApi<'a, T> { - session::storage::StorageApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { - grandpa::storage::StorageApi::new(self.client) - } - pub fn im_online(&self) -> im_online::storage::StorageApi<'a, T> { - im_online::storage::StorageApi::new(self.client) - } - pub fn democracy(&self) -> democracy::storage::StorageApi<'a, T> { - democracy::storage::StorageApi::new(self.client) - } - pub fn council(&self) -> council::storage::StorageApi<'a, T> { - council::storage::StorageApi::new(self.client) - } - pub fn technical_committee( - &self, - ) -> technical_committee::storage::StorageApi<'a, T> { - technical_committee::storage::StorageApi::new(self.client) - } - pub fn phragmen_election(&self) -> phragmen_election::storage::StorageApi<'a, T> { - phragmen_election::storage::StorageApi::new(self.client) - } - pub fn technical_membership( - &self, - ) -> technical_membership::storage::StorageApi<'a, T> { - technical_membership::storage::StorageApi::new(self.client) - } - pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { - treasury::storage::StorageApi::new(self.client) - } - pub fn claims(&self) -> claims::storage::StorageApi<'a, T> { - claims::storage::StorageApi::new(self.client) - } - pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { - vesting::storage::StorageApi::new(self.client) - } - pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { - identity::storage::StorageApi::new(self.client) - } - pub fn proxy(&self) -> proxy::storage::StorageApi<'a, T> { - proxy::storage::StorageApi::new(self.client) - } - pub fn multisig(&self) -> multisig::storage::StorageApi<'a, T> { - multisig::storage::StorageApi::new(self.client) - } - pub fn bounties(&self) -> bounties::storage::StorageApi<'a, T> { - bounties::storage::StorageApi::new(self.client) - } - pub fn child_bounties(&self) -> child_bounties::storage::StorageApi<'a, T> { - child_bounties::storage::StorageApi::new(self.client) - } - pub fn tips(&self) -> tips::storage::StorageApi<'a, T> { - tips::storage::StorageApi::new(self.client) - } - pub fn election_provider_multi_phase( - &self, - ) -> 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 configuration(&self) -> configuration::storage::StorageApi<'a, T> { - configuration::storage::StorageApi::new(self.client) - } - pub fn paras_shared(&self) -> paras_shared::storage::StorageApi<'a, T> { - paras_shared::storage::StorageApi::new(self.client) - } - pub fn para_inclusion(&self) -> para_inclusion::storage::StorageApi<'a, T> { - para_inclusion::storage::StorageApi::new(self.client) - } - pub fn para_inherent(&self) -> para_inherent::storage::StorageApi<'a, T> { - para_inherent::storage::StorageApi::new(self.client) - } - pub fn para_scheduler(&self) -> para_scheduler::storage::StorageApi<'a, T> { - para_scheduler::storage::StorageApi::new(self.client) - } - pub fn paras(&self) -> paras::storage::StorageApi<'a, T> { - paras::storage::StorageApi::new(self.client) - } - pub fn initializer(&self) -> initializer::storage::StorageApi<'a, T> { - initializer::storage::StorageApi::new(self.client) - } - pub fn dmp(&self) -> dmp::storage::StorageApi<'a, T> { - dmp::storage::StorageApi::new(self.client) - } - pub fn ump(&self) -> ump::storage::StorageApi<'a, T> { - ump::storage::StorageApi::new(self.client) - } - pub fn hrmp(&self) -> hrmp::storage::StorageApi<'a, T> { - hrmp::storage::StorageApi::new(self.client) - } - pub fn para_session_info(&self) -> para_session_info::storage::StorageApi<'a, T> { - para_session_info::storage::StorageApi::new(self.client) - } - pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi<'a, T> { - paras_disputes::storage::StorageApi::new(self.client) - } - pub fn registrar(&self) -> registrar::storage::StorageApi<'a, T> { - registrar::storage::StorageApi::new(self.client) - } - pub fn slots(&self) -> slots::storage::StorageApi<'a, T> { - slots::storage::StorageApi::new(self.client) - } - pub fn auctions(&self) -> auctions::storage::StorageApi<'a, T> { - auctions::storage::StorageApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::storage::StorageApi<'a, T> { - crowdloan::storage::StorageApi::new(self.client) - } - pub fn xcm_pallet(&self) -> xcm_pallet::storage::StorageApi<'a, T> { - xcm_pallet::storage::StorageApi::new(self.client) - } - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn system(&self) -> system::calls::TransactionApi<'a, T, X> { - system::calls::TransactionApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T, X> { - scheduler::calls::TransactionApi::new(self.client) - } - pub fn preimage(&self) -> preimage::calls::TransactionApi<'a, T, X> { - preimage::calls::TransactionApi::new(self.client) - } - pub fn babe(&self) -> babe::calls::TransactionApi<'a, T, X> { - babe::calls::TransactionApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T, X> { - timestamp::calls::TransactionApi::new(self.client) - } - pub fn indices(&self) -> indices::calls::TransactionApi<'a, T, X> { - indices::calls::TransactionApi::new(self.client) - } - pub fn balances(&self) -> balances::calls::TransactionApi<'a, T, X> { - balances::calls::TransactionApi::new(self.client) - } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T, X> { - authorship::calls::TransactionApi::new(self.client) - } - pub fn staking(&self) -> staking::calls::TransactionApi<'a, T, X> { - staking::calls::TransactionApi::new(self.client) - } - pub fn session(&self) -> session::calls::TransactionApi<'a, T, X> { - session::calls::TransactionApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T, X> { - grandpa::calls::TransactionApi::new(self.client) - } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T, X> { - im_online::calls::TransactionApi::new(self.client) - } - pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T, X> { - democracy::calls::TransactionApi::new(self.client) - } - pub fn council(&self) -> council::calls::TransactionApi<'a, T, X> { - council::calls::TransactionApi::new(self.client) - } - pub fn technical_committee( - &self, - ) -> technical_committee::calls::TransactionApi<'a, T, X> { - technical_committee::calls::TransactionApi::new(self.client) - } - pub fn phragmen_election( - &self, - ) -> phragmen_election::calls::TransactionApi<'a, T, X> { - phragmen_election::calls::TransactionApi::new(self.client) - } - pub fn technical_membership( - &self, - ) -> technical_membership::calls::TransactionApi<'a, T, X> { - technical_membership::calls::TransactionApi::new(self.client) - } - pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T, X> { - treasury::calls::TransactionApi::new(self.client) - } - pub fn claims(&self) -> claims::calls::TransactionApi<'a, T, X> { - claims::calls::TransactionApi::new(self.client) - } - pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T, X> { - vesting::calls::TransactionApi::new(self.client) - } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T, X> { - utility::calls::TransactionApi::new(self.client) - } - pub fn identity(&self) -> identity::calls::TransactionApi<'a, T, X> { - identity::calls::TransactionApi::new(self.client) - } - pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T, X> { - proxy::calls::TransactionApi::new(self.client) - } - pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T, X> { - multisig::calls::TransactionApi::new(self.client) - } - pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T, X> { - bounties::calls::TransactionApi::new(self.client) - } - pub fn child_bounties(&self) -> child_bounties::calls::TransactionApi<'a, T, X> { - child_bounties::calls::TransactionApi::new(self.client) - } - pub fn tips(&self) -> tips::calls::TransactionApi<'a, T, X> { - tips::calls::TransactionApi::new(self.client) - } - pub fn election_provider_multi_phase( - &self, - ) -> election_provider_multi_phase::calls::TransactionApi<'a, T, X> { - election_provider_multi_phase::calls::TransactionApi::new(self.client) - } - pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T, X> { - bags_list::calls::TransactionApi::new(self.client) - } - pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T, X> { - configuration::calls::TransactionApi::new(self.client) - } - pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T, X> { - paras_shared::calls::TransactionApi::new(self.client) - } - pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T, X> { - para_inclusion::calls::TransactionApi::new(self.client) - } - pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T, X> { - para_inherent::calls::TransactionApi::new(self.client) - } - pub fn paras(&self) -> paras::calls::TransactionApi<'a, T, X> { - paras::calls::TransactionApi::new(self.client) - } - pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T, X> { - initializer::calls::TransactionApi::new(self.client) - } - pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T, X> { - dmp::calls::TransactionApi::new(self.client) - } - pub fn ump(&self) -> ump::calls::TransactionApi<'a, T, X> { - ump::calls::TransactionApi::new(self.client) - } - pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T, X> { - hrmp::calls::TransactionApi::new(self.client) - } - pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi<'a, T, X> { - paras_disputes::calls::TransactionApi::new(self.client) - } - pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T, X> { - registrar::calls::TransactionApi::new(self.client) - } - pub fn slots(&self) -> slots::calls::TransactionApi<'a, T, X> { - slots::calls::TransactionApi::new(self.client) - } - pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T, X> { - auctions::calls::TransactionApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T, X> { - crowdloan::calls::TransactionApi::new(self.client) - } - pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi<'a, T, X> { - xcm_pallet::calls::TransactionApi::new(self.client) - } - } -} diff --git a/subxt/tests/integration/events.rs b/subxt/tests/integration/events.rs deleted file mode 100644 index 937a4faf91..0000000000 --- a/subxt/tests/integration/events.rs +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - node_runtime::{ - balances, - system, - }, - pair_signer, - test_context, -}; -use futures::StreamExt; -use sp_keyring::AccountKeyring; - -// Check that we can subscribe to non-finalized block events. -#[tokio::test] -async fn non_finalized_block_subscription() -> Result<(), subxt::BasicError> { - env_logger::try_init().ok(); - let ctx = test_context().await; - - let mut event_sub = ctx.api.events().subscribe().await?; - - // Wait for the next set of events, and check that the - // associated block hash is not finalized yet. - let events = event_sub.next().await.unwrap()?; - let event_block_hash = events.block_hash(); - let current_block_hash = ctx.api.client.rpc().block_hash(None).await?.unwrap(); - - assert_eq!(event_block_hash, current_block_hash); - Ok(()) -} - -// Check that we can subscribe to finalized block events. -#[tokio::test] -async fn finalized_block_subscription() -> Result<(), subxt::BasicError> { - env_logger::try_init().ok(); - let ctx = test_context().await; - - let mut event_sub = ctx.api.events().subscribe_finalized().await?; - - // Wait for the next set of events, and check that the - // associated block hash is the one we just finalized. - // (this can be a bit slow as we have to wait for finalization) - let events = event_sub.next().await.unwrap()?; - let event_block_hash = events.block_hash(); - let finalized_hash = ctx.api.client.rpc().finalized_head().await?; - - assert_eq!(event_block_hash, finalized_hash); - Ok(()) -} - -// Check that our subscription actually keeps producing events for -// a few blocks. -#[tokio::test] -async fn subscription_produces_events_each_block() -> Result<(), subxt::BasicError> { - env_logger::try_init().ok(); - let ctx = test_context().await; - - let mut event_sub = ctx.api.events().subscribe().await?; - - for i in 0..3 { - let events = event_sub - .next() - .await - .expect("events expected each block")?; - let success_event = events - .find_first::() - .expect("decode error"); - // Every now and then I get no bytes back for the first block events; - // I assume that this might be the case for the genesis block, so don't - // worry if no event found (but we should have no decode errors etc either way). - if i > 0 && success_event.is_none() { - let n = events.len(); - panic!("Expected an extrinsic success event on iteration {i} (saw {n} other events)") - } - } - - Ok(()) -} - -// Check that our subscription receives events, and we can filter them based on -// it's Stream impl, and ultimately see the event we expect. -#[tokio::test] -async fn balance_transfer_subscription() -> Result<(), subxt::BasicError> { - env_logger::try_init().ok(); - let ctx = test_context().await; - - // Subscribe to balance transfer events, ignoring all else. - let event_sub = ctx - .api - .events() - .subscribe() - .await? - .filter_events::<(balances::events::Transfer,)>(); - - // Calling `.next()` on the above borrows it, and the `filter_map` - // means it's no longer `Unpin`, so we pin it on the stack: - futures::pin_mut!(event_sub); - - // Make a transfer: - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id(); - ctx.api - .tx() - .balances() - .transfer(bob.clone().into(), 10_000)? - .sign_and_submit_then_watch_default(&alice) - .await?; - - // Wait for the next balance transfer event in our subscription stream - // and check that it lines up: - let event = event_sub.next().await.unwrap().unwrap().event; - assert_eq!( - event, - balances::events::Transfer { - from: alice.account_id().clone(), - to: bob.clone(), - amount: 10_000 - } - ); - - Ok(()) -} - -#[tokio::test] -async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::BasicError> { - // This function is not publically available to use, but contains - // the key logic for filling in missing blocks, so we want to test it. - // This is used in `subscribe_finalized` to ensure no block headers are - // missed. - use subxt::events::subscribe_to_block_headers_filling_in_gaps; - - let ctx = test_context().await; - - // Manually subscribe to the next 6 finalized block headers, but deliberately - // filter out some in the middle so we get back b _ _ b _ b. This guarantees - // that there will be some gaps, even if there aren't any from the subscription. - let some_finalized_blocks = ctx - .api - .client - .rpc() - .subscribe_finalized_blocks() - .await? - .enumerate() - .take(6) - .filter(|(n, _)| { - let n = *n; - async move { n == 0 || n == 3 || n == 5 } - }) - .map(|(_, h)| h); - - // This should spot any gaps in the middle and fill them back in. - let all_finalized_blocks = subscribe_to_block_headers_filling_in_gaps( - &ctx.api.client, - None, - some_finalized_blocks, - ); - futures::pin_mut!(all_finalized_blocks); - - // Iterate the block headers, making sure we get them all in order. - let mut last_block_number = None; - while let Some(header) = all_finalized_blocks.next().await { - let header = header?; - - use sp_runtime::traits::Header; - let block_number: u128 = (*header.number()).into(); - - if let Some(last) = last_block_number { - assert_eq!(last + 1, block_number); - } - last_block_number = Some(block_number); - } - - Ok(()) -} - -// This is just a compile-time check that we can subscribe to events in -// a context that requires the event subscription/filtering to be Send-able. -// We test a typical use of EventSubscription and FilterEvents. We don't need -// to run this code; just check that it compiles. -#[allow(unused)] -async fn check_events_are_sendable() { - // check that EventSubscription can be used across await points. - tokio::task::spawn(async { - let ctx = test_context().await; - - let mut event_sub = ctx.api.events().subscribe().await?; - - while let Some(ev) = event_sub.next().await { - // if `event_sub` doesn't implement Send, we can't hold - // it across an await point inside of a tokio::spawn, which - // requires Send. This will lead to a compile error. - } - - Ok::<_, subxt::BasicError>(()) - }); - - // Check that FilterEvents can be used across await points. - tokio::task::spawn(async { - let ctx = test_context().await; - - let mut event_sub = ctx - .api - .events() - .subscribe() - .await? - .filter_events::<(balances::events::Transfer,)>(); - - while let Some(ev) = event_sub.next().await { - // if `event_sub` doesn't implement Send, we can't hold - // it across an await point inside of a tokio::spawn, which - // requires Send; This will lead to a compile error. - } - - Ok::<_, subxt::BasicError>(()) - }); -} diff --git a/subxt/tests/integration/frame/balances.rs b/subxt/tests/integration/frame/balances.rs deleted file mode 100644 index b977eee427..0000000000 --- a/subxt/tests/integration/frame/balances.rs +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - node_runtime::{ - balances, - runtime_types, - system, - DispatchError, - }, - pair_signer, - test_context, -}; -use codec::Decode; -use sp_core::{ - sr25519::Pair, - Pair as _, -}; -use sp_keyring::AccountKeyring; -use sp_runtime::{ - AccountId32, - MultiAddress, -}; -use subxt::Error; - -#[tokio::test] -async fn tx_basic_transfer() -> Result<(), subxt::Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = pair_signer(AccountKeyring::Bob.pair()); - let bob_address = bob.account_id().clone().into(); - let cxt = test_context().await; - let api = &cxt.api; - - let alice_pre = api - .storage() - .system() - .account(alice.account_id(), None) - .await?; - let bob_pre = api - .storage() - .system() - .account(bob.account_id(), None) - .await?; - - let events = api - .tx() - .balances() - .transfer(bob_address, 10_000)? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await?; - let event = events - .find_first::() - .expect("Failed to decode balances::events::Transfer") - .expect("Failed to find balances::events::Transfer"); - let _extrinsic_success = events - .find_first::() - .expect("Failed to decode ExtrinisicSuccess") - .expect("Failed to find ExtrinisicSuccess"); - - let expected_event = balances::events::Transfer { - from: alice.account_id().clone(), - to: bob.account_id().clone(), - amount: 10_000, - }; - assert_eq!(event, expected_event); - - let alice_post = api - .storage() - .system() - .account(alice.account_id(), None) - .await?; - let bob_post = api - .storage() - .system() - .account(bob.account_id(), None) - .await?; - - assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); - assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); - Ok(()) -} - -#[tokio::test] -async fn multiple_transfers_work_nonce_incremented( -) -> Result<(), subxt::Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = pair_signer(AccountKeyring::Bob.pair()); - let bob_address: MultiAddress = bob.account_id().clone().into(); - let cxt = test_context().await; - let api = &cxt.api; - - let bob_pre = api - .storage() - .system() - .account(bob.account_id(), None) - .await?; - - for _ in 0..3 { - api - .tx() - .balances() - .transfer(bob_address.clone(), 10_000)? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_in_block() // Don't need to wait for finalization; this is quicker. - .await? - .wait_for_success() - .await?; - } - - let bob_post = api - .storage() - .system() - .account(bob.account_id(), None) - .await?; - - assert_eq!(bob_pre.data.free + 30_000, bob_post.data.free); - Ok(()) -} - -#[tokio::test] -async fn storage_total_issuance() { - let cxt = test_context().await; - let total_issuance = cxt - .api - .storage() - .balances() - .total_issuance(None) - .await - .unwrap(); - assert_ne!(total_issuance, 0); -} - -#[tokio::test] -async fn storage_balance_lock() -> Result<(), subxt::Error> { - let bob = pair_signer(AccountKeyring::Bob.pair()); - let charlie = AccountKeyring::Charlie.to_account_id(); - let cxt = test_context().await; - - cxt.api - .tx() - .staking() - .bond( - charlie.into(), - 100_000_000_000_000, - runtime_types::pallet_staking::RewardDestination::Stash, - )? - .sign_and_submit_then_watch_default(&bob) - .await? - .wait_for_finalized_success() - .await? - .find_first::()? - .expect("No ExtrinsicSuccess Event found"); - - let locked_account = AccountKeyring::Bob.to_account_id(); - let locks = cxt - .api - .storage() - .balances() - .locks(&locked_account, None) - .await?; - - assert_eq!( - locks.0, - vec![runtime_types::pallet_balances::BalanceLock { - id: *b"staking ", - amount: 100_000_000_000_000, - reasons: runtime_types::pallet_balances::Reasons::All, - }] - ); - - Ok(()) -} - -#[tokio::test] -async fn transfer_error() { - env_logger::try_init().ok(); - let alice = pair_signer(AccountKeyring::Alice.pair()); - let alice_addr = alice.account_id().clone().into(); - let hans = pair_signer(Pair::generate().0); - let hans_address = hans.account_id().clone().into(); - let ctx = test_context().await; - - ctx.api - .tx() - .balances() - .transfer(hans_address, 100_000_000_000_000_000) - .unwrap() - .sign_and_submit_then_watch_default(&alice) - .await - .unwrap() - .wait_for_finalized_success() - .await - .unwrap(); - - let res = ctx - .api - .tx() - .balances() - .transfer(alice_addr, 100_000_000_000_000_000) - .unwrap() - .sign_and_submit_then_watch_default(&hans) - .await - .unwrap() - .wait_for_finalized_success() - .await; - - if let Err(Error::Module(err)) = res { - assert_eq!(err.pallet, "Balances"); - assert_eq!(err.error, "InsufficientBalance"); - } else { - panic!("expected a runtime module error"); - } -} - -#[tokio::test] -async fn transfer_implicit_subscription() { - env_logger::try_init().ok(); - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id(); - let bob_addr = bob.clone().into(); - let cxt = test_context().await; - - let event = cxt - .api - .tx() - .balances() - .transfer(bob_addr, 10_000) - .unwrap() - .sign_and_submit_then_watch_default(&alice) - .await - .unwrap() - .wait_for_finalized_success() - .await - .unwrap() - .find_first::() - .expect("Can decode events") - .expect("Can find balance transfer event"); - - assert_eq!( - event, - balances::events::Transfer { - from: alice.account_id().clone(), - to: bob.clone(), - amount: 10_000 - } - ); -} - -#[tokio::test] -async fn constant_existential_deposit() { - let cxt = test_context().await; - let balances_metadata = cxt.client().metadata().pallet("Balances").unwrap(); - let constant_metadata = balances_metadata.constant("ExistentialDeposit").unwrap(); - let existential_deposit = u128::decode(&mut &constant_metadata.value[..]).unwrap(); - assert_eq!(existential_deposit, 100_000_000_000_000); - assert_eq!( - existential_deposit, - cxt.api - .constants() - .balances() - .existential_deposit() - .unwrap() - ); -} diff --git a/subxt/tests/integration/frame/contracts.rs b/subxt/tests/integration/frame/contracts.rs deleted file mode 100644 index 944d33779b..0000000000 --- a/subxt/tests/integration/frame/contracts.rs +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use sp_keyring::AccountKeyring; - -use crate::{ - node_runtime::{ - self, - contracts::{ - calls::TransactionApi, - events, - storage, - }, - system, - DispatchError, - }, - test_context, - NodeRuntimeParams, - TestContext, -}; -use sp_core::sr25519::Pair; -use sp_runtime::MultiAddress; -use subxt::{ - Client, - Config, - DefaultConfig, - Error, - PairSigner, - TransactionProgress, -}; - -struct ContractsTestContext { - cxt: TestContext, - signer: PairSigner, -} - -type Hash = ::Hash; -type AccountId = ::AccountId; - -impl ContractsTestContext { - async fn init() -> Self { - let cxt = test_context().await; - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - - Self { cxt, signer } - } - - fn client(&self) -> &Client { - self.cxt.client() - } - - fn contracts_tx(&self) -> TransactionApi { - self.cxt.api.tx().contracts() - } - - async fn instantiate_with_code( - &self, - ) -> Result<(Hash, AccountId), Error> { - log::info!("instantiate_with_code:"); - const CONTRACT: &str = r#" - (module - (func (export "call")) - (func (export "deploy")) - ) - "#; - let code = wabt::wat2wasm(CONTRACT).expect("invalid wabt"); - - let events = self - .cxt - .api - .tx() - .contracts() - .instantiate_with_code( - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - None, // storage_deposit_limit - code, - vec![], // data - vec![], // salt - )? - .sign_and_submit_then_watch_default(&self.signer) - .await? - .wait_for_finalized_success() - .await?; - - let code_stored = events - .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; - let instantiated = events - .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - let _extrinsic_success = events - .find_first::()? - .ok_or_else(|| { - Error::Other("Failed to find a ExtrinsicSuccess event".into()) - })?; - - log::info!(" Block hash: {:?}", events.block_hash()); - log::info!(" Code hash: {:?}", code_stored.code_hash); - log::info!(" Contract address: {:?}", instantiated.contract); - Ok((code_stored.code_hash, instantiated.contract)) - } - - async fn instantiate( - &self, - code_hash: Hash, - data: Vec, - salt: Vec, - ) -> Result> { - // call instantiate extrinsic - let result = self - .contracts_tx() - .instantiate( - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - None, // storage_deposit_limit - code_hash, - data, - salt, - )? - .sign_and_submit_then_watch_default(&self.signer) - .await? - .wait_for_finalized_success() - .await?; - - log::info!("Instantiate result: {:?}", result); - let instantiated = result - .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - - Ok(instantiated.contract) - } - - async fn call( - &self, - contract: AccountId, - input_data: Vec, - ) -> Result< - TransactionProgress<'_, DefaultConfig, DispatchError, node_runtime::Event>, - Error, - > { - log::info!("call: {:?}", contract); - let result = self - .contracts_tx() - .call( - MultiAddress::Id(contract), - 0, // value - 500_000_000, // gas_limit - None, // storage_deposit_limit - input_data, - )? - .sign_and_submit_then_watch_default(&self.signer) - .await?; - - log::info!("Call result: {:?}", result); - Ok(result) - } -} - -#[tokio::test] -async fn tx_instantiate_with_code() { - let ctx = ContractsTestContext::init().await; - let result = ctx.instantiate_with_code().await; - - assert!( - result.is_ok(), - "Error calling instantiate_with_code and receiving CodeStored and Instantiated Events: {:?}", - result - ); -} - -#[tokio::test] -async fn tx_instantiate() { - let ctx = ContractsTestContext::init().await; - let (code_hash, _) = ctx.instantiate_with_code().await.unwrap(); - - let instantiated = ctx.instantiate(code_hash, vec![], vec![1u8]).await; - - assert!( - instantiated.is_ok(), - "Error instantiating contract: {:?}", - instantiated - ); -} - -#[tokio::test] -async fn tx_call() { - let cxt = ContractsTestContext::init().await; - let (_, contract) = cxt.instantiate_with_code().await.unwrap(); - - let contract_info = cxt - .cxt - .api - .storage() - .contracts() - .contract_info_of(&contract, None) - .await; - assert!(contract_info.is_ok()); - - let keys = cxt - .client() - .storage() - .fetch_keys::(5, None, None) - .await - .unwrap() - .iter() - .map(|key| hex::encode(&key.0)) - .collect::>(); - println!("keys post: {:?}", keys); - - let executed = cxt.call(contract, vec![]).await; - - assert!(executed.is_ok(), "Error calling contract: {:?}", executed); -} diff --git a/subxt/tests/integration/frame/mod.rs b/subxt/tests/integration/frame/mod.rs deleted file mode 100644 index a4dc4dfaa0..0000000000 --- a/subxt/tests/integration/frame/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -//! Test interactions with some built-in FRAME pallets. - -mod balances; -mod contracts; -mod staking; -mod sudo; -mod system; -mod timestamp; diff --git a/subxt/tests/integration/frame/staking.rs b/subxt/tests/integration/frame/staking.rs deleted file mode 100644 index e5a9ddd1aa..0000000000 --- a/subxt/tests/integration/frame/staking.rs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - node_runtime::{ - runtime_types::pallet_staking::{ - RewardDestination, - ValidatorPrefs, - }, - staking, - DispatchError, - }, - pair_signer, - test_context, -}; -use assert_matches::assert_matches; -use sp_core::{ - sr25519, - Pair, -}; -use sp_keyring::AccountKeyring; -use subxt::Error; - -/// Helper function to generate a crypto pair from seed -fn get_from_seed(seed: &str) -> sr25519::Pair { - sr25519::Pair::from_string(&format!("//{}", seed), None) - .expect("static values are valid; qed") -} - -fn default_validator_prefs() -> ValidatorPrefs { - ValidatorPrefs { - commission: sp_runtime::Perbill::default(), - blocked: false, - } -} - -#[tokio::test] -async fn validate_with_controller_account() { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let ctx = test_context().await; - ctx.api - .tx() - .staking() - .validate(default_validator_prefs()) - .unwrap() - .sign_and_submit_then_watch_default(&alice) - .await - .unwrap() - .wait_for_finalized_success() - .await - .expect("should be successful"); -} - -#[tokio::test] -async fn validate_not_possible_for_stash_account() -> Result<(), Error> { - let alice_stash = pair_signer(get_from_seed("Alice//stash")); - let ctx = test_context().await; - let announce_validator = ctx - .api - .tx() - .staking() - .validate(default_validator_prefs())? - .sign_and_submit_then_watch_default(&alice_stash) - .await? - .wait_for_finalized_success() - .await; - assert_matches!(announce_validator, Err(Error::Module(err)) => { - assert_eq!(err.pallet, "Staking"); - assert_eq!(err.error, "NotController"); - }); - Ok(()) -} - -#[tokio::test] -async fn nominate_with_controller_account() { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = pair_signer(AccountKeyring::Bob.pair()); - let ctx = test_context().await; - - ctx.api - .tx() - .staking() - .nominate(vec![bob.account_id().clone().into()]) - .unwrap() - .sign_and_submit_then_watch_default(&alice) - .await - .unwrap() - .wait_for_finalized_success() - .await - .expect("should be successful"); -} - -#[tokio::test] -async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { - let alice_stash = pair_signer(get_from_seed("Alice//stash")); - let bob = pair_signer(AccountKeyring::Bob.pair()); - let ctx = test_context().await; - - let nomination = ctx - .api - .tx() - .staking() - .nominate(vec![bob.account_id().clone().into()])? - .sign_and_submit_then_watch_default(&alice_stash) - .await? - .wait_for_finalized_success() - .await; - - assert_matches!(nomination, Err(Error::Module(err)) => { - assert_eq!(err.pallet, "Staking"); - assert_eq!(err.error, "NotController"); - }); - Ok(()) -} - -#[tokio::test] -async fn chill_works_for_controller_only() -> Result<(), Error> { - let alice_stash = pair_signer(get_from_seed("Alice//stash")); - let bob_stash = pair_signer(get_from_seed("Bob//stash")); - let alice = pair_signer(AccountKeyring::Alice.pair()); - let ctx = test_context().await; - - // this will fail the second time, which is why this is one test, not two - ctx.api - .tx() - .staking() - .nominate(vec![bob_stash.account_id().clone().into()])? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await?; - - let ledger = ctx - .api - .storage() - .staking() - .ledger(alice.account_id(), None) - .await? - .unwrap(); - assert_eq!(alice_stash.account_id(), &ledger.stash); - - let chill = ctx - .api - .tx() - .staking() - .chill()? - .sign_and_submit_then_watch_default(&alice_stash) - .await? - .wait_for_finalized_success() - .await; - - assert_matches!(chill, Err(Error::Module(err)) => { - assert_eq!(err.pallet, "Staking"); - assert_eq!(err.error, "NotController"); - }); - - let is_chilled = ctx - .api - .tx() - .staking() - .chill()? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await? - .has::()?; - assert!(is_chilled); - - Ok(()) -} - -#[tokio::test] -async fn tx_bond() -> Result<(), Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let ctx = test_context().await; - - let bond = ctx - .api - .tx() - .staking() - .bond( - AccountKeyring::Bob.to_account_id().into(), - 100_000_000_000_000, - RewardDestination::Stash, - ) - .unwrap() - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await; - - assert!(bond.is_ok()); - - let bond_again = ctx - .api - .tx() - .staking() - .bond( - AccountKeyring::Bob.to_account_id().into(), - 100_000_000_000_000, - RewardDestination::Stash, - ) - .unwrap() - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await; - - assert_matches!(bond_again, Err(Error::Module(err)) => { - assert_eq!(err.pallet, "Staking"); - assert_eq!(err.error, "AlreadyBonded"); - }); - Ok(()) -} - -#[tokio::test] -async fn storage_history_depth() -> Result<(), Error> { - let ctx = test_context().await; - let history_depth = ctx.api.storage().staking().history_depth(None).await?; - assert_eq!(history_depth, 84); - Ok(()) -} - -#[tokio::test] -async fn storage_current_era() -> Result<(), Error> { - let ctx = test_context().await; - let _current_era = ctx - .api - .storage() - .staking() - .current_era(None) - .await? - .expect("current era always exists"); - Ok(()) -} - -#[tokio::test] -async fn storage_era_reward_points() -> Result<(), Error> { - let cxt = test_context().await; - let current_era_result = cxt - .api - .storage() - .staking() - .eras_reward_points(&0, None) - .await; - assert!(current_era_result.is_ok()); - - Ok(()) -} diff --git a/subxt/tests/integration/frame/sudo.rs b/subxt/tests/integration/frame/sudo.rs deleted file mode 100644 index 501320d44b..0000000000 --- a/subxt/tests/integration/frame/sudo.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - node_runtime::{ - runtime_types, - sudo, - DispatchError, - }, - pair_signer, - test_context, -}; -use sp_keyring::AccountKeyring; - -type Call = runtime_types::node_runtime::Call; -type BalancesCall = runtime_types::pallet_balances::pallet::Call; - -#[tokio::test] -async fn test_sudo() -> Result<(), subxt::Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id().into(); - let cxt = test_context().await; - - let call = Call::Balances(BalancesCall::transfer { - dest: bob, - value: 10_000, - }); - - let found_event = cxt - .api - .tx() - .sudo() - .sudo(call)? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await? - .has::()?; - - assert!(found_event); - Ok(()) -} - -#[tokio::test] -async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id().into(); - let cxt = test_context().await; - - let call = Call::Balances(BalancesCall::transfer { - dest: bob, - value: 10_000, - }); - - let found_event = cxt - .api - .tx() - .sudo() - .sudo_unchecked_weight(call, 0)? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await? - .has::()?; - - assert!(found_event); - Ok(()) -} diff --git a/subxt/tests/integration/frame/system.rs b/subxt/tests/integration/frame/system.rs deleted file mode 100644 index ff7e9a9c01..0000000000 --- a/subxt/tests/integration/frame/system.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - node_runtime::{ - system, - DispatchError, - }, - pair_signer, - test_context, -}; -use assert_matches::assert_matches; -use sp_keyring::AccountKeyring; - -#[tokio::test] -async fn storage_account() -> Result<(), subxt::Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - - let cxt = test_context().await; - let account_info = cxt - .api - .storage() - .system() - .account(alice.account_id(), None) - .await; - - assert_matches!(account_info, Ok(_)); - Ok(()) -} - -#[tokio::test] -async fn tx_remark_with_event() -> Result<(), subxt::Error> { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let cxt = test_context().await; - - let found_event = cxt - .api - .tx() - .system() - .remark_with_event(b"remarkable".to_vec())? - .sign_and_submit_then_watch_default(&alice) - .await? - .wait_for_finalized_success() - .await? - .has::()?; - - assert!(found_event); - Ok(()) -} diff --git a/subxt/tests/integration/frame/timestamp.rs b/subxt/tests/integration/frame/timestamp.rs deleted file mode 100644 index fa819071b0..0000000000 --- a/subxt/tests/integration/frame/timestamp.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::test_context; - -#[tokio::test] -async fn storage_get_current_timestamp() { - let cxt = test_context().await; - - let timestamp = cxt.api.storage().timestamp().now(None).await; - - assert!(timestamp.is_ok()) -} diff --git a/subxt/tests/integration/main.rs b/subxt/tests/integration/main.rs deleted file mode 100644 index 00dd02b3c8..0000000000 --- a/subxt/tests/integration/main.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -mod codegen; -#[cfg(feature = "integration-tests")] -mod utils; - -#[cfg(test)] -#[cfg(feature = "integration-tests")] -mod client; -#[cfg(test)] -#[cfg(feature = "integration-tests")] -mod events; -#[cfg(test)] -#[cfg(feature = "integration-tests")] -mod frame; -#[cfg(test)] -#[cfg(feature = "integration-tests")] -mod metadata; -#[cfg(test)] -#[cfg(feature = "integration-tests")] -mod storage; - -#[cfg(feature = "integration-tests")] -use test_runtime::node_runtime; -#[cfg(feature = "integration-tests")] -use utils::*; diff --git a/subxt/tests/integration/metadata/mod.rs b/subxt/tests/integration/metadata/mod.rs deleted file mode 100644 index 3217f6bbfe..0000000000 --- a/subxt/tests/integration/metadata/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -mod validation; diff --git a/subxt/tests/integration/metadata/validation.rs b/subxt/tests/integration/metadata/validation.rs deleted file mode 100644 index fa8db37738..0000000000 --- a/subxt/tests/integration/metadata/validation.rs +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - test_context, - TestContext, -}; -use frame_metadata::{ - ExtrinsicMetadata, - PalletCallMetadata, - PalletMetadata, - PalletStorageMetadata, - RuntimeMetadataPrefixed, - RuntimeMetadataV14, - StorageEntryMetadata, - StorageEntryModifier, - StorageEntryType, -}; -use scale_info::{ - build::{ - Fields, - Variants, - }, - meta_type, - Path, - Type, - TypeInfo, -}; -use subxt::{ - ClientBuilder, - DefaultConfig, - Metadata, - SubstrateExtrinsicParams, -}; - -use crate::utils::node_runtime; - -type RuntimeApi = - node_runtime::RuntimeApi>; - -async fn metadata_to_api(metadata: RuntimeMetadataV14, cxt: &TestContext) -> RuntimeApi { - let prefixed = RuntimeMetadataPrefixed::from(metadata); - let metadata = Metadata::try_from(prefixed).unwrap(); - - ClientBuilder::new() - .set_url(cxt.node_proc.ws_url().to_string()) - .set_metadata(metadata) - .build() - .await - .unwrap() - .to_runtime_api::, - >>() -} - -#[tokio::test] -async fn full_metadata_check() { - let cxt = test_context().await; - let api = &cxt.api; - - // Runtime metadata is identical to the metadata used during API generation. - assert!(api.validate_metadata().is_ok()); - - // Modify the metadata. - let mut metadata: RuntimeMetadataV14 = - api.client.metadata().runtime_metadata().clone(); - metadata.pallets[0].name = "NewPallet".to_string(); - - let new_api = metadata_to_api(metadata, &cxt).await; - assert_eq!( - new_api - .validate_metadata() - .err() - .expect("Validation should fail for incompatible metadata"), - ::subxt::MetadataError::IncompatibleMetadata - ); -} - -#[tokio::test] -async fn constants_check() { - let cxt = test_context().await; - let api = &cxt.api; - - // Ensure that `ExistentialDeposit` is compatible before altering the metadata. - assert!(cxt.api.constants().balances().existential_deposit().is_ok()); - - // Modify the metadata. - let mut metadata: RuntimeMetadataV14 = - api.client.metadata().runtime_metadata().clone(); - - let mut existential = metadata - .pallets - .iter_mut() - .find(|pallet| pallet.name == "Balances") - .expect("Metadata must contain Balances pallet") - .constants - .iter_mut() - .find(|constant| constant.name == "ExistentialDeposit") - .expect("ExistentialDeposit constant must be present"); - existential.value = vec![0u8; 32]; - - let new_api = metadata_to_api(metadata, &cxt).await; - - assert!(new_api.validate_metadata().is_err()); - assert!(new_api - .constants() - .balances() - .existential_deposit() - .is_err()); - - // Other constant validation should not be impacted. - assert!(new_api.constants().balances().max_locks().is_ok()); -} - -fn default_pallet() -> PalletMetadata { - PalletMetadata { - name: "Test", - storage: None, - calls: None, - event: None, - constants: vec![], - error: None, - index: 0, - } -} - -fn pallets_to_metadata(pallets: Vec) -> RuntimeMetadataV14 { - RuntimeMetadataV14::new( - pallets, - ExtrinsicMetadata { - ty: meta_type::<()>(), - version: 0, - signed_extensions: vec![], - }, - meta_type::<()>(), - ) -} - -#[tokio::test] -async fn calls_check() { - let cxt = test_context().await; - - // Ensure that `Unbond` and `WinthdrawUnbonded` calls are compatible before altering the metadata. - assert!(cxt.api.tx().staking().unbond(123_456_789_012_345).is_ok()); - assert!(cxt.api.tx().staking().withdraw_unbonded(10).is_ok()); - - // Reconstruct the `Staking` call as is. - struct CallRec; - impl TypeInfo for CallRec { - type Identity = Self; - fn type_info() -> Type { - Type::builder() - .path(Path::new("Call", "pallet_staking::pallet::pallet")) - .variant( - Variants::new() - .variant("unbond", |v| { - v.index(0).fields(Fields::named().field(|f| { - f.compact::() - .name("value") - .type_name("BalanceOf") - })) - }) - .variant("withdraw_unbonded", |v| { - v.index(1).fields(Fields::named().field(|f| { - f.ty::().name("num_slashing_spans").type_name("u32") - })) - }), - ) - } - } - let pallet = PalletMetadata { - name: "Staking", - calls: Some(PalletCallMetadata { - ty: meta_type::(), - }), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_ok()); - assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); - - // Change `Unbond` call but leave the rest as is. - struct CallRecSecond; - impl TypeInfo for CallRecSecond { - type Identity = Self; - fn type_info() -> Type { - Type::builder() - .path(Path::new("Call", "pallet_staking::pallet::pallet")) - .variant( - Variants::new() - .variant("unbond", |v| { - v.index(0).fields(Fields::named().field(|f| { - // Is of type u32 instead of u128. - f.compact::().name("value").type_name("BalanceOf") - })) - }) - .variant("withdraw_unbonded", |v| { - v.index(1).fields(Fields::named().field(|f| { - f.ty::().name("num_slashing_spans").type_name("u32") - })) - }), - ) - } - } - let pallet = PalletMetadata { - name: "Staking", - calls: Some(PalletCallMetadata { - ty: meta_type::(), - }), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - // Unbond call should fail, while withdraw_unbonded remains compatible. - assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_err()); - assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); -} - -#[tokio::test] -async fn storage_check() { - let cxt = test_context().await; - - // Ensure that `ExtrinsicCount` and `EventCount` storages are compatible before altering the metadata. - assert!(cxt - .api - .storage() - .system() - .extrinsic_count(None) - .await - .is_ok()); - assert!(cxt - .api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); - - // Reconstruct the storage. - let storage = PalletStorageMetadata { - prefix: "System", - entries: vec![ - StorageEntryMetadata { - name: "ExtrinsicCount", - modifier: StorageEntryModifier::Optional, - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - StorageEntryMetadata { - name: "AllExtrinsicsLen", - modifier: StorageEntryModifier::Optional, - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - ], - }; - let pallet = PalletMetadata { - name: "System", - storage: Some(storage), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api - .storage() - .system() - .extrinsic_count(None) - .await - .is_ok()); - assert!(new_api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); - - // Reconstruct the storage while modifying ExtrinsicCount. - let storage = PalletStorageMetadata { - prefix: "System", - entries: vec![ - StorageEntryMetadata { - name: "ExtrinsicCount", - modifier: StorageEntryModifier::Optional, - // Previously was u32. - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - StorageEntryMetadata { - name: "AllExtrinsicsLen", - modifier: StorageEntryModifier::Optional, - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - ], - }; - let pallet = PalletMetadata { - name: "System", - storage: Some(storage), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api - .storage() - .system() - .extrinsic_count(None) - .await - .is_err()); - assert!(new_api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); -} diff --git a/subxt/tests/integration/storage.rs b/subxt/tests/integration/storage.rs deleted file mode 100644 index 552a06278f..0000000000 --- a/subxt/tests/integration/storage.rs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - node_runtime::{ - self, - DispatchError, - }, - pair_signer, - test_context, -}; -use sp_keyring::AccountKeyring; - -#[tokio::test] -async fn storage_plain_lookup() -> Result<(), subxt::Error> { - let ctx = test_context().await; - - // Look up a plain value. Wait long enough that we don't get the genesis block data, - // because it may have no storage associated with it. - tokio::time::sleep(std::time::Duration::from_secs(6)).await; - let entry = ctx.api.storage().timestamp().now(None).await?; - assert!(entry > 0); - - Ok(()) -} - -#[tokio::test] -async fn storage_map_lookup() -> Result<(), subxt::Error> { - let ctx = test_context().await; - - let signer = pair_signer(AccountKeyring::Alice.pair()); - let alice = AccountKeyring::Alice.to_account_id(); - - // Do some transaction to bump the Alice nonce to 1: - ctx.api - .tx() - .system() - .remark(vec![1, 2, 3, 4, 5])? - .sign_and_submit_then_watch_default(&signer) - .await? - .wait_for_finalized_success() - .await?; - - // Look up the nonce for the user (we expect it to be 1). - let entry = ctx.api.storage().system().account(&alice, None).await?; - assert_eq!(entry.nonce, 1); - - Ok(()) -} - -// This fails until the fix in https://github.com/paritytech/subxt/pull/458 is introduced. -// Here we create a key that looks a bit like a StorageNMap key, but should in fact be -// treated as a StorageKey (ie we should hash both values together with one hasher, rather -// than hash both values separately, or ignore the second value). -#[tokio::test] -async fn storage_n_mapish_key_is_properly_created( -) -> Result<(), subxt::Error> { - use codec::Encode; - use node_runtime::{ - runtime_types::sp_core::crypto::KeyTypeId, - session::storage::KeyOwner, - }; - use subxt::{ - storage::StorageKeyPrefix, - StorageEntry, - }; - - // This is what the generated code hashes a `session().key_owner(..)` key into: - let actual_key_bytes = KeyOwner(&KeyTypeId([1, 2, 3, 4]), &[5u8, 6, 7, 8]) - .key() - .final_key(StorageKeyPrefix::new::()) - .0; - - // Let's manually hash to what we assume it should be and compare: - let expected_key_bytes = { - // Hash the prefix to the storage entry: - let mut bytes = sp_core::twox_128("Session".as_bytes()).to_vec(); - bytes.extend(&sp_core::twox_128("KeyOwner".as_bytes())[..]); - // twox64_concat a *tuple* of the args expected: - let suffix = (KeyTypeId([1, 2, 3, 4]), vec![5u8, 6, 7, 8]).encode(); - bytes.extend(&sp_core::twox_64(&suffix)); - bytes.extend(&suffix); - bytes - }; - - assert_eq!(actual_key_bytes, expected_key_bytes); - Ok(()) -} - -#[tokio::test] -async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> { - let ctx = test_context().await; - - // Boilerplate; we create a new asset class with ID 99, and then - // we "approveTransfer" of some of this asset class. This gives us an - // entry in the `Approvals` StorageNMap that we can try to look up. - let signer = pair_signer(AccountKeyring::Alice.pair()); - let alice = AccountKeyring::Alice.to_account_id(); - let bob = AccountKeyring::Bob.to_account_id(); - ctx.api - .tx() - .assets() - .create(99, alice.clone().into(), 1)? - .sign_and_submit_then_watch_default(&signer) - .await? - .wait_for_finalized_success() - .await?; - ctx.api - .tx() - .assets() - .approve_transfer(99, bob.clone().into(), 123)? - .sign_and_submit_then_watch_default(&signer) - .await? - .wait_for_finalized_success() - .await?; - - // The actual test; look up this approval in storage: - let entry = ctx - .api - .storage() - .assets() - .approvals(&99, &alice, &bob, None) - .await?; - assert_eq!(entry.map(|a| a.amount), Some(123)); - Ok(()) -} diff --git a/subxt/tests/integration/utils/context.rs b/subxt/tests/integration/utils/context.rs deleted file mode 100644 index b1e85d102b..0000000000 --- a/subxt/tests/integration/utils/context.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -pub(crate) use crate::{ - node_runtime, - TestNodeProcess, -}; - -use sp_core::sr25519::Pair; -use sp_keyring::AccountKeyring; -use subxt::{ - Client, - DefaultConfig, - PairSigner, - SubstrateExtrinsicParams, -}; - -/// substrate node should be installed on the $PATH -const SUBSTRATE_NODE_PATH: &str = "substrate"; - -pub type NodeRuntimeParams = SubstrateExtrinsicParams; - -pub async fn test_node_process_with( - key: AccountKeyring, -) -> TestNodeProcess { - let path = std::env::var("SUBSTRATE_NODE_PATH").unwrap_or_else(|_| { - if which::which(SUBSTRATE_NODE_PATH).is_err() { - panic!("A substrate binary should be installed on your path for integration tests. \ - See https://github.com/paritytech/subxt/tree/master#integration-testing") - } - SUBSTRATE_NODE_PATH.to_string() - }); - - let proc = TestNodeProcess::::build(path.as_str()) - .with_authority(key) - .spawn::() - .await; - proc.unwrap() -} - -pub async fn test_node_process() -> TestNodeProcess { - test_node_process_with(AccountKeyring::Alice).await -} - -pub struct TestContext { - pub node_proc: TestNodeProcess, - pub api: node_runtime::RuntimeApi, -} - -impl TestContext { - pub fn client(&self) -> &Client { - &self.api.client - } -} - -pub async fn test_context() -> TestContext { - env_logger::try_init().ok(); - let node_proc = test_node_process_with(AccountKeyring::Alice).await; - let api = node_proc.client().clone().to_runtime_api(); - TestContext { node_proc, api } -} - -pub fn pair_signer(pair: Pair) -> PairSigner { - PairSigner::new(pair) -} diff --git a/subxt/tests/integration/utils/mod.rs b/subxt/tests/integration/utils/mod.rs deleted file mode 100644 index d2041160d6..0000000000 --- a/subxt/tests/integration/utils/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -mod context; -mod node_proc; - -pub use context::*; -pub use node_proc::TestNodeProcess; diff --git a/subxt/tests/integration/utils/node_proc.rs b/subxt/tests/integration/utils/node_proc.rs deleted file mode 100644 index 16e5d8887f..0000000000 --- a/subxt/tests/integration/utils/node_proc.rs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use sp_keyring::AccountKeyring; -use std::{ - ffi::{ - OsStr, - OsString, - }, - io::{ - BufRead, - BufReader, - Read, - }, - process, -}; -use subxt::{ - Client, - ClientBuilder, - Config, -}; - -/// Spawn a local substrate node for testing subxt. -pub struct TestNodeProcess { - proc: process::Child, - client: Client, - ws_url: String, -} - -impl Drop for TestNodeProcess -where - R: Config, -{ - fn drop(&mut self) { - let _ = self.kill(); - } -} - -impl TestNodeProcess -where - R: Config, -{ - /// Construct a builder for spawning a test node process. - pub fn build(program: S) -> TestNodeProcessBuilder - where - S: AsRef + Clone, - { - TestNodeProcessBuilder::new(program) - } - - /// Attempt to kill the running substrate process. - pub fn kill(&mut self) -> Result<(), String> { - log::info!("Killing node process {}", self.proc.id()); - if let Err(err) = self.proc.kill() { - let err = format!("Error killing node process {}: {}", self.proc.id(), err); - log::error!("{}", err); - return Err(err) - } - Ok(()) - } - - /// Returns the subxt client connected to the running node. - pub fn client(&self) -> &Client { - &self.client - } - - /// Returns the address to which the client is connected. - pub fn ws_url(&self) -> &str { - &self.ws_url - } -} - -/// Construct a test node process. -pub struct TestNodeProcessBuilder { - node_path: OsString, - authority: Option, -} - -impl TestNodeProcessBuilder { - pub fn new

(node_path: P) -> TestNodeProcessBuilder - where - P: AsRef, - { - Self { - node_path: node_path.as_ref().into(), - authority: None, - } - } - - /// Set the authority dev account for a node in validator mode e.g. --alice. - pub fn with_authority(&mut self, account: AccountKeyring) -> &mut Self { - self.authority = Some(account); - self - } - - /// Spawn the substrate node at the given path, and wait for rpc to be initialized. - pub async fn spawn(&self) -> Result, String> - where - R: Config, - { - let mut cmd = process::Command::new(&self.node_path); - cmd.env("RUST_LOG", "info") - .arg("--dev") - .arg("--tmp") - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::piped()) - .arg("--port=0") - .arg("--rpc-port=0") - .arg("--ws-port=0"); - - if let Some(authority) = self.authority { - let authority = format!("{:?}", authority); - let arg = format!("--{}", authority.as_str().to_lowercase()); - cmd.arg(arg); - } - - let mut proc = cmd.spawn().map_err(|e| { - format!( - "Error spawning substrate node '{}': {}", - self.node_path.to_string_lossy(), - e - ) - })?; - - // Wait for RPC port to be logged (it's logged to stderr): - let stderr = proc.stderr.take().unwrap(); - let ws_port = find_substrate_port_from_output(stderr); - let ws_url = format!("ws://127.0.0.1:{}", ws_port); - - // Connect to the node with a subxt client: - let client = ClientBuilder::new().set_url(ws_url.clone()).build().await; - match client { - Ok(client) => { - Ok(TestNodeProcess { - proc, - client, - ws_url, - }) - } - Err(err) => { - let err = format!("Failed to connect to node rpc at {}: {}", ws_url, err); - log::error!("{}", err); - proc.kill().map_err(|e| { - format!("Error killing substrate process '{}': {}", proc.id(), e) - })?; - Err(err) - } - } - } -} - -// Consume a stderr reader from a spawned substrate command and -// locate the port number that is logged out to it. -fn find_substrate_port_from_output(r: impl Read + Send + 'static) -> u16 { - BufReader::new(r) - .lines() - .find_map(|line| { - let line = line - .expect("failed to obtain next line from stdout for port discovery"); - - // does the line contain our port (we expect this specific output from substrate). - let line_end = match line.rsplit_once("Listening for new connections on 127.0.0.1:") { - None => return None, - Some((_, after)) => after - }; - - // trim non-numeric chars from the end of the port part of the line. - let port_str = line_end.trim_end_matches(|b| !('0'..='9').contains(&b)); - - // expect to have a number here (the chars after '127.0.0.1:') and parse them into a u16. - let port_num = port_str - .parse() - .unwrap_or_else(|_| panic!("valid port expected on 'Listening for new connections' line, got '{port_str}'")); - - Some(port_num) - }) - .expect("We should find a port before the reader ends") -} From e73c76355d929fe02328ce7cb35f4716224e03c9 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:08:04 +0300 Subject: [PATCH 26/37] test-runtime: Remove `integration-tests` feature flag Signed-off-by: Alexandru Vasile --- test-runtime/Cargo.toml | 3 --- test-runtime/build.rs | 7 ------- test-runtime/src/lib.rs | 2 -- 3 files changed, 12 deletions(-) diff --git a/test-runtime/Cargo.toml b/test-runtime/Cargo.toml index 2629191db5..932934f5c2 100644 --- a/test-runtime/Cargo.toml +++ b/test-runtime/Cargo.toml @@ -3,9 +3,6 @@ name = "test-runtime" version = "0.20.0" edition = "2021" -[features] -integration-tests = [] - [dependencies] subxt = { path = "../subxt" } sp-runtime = "6.0.0" diff --git a/test-runtime/build.rs b/test-runtime/build.rs index 93960401cb..acff4a9641 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -33,7 +33,6 @@ use subxt::rpc::{ }; static SUBSTRATE_BIN_ENV_VAR: &str = "SUBSTRATE_NODE_PATH"; -static INTEGRATION_FEATURE_FLAG: &str = "CARGO_FEATURE_INTEGRATION_TESTS"; #[tokio::main] async fn main() { @@ -41,12 +40,6 @@ async fn main() { } async fn run() { - // The build script must run only in test context, as having `integration-tests` feature - // flag enabled. - if env::var_os(INTEGRATION_FEATURE_FLAG).is_none() { - return - } - // Select substrate binary to run based on env var. let substrate_bin = env::var(SUBSTRATE_BIN_ENV_VAR).unwrap_or_else(|_| "substrate".to_owned()); diff --git a/test-runtime/src/lib.rs b/test-runtime/src/lib.rs index 8cca9b6f28..e5bbb383e1 100644 --- a/test-runtime/src/lib.rs +++ b/test-runtime/src/lib.rs @@ -17,8 +17,6 @@ #![allow(clippy::too_many_arguments)] /// The SCALE encoded metadata obtained from a local run of a substrate node. -#[cfg(feature = "integration-tests")] pub static METADATA: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/metadata.scale")); -#[cfg(feature = "integration-tests")] include!(concat!(env!("OUT_DIR"), "/runtime.rs")); From e3093289f3d5b80d84c85edfcba13bf737be4e31 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:08:28 +0300 Subject: [PATCH 27/37] integration-tests: Add an integration test crate for subxt Signed-off-by: Alexandru Vasile --- Cargo.toml | 1 + integration-tests/Cargo.toml | 43 + integration-tests/src/lib.rs | 15 + integration-tests/tests/integration/client.rs | 133 + .../tests/integration/codegen/mod.rs | 26 + .../tests/integration/codegen/polkadot.rs | 47645 ++++++++++++++++ integration-tests/tests/integration/events.rs | 230 + .../tests/integration/frame/balances.rs | 280 + .../tests/integration/frame/contracts.rs | 227 + .../tests/integration/frame/mod.rs | 24 + .../tests/integration/frame/staking.rs | 262 + .../tests/integration/frame/sudo.rs | 81 + .../tests/integration/frame/system.rs | 62 + .../tests/integration/frame/timestamp.rs | 26 + integration-tests/tests/integration/main.rs | 32 + .../tests/integration/metadata/mod.rs | 17 + .../tests/integration/metadata/validation.rs | 334 + .../tests/integration/storage.rs | 139 + .../tests/integration/utils/context.rs | 78 + .../tests/integration/utils/mod.rs | 21 + .../tests/integration/utils/node_proc.rs | 191 + 21 files changed, 49867 insertions(+) create mode 100644 integration-tests/Cargo.toml create mode 100644 integration-tests/src/lib.rs create mode 100644 integration-tests/tests/integration/client.rs create mode 100644 integration-tests/tests/integration/codegen/mod.rs create mode 100644 integration-tests/tests/integration/codegen/polkadot.rs create mode 100644 integration-tests/tests/integration/events.rs create mode 100644 integration-tests/tests/integration/frame/balances.rs create mode 100644 integration-tests/tests/integration/frame/contracts.rs create mode 100644 integration-tests/tests/integration/frame/mod.rs create mode 100644 integration-tests/tests/integration/frame/staking.rs create mode 100644 integration-tests/tests/integration/frame/sudo.rs create mode 100644 integration-tests/tests/integration/frame/system.rs create mode 100644 integration-tests/tests/integration/frame/timestamp.rs create mode 100644 integration-tests/tests/integration/main.rs create mode 100644 integration-tests/tests/integration/metadata/mod.rs create mode 100644 integration-tests/tests/integration/metadata/validation.rs create mode 100644 integration-tests/tests/integration/storage.rs create mode 100644 integration-tests/tests/integration/utils/context.rs create mode 100644 integration-tests/tests/integration/utils/mod.rs create mode 100644 integration-tests/tests/integration/utils/node_proc.rs diff --git a/Cargo.toml b/Cargo.toml index 82ae63559a..c40d47f125 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "cli", "codegen", "examples", + "integration-tests", "macro", "metadata", "subxt", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml new file mode 100644 index 0000000000..7de2cc075b --- /dev/null +++ b/integration-tests/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "subxt-integration" +version = "0.20.0" +authors = ["Parity Technologies "] +edition = "2021" + +license = "GPL-3.0" +readme = "../README.md" +repository = "https://github.com/paritytech/subxt" +documentation = "https://docs.rs/subxt" +homepage = "https://www.parity.io/" +description = "Subxt integration tests that rely on the Substrate binary" + +[features] +default = ["subxt/integration-tests"] + +[dependencies] +async-trait = "0.1.49" +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } +scale-info = { version = "2.0.0", features = ["bit-vec"] } +futures = "0.3.13" +hex = "0.4.3" +log = "0.4.14" + +subxt-macro = { version = "0.20.0", path = "../macro" } +subxt-metadata = { version = "0.20.0", path = "../metadata" } +subxt = { version = "0.20.0", path = "../subxt" } + +sp-core = { version = "6.0.0", default-features = false } +sp-runtime = "6.0.0" + +frame-metadata = "15.0.0" +derivative = "2.2.0" + +sp-arithmetic = { version = "5.0.0", default-features = false } +assert_matches = "1.5.0" +tokio = { version = "1.8", features = ["macros", "time"] } +env_logger = "0.9.0" +tempdir = "0.3.7" +wabt = "0.10.0" +which = "4.0.2" +test-runtime = { path = "../test-runtime" } +sp-keyring = "6.0.0" diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs new file mode 100644 index 0000000000..82b38f41f3 --- /dev/null +++ b/integration-tests/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . diff --git a/integration-tests/tests/integration/client.rs b/integration-tests/tests/integration/client.rs new file mode 100644 index 0000000000..050ef2e32b --- /dev/null +++ b/integration-tests/tests/integration/client.rs @@ -0,0 +1,133 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + test_node_process, + test_node_process_with, + utils::node_runtime::system, +}; + +use sp_core::storage::{ + well_known_keys, + StorageKey, +}; +use sp_keyring::AccountKeyring; + +#[tokio::test] +async fn insert_key() { + let test_node_process = test_node_process_with(AccountKeyring::Bob).await; + let client = test_node_process.client(); + let public = AccountKeyring::Alice.public().as_array_ref().to_vec(); + client + .rpc() + .insert_key( + "aura".to_string(), + "//Alice".to_string(), + public.clone().into(), + ) + .await + .unwrap(); + assert!(client + .rpc() + .has_key(public.clone().into(), "aura".to_string()) + .await + .unwrap()); +} + +#[tokio::test] +async fn fetch_block_hash() { + let node_process = test_node_process().await; + node_process.client().rpc().block_hash(None).await.unwrap(); +} + +#[tokio::test] +async fn fetch_block() { + let node_process = test_node_process().await; + let client = node_process.client(); + let block_hash = client.rpc().block_hash(None).await.unwrap(); + client.rpc().block(block_hash).await.unwrap(); +} + +#[tokio::test] +async fn fetch_read_proof() { + let node_process = test_node_process().await; + let client = node_process.client(); + let block_hash = client.rpc().block_hash(None).await.unwrap(); + client + .rpc() + .read_proof( + vec![ + StorageKey(well_known_keys::HEAP_PAGES.to_vec()), + StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), + ], + block_hash, + ) + .await + .unwrap(); +} + +#[tokio::test] +async fn chain_subscribe_blocks() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut blocks = client.rpc().subscribe_blocks().await.unwrap(); + blocks.next().await.unwrap().unwrap(); +} + +#[tokio::test] +async fn chain_subscribe_finalized_blocks() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut blocks = client.rpc().subscribe_finalized_blocks().await.unwrap(); + blocks.next().await.unwrap().unwrap(); +} + +#[tokio::test] +async fn fetch_keys() { + let node_process = test_node_process().await; + let client = node_process.client(); + let keys = client + .storage() + .fetch_keys::(4, None, None) + .await + .unwrap(); + assert_eq!(keys.len(), 4) +} + +#[tokio::test] +async fn test_iter() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut iter = client + .storage() + .iter::(None) + .await + .unwrap(); + let mut i = 0; + while iter.next().await.unwrap().is_some() { + i += 1; + } + assert_eq!(i, 13); +} + +#[tokio::test] +async fn fetch_system_info() { + let node_process = test_node_process().await; + let client = node_process.client(); + assert_eq!(client.rpc().system_chain().await.unwrap(), "Development"); + assert_eq!(client.rpc().system_name().await.unwrap(), "Substrate Node"); + assert!(!client.rpc().system_version().await.unwrap().is_empty()); +} diff --git a/integration-tests/tests/integration/codegen/mod.rs b/integration-tests/tests/integration/codegen/mod.rs new file mode 100644 index 0000000000..4f35f5d3e9 --- /dev/null +++ b/integration-tests/tests/integration/codegen/mod.rs @@ -0,0 +1,26 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +/// Checks that code generated by `subxt-cli codegen` compiles. Allows inspection of compiler errors +/// directly, more accurately than via the macro and `cargo expand`. +/// +/// Generate by: +/// +/// - run `polkadot --dev --tmp` node locally +/// - `cargo run --release -p subxt-cli -- codegen | rustfmt > subxt/tests/integration/codegen/polkadot.rs` +#[rustfmt::skip] +#[allow(clippy::all)] +mod polkadot; diff --git a/integration-tests/tests/integration/codegen/polkadot.rs b/integration-tests/tests/integration/codegen/polkadot.rs new file mode 100644 index 0000000000..d9dc9e17a8 --- /dev/null +++ b/integration-tests/tests/integration/codegen/polkadot.rs @@ -0,0 +1,47645 @@ +#[allow(dead_code, unused_imports, non_camel_case_types)] +pub mod api { + use super::api as root_mod; + pub static PALLETS: [&str; 51usize] = [ + "System", + "Scheduler", + "Preimage", + "Babe", + "Timestamp", + "Indices", + "Balances", + "TransactionPayment", + "Authorship", + "Staking", + "Offences", + "Historical", + "Session", + "Grandpa", + "ImOnline", + "AuthorityDiscovery", + "Democracy", + "Council", + "TechnicalCommittee", + "PhragmenElection", + "TechnicalMembership", + "Treasury", + "Claims", + "Vesting", + "Utility", + "Identity", + "Proxy", + "Multisig", + "Bounties", + "ChildBounties", + "Tips", + "ElectionProviderMultiPhase", + "BagsList", + "ParachainsOrigin", + "Configuration", + "ParasShared", + "ParaInclusion", + "ParaInherent", + "ParaScheduler", + "Paras", + "Initializer", + "Dmp", + "Ump", + "Hrmp", + "ParaSessionInfo", + "ParasDisputes", + "Registrar", + "Slots", + "Auctions", + "Crowdloan", + "XcmPallet", + ]; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Event { + #[codec(index = 0)] + System(system::Event), + #[codec(index = 1)] + Scheduler(scheduler::Event), + #[codec(index = 10)] + Preimage(preimage::Event), + #[codec(index = 4)] + Indices(indices::Event), + #[codec(index = 5)] + Balances(balances::Event), + #[codec(index = 7)] + Staking(staking::Event), + #[codec(index = 8)] + Offences(offences::Event), + #[codec(index = 9)] + Session(session::Event), + #[codec(index = 11)] + Grandpa(grandpa::Event), + #[codec(index = 12)] + ImOnline(im_online::Event), + #[codec(index = 14)] + Democracy(democracy::Event), + #[codec(index = 15)] + Council(council::Event), + #[codec(index = 16)] + TechnicalCommittee(technical_committee::Event), + #[codec(index = 17)] + PhragmenElection(phragmen_election::Event), + #[codec(index = 18)] + TechnicalMembership(technical_membership::Event), + #[codec(index = 19)] + Treasury(treasury::Event), + #[codec(index = 24)] + Claims(claims::Event), + #[codec(index = 25)] + Vesting(vesting::Event), + #[codec(index = 26)] + Utility(utility::Event), + #[codec(index = 28)] + Identity(identity::Event), + #[codec(index = 29)] + Proxy(proxy::Event), + #[codec(index = 30)] + Multisig(multisig::Event), + #[codec(index = 34)] + Bounties(bounties::Event), + #[codec(index = 38)] + ChildBounties(child_bounties::Event), + #[codec(index = 35)] + Tips(tips::Event), + #[codec(index = 36)] + ElectionProviderMultiPhase(election_provider_multi_phase::Event), + #[codec(index = 37)] + BagsList(bags_list::Event), + #[codec(index = 53)] + ParaInclusion(para_inclusion::Event), + #[codec(index = 56)] + Paras(paras::Event), + #[codec(index = 59)] + Ump(ump::Event), + #[codec(index = 60)] + Hrmp(hrmp::Event), + #[codec(index = 62)] + ParasDisputes(paras_disputes::Event), + #[codec(index = 70)] + Registrar(registrar::Event), + #[codec(index = 71)] + Slots(slots::Event), + #[codec(index = 72)] + Auctions(auctions::Event), + #[codec(index = 73)] + Crowdloan(crowdloan::Event), + #[codec(index = 99)] + XcmPallet(xcm_pallet::Event), + } + pub mod system { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct FillBlock { + pub ratio: runtime_types::sp_arithmetic::per_things::Perbill, + } + impl ::subxt::Call for FillBlock { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "fill_block"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Remark { + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Remark { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "remark"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHeapPages { + pub pages: ::core::primitive::u64, + } + impl ::subxt::Call for SetHeapPages { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_heap_pages"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetCode { + pub code: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for SetCode { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_code"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetCodeWithoutChecks { + pub code: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for SetCodeWithoutChecks { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_code_without_checks"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetStorage { + pub items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, + } + impl ::subxt::Call for SetStorage { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_storage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KillStorage { + pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + } + impl ::subxt::Call for KillStorage { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "kill_storage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KillPrefix { + pub prefix: ::std::vec::Vec<::core::primitive::u8>, + pub subkeys: ::core::primitive::u32, + } + impl ::subxt::Call for KillPrefix { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "kill_prefix"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemarkWithEvent { + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for RemarkWithEvent { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "remark_with_event"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "A dispatch that will fill the block weight up to the given ratio."] + pub fn fill_block( + &self, + ratio: runtime_types::sp_arithmetic::per_things::Perbill, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + FillBlock, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 228u8, 117u8, 251u8, 95u8, 47u8, 56u8, 32u8, 177u8, 191u8, + 72u8, 75u8, 23u8, 193u8, 175u8, 227u8, 218u8, 127u8, 94u8, + 114u8, 110u8, 215u8, 61u8, 162u8, 102u8, 73u8, 89u8, 218u8, + 148u8, 59u8, 73u8, 59u8, 149u8, + ] + { + let call = FillBlock { ratio }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`"] + #[doc = "# "] + pub fn remark( + &self, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Remark, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 186u8, 79u8, 33u8, 199u8, 216u8, 115u8, 19u8, 146u8, 220u8, + 174u8, 98u8, 61u8, 179u8, 230u8, 40u8, 70u8, 22u8, 251u8, + 77u8, 62u8, 133u8, 80u8, 186u8, 70u8, 135u8, 172u8, 178u8, + 241u8, 69u8, 106u8, 235u8, 140u8, + ] + { + let call = Remark { remark }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + pub fn set_heap_pages( + &self, + pages: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHeapPages, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 77u8, 138u8, 122u8, 55u8, 179u8, 101u8, 60u8, 137u8, 173u8, + 39u8, 28u8, 36u8, 237u8, 243u8, 232u8, 162u8, 76u8, 176u8, + 135u8, 58u8, 60u8, 177u8, 105u8, 136u8, 94u8, 53u8, 26u8, + 31u8, 41u8, 156u8, 228u8, 241u8, + ] + { + let call = SetHeapPages { pages }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the new runtime code."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] + #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] + #[doc = " expensive)."] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] + #[doc = "expensive. We will treat this as a full block."] + #[doc = "# "] + pub fn set_code( + &self, + code: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetCode, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 35u8, 75u8, 103u8, 203u8, 91u8, 141u8, 77u8, 95u8, 37u8, + 157u8, 107u8, 240u8, 54u8, 242u8, 245u8, 205u8, 104u8, 165u8, + 177u8, 37u8, 86u8, 197u8, 28u8, 202u8, 121u8, 159u8, 18u8, + 204u8, 237u8, 117u8, 141u8, 131u8, + ] + { + let call = SetCode { code }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C)` where `C` length of `code`"] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] + #[doc = "block. # "] + pub fn set_code_without_checks( + &self, + code: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetCodeWithoutChecks, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 150u8, 148u8, 119u8, 129u8, 77u8, 216u8, 135u8, 187u8, 127u8, + 24u8, 238u8, 15u8, 227u8, 229u8, 191u8, 217u8, 106u8, 129u8, + 149u8, 79u8, 154u8, 78u8, 53u8, 159u8, 89u8, 69u8, 103u8, + 197u8, 93u8, 161u8, 134u8, 17u8, + ] + { + let call = SetCodeWithoutChecks { code }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set some items of storage."] + pub fn set_storage( + &self, + items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetStorage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 197u8, 12u8, 119u8, 205u8, 152u8, 103u8, 211u8, 170u8, 146u8, + 253u8, 25u8, 56u8, 180u8, 146u8, 74u8, 75u8, 38u8, 108u8, + 212u8, 154u8, 23u8, 22u8, 148u8, 175u8, 107u8, 186u8, 222u8, + 13u8, 149u8, 132u8, 204u8, 217u8, + ] + { + let call = SetStorage { items }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Kill some items from storage."] + pub fn kill_storage( + &self, + keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + KillStorage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 154u8, 115u8, 185u8, 20u8, 126u8, 90u8, 222u8, 131u8, 199u8, + 57u8, 184u8, 226u8, 43u8, 245u8, 161u8, 176u8, 194u8, 123u8, + 139u8, 97u8, 97u8, 94u8, 47u8, 64u8, 204u8, 96u8, 190u8, + 94u8, 216u8, 237u8, 69u8, 51u8, + ] + { + let call = KillStorage { keys }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + pub fn kill_prefix( + &self, + prefix: ::std::vec::Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + KillPrefix, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 214u8, 101u8, 191u8, 241u8, 1u8, 241u8, 144u8, 116u8, 246u8, + 199u8, 159u8, 249u8, 155u8, 164u8, 220u8, 221u8, 75u8, 33u8, + 204u8, 3u8, 255u8, 201u8, 187u8, 238u8, 181u8, 213u8, 41u8, + 105u8, 234u8, 120u8, 202u8, 115u8, + ] + { + let call = KillPrefix { prefix, subkeys }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Make some on-chain remark and emit event."] + pub fn remark_with_event( + &self, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemarkWithEvent, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 171u8, 82u8, 75u8, 237u8, 69u8, 197u8, 223u8, 125u8, 123u8, + 51u8, 241u8, 35u8, 202u8, 210u8, 227u8, 109u8, 1u8, 241u8, + 255u8, 63u8, 33u8, 115u8, 156u8, 239u8, 97u8, 76u8, 193u8, + 35u8, 74u8, 199u8, 43u8, 255u8, + ] + { + let call = RemarkWithEvent { remark }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::frame_system::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An extrinsic completed successfully."] + pub struct ExtrinsicSuccess { + pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, + } + impl ::subxt::Event for ExtrinsicSuccess { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicSuccess"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An extrinsic failed."] + pub struct ExtrinsicFailed { + pub dispatch_error: runtime_types::sp_runtime::DispatchError, + pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, + } + impl ::subxt::Event for ExtrinsicFailed { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicFailed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "`:code` was updated."] + pub struct CodeUpdated; + impl ::subxt::Event for CodeUpdated { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "CodeUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new account was created."] + pub struct NewAccount { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for NewAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "NewAccount"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account was reaped."] + pub struct KilledAccount { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for KilledAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "KilledAccount"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "On on-chain remark happened."] + pub struct Remarked { + pub sender: ::subxt::sp_core::crypto::AccountId32, + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Remarked { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "Remarked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Account<'_> { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "Account"; + type Value = runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct ExtrinsicCount; + impl ::subxt::StorageEntry for ExtrinsicCount { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExtrinsicCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct BlockWeight; + impl ::subxt::StorageEntry for BlockWeight { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "BlockWeight"; + type Value = runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u64, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct AllExtrinsicsLen; + impl ::subxt::StorageEntry for AllExtrinsicsLen { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "AllExtrinsicsLen"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct BlockHash<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for BlockHash<'_> { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "BlockHash"; + type Value = ::subxt::sp_core::H256; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ExtrinsicData<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ExtrinsicData<'_> { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExtrinsicData"; + type Value = ::std::vec::Vec<::core::primitive::u8>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Number; + impl ::subxt::StorageEntry for Number { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "Number"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParentHash; + impl ::subxt::StorageEntry for ParentHash { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ParentHash"; + type Value = ::subxt::sp_core::H256; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Digest; + impl ::subxt::StorageEntry for Digest { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "Digest"; + type Value = runtime_types::sp_runtime::generic::digest::Digest; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Events; + impl ::subxt::StorageEntry for Events { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "Events"; + type Value = ::std::vec::Vec< + runtime_types::frame_system::EventRecord< + runtime_types::polkadot_runtime::Event, + ::subxt::sp_core::H256, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EventCount; + impl ::subxt::StorageEntry for EventCount { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "EventCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EventTopics<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for EventTopics<'_> { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "EventTopics"; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct LastRuntimeUpgrade; + impl ::subxt::StorageEntry for LastRuntimeUpgrade { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "LastRuntimeUpgrade"; + type Value = runtime_types::frame_system::LastRuntimeUpgradeInfo; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UpgradedToU32RefCount; + impl ::subxt::StorageEntry for UpgradedToU32RefCount { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "UpgradedToU32RefCount"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UpgradedToTripleRefCount; + impl ::subxt::StorageEntry for UpgradedToTripleRefCount { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "UpgradedToTripleRefCount"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ExecutionPhase; + impl ::subxt::StorageEntry for ExecutionPhase { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExecutionPhase"; + type Value = runtime_types::frame_system::Phase; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The full account information for a particular account ID."] + pub async fn account( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The current weight for the block."] + pub async fn block_weight( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u64, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Map of block numbers to block hashes."] + pub async fn block_hash( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] + pub async fn extrinsic_data( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u8>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The current block number being processed. Set by `execute_block`."] + pub async fn number( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Hash of the previous block."] + pub async fn parent_hash( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Events deposited for the current block."] + #[doc = ""] + #[doc = " NOTE: This storage item is explicitly unbounded since it is never intended to be read"] + #[doc = " from within the runtime."] + pub async 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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().storage_hash::()? + == [ + 51u8, 117u8, 189u8, 125u8, 155u8, 137u8, 63u8, 1u8, 80u8, + 211u8, 18u8, 228u8, 58u8, 237u8, 241u8, 176u8, 127u8, 189u8, + 246u8, 174u8, 50u8, 174u8, 102u8, 21u8, 108u8, 229u8, 132u8, + 20u8, 6u8, 205u8, 13u8, 88u8, + ] + { + let entry = Events; + self.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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] + #[doc = " of events in the `>` list."] + #[doc = ""] + #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] + #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] + #[doc = " in case of changes fetch the list of events of interest."] + #[doc = ""] + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] + #[doc = " of events in the `>` list."] + #[doc = ""] + #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] + #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] + #[doc = " in case of changes fetch the list of events of interest."] + #[doc = ""] + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] + pub async fn last_runtime_upgrade( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_system::LastRuntimeUpgradeInfo, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] + pub async fn upgraded_to_u32_ref_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Block & extrinsics weights: base values and limits."] + pub fn block_weights( + &self, + ) -> ::core::result::Result< + runtime_types::frame_system::limits::BlockWeights, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("System", "BlockWeights")? + == [ + 204u8, 48u8, 167u8, 131u8, 33u8, 100u8, 198u8, 189u8, 195u8, + 1u8, 117u8, 121u8, 184u8, 221u8, 144u8, 199u8, 43u8, 212u8, + 40u8, 31u8, 121u8, 47u8, 154u8, 102u8, 87u8, 136u8, 106u8, + 147u8, 213u8, 167u8, 193u8, 209u8, + ] + { + let pallet = self.client.metadata().pallet("System")?; + let constant = pallet.constant("BlockWeights")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum length of a block (in bytes)."] + pub fn block_length( + &self, + ) -> ::core::result::Result< + runtime_types::frame_system::limits::BlockLength, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("System", "BlockLength")? + == [ + 162u8, 232u8, 19u8, 135u8, 181u8, 6u8, 183u8, 230u8, 146u8, + 3u8, 140u8, 106u8, 44u8, 46u8, 50u8, 144u8, 239u8, 69u8, + 100u8, 195u8, 13u8, 73u8, 52u8, 140u8, 204u8, 91u8, 32u8, + 153u8, 179u8, 7u8, 207u8, 49u8, + ] + { + let pallet = self.client.metadata().pallet("System")?; + let constant = pallet.constant("BlockLength")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] + pub fn block_hash_count( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("System", "BlockHashCount")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("System")?; + let constant = pallet.constant("BlockHashCount")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The weight of runtime database operations the runtime can invoke."] + pub fn db_weight( + &self, + ) -> ::core::result::Result< + runtime_types::frame_support::weights::RuntimeDbWeight, + ::subxt::BasicError, + > { + if self.client.metadata().constant_hash("System", "DbWeight")? + == [ + 148u8, 162u8, 51u8, 245u8, 246u8, 116u8, 90u8, 22u8, 43u8, + 254u8, 84u8, 59u8, 121u8, 135u8, 46u8, 37u8, 5u8, 71u8, + 146u8, 64u8, 252u8, 95u8, 226u8, 64u8, 137u8, 198u8, 222u8, + 159u8, 14u8, 92u8, 175u8, 174u8, + ] + { + let pallet = self.client.metadata().pallet("System")?; + let constant = pallet.constant("DbWeight")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Get the chain's current version."] + pub fn version( + &self, + ) -> ::core::result::Result< + runtime_types::sp_version::RuntimeVersion, + ::subxt::BasicError, + > { + if self.client.metadata().constant_hash("System", "Version")? + == [ + 121u8, 146u8, 105u8, 234u8, 154u8, 125u8, 117u8, 194u8, + 183u8, 62u8, 171u8, 26u8, 86u8, 200u8, 90u8, 254u8, 176u8, + 67u8, 111u8, 241u8, 185u8, 244u8, 208u8, 140u8, 94u8, 2u8, + 48u8, 138u8, 231u8, 151u8, 157u8, 217u8, + ] + { + let pallet = self.client.metadata().pallet("System")?; + let constant = pallet.constant("Version")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The designated SS85 prefix of this chain."] + #[doc = ""] + #[doc = " This replaces the \"ss58Format\" property declared in the chain spec. Reason is"] + #[doc = " that the runtime should know about the prefix in order to make use of it as"] + #[doc = " an identifier of the chain."] + pub fn ss58_prefix( + &self, + ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("System", "SS58Prefix")? + == [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, + 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, + 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, + 123u8, 128u8, 193u8, 29u8, 70u8, + ] + { + let pallet = self.client.metadata().pallet("System")?; + let constant = pallet.constant("SS58Prefix")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod scheduler { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Schedule { + pub when: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + } + impl ::subxt::Call for Schedule { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Cancel { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Cancel { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduleNamed { + pub id: ::std::vec::Vec<::core::primitive::u8>, + pub when: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + } + impl ::subxt::Call for ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelNamed { + pub id: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for CancelNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduleAfter { + pub after: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + } + impl ::subxt::Call for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_after"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduleNamedAfter { + pub id: ::std::vec::Vec<::core::primitive::u8>, + pub after: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + } + impl ::subxt::Call for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named_after"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Anonymously schedule a task."] + pub fn schedule( + &self, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Schedule, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 171u8, 203u8, 174u8, 141u8, 138u8, 30u8, 100u8, 95u8, 14u8, + 2u8, 34u8, 14u8, 199u8, 60u8, 129u8, 160u8, 8u8, 166u8, 4u8, + 20u8, 41u8, 86u8, 21u8, 73u8, 222u8, 151u8, 179u8, 209u8, + 74u8, 31u8, 71u8, 73u8, + ] + { + let call = Schedule { + when, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel an anonymously scheduled task."] + pub fn cancel( + &self, + when: ::core::primitive::u32, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Cancel, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 118u8, 0u8, 188u8, 218u8, 148u8, 86u8, 139u8, 15u8, 3u8, + 161u8, 6u8, 150u8, 46u8, 32u8, 85u8, 179u8, 106u8, 113u8, + 240u8, 115u8, 167u8, 114u8, 243u8, 69u8, 103u8, 60u8, 99u8, + 135u8, 21u8, 8u8, 19u8, 225u8, + ] + { + let call = Cancel { when, index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule a named task."] + pub fn schedule_named( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ScheduleNamed, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 47u8, 156u8, 239u8, 248u8, 198u8, 13u8, 10u8, 156u8, 176u8, + 254u8, 247u8, 152u8, 108u8, 255u8, 224u8, 185u8, 109u8, 56u8, + 233u8, 5u8, 73u8, 230u8, 151u8, 97u8, 125u8, 183u8, 4u8, + 202u8, 163u8, 3u8, 70u8, 221u8, + ] + { + let call = ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelNamed, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 118u8, 221u8, 232u8, 126u8, 67u8, 134u8, 33u8, 7u8, 224u8, + 110u8, 181u8, 18u8, 57u8, 39u8, 15u8, 64u8, 90u8, 132u8, 2u8, + 238u8, 19u8, 241u8, 194u8, 120u8, 5u8, 109u8, 74u8, 205u8, + 42u8, 244u8, 99u8, 54u8, + ] + { + let call = CancelNamed { id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Anonymously schedule a task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule`]."] + #[doc = "# "] + pub fn schedule_after( + &self, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ScheduleAfter, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 150u8, 70u8, 131u8, 52u8, 50u8, 73u8, 176u8, 193u8, 17u8, + 31u8, 218u8, 113u8, 220u8, 23u8, 160u8, 196u8, 100u8, 27u8, + 193u8, 79u8, 254u8, 68u8, 22u8, 216u8, 157u8, 136u8, 233u8, + 98u8, 46u8, 220u8, 121u8, 29u8, + ] + { + let call = ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule a named task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule_named`](Self::schedule_named)."] + #[doc = "# "] + pub fn schedule_named_after( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ScheduleNamedAfter, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 127u8, 121u8, 141u8, 162u8, 95u8, 211u8, 214u8, 15u8, 22u8, + 28u8, 23u8, 71u8, 92u8, 58u8, 249u8, 163u8, 216u8, 85u8, + 155u8, 88u8, 161u8, 113u8, 153u8, 200u8, 248u8, 168u8, 121u8, + 124u8, 131u8, 122u8, 232u8, 160u8, + ] + { + let call = ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Scheduled some task."] + pub struct Scheduled { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Canceled some task."] + pub struct Canceled { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Dispatched some task."] + pub struct Dispatched { + pub task: (::core::primitive::u32, ::core::primitive::u32), + pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The call for the provided hash was not found so the task has been aborted."] + pub struct CallLookupFailed { + pub task: (::core::primitive::u32, ::core::primitive::u32), + pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub error: runtime_types::frame_support::traits::schedule::LookupError, + } + impl ::subxt::Event for CallLookupFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "CallLookupFailed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Agenda<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Agenda<'_> { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Agenda"; + type Value = ::std::vec::Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV3< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + ::core::primitive::u32, + runtime_types::polkadot_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Lookup<'a>(pub &'a [::core::primitive::u8]); + impl ::subxt::StorageEntry for Lookup<'_> { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Lookup"; + type Value = (::core::primitive::u32, ::core::primitive::u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub 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 >{ + if self.client.metadata().storage_hash::()? + == [ + 235u8, 95u8, 118u8, 134u8, 98u8, 235u8, 250u8, 110u8, 250u8, + 7u8, 75u8, 190u8, 53u8, 194u8, 153u8, 51u8, 125u8, 69u8, + 46u8, 232u8, 63u8, 132u8, 47u8, 167u8, 210u8, 46u8, 43u8, + 142u8, 255u8, 252u8, 99u8, 253u8, + ] + { + 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 async fn agenda_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Agenda<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().storage_hash::()? + == [ + 235u8, 95u8, 118u8, 134u8, 98u8, 235u8, 250u8, 110u8, 250u8, + 7u8, 75u8, 190u8, 53u8, 194u8, 153u8, 51u8, 125u8, 69u8, + 46u8, 232u8, 63u8, 132u8, 47u8, 167u8, 210u8, 46u8, 43u8, + 142u8, 255u8, 252u8, 99u8, 253u8, + ] + { + self.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( + &self, + _0: &[::core::primitive::u8], + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The maximum weight that may be scheduled per block for any dispatchables of less"] + #[doc = " priority than `schedule::HARD_DEADLINE`."] + pub fn maximum_weight( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Scheduler", "MaximumWeight")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self.client.metadata().pallet("Scheduler")?; + let constant = pallet.constant("MaximumWeight")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of scheduled calls in the queue for a single block."] + #[doc = " Not strictly enforced, but used for weight estimation."] + pub fn max_scheduled_per_block( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Scheduler", "MaxScheduledPerBlock")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Scheduler")?; + let constant = pallet.constant("MaxScheduledPerBlock")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod preimage { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NotePreimage { + pub bytes: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NotePreimage { + const PALLET: &'static str = "Preimage"; + const FUNCTION: &'static str = "note_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnnotePreimage { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for UnnotePreimage { + const PALLET: &'static str = "Preimage"; + const FUNCTION: &'static str = "unnote_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RequestPreimage { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for RequestPreimage { + const PALLET: &'static str = "Preimage"; + const FUNCTION: &'static str = "request_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnrequestPreimage { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for UnrequestPreimage { + const PALLET: &'static str = "Preimage"; + const FUNCTION: &'static str = "unrequest_preimage"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Register a preimage on-chain."] + #[doc = ""] + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + pub fn note_preimage( + &self, + bytes: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NotePreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 116u8, 66u8, 88u8, 251u8, 187u8, 86u8, 82u8, 136u8, 215u8, + 82u8, 240u8, 255u8, 70u8, 190u8, 116u8, 187u8, 232u8, 168u8, + 125u8, 234u8, 8u8, 21u8, 247u8, 195u8, 167u8, 237u8, 27u8, + 202u8, 123u8, 25u8, 225u8, 131u8, + ] + { + let call = NotePreimage { bytes }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Clear an unrequested preimage from the runtime storage."] + pub fn unnote_preimage( + &self, + hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + UnnotePreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 162u8, 195u8, 220u8, 134u8, 147u8, 150u8, 145u8, 130u8, + 231u8, 104u8, 83u8, 70u8, 42u8, 90u8, 248u8, 61u8, 223u8, + 63u8, 162u8, 219u8, 92u8, 248u8, 179u8, 99u8, 158u8, 252u8, + 89u8, 59u8, 115u8, 130u8, 73u8, 21u8, + ] + { + let call = UnnotePreimage { hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] + #[doc = ""] + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + pub fn request_preimage( + &self, + hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RequestPreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 186u8, 108u8, 235u8, 145u8, 104u8, 29u8, 22u8, 33u8, 21u8, + 121u8, 32u8, 75u8, 141u8, 125u8, 205u8, 186u8, 210u8, 184u8, + 134u8, 248u8, 74u8, 175u8, 104u8, 91u8, 247u8, 151u8, 70u8, + 192u8, 183u8, 163u8, 245u8, 180u8, + ] + { + let call = RequestPreimage { hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Clear a previously made request for a preimage."] + #[doc = ""] + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub fn unrequest_preimage( + &self, + hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + UnrequestPreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 160u8, 6u8, 6u8, 198u8, 77u8, 37u8, 28u8, 86u8, 240u8, 160u8, + 128u8, 123u8, 144u8, 150u8, 150u8, 60u8, 107u8, 148u8, 189u8, + 192u8, 125u8, 25u8, 55u8, 212u8, 193u8, 212u8, 198u8, 131u8, + 113u8, 37u8, 213u8, 152u8, + ] + { + let call = UnrequestPreimage { hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_preimage::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A preimage has been noted."] + pub struct Noted { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Noted { + const PALLET: &'static str = "Preimage"; + const EVENT: &'static str = "Noted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A preimage has been requested."] + pub struct Requested { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Requested { + const PALLET: &'static str = "Preimage"; + const EVENT: &'static str = "Requested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A preimage has ben cleared."] + pub struct Cleared { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Cleared { + const PALLET: &'static str = "Preimage"; + const EVENT: &'static str = "Cleared"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StatusFor<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for StatusFor<'_> { + const PALLET: &'static str = "Preimage"; + const STORAGE: &'static str = "StatusFor"; + type Value = runtime_types::pallet_preimage::RequestStatus< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct PreimageFor<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for PreimageFor<'_> { + const PALLET: &'static str = "Preimage"; + const STORAGE: &'static str = "PreimageFor"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The request status of a given hash."] + pub async fn status_for( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The preimages stored by this pallet."] + pub async fn preimage_for( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod babe { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReportEquivocation { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + impl ::subxt::Call for ReportEquivocation { + const PALLET: &'static str = "Babe"; + const FUNCTION: &'static str = "report_equivocation"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + impl ::subxt::Call for ReportEquivocationUnsigned { + const PALLET: &'static str = "Babe"; + const FUNCTION: &'static str = "report_equivocation_unsigned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PlanConfigChange { + pub config: + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + } + impl ::subxt::Call for PlanConfigChange { + const PALLET: &'static str = "Babe"; + const FUNCTION: &'static str = "plan_config_change"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + pub fn report_equivocation( + &self, + equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReportEquivocation, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 123u8, 212u8, 216u8, 77u8, 79u8, 132u8, 201u8, 155u8, 166u8, + 230u8, 50u8, 89u8, 98u8, 68u8, 56u8, 213u8, 206u8, 245u8, + 91u8, 104u8, 89u8, 189u8, 57u8, 38u8, 127u8, 22u8, 47u8, + 206u8, 142u8, 202u8, 106u8, 154u8, + ] + { + let call = ReportEquivocation { + equivocation_proof: ::std::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_equivocation_unsigned( + &self, + equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReportEquivocationUnsigned, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 32u8, 163u8, 168u8, 251u8, 251u8, 9u8, 1u8, 195u8, 173u8, + 32u8, 235u8, 125u8, 141u8, 201u8, 130u8, 207u8, 239u8, 76u8, + 150u8, 99u8, 74u8, 193u8, 60u8, 165u8, 93u8, 49u8, 95u8, + 224u8, 217u8, 243u8, 117u8, 173u8, + ] + { + let call = ReportEquivocationUnsigned { + equivocation_proof: ::std::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] + #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] + #[doc = "Multiple calls to this method will replace any existing planned config change that had"] + #[doc = "not been enacted yet."] + pub fn plan_config_change( + &self, + config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + PlanConfigChange, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 215u8, 121u8, 90u8, 87u8, 178u8, 247u8, 114u8, 53u8, 174u8, + 28u8, 20u8, 33u8, 139u8, 216u8, 13u8, 187u8, 74u8, 198u8, + 38u8, 28u8, 175u8, 13u8, 73u8, 132u8, 103u8, 78u8, 217u8, + 207u8, 113u8, 169u8, 42u8, 103u8, + ] + { + let call = PlanConfigChange { config }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct EpochIndex; + impl ::subxt::StorageEntry for EpochIndex { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "EpochIndex"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Authorities; + impl ::subxt::StorageEntry for Authorities { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "Authorities"; + type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct GenesisSlot; + impl ::subxt::StorageEntry for GenesisSlot { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "GenesisSlot"; + type Value = runtime_types::sp_consensus_slots::Slot; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentSlot; + impl ::subxt::StorageEntry for CurrentSlot { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "CurrentSlot"; + type Value = runtime_types::sp_consensus_slots::Slot; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Randomness; + impl ::subxt::StorageEntry for Randomness { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "Randomness"; + type Value = [::core::primitive::u8; 32usize]; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct PendingEpochConfigChange; + impl ::subxt::StorageEntry for PendingEpochConfigChange { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "PendingEpochConfigChange"; + type Value = + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextRandomness; + impl ::subxt::StorageEntry for NextRandomness { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "NextRandomness"; + type Value = [::core::primitive::u8; 32usize]; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextAuthorities; + impl ::subxt::StorageEntry for NextAuthorities { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "NextAuthorities"; + type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SegmentIndex; + impl ::subxt::StorageEntry for SegmentIndex { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "SegmentIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UnderConstruction<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for UnderConstruction<'_> { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "UnderConstruction"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Initialized; + impl ::subxt::StorageEntry for Initialized { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "Initialized"; + type Value = ::core::option::Option<[::core::primitive::u8; 32usize]>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct AuthorVrfRandomness; + impl ::subxt::StorageEntry for AuthorVrfRandomness { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "AuthorVrfRandomness"; + type Value = ::core::option::Option<[::core::primitive::u8; 32usize]>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EpochStart; + impl ::subxt::StorageEntry for EpochStart { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "EpochStart"; + type Value = (::core::primitive::u32, ::core::primitive::u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Lateness; + impl ::subxt::StorageEntry for Lateness { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "Lateness"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EpochConfig; + impl ::subxt::StorageEntry for EpochConfig { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "EpochConfig"; + type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextEpochConfig; + impl ::subxt::StorageEntry for NextEpochConfig { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "NextEpochConfig"; + type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Current epoch index."] + pub async fn epoch_index( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The epoch randomness for the *current* epoch."] + #[doc = ""] + #[doc = " # Security"] + #[doc = ""] + #[doc = " This MUST NOT be used for gambling, as it can be influenced by a"] + #[doc = " malicious validator in the short term. It MAY be used in many"] + #[doc = " cryptographic protocols, however, so long as one remembers that this"] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + [::core::primitive::u8; 32usize], + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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 = " Next epoch randomness."] + pub async fn next_randomness( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + [::core::primitive::u8; 32usize], + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " Randomness under construction."] + #[doc = ""] + #[doc = " We make a trade-off between storage accesses and list length."] + #[doc = " We store the under-construction randomness in segments of up to"] + #[doc = " `UNDER_CONSTRUCTION_SEGMENT_LENGTH`."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] + pub async fn under_construction( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + ::core::option::Option<[::core::primitive::u8; 32usize]>, + >, + ::subxt::BasicError, + > { + if self.client.metadata().storage_hash::()? + == [ + 48u8, 206u8, 111u8, 118u8, 149u8, 175u8, 148u8, 53u8, 233u8, + 82u8, 220u8, 57u8, 22u8, 164u8, 116u8, 228u8, 134u8, 237u8, + 129u8, 195u8, 60u8, 169u8, 1u8, 164u8, 74u8, 177u8, 145u8, + 112u8, 66u8, 198u8, 53u8, 157u8, + ] + { + let entry = Initialized; + self.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_initialize`, 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The block numbers when the last and current epoch have started, respectively `N-1` and"] + #[doc = " `N`."] + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " How late the current block is compared to its parent."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] + #[doc = " genesis."] + pub async fn epoch_config( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The amount of time, in slots, that each epoch should last."] + #[doc = " NOTE: Currently it is not possible to change the epoch duration after"] + #[doc = " the chain has started. Attempting to do so will brick block production."] + pub fn epoch_duration( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Babe", "EpochDuration")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self.client.metadata().pallet("Babe")?; + let constant = pallet.constant("EpochDuration")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The expected average block time at which BABE should be creating"] + #[doc = " blocks. Since BABE is probabilistic it is not trivial to figure out"] + #[doc = " what the expected average block time should be based on the slot"] + #[doc = " duration and the security parameter `c` (where `1 - c` represents"] + #[doc = " the probability of a slot being empty)."] + pub fn expected_block_time( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Babe", "ExpectedBlockTime")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self.client.metadata().pallet("Babe")?; + let constant = pallet.constant("ExpectedBlockTime")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Max number of authorities allowed"] + pub fn max_authorities( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Babe", "MaxAuthorities")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Babe")?; + let constant = pallet.constant("MaxAuthorities")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod timestamp { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Set { + #[codec(compact)] + pub now: ::core::primitive::u64, + } + impl ::subxt::Call for Set { + const PALLET: &'static str = "Timestamp"; + const FUNCTION: &'static str = "set"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "`MinimumPeriod`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Inherent`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + #[doc = "# "] + pub fn set( + &self, + now: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Set, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 191u8, 73u8, 102u8, 150u8, 65u8, 157u8, 172u8, 194u8, 7u8, + 72u8, 1u8, 35u8, 54u8, 99u8, 245u8, 139u8, 40u8, 136u8, + 245u8, 53u8, 167u8, 100u8, 143u8, 244u8, 160u8, 5u8, 18u8, + 130u8, 77u8, 160u8, 227u8, 51u8, + ] + { + let call = Set { now }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct Now; + impl ::subxt::StorageEntry for Now { + const PALLET: &'static str = "Timestamp"; + const STORAGE: &'static str = "Now"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DidUpdate; + impl ::subxt::StorageEntry for DidUpdate { + const PALLET: &'static str = "Timestamp"; + const STORAGE: &'static str = "DidUpdate"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Current time for the current block."] + pub async fn now( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Did the timestamp get updated in this block?"] + pub async fn did_update( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The minimum period between blocks. Beware that this is different to the *expected*"] + #[doc = " period that the block production apparatus provides. Your chosen consensus system will"] + #[doc = " generally work with this to determine a sensible block time. e.g. For Aura, it will be"] + #[doc = " double this period on default settings."] + pub fn minimum_period( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Timestamp", "MinimumPeriod")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self.client.metadata().pallet("Timestamp")?; + let constant = pallet.constant("MinimumPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod indices { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Claim { + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Claim { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "claim"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Transfer { + pub new: ::subxt::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "transfer"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Free { + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Free { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "free"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceTransfer { + pub new: ::subxt::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + pub freeze: ::core::primitive::bool, + } + impl ::subxt::Call for ForceTransfer { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "force_transfer"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Freeze { + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Freeze { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "freeze"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Assign an previously unassigned index."] + #[doc = ""] + #[doc = "Payment: `Deposit` is reserved from the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be claimed. This must not be in use."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + pub fn claim( + &self, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Claim, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 27u8, 4u8, 108u8, 55u8, 23u8, 109u8, 175u8, 25u8, 201u8, + 230u8, 228u8, 51u8, 164u8, 15u8, 79u8, 10u8, 219u8, 182u8, + 242u8, 102u8, 164u8, 148u8, 39u8, 91u8, 106u8, 197u8, 29u8, + 190u8, 178u8, 221u8, 16u8, 87u8, + ] + { + let call = Claim { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] + #[doc = "is effectively transferred to the new account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One transfer operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (recipient)"] + #[doc = " - Writes: Indices Accounts, System Account (recipient)"] + #[doc = "# "] + pub fn transfer( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Transfer, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 124u8, 83u8, 33u8, 230u8, 23u8, 70u8, 83u8, 59u8, 76u8, + 100u8, 219u8, 100u8, 165u8, 163u8, 102u8, 193u8, 11u8, 22u8, + 30u8, 125u8, 114u8, 28u8, 61u8, 156u8, 38u8, 170u8, 129u8, + 74u8, 187u8, 28u8, 33u8, 65u8, + ] + { + let call = Transfer { new, index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Free up an index owned by the sender."] + #[doc = ""] + #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] + #[doc = ""] + #[doc = "- `index`: the index to be freed. This must be owned by the sender."] + #[doc = ""] + #[doc = "Emits `IndexFreed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + pub fn free( + &self, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Free, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 153u8, 143u8, 162u8, 33u8, 229u8, 3u8, 159u8, 153u8, 111u8, + 100u8, 160u8, 250u8, 227u8, 24u8, 157u8, 226u8, 173u8, 39u8, + 25u8, 200u8, 137u8, 147u8, 232u8, 213u8, 182u8, 49u8, 142u8, + 250u8, 139u8, 155u8, 84u8, 214u8, + ] + { + let call = Free { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] + #[doc = "held, then any deposit is reimbursed to its current owner."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `index`: the index to be (re-)assigned."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (original owner)"] + #[doc = " - Writes: Indices Accounts, System Account (original owner)"] + #[doc = "# "] + pub fn force_transfer( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + freeze: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceTransfer, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 181u8, 143u8, 90u8, 135u8, 132u8, 11u8, 145u8, 85u8, 4u8, + 211u8, 56u8, 110u8, 213u8, 153u8, 224u8, 106u8, 198u8, 250u8, + 130u8, 253u8, 72u8, 58u8, 133u8, 150u8, 102u8, 119u8, 177u8, + 175u8, 77u8, 106u8, 253u8, 99u8, + ] + { + let call = ForceTransfer { new, index, freeze }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] + #[doc = "deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "- `index`: the index to be frozen in place."] + #[doc = ""] + #[doc = "Emits `IndexFrozen` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one slash operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + pub fn freeze( + &self, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Freeze, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 204u8, 127u8, 214u8, 137u8, 138u8, 28u8, 171u8, 169u8, 184u8, + 164u8, 235u8, 114u8, 132u8, 176u8, 14u8, 207u8, 72u8, 39u8, + 179u8, 231u8, 137u8, 243u8, 242u8, 57u8, 89u8, 57u8, 213u8, + 210u8, 87u8, 12u8, 253u8, 159u8, + ] + { + let call = Freeze { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_indices::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A account index was assigned."] + pub struct IndexAssigned { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for IndexAssigned { + const PALLET: &'static str = "Indices"; + const EVENT: &'static str = "IndexAssigned"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A account index has been freed up (unassigned)."] + pub struct IndexFreed { + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for IndexFreed { + const PALLET: &'static str = "Indices"; + const EVENT: &'static str = "IndexFreed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A account index has been frozen to its current account ID."] + pub struct IndexFrozen { + pub index: ::core::primitive::u32, + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for IndexFrozen { + const PALLET: &'static str = "Indices"; + const EVENT: &'static str = "IndexFrozen"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Accounts<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Accounts<'_> { + const PALLET: &'static str = "Indices"; + const STORAGE: &'static str = "Accounts"; + type Value = ( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The lookup from index to account."] + pub async fn accounts( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The deposit needed for reserving an index."] + pub fn deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().constant_hash("Indices", "Deposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Indices")?; + let constant = pallet.constant("Deposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod balances { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Transfer { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetBalance { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub new_free: ::core::primitive::u128, + #[codec(compact)] + pub new_reserved: ::core::primitive::u128, + } + impl ::subxt::Call for SetBalance { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "set_balance"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceTransfer { + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for ForceTransfer { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "force_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TransferKeepAlive { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for TransferKeepAlive { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "transfer_keep_alive"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TransferAll { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub keep_alive: ::core::primitive::bool, + } + impl ::subxt::Call for TransferAll { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "transfer_all"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceUnreserve { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Call for ForceUnreserve { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "force_unreserve"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] + #[doc = " types. See related functions below."] + #[doc = "- It contains a limited number of reads and writes internally and no complex"] + #[doc = " computation."] + #[doc = ""] + #[doc = "Related functions:"] + #[doc = ""] + #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] + #[doc = " - Transferring balances to accounts that did not exist before will cause"] + #[doc = " `T::OnNewAccount::on_new_account` to be called."] + #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] + #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] + #[doc = " that the transfer will not kill the origin account."] + #[doc = "---------------------------------"] + #[doc = "- Origin account is already in memory, so no DB operations for them."] + #[doc = "# "] + pub fn transfer( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Transfer, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 250u8, 8u8, 164u8, 186u8, 80u8, 220u8, 134u8, 247u8, 142u8, + 121u8, 34u8, 22u8, 169u8, 39u8, 6u8, 93u8, 72u8, 47u8, 44u8, + 107u8, 9u8, 98u8, 203u8, 190u8, 136u8, 55u8, 251u8, 78u8, + 216u8, 150u8, 98u8, 118u8, + ] + { + let call = Transfer { dest, value }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the balances of a given account."] + #[doc = ""] + #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] + #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] + #[doc = "If the new free or reserved balance is below the existential deposit,"] + #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub fn set_balance( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + new_free: ::core::primitive::u128, + new_reserved: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetBalance, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 232u8, 6u8, 27u8, 131u8, 163u8, 72u8, 148u8, 197u8, 14u8, + 239u8, 94u8, 1u8, 32u8, 94u8, 17u8, 14u8, 123u8, 82u8, 39u8, + 233u8, 77u8, 20u8, 40u8, 139u8, 222u8, 137u8, 103u8, 18u8, + 126u8, 63u8, 200u8, 149u8, + ] + { + let call = SetBalance { + who, + new_free, + new_reserved, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] + #[doc = "specified."] + #[doc = "# "] + #[doc = "- Same as transfer, but additional read and write because the source account is not"] + #[doc = " assumed to be in the overlay."] + #[doc = "# "] + pub fn force_transfer( + &self, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceTransfer, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 120u8, 66u8, 111u8, 84u8, 176u8, 241u8, 214u8, 118u8, 219u8, + 75u8, 127u8, 222u8, 45u8, 33u8, 204u8, 147u8, 126u8, 214u8, + 101u8, 190u8, 37u8, 37u8, 159u8, 166u8, 61u8, 143u8, 22u8, + 32u8, 15u8, 83u8, 221u8, 230u8, + ] + { + let call = ForceTransfer { + source, + dest, + value, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] + #[doc = "origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer`] instead."] + #[doc = ""] + #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] + pub fn transfer_keep_alive( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + TransferKeepAlive, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 111u8, 233u8, 125u8, 71u8, 223u8, 141u8, 112u8, 94u8, 157u8, + 11u8, 88u8, 7u8, 239u8, 145u8, 247u8, 183u8, 245u8, 87u8, + 157u8, 35u8, 49u8, 91u8, 54u8, 103u8, 101u8, 76u8, 110u8, + 94u8, 81u8, 170u8, 153u8, 209u8, + ] + { + let call = TransferKeepAlive { dest, value }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true). # "] + #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] + #[doc = " #"] + pub fn transfer_all( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + keep_alive: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + TransferAll, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 240u8, 165u8, 185u8, 144u8, 24u8, 149u8, 15u8, 46u8, 60u8, + 147u8, 19u8, 187u8, 96u8, 24u8, 150u8, 53u8, 151u8, 232u8, + 200u8, 164u8, 176u8, 167u8, 8u8, 23u8, 63u8, 135u8, 68u8, + 110u8, 5u8, 21u8, 35u8, 78u8, + ] + { + let call = TransferAll { dest, keep_alive }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub fn force_unreserve( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + amount: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceUnreserve, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 106u8, 42u8, 48u8, 136u8, 41u8, 155u8, 214u8, 112u8, 99u8, + 122u8, 202u8, 250u8, 95u8, 60u8, 182u8, 13u8, 25u8, 149u8, + 212u8, 212u8, 247u8, 191u8, 130u8, 95u8, 84u8, 252u8, 252u8, + 197u8, 244u8, 149u8, 103u8, 67u8, + ] + { + let call = ForceUnreserve { who, amount }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_balances::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account was created with some free balance."] + pub struct Endowed { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub free_balance: ::core::primitive::u128, + } + impl ::subxt::Event for Endowed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Endowed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + pub struct DustLost { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for DustLost { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "DustLost"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Transfer succeeded."] + pub struct Transfer { + pub from: ::subxt::sp_core::crypto::AccountId32, + pub to: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for Transfer { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A balance was set by root."] + pub struct BalanceSet { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub free: ::core::primitive::u128, + pub reserved: ::core::primitive::u128, + } + impl ::subxt::Event for BalanceSet { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "BalanceSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some balance was reserved (moved from free to reserved)."] + pub struct Reserved { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for Reserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Reserved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + pub struct Unreserved { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for Unreserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Unreserved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + pub struct ReserveRepatriated { + pub from: ::subxt::sp_core::crypto::AccountId32, + pub to: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + pub destination_status: + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + } + impl ::subxt::Event for ReserveRepatriated { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "ReserveRepatriated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + pub struct Deposit { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Deposit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + pub struct Withdraw { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for Withdraw { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Withdraw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] + pub struct Slashed { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Slashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct TotalIssuance; + impl ::subxt::StorageEntry for TotalIssuance { + const PALLET: &'static str = "Balances"; + const STORAGE: &'static str = "TotalIssuance"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Account<'_> { + const PALLET: &'static str = "Balances"; + const STORAGE: &'static str = "Account"; + type Value = + runtime_types::pallet_balances::AccountData<::core::primitive::u128>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Locks<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Locks<'_> { + const PALLET: &'static str = "Balances"; + const STORAGE: &'static str = "Locks"; + type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Reserves<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Reserves<'_> { + const PALLET: &'static str = "Balances"; + const STORAGE: &'static str = "Reserves"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Balances"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_balances::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The total units issued in the system."] + pub async fn total_issuance( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[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( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[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, + > { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Named reserves on some account balances."] + pub async fn reserves( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The minimum amount required to keep an account open."] + pub fn existential_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Balances", "ExistentialDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Balances")?; + let constant = pallet.constant("ExistentialDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of locks that should exist on an account."] + #[doc = " Not strictly enforced, but used for weight estimation."] + pub fn max_locks( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Balances", "MaxLocks")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Balances")?; + let constant = pallet.constant("MaxLocks")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of named reserves that can exist on an account."] + pub fn max_reserves( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Balances", "MaxReserves")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Balances")?; + let constant = pallet.constant("MaxReserves")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod transaction_payment { + use super::{ + root_mod, + runtime_types, + }; + pub mod storage { + use super::runtime_types; + pub struct NextFeeMultiplier; + impl ::subxt::StorageEntry for NextFeeMultiplier { + const PALLET: &'static str = "TransactionPayment"; + const STORAGE: &'static str = "NextFeeMultiplier"; + type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "TransactionPayment"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_transaction_payment::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn next_fee_multiplier( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::fixed_point::FixedU128, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + pub async fn storage_version( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_transaction_payment::Releases, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The fee to be paid for making a transaction; the per-byte portion."] + pub fn transaction_byte_fee( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("TransactionPayment", "TransactionByteFee")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = + self.client.metadata().pallet("TransactionPayment")?; + let constant = pallet.constant("TransactionByteFee")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " A fee mulitplier for `Operational` extrinsics to compute \"virtual tip\" to boost their"] + #[doc = " `priority`"] + #[doc = ""] + #[doc = " This value is multipled by the `final_fee` to obtain a \"virtual tip\" that is later"] + #[doc = " added to a tip component in regular `priority` calculations."] + #[doc = " It means that a `Normal` transaction can front-run a similarly-sized `Operational`"] + #[doc = " extrinsic (with no tip), by including a tip value greater than the virtual tip."] + #[doc = ""] + #[doc = " ```rust,ignore"] + #[doc = " // For `Normal`"] + #[doc = " let priority = priority_calc(tip);"] + #[doc = ""] + #[doc = " // For `Operational`"] + #[doc = " let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;"] + #[doc = " let priority = priority_calc(tip + virtual_tip);"] + #[doc = " ```"] + #[doc = ""] + #[doc = " Note that since we use `final_fee` the multiplier applies also to the regular `tip`"] + #[doc = " sent with the transaction. So, not only does the transaction get a priority bump based"] + #[doc = " on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`"] + #[doc = " transactions."] + pub fn operational_fee_multiplier( + &self, + ) -> ::core::result::Result<::core::primitive::u8, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("TransactionPayment", "OperationalFeeMultiplier")? + == [ + 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, + 110u8, 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, + 185u8, 66u8, 226u8, 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, + 114u8, 237u8, 228u8, 183u8, 165u8, + ] + { + let pallet = + self.client.metadata().pallet("TransactionPayment")?; + let constant = pallet.constant("OperationalFeeMultiplier")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[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, + > { + if self + .client + .metadata() + .constant_hash("TransactionPayment", "WeightToFee")? + == [ + 99u8, 211u8, 10u8, 189u8, 123u8, 171u8, 119u8, 79u8, 112u8, + 33u8, 10u8, 47u8, 119u8, 55u8, 237u8, 32u8, 127u8, 21u8, + 117u8, 156u8, 153u8, 243u8, 128u8, 211u8, 243u8, 75u8, 15u8, + 181u8, 126u8, 73u8, 51u8, 47u8, + ] + { + let pallet = + self.client.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()) + } + } + } + } + } + pub mod authorship { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetUncles { + pub new_uncles: ::std::vec::Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + } + impl ::subxt::Call for SetUncles { + const PALLET: &'static str = "Authorship"; + const FUNCTION: &'static str = "set_uncles"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Provide a set of uncles."] + pub fn set_uncles( + &self, + new_uncles: ::std::vec::Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetUncles, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 5u8, 56u8, 71u8, 152u8, 103u8, 232u8, 101u8, 171u8, 200u8, + 2u8, 177u8, 102u8, 0u8, 93u8, 210u8, 90u8, 56u8, 151u8, 5u8, + 235u8, 227u8, 197u8, 189u8, 248u8, 2u8, 71u8, 49u8, 220u8, + 212u8, 253u8, 235u8, 67u8, + ] + { + let call = SetUncles { new_uncles }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct Uncles; + impl ::subxt::StorageEntry for Uncles { + const PALLET: &'static str = "Authorship"; + const STORAGE: &'static str = "Uncles"; + type Value = ::std::vec::Vec< + runtime_types::pallet_authorship::UncleEntryItem< + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Author; + impl ::subxt::StorageEntry for Author { + const PALLET: &'static str = "Authorship"; + const STORAGE: &'static str = "Author"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DidSetUncles; + impl ::subxt::StorageEntry for DidSetUncles { + const PALLET: &'static str = "Authorship"; + const STORAGE: &'static str = "DidSetUncles"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Uncles"] + pub async 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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Author of current block."] + pub async fn author( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Whether uncles were already set in this block."] + pub async fn did_set_uncles( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The number of blocks back we should accept uncles."] + #[doc = " This means that we will deal with uncle-parents that are"] + #[doc = " `UncleGenerations + 1` before `now`."] + pub fn uncle_generations( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Authorship", "UncleGenerations")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Authorship")?; + let constant = pallet.constant("UncleGenerations")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod staking { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bond { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + pub payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + } + impl ::subxt::Call for Bond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "bond"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BondExtra { + #[codec(compact)] + pub max_additional: ::core::primitive::u128, + } + impl ::subxt::Call for BondExtra { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "bond_extra"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Unbond { + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Unbond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "unbond"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct WithdrawUnbonded { + pub num_slashing_spans: ::core::primitive::u32, + } + impl ::subxt::Call for WithdrawUnbonded { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "withdraw_unbonded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Validate { + pub prefs: runtime_types::pallet_staking::ValidatorPrefs, + } + impl ::subxt::Call for Validate { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "validate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Nominate { + pub targets: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + } + impl ::subxt::Call for Nominate { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "nominate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Chill; + impl ::subxt::Call for Chill { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetPayee { + pub payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + } + impl ::subxt::Call for SetPayee { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_payee"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetController { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for SetController { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_controller"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetValidatorCount { + #[codec(compact)] + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_validator_count"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IncreaseValidatorCount { + #[codec(compact)] + pub additional: ::core::primitive::u32, + } + impl ::subxt::Call for IncreaseValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "increase_validator_count"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScaleValidatorCount { + pub factor: runtime_types::sp_arithmetic::per_things::Percent, + } + impl ::subxt::Call for ScaleValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "scale_validator_count"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNoEras; + impl ::subxt::Call for ForceNoEras { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_no_eras"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNewEra; + impl ::subxt::Call for ForceNewEra { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_new_era"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetInvulnerables { + pub invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for SetInvulnerables { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_invulnerables"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceUnstake { + pub stash: ::subxt::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + impl ::subxt::Call for ForceUnstake { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_unstake"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNewEraAlways; + impl ::subxt::Call for ForceNewEraAlways { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_new_era_always"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelDeferredSlash { + pub era: ::core::primitive::u32, + pub slash_indices: ::std::vec::Vec<::core::primitive::u32>, + } + impl ::subxt::Call for CancelDeferredSlash { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "cancel_deferred_slash"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PayoutStakers { + pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + pub era: ::core::primitive::u32, + } + impl ::subxt::Call for PayoutStakers { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "payout_stakers"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rebond { + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Rebond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "rebond"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetHistoryDepth { + #[codec(compact)] + pub new_history_depth: ::core::primitive::u32, + #[codec(compact)] + pub era_items_deleted: ::core::primitive::u32, + } + impl ::subxt::Call for SetHistoryDepth { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_history_depth"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReapStash { + pub stash: ::subxt::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + impl ::subxt::Call for ReapStash { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "reap_stash"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Kick { + pub who: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + } + impl ::subxt::Call for Kick { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "kick"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetStakingConfigs { + pub min_nominator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + pub min_validator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + pub max_nominator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + pub max_validator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + pub chill_threshold: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, + pub min_commission: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + } + impl ::subxt::Call for SetStakingConfigs { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_staking_configs"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ChillOther { + pub controller: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ChillOther { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill_other"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceApplyMinCommission { + pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ForceApplyMinCommission { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_apply_min_commission"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] + #[doc = "be the account that controls it."] + #[doc = ""] + #[doc = "`value` must be more than the `minimum_balance` specified by `T::Currency`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash account."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = "# "] + #[doc = "- Independent of the arguments. Moderate complexity."] + #[doc = "- O(1)."] + #[doc = "- Three extra DB entries."] + #[doc = ""] + #[doc = "NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned"] + #[doc = "unless the `origin` falls below _existential deposit_ and gets removed as dust."] + #[doc = "------------------"] + #[doc = "# "] + pub fn bond( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Bond, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 41u8, 8u8, 237u8, 132u8, 236u8, 61u8, 222u8, 146u8, 255u8, + 136u8, 174u8, 104u8, 120u8, 64u8, 198u8, 147u8, 80u8, 237u8, + 65u8, 255u8, 187u8, 55u8, 252u8, 34u8, 252u8, 88u8, 35u8, + 236u8, 249u8, 170u8, 116u8, 208u8, + ] + { + let call = Bond { + controller, + value, + payee, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] + #[doc = "for staking."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "Use this if there are additional funds in your stash account that you wish to bond."] + #[doc = "Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose"] + #[doc = "any limitation on the amount that can be added."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn bond_extra( + &self, + max_additional: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + BondExtra, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 170u8, 38u8, 37u8, 71u8, 243u8, 41u8, 24u8, 59u8, 17u8, + 229u8, 61u8, 20u8, 130u8, 167u8, 1u8, 1u8, 158u8, 180u8, + 234u8, 65u8, 196u8, 181u8, 232u8, 146u8, 62u8, 90u8, 194u8, + 183u8, 253u8, 142u8, 251u8, 200u8, + ] + { + let call = BondExtra { max_additional }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] + #[doc = "period ends. If this leaves an amount actively bonded less than"] + #[doc = "T::Currency::minimum_balance(), then it is increased to the full amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "Once the unlock period is done, you can call `withdraw_unbonded` to actually move"] + #[doc = "the funds out of management ready for transfer."] + #[doc = ""] + #[doc = "No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)"] + #[doc = "can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need"] + #[doc = "to be called first to remove some of the chunks (if possible)."] + #[doc = ""] + #[doc = "If a user encounters the `InsufficientBond` error when calling this extrinsic,"] + #[doc = "they should call `chill` first in order to free up their bonded funds."] + #[doc = ""] + #[doc = "Emits `Unbonded`."] + #[doc = ""] + #[doc = "See also [`Call::withdraw_unbonded`]."] + pub fn unbond( + &self, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Unbond, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 85u8, 188u8, 141u8, 62u8, 242u8, 15u8, 6u8, 20u8, 96u8, + 220u8, 201u8, 163u8, 29u8, 136u8, 24u8, 4u8, 143u8, 13u8, + 22u8, 118u8, 22u8, 212u8, 164u8, 125u8, 200u8, 219u8, 6u8, + 25u8, 174u8, 92u8, 108u8, 89u8, + ] + { + let call = Unbond { value }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] + #[doc = ""] + #[doc = "This essentially frees up that balance to be used by the stash account to do"] + #[doc = "whatever it wants."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller."] + #[doc = ""] + #[doc = "Emits `Withdrawn`."] + #[doc = ""] + #[doc = "See also [`Call::unbond`]."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity O(S) where S is the number of slashing spans to remove"] + #[doc = "NOTE: Weight annotation is the kill scenario, we refund otherwise."] + #[doc = "# "] + pub fn withdraw_unbonded( + &self, + num_slashing_spans: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + WithdrawUnbonded, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 252u8, 47u8, 185u8, 86u8, 179u8, 203u8, 20u8, 5u8, 88u8, + 252u8, 212u8, 173u8, 20u8, 202u8, 206u8, 56u8, 10u8, 186u8, + 124u8, 221u8, 42u8, 61u8, 202u8, 110u8, 233u8, 40u8, 210u8, + 135u8, 204u8, 110u8, 133u8, 123u8, + ] + { + let call = WithdrawUnbonded { num_slashing_spans }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Declare the desire to validate for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + pub fn validate( + &self, + prefs: runtime_types::pallet_staking::ValidatorPrefs, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Validate, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 138u8, 13u8, 146u8, 216u8, 4u8, 27u8, 20u8, 159u8, 148u8, + 25u8, 169u8, 229u8, 145u8, 2u8, 251u8, 58u8, 13u8, 128u8, + 20u8, 22u8, 194u8, 11u8, 13u8, 65u8, 50u8, 51u8, 158u8, + 239u8, 45u8, 90u8, 6u8, 37u8, + ] + { + let call = Validate { prefs }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Declare the desire to nominate `targets` for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- The transaction's complexity is proportional to the size of `targets` (N)"] + #[doc = "which is capped at CompactAssignments::LIMIT (T::MaxNominations)."] + #[doc = "- Both the reads and writes follow a similar pattern."] + #[doc = "# "] + pub fn nominate( + &self, + targets: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Nominate, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 199u8, 181u8, 123u8, 171u8, 186u8, 9u8, 23u8, 220u8, 147u8, + 7u8, 252u8, 26u8, 25u8, 195u8, 126u8, 175u8, 181u8, 118u8, + 162u8, 37u8, 99u8, 31u8, 100u8, 249u8, 245u8, 122u8, 235u8, + 11u8, 43u8, 39u8, 198u8, 145u8, + ] + { + let call = Nominate { targets }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Declare no desire to either validate or nominate."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains one read."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "# "] + pub fn chill( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Chill, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 94u8, 20u8, 196u8, 31u8, 220u8, 125u8, 115u8, 167u8, 140u8, + 3u8, 20u8, 132u8, 81u8, 120u8, 215u8, 166u8, 230u8, 56u8, + 16u8, 222u8, 31u8, 153u8, 120u8, 62u8, 153u8, 67u8, 220u8, + 239u8, 11u8, 234u8, 127u8, 122u8, + ] + { + let call = Chill {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "(Re-)set the payment target for a controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "---------"] + #[doc = "- Weight: O(1)"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Ledger"] + #[doc = " - Write: Payee"] + #[doc = "# "] + pub fn set_payee( + &self, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetPayee, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 185u8, 62u8, 154u8, 65u8, 135u8, 104u8, 38u8, 171u8, 237u8, + 16u8, 169u8, 38u8, 53u8, 161u8, 170u8, 232u8, 249u8, 185u8, + 24u8, 155u8, 54u8, 88u8, 96u8, 147u8, 171u8, 85u8, 216u8, + 240u8, 52u8, 158u8, 134u8, 72u8, + ] + { + let call = SetPayee { payee }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "(Re-)set the controller of a stash."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "----------"] + #[doc = "Weight: O(1)"] + #[doc = "DB Weight:"] + #[doc = "- Read: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "# "] + pub fn set_controller( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetController, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 239u8, 105u8, 43u8, 234u8, 201u8, 103u8, 93u8, 252u8, 26u8, + 52u8, 27u8, 23u8, 219u8, 153u8, 195u8, 150u8, 244u8, 13u8, + 24u8, 241u8, 199u8, 160u8, 119u8, 37u8, 55u8, 239u8, 142u8, + 16u8, 80u8, 45u8, 20u8, 233u8, + ] + { + let call = SetController { controller }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight: O(1)"] + #[doc = "Write: Validator Count"] + #[doc = "# "] + pub fn set_validator_count( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetValidatorCount, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 181u8, 82u8, 21u8, 239u8, 81u8, 194u8, 166u8, 66u8, 55u8, + 156u8, 68u8, 22u8, 76u8, 251u8, 241u8, 113u8, 168u8, 8u8, + 193u8, 125u8, 112u8, 82u8, 200u8, 139u8, 55u8, 139u8, 22u8, + 35u8, 171u8, 124u8, 112u8, 52u8, + ] + { + let call = SetValidatorCount { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Increments the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + pub fn increase_validator_count( + &self, + additional: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + IncreaseValidatorCount, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 219u8, 143u8, 69u8, 205u8, 182u8, 155u8, 101u8, 39u8, 59u8, + 214u8, 81u8, 47u8, 247u8, 54u8, 106u8, 92u8, 183u8, 42u8, + 30u8, 57u8, 28u8, 136u8, 13u8, 13u8, 170u8, 101u8, 216u8, + 234u8, 194u8, 90u8, 248u8, 234u8, + ] + { + let call = IncreaseValidatorCount { additional }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Scale up the ideal number of validators by a factor."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + pub fn scale_validator_count( + &self, + factor: runtime_types::sp_arithmetic::per_things::Percent, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ScaleValidatorCount, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 170u8, 156u8, 101u8, 109u8, 117u8, 199u8, 38u8, 157u8, 132u8, + 210u8, 54u8, 66u8, 251u8, 10u8, 123u8, 120u8, 237u8, 31u8, + 206u8, 176u8, 224u8, 112u8, 82u8, 70u8, 152u8, 6u8, 166u8, + 118u8, 10u8, 172u8, 254u8, 148u8, + ] + { + let call = ScaleValidatorCount { factor }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force there to be no new eras indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "Thus the election process may be ongoing when this is called. In this case the"] + #[doc = "election will continue until the next era is triggered."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write: ForceEra"] + #[doc = "# "] + pub fn force_no_eras( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceNoEras, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 16u8, 81u8, 207u8, 168u8, 23u8, 236u8, 11u8, 75u8, 141u8, + 107u8, 92u8, 2u8, 53u8, 111u8, 252u8, 116u8, 91u8, 120u8, + 75u8, 24u8, 125u8, 53u8, 9u8, 28u8, 242u8, 87u8, 245u8, 55u8, + 40u8, 103u8, 151u8, 178u8, + ] + { + let call = ForceNoEras {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] + #[doc = "reset to normal (non-forced) behaviour."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write ForceEra"] + #[doc = "# "] + pub fn force_new_era( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceNewEra, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 230u8, 242u8, 169u8, 196u8, 78u8, 145u8, 24u8, 191u8, 113u8, + 68u8, 5u8, 138u8, 48u8, 51u8, 109u8, 126u8, 73u8, 136u8, + 162u8, 158u8, 174u8, 201u8, 213u8, 230u8, 215u8, 44u8, 200u8, + 32u8, 75u8, 27u8, 23u8, 254u8, + ] + { + let call = ForceNewEra {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the validators who cannot be slashed (if any)."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + pub fn set_invulnerables( + &self, + invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetInvulnerables, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 0u8, 119u8, 27u8, 243u8, 238u8, 65u8, 133u8, 89u8, 210u8, + 202u8, 154u8, 243u8, 168u8, 158u8, 9u8, 147u8, 146u8, 215u8, + 172u8, 28u8, 171u8, 183u8, 112u8, 42u8, 245u8, 232u8, 238u8, + 94u8, 205u8, 46u8, 0u8, 20u8, + ] + { + let call = SetInvulnerables { invulnerables }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force a current staker to become completely unstaked, immediately."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + pub fn force_unstake( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceUnstake, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 254u8, 115u8, 250u8, 15u8, 235u8, 119u8, 2u8, 131u8, 237u8, + 144u8, 247u8, 66u8, 150u8, 92u8, 12u8, 112u8, 137u8, 195u8, + 246u8, 178u8, 129u8, 64u8, 214u8, 4u8, 183u8, 18u8, 94u8, + 104u8, 157u8, 174u8, 231u8, 1u8, + ] + { + let call = ForceUnstake { + stash, + num_slashing_spans, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force there to be a new era at the end of sessions indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + pub fn force_new_era_always( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceNewEraAlways, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 179u8, 118u8, 189u8, 54u8, 248u8, 141u8, 207u8, 142u8, 80u8, + 37u8, 241u8, 185u8, 138u8, 254u8, 117u8, 147u8, 225u8, 118u8, + 34u8, 177u8, 197u8, 158u8, 8u8, 82u8, 202u8, 108u8, 208u8, + 26u8, 64u8, 33u8, 74u8, 43u8, + ] + { + let call = ForceNewEraAlways {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel enactment of a deferred slash."] + #[doc = ""] + #[doc = "Can be called by the `T::SlashCancelOrigin`."] + #[doc = ""] + #[doc = "Parameters: era and indices of the slashes for that era to kill."] + pub fn cancel_deferred_slash( + &self, + era: ::core::primitive::u32, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelDeferredSlash, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 217u8, 175u8, 246u8, 108u8, 78u8, 134u8, 98u8, 49u8, 178u8, + 209u8, 98u8, 178u8, 52u8, 242u8, 173u8, 135u8, 171u8, 70u8, + 129u8, 239u8, 62u8, 150u8, 84u8, 142u8, 243u8, 193u8, 179u8, + 249u8, 114u8, 231u8, 8u8, 252u8, + ] + { + let call = CancelDeferredSlash { era, slash_indices }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Pay out all the stakers behind a single validator for a single era."] + #[doc = ""] + #[doc = "- `validator_stash` is the stash account of the validator. Their nominators, up to"] + #[doc = " `T::MaxNominatorRewardedPerValidator`, will also receive their rewards."] + #[doc = "- `era` may be any era between `[current_era - history_depth; current_era]`."] + #[doc = ""] + #[doc = "The origin of this call must be _Signed_. Any account can call this function, even if"] + #[doc = "it is not one of the stakers."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: at most O(MaxNominatorRewardedPerValidator)."] + #[doc = "- Contains a limited number of reads and writes."] + #[doc = "-----------"] + #[doc = "N is the Number of payouts for the validator (including the validator)"] + #[doc = "Weight:"] + #[doc = "- Reward Destination Staked: O(N)"] + #[doc = "- Reward Destination Controller (Creating): O(N)"] + #[doc = ""] + #[doc = " NOTE: weights are assuming that payouts are made to alive stash account (Staked)."] + #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] + #[doc = "# "] + pub fn payout_stakers( + &self, + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + PayoutStakers, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 235u8, 65u8, 65u8, 249u8, 162u8, 235u8, 127u8, 48u8, 216u8, + 51u8, 252u8, 111u8, 186u8, 191u8, 174u8, 245u8, 144u8, 77u8, + 135u8, 124u8, 205u8, 160u8, 148u8, 130u8, 81u8, 213u8, 195u8, + 105u8, 21u8, 65u8, 186u8, 157u8, + ] + { + let call = PayoutStakers { + validator_stash, + era, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Rebond a portion of the stash scheduled to be unlocked."] + #[doc = ""] + #[doc = "The dispatch origin must be signed by the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: O(L), where L is unlocking chunks"] + #[doc = "- Bounded by `MaxUnlockingChunks`."] + #[doc = "- Storage changes: Can't increase storage, only decrease it."] + #[doc = "# "] + pub fn rebond( + &self, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Rebond, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 138u8, 156u8, 164u8, 170u8, 178u8, 236u8, 221u8, 242u8, + 157u8, 176u8, 173u8, 145u8, 254u8, 94u8, 158u8, 27u8, 138u8, + 103u8, 116u8, 31u8, 41u8, 106u8, 199u8, 180u8, 233u8, 172u8, + 38u8, 7u8, 76u8, 29u8, 5u8, 225u8, + ] + { + let call = Rebond { value }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set `HistoryDepth` value. This function will delete any history information"] + #[doc = "when `HistoryDepth` is reduced."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `new_history_depth`: The new history depth you would like to set."] + #[doc = "- `era_items_deleted`: The number of items that will be deleted by this dispatch. This"] + #[doc = " should report all the storage items that will be deleted by clearing old era history."] + #[doc = " Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an"] + #[doc = " accurate number."] + #[doc = ""] + #[doc = "Origin must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "- E: Number of history depths removed, i.e. 10 -> 7 = 3"] + #[doc = "- Weight: O(E)"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Current Era, History Depth"] + #[doc = " - Writes: History Depth"] + #[doc = " - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs"] + #[doc = " - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,"] + #[doc = " ErasStartSessionIndex"] + #[doc = "# "] + pub fn set_history_depth( + &self, + new_history_depth: ::core::primitive::u32, + era_items_deleted: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHistoryDepth, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 128u8, 149u8, 139u8, 192u8, 213u8, 239u8, 248u8, 215u8, 57u8, + 145u8, 177u8, 225u8, 43u8, 214u8, 228u8, 14u8, 213u8, 181u8, + 18u8, 40u8, 242u8, 1u8, 210u8, 87u8, 143u8, 78u8, 0u8, 23u8, + 145u8, 46u8, 210u8, 168u8, + ] + { + let call = SetHistoryDepth { + new_history_depth, + era_items_deleted, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] + #[doc = "be considered `dust` in the staking system. The requirements are:"] + #[doc = ""] + #[doc = "1. the `total_balance` of the stash is below existential deposit."] + #[doc = "2. or, the `ledger.total` of the stash is below existential deposit."] + #[doc = ""] + #[doc = "The former can happen in cases like a slash; the latter when a fully unbonded account"] + #[doc = "is still receiving staking rewards in `RewardDestination::Staked`."] + #[doc = ""] + #[doc = "It can be called by anyone, as long as `stash` meets the above requirements."] + #[doc = ""] + #[doc = "Refunds the transaction fees upon successful execution."] + pub fn reap_stash( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReapStash, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 84u8, 192u8, 207u8, 193u8, 133u8, 53u8, 93u8, 148u8, 153u8, + 112u8, 54u8, 145u8, 68u8, 195u8, 42u8, 158u8, 17u8, 230u8, + 197u8, 218u8, 179u8, 101u8, 237u8, 105u8, 17u8, 232u8, 125u8, + 163u8, 209u8, 134u8, 3u8, 248u8, + ] + { + let call = ReapStash { + stash, + num_slashing_spans, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove the given nominations from the calling validator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "- `who`: A list of nominator stash accounts who are nominating this validator which"] + #[doc = " should no longer be nominating this validator."] + #[doc = ""] + #[doc = "Note: Making this call only makes sense if you first set the validator preferences to"] + #[doc = "block any further nominations."] + pub fn kick( + &self, + who: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Kick, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 145u8, 201u8, 168u8, 147u8, 25u8, 39u8, 62u8, 48u8, 236u8, + 44u8, 45u8, 233u8, 178u8, 196u8, 117u8, 117u8, 74u8, 193u8, + 131u8, 101u8, 210u8, 40u8, 18u8, 207u8, 99u8, 160u8, 103u8, + 89u8, 69u8, 72u8, 155u8, 89u8, + ] + { + let call = Kick { who }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Update the various staking configurations ."] + #[doc = ""] + #[doc = "* `min_nominator_bond`: The minimum active bond needed to be a nominator."] + #[doc = "* `min_validator_bond`: The minimum active bond needed to be a validator."] + #[doc = "* `max_nominator_count`: The max number of users who can be a nominator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `max_validator_count`: The max number of users who can be a validator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which"] + #[doc = " should be filled in order for the `chill_other` transaction to work."] + #[doc = "* `min_commission`: The minimum amount of commission that each validators must maintain."] + #[doc = " This is checked only upon calling `validate`. Existing validators are not affected."] + #[doc = ""] + #[doc = "Origin must be Root to call this function."] + #[doc = ""] + #[doc = "NOTE: Existing nominators and validators will not be affected by this update."] + #[doc = "to kick people under the new limits, `chill_other` should be called."] + pub fn set_staking_configs( + &self, + min_nominator_bond : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u128 >, + min_validator_bond : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u128 >, + max_nominator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, + max_validator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, + chill_threshold : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Percent >, + min_commission : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Perbill >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetStakingConfigs, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 249u8, 192u8, 107u8, 126u8, 200u8, 50u8, 63u8, 120u8, 116u8, + 53u8, 183u8, 80u8, 134u8, 135u8, 49u8, 112u8, 232u8, 140u8, + 177u8, 175u8, 136u8, 220u8, 209u8, 179u8, 219u8, 110u8, 19u8, + 165u8, 191u8, 173u8, 65u8, 13u8, + ] + { + let call = SetStakingConfigs { + min_nominator_bond, + min_validator_bond, + max_nominator_count, + max_validator_count, + chill_threshold, + min_commission, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_, but can be called by anyone."] + #[doc = ""] + #[doc = "If the caller is the same as the controller being targeted, then no further checks are"] + #[doc = "enforced, and this function behaves just like `chill`."] + #[doc = ""] + #[doc = "If the caller is different than the controller being targeted, the following conditions"] + #[doc = "must be met:"] + #[doc = ""] + #[doc = "* `controller` must belong to a nominator who has become non-decodable,"] + #[doc = ""] + #[doc = "Or:"] + #[doc = ""] + #[doc = "* A `ChillThreshold` must be set and checked which defines how close to the max"] + #[doc = " nominators or validators we must reach before users can start chilling one-another."] + #[doc = "* A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine"] + #[doc = " how close we are to the threshold."] + #[doc = "* A `MinNominatorBond` and `MinValidatorBond` must be set and checked, which determines"] + #[doc = " if this is a person that should be chilled because they have not met the threshold"] + #[doc = " bond required."] + #[doc = ""] + #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] + #[doc = "who do not satisfy these requirements."] + pub fn chill_other( + &self, + controller: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ChillOther, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 219u8, 114u8, 146u8, 43u8, 175u8, 216u8, 70u8, 148u8, 137u8, + 192u8, 77u8, 247u8, 134u8, 80u8, 188u8, 100u8, 79u8, 141u8, + 32u8, 94u8, 15u8, 178u8, 159u8, 233u8, 235u8, 6u8, 243u8, + 253u8, 22u8, 145u8, 146u8, 219u8, + ] + { + let call = ChillOther { controller }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] + #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] + #[doc = "can call this."] + pub fn force_apply_min_commission( + &self, + validator_stash: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceApplyMinCommission, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 8u8, 57u8, 61u8, 141u8, 175u8, 100u8, 174u8, 161u8, 236u8, + 2u8, 133u8, 169u8, 249u8, 168u8, 236u8, 188u8, 168u8, 221u8, + 88u8, 148u8, 95u8, 24u8, 214u8, 206u8, 165u8, 170u8, 200u8, + 134u8, 38u8, 174u8, 187u8, 119u8, + ] + { + let call = ForceApplyMinCommission { validator_stash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] + #[doc = "the remainder from the maximum amount of reward."] + #[doc = "\\[era_index, validator_payout, remainder\\]"] + pub struct EraPaid( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for EraPaid { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "EraPaid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] + pub struct Rewarded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "One validator (and its nominators) has been slashed by the given amount."] + #[doc = "\\[validator, amount\\]"] + pub struct Slashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Slashed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "An old slashing report from a prior era was discarded because it could"] + #[doc = "not be processed. \\[session_index\\]"] + pub struct OldSlashingReportDiscarded(pub ::core::primitive::u32); + impl ::subxt::Event for OldSlashingReportDiscarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "OldSlashingReportDiscarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new set of stakers was elected."] + pub struct StakersElected; + impl ::subxt::Event for StakersElected { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakersElected"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has bonded this amount. \\[stash, amount\\]"] + #[doc = ""] + #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] + #[doc = "it will not be emitted for staking rewards when they are added to stake."] + pub struct Bonded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Bonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Bonded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] + pub struct Unbonded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Unbonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Unbonded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] + #[doc = "from the unlocking queue. \\[stash, amount\\]"] + pub struct Withdrawn( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Withdrawn { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Withdrawn"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] + pub struct Kicked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Kicked { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Kicked"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The election failed. No new era is planned."] + pub struct StakingElectionFailed; + impl ::subxt::Event for StakingElectionFailed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakingElectionFailed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has stopped participating as either a validator or nominator."] + #[doc = "\\[stash\\]"] + pub struct Chilled(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Chilled { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Chilled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] + pub struct PayoutStarted( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for PayoutStarted { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "PayoutStarted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct HistoryDepth; + impl ::subxt::StorageEntry for HistoryDepth { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "HistoryDepth"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ValidatorCount; + impl ::subxt::StorageEntry for ValidatorCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ValidatorCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MinimumValidatorCount; + impl ::subxt::StorageEntry for MinimumValidatorCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinimumValidatorCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Invulnerables; + impl ::subxt::StorageEntry for Invulnerables { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Invulnerables"; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bonded<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Bonded<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Bonded"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct MinNominatorBond; + impl ::subxt::StorageEntry for MinNominatorBond { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinNominatorBond"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MinValidatorBond; + impl ::subxt::StorageEntry for MinValidatorBond { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinValidatorBond"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MinCommission; + impl ::subxt::StorageEntry for MinCommission { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinCommission"; + type Value = runtime_types::sp_arithmetic::per_things::Perbill; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Ledger<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Ledger<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Ledger"; + type Value = runtime_types::pallet_staking::StakingLedger< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Payee<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Payee<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Payee"; + type Value = runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Validators<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Validators<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Validators"; + type Value = runtime_types::pallet_staking::ValidatorPrefs; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CounterForValidators; + impl ::subxt::StorageEntry for CounterForValidators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CounterForValidators"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MaxValidatorsCount; + impl ::subxt::StorageEntry for MaxValidatorsCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MaxValidatorsCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Nominators<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Nominators<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Nominators"; + type Value = runtime_types::pallet_staking::Nominations; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CounterForNominators; + impl ::subxt::StorageEntry for CounterForNominators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CounterForNominators"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MaxNominatorsCount; + impl ::subxt::StorageEntry for MaxNominatorsCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MaxNominatorsCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentEra; + impl ::subxt::StorageEntry for CurrentEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CurrentEra"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ActiveEra; + impl ::subxt::StorageEntry for ActiveEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ActiveEra"; + type Value = runtime_types::pallet_staking::ActiveEraInfo; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ErasStartSessionIndex<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasStartSessionIndex<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStartSessionIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasStakers<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ErasStakers<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStakers"; + type Value = runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ErasStakersClipped<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ErasStakersClipped<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStakersClipped"; + type Value = runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ErasValidatorPrefs<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ErasValidatorPrefs<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasValidatorPrefs"; + type Value = runtime_types::pallet_staking::ValidatorPrefs; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ErasValidatorReward<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasValidatorReward<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasValidatorReward"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasRewardPoints<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasRewardPoints<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasRewardPoints"; + type Value = runtime_types::pallet_staking::EraRewardPoints< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasTotalStake<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasTotalStake<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasTotalStake"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ForceEra; + impl ::subxt::StorageEntry for ForceEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ForceEra"; + type Value = runtime_types::pallet_staking::Forcing; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SlashRewardFraction; + impl ::subxt::StorageEntry for SlashRewardFraction { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SlashRewardFraction"; + type Value = runtime_types::sp_arithmetic::per_things::Perbill; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CanceledSlashPayout; + impl ::subxt::StorageEntry for CanceledSlashPayout { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CanceledSlashPayout"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UnappliedSlashes<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for UnappliedSlashes<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "UnappliedSlashes"; + type Value = ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct BondedEras; + impl ::subxt::StorageEntry for BondedEras { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "BondedEras"; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ValidatorSlashInEra<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ValidatorSlashInEra<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ValidatorSlashInEra"; + type Value = ( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct NominatorSlashInEra<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for NominatorSlashInEra<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "NominatorSlashInEra"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct SlashingSpans<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SlashingSpans<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SlashingSpans"; + type Value = runtime_types::pallet_staking::slashing::SlashingSpans; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct SpanSlash<'a>( + pub &'a ::subxt::sp_core::crypto::AccountId32, + pub &'a ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for SpanSlash<'_> { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SpanSlash"; + type Value = runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &(&self.0, &self.1), + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct EarliestUnappliedSlash; + impl ::subxt::StorageEntry for EarliestUnappliedSlash { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "EarliestUnappliedSlash"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentPlannedSession; + impl ::subxt::StorageEntry for CurrentPlannedSession { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CurrentPlannedSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct OffendingValidators; + impl ::subxt::StorageEntry for OffendingValidators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "OffendingValidators"; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_staking::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ChillThreshold; + impl ::subxt::StorageEntry for ChillThreshold { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ChillThreshold"; + type Value = runtime_types::sp_arithmetic::per_things::Percent; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Number of eras to keep in history."] + #[doc = ""] + #[doc = " Information is kept for eras in `[current_era - history_depth; current_era]`."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The ideal number of staking participants."] + pub async fn validator_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Minimum number of staking participants before emergency conditions are imposed."] + pub async fn minimum_validator_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Map from all locked \"stash\" accounts to the controller account."] + pub async fn bonded( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The minimum active bond to become and maintain the role of a nominator."] + pub async fn min_nominator_bond( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The minimum active bond to become and maintain the role of a validator."] + pub async fn min_validator_bond( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The minimum amount of commission that validators can set."] + #[doc = ""] + #[doc = " If set to `0`, no limit exists."] + pub async fn min_commission( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Perbill, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] + pub async fn ledger( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::StakingLedger< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().storage_hash::()? + == [ + 91u8, 46u8, 130u8, 228u8, 126u8, 95u8, 46u8, 57u8, 222u8, + 98u8, 250u8, 145u8, 83u8, 135u8, 240u8, 153u8, 57u8, 21u8, + 232u8, 254u8, 217u8, 22u8, 62u8, 76u8, 128u8, 159u8, 137u8, + 149u8, 112u8, 251u8, 142u8, 35u8, + ] + { + let entry = Ledger(_0); + self.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, + > { + if self.client.metadata().storage_hash::()? + == [ + 91u8, 46u8, 130u8, 228u8, 126u8, 95u8, 46u8, 57u8, 222u8, + 98u8, 250u8, 145u8, 83u8, 135u8, 240u8, 153u8, 57u8, 21u8, + 232u8, 254u8, 217u8, 22u8, 62u8, 76u8, 128u8, 159u8, 137u8, + 149u8, 112u8, 251u8, 142u8, 35u8, + ] + { + self.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( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = "Counter for the related counted storage map"] + pub async fn counter_for_validators( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] + #[doc = " they wish to support."] + #[doc = ""] + #[doc = " Note that the keys of this storage map might become non-decodable in case the"] + #[doc = " [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators"] + #[doc = " are still existent in storage, their key is correct and retrievable (i.e. `contains_key`"] + #[doc = " indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable"] + #[doc = " nominators will effectively not-exist, until they re-submit their preferences such that it"] + #[doc = " is within the bounds of the newly set `Config::MaxNominations`."] + #[doc = ""] + #[doc = " This implies that `::iter_keys().count()` and `::iter().count()` might return different"] + #[doc = " values for this map. Moreover, the main `::count()` is aligned with the former, namely the"] + #[doc = " number of keys that exist."] + #[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( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] + #[doc = " they wish to support."] + #[doc = ""] + #[doc = " Note that the keys of this storage map might become non-decodable in case the"] + #[doc = " [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators"] + #[doc = " are still existent in storage, their key is correct and retrievable (i.e. `contains_key`"] + #[doc = " indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable"] + #[doc = " nominators will effectively not-exist, until they re-submit their preferences such that it"] + #[doc = " is within the bounds of the newly set `Config::MaxNominations`."] + #[doc = ""] + #[doc = " This implies that `::iter_keys().count()` and `::iter().count()` might return different"] + #[doc = " values for this map. Moreover, the main `::count()` is aligned with the former, namely the"] + #[doc = " number of keys that exist."] + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = "Counter for the related counted storage map"] + pub async fn counter_for_nominators( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Exposure of validator at era."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] + pub async fn eras_stakers( + &self, + _0: &::core::primitive::u32, + _1: &::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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Exposure of validator at era."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Clipped Exposure of validator at era."] + #[doc = ""] + #[doc = " This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the"] + #[doc = " `T::MaxNominatorRewardedPerValidator` biggest stakers."] + #[doc = " (Note: the field `total` and `own` of the exposure remains unchanged)."] + #[doc = " This is used to limit the i/o cost for the nominator payout."] + #[doc = ""] + #[doc = " This is keyed fist by the era index to allow bulk deletion and then the stash account."] + #[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( + &self, + _0: &::core::primitive::u32, + _1: &::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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Clipped Exposure of validator at era."] + #[doc = ""] + #[doc = " This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the"] + #[doc = " `T::MaxNominatorRewardedPerValidator` biggest stakers."] + #[doc = " (Note: the field `total` and `own` of the exposure remains unchanged)."] + #[doc = " This is used to limit the i/o cost for the nominator payout."] + #[doc = ""] + #[doc = " This is keyed fist by the era index to allow bulk deletion and then the stash account."] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + pub 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + pub async fn eras_validator_prefs_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorPrefs<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Perbill, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[doc = " All unapplied slashes that are queued for later."] + pub async fn unapplied_slashes( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + _1: &::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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Slashing spans for stash accounts."] + pub async fn slashing_spans( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + _1: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Indices of validators that have offended in the active era and whether they are currently"] + #[doc = " disabled."] + #[doc = ""] + #[doc = " This value should be a superset of disabled validators since not all offences lead to the"] + #[doc = " validator being disabled (if there was no slash). This is needed to track the percentage of"] + #[doc = " validators that have offended in the current era, ensuring a new era is forced if"] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Maximum number of nominations per nominator."] + pub fn max_nominations( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Staking", "MaxNominations")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Staking")?; + let constant = pallet.constant("MaxNominations")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Number of sessions per era."] + pub fn sessions_per_era( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Staking", "SessionsPerEra")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Staking")?; + let constant = pallet.constant("SessionsPerEra")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Number of eras that staked funds must remain bonded for."] + pub fn bonding_duration( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Staking", "BondingDuration")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Staking")?; + let constant = pallet.constant("BondingDuration")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Number of eras that slashes are deferred by, after computation."] + #[doc = ""] + #[doc = " This should be less than the bonding duration. Set to 0 if slashes"] + #[doc = " should be applied immediately, without opportunity for intervention."] + pub fn slash_defer_duration( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Staking", "SlashDeferDuration")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Staking")?; + let constant = pallet.constant("SlashDeferDuration")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of nominators rewarded for each validator."] + #[doc = ""] + #[doc = " For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can"] + #[doc = " claim their reward. This used to limit the i/o cost for the nominator payout."] + pub fn max_nominator_rewarded_per_validator( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Staking", "MaxNominatorRewardedPerValidator")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Staking")?; + let constant = + pallet.constant("MaxNominatorRewardedPerValidator")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively"] + #[doc = " determines how many unique eras a staker may be unbonding in."] + pub fn max_unlocking_chunks( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Staking", "MaxUnlockingChunks")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Staking")?; + let constant = pallet.constant("MaxUnlockingChunks")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod offences { + use super::{ + root_mod, + runtime_types, + }; + pub type Event = runtime_types::pallet_offences::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] + #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] + #[doc = "\\[kind, timeslot\\]."] + pub struct Offence { + pub kind: [::core::primitive::u8; 16usize], + pub timeslot: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Event for Offence { + const PALLET: &'static str = "Offences"; + const EVENT: &'static str = "Offence"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Reports<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reports<'_> { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "Reports"; + type Value = runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::sp_core::crypto::AccountId32, + ( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ConcurrentReportsIndex<'a>( + pub &'a [::core::primitive::u8; 16usize], + pub &'a [::core::primitive::u8], + ); + impl ::subxt::StorageEntry for ConcurrentReportsIndex<'_> { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ConcurrentReportsIndex"; + type Value = ::std::vec::Vec<::subxt::sp_core::H256>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ReportsByKindIndex<'a>(pub &'a [::core::primitive::u8; 16usize]); + impl ::subxt::StorageEntry for ReportsByKindIndex<'_> { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ReportsByKindIndex"; + type Value = ::std::vec::Vec<::core::primitive::u8>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The primary structure that holds all offence records keyed by report identifiers."] + pub async fn reports( + &self, + _0: &::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, + ( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Enumerates all reports of a kind along with the time they happened."] + #[doc = ""] + #[doc = " All reports are sorted by the time of offence."] + #[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( + &self, + _0: &[::core::primitive::u8; 16usize], + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u8>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Enumerates all reports of a kind along with the time they happened."] + #[doc = ""] + #[doc = " All reports are sorted by the time of offence."] + #[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, + > { + if self + .client + .metadata() + .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 mod historical { + use super::{ + root_mod, + runtime_types, + }; + } + pub mod session { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetKeys { + pub keys: runtime_types::polkadot_runtime::SessionKeys, + pub proof: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for SetKeys { + const PALLET: &'static str = "Session"; + const FUNCTION: &'static str = "set_keys"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PurgeKeys; + impl ::subxt::Call for PurgeKeys { + const PALLET: &'static str = "Session"; + const FUNCTION: &'static str = "purge_keys"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be signed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] + #[doc = " `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] + #[doc = "- DbWrites: `origin account`, `NextKeys`"] + #[doc = "- DbReads per key id: `KeyOwner`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + pub fn set_keys( + &self, + keys: runtime_types::polkadot_runtime::SessionKeys, + proof: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetKeys, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 194u8, 88u8, 145u8, 74u8, 215u8, 181u8, 126u8, 21u8, 193u8, + 174u8, 42u8, 142u8, 229u8, 213u8, 104u8, 36u8, 134u8, 83u8, + 245u8, 106u8, 9u8, 42u8, 75u8, 206u8, 161u8, 248u8, 232u8, + 31u8, 160u8, 213u8, 70u8, 228u8, + ] + { + let call = SetKeys { keys, proof }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] + #[doc = " of `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] + #[doc = "- DbWrites: `NextKeys`, `origin account`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + pub fn purge_keys( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + PurgeKeys, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 200u8, 255u8, 4u8, 213u8, 188u8, 92u8, 99u8, 116u8, 163u8, + 152u8, 29u8, 35u8, 133u8, 119u8, 246u8, 44u8, 91u8, 31u8, + 145u8, 23u8, 213u8, 64u8, 71u8, 242u8, 207u8, 239u8, 231u8, + 37u8, 61u8, 63u8, 190u8, 35u8, + ] + { + let call = PurgeKeys {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_session::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "New session has happened. Note that the argument is the session index, not the"] + #[doc = "block number as the type might suggest."] + pub struct NewSession { + pub session_index: ::core::primitive::u32, + } + impl ::subxt::Event for NewSession { + const PALLET: &'static str = "Session"; + const EVENT: &'static str = "NewSession"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Validators; + impl ::subxt::StorageEntry for Validators { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "Validators"; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentIndex; + impl ::subxt::StorageEntry for CurrentIndex { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "CurrentIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct QueuedChanged; + impl ::subxt::StorageEntry for QueuedChanged { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "QueuedChanged"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct QueuedKeys; + impl ::subxt::StorageEntry for QueuedKeys { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "QueuedKeys"; + type Value = ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::SessionKeys, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DisabledValidators; + impl ::subxt::StorageEntry for DisabledValidators { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "DisabledValidators"; + type Value = ::std::vec::Vec<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextKeys<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for NextKeys<'_> { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "NextKeys"; + type Value = runtime_types::polkadot_runtime::SessionKeys; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct KeyOwner<'a>( + pub &'a runtime_types::sp_core::crypto::KeyTypeId, + pub &'a [::core::primitive::u8], + ); + impl ::subxt::StorageEntry for KeyOwner<'_> { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "KeyOwner"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &(&self.0, &self.1), + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The current set of validators."] + pub async fn validators( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Current index of the session."] + pub async fn current_index( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::SessionKeys, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Indices of disabled validators."] + #[doc = ""] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The next session keys for a validator."] + pub async fn next_keys( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] + pub async fn key_owner( + &self, + _0: &runtime_types::sp_core::crypto::KeyTypeId, + _1: &[::core::primitive::u8], + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod grandpa { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReportEquivocation { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + ::core::primitive::u32, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + impl ::subxt::Call for ReportEquivocation { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "report_equivocation"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + ::core::primitive::u32, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + impl ::subxt::Call for ReportEquivocationUnsigned { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "report_equivocation_unsigned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NoteStalled { + pub delay: ::core::primitive::u32, + pub best_finalized_block_number: ::core::primitive::u32, + } + impl ::subxt::Call for NoteStalled { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "note_stalled"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + pub fn report_equivocation( + &self, + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReportEquivocation, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 230u8, 252u8, 24u8, 207u8, 164u8, 127u8, 177u8, 30u8, 113u8, + 175u8, 207u8, 252u8, 230u8, 225u8, 181u8, 190u8, 236u8, + 110u8, 145u8, 168u8, 200u8, 134u8, 88u8, 234u8, 231u8, 45u8, + 149u8, 169u8, 155u8, 114u8, 62u8, 65u8, + ] + { + let call = ReportEquivocation { + equivocation_proof: ::std::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_equivocation_unsigned( + &self, + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReportEquivocationUnsigned, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 141u8, 235u8, 27u8, 135u8, 124u8, 124u8, 234u8, 51u8, 100u8, + 105u8, 188u8, 248u8, 133u8, 10u8, 84u8, 14u8, 40u8, 235u8, + 14u8, 107u8, 63u8, 148u8, 107u8, 172u8, 136u8, 159u8, 86u8, + 23u8, 145u8, 221u8, 93u8, 206u8, + ] + { + let call = ReportEquivocationUnsigned { + equivocation_proof: ::std::boxed::Box::new( + equivocation_proof, + ), + key_owner_proof, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + 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 = "Only callable by root."] + pub fn note_stalled( + &self, + delay: ::core::primitive::u32, + best_finalized_block_number: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NoteStalled, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 227u8, 98u8, 249u8, 158u8, 96u8, 124u8, 72u8, 188u8, 27u8, + 215u8, 73u8, 62u8, 103u8, 79u8, 38u8, 48u8, 212u8, 88u8, + 233u8, 187u8, 11u8, 95u8, 39u8, 247u8, 55u8, 184u8, 228u8, + 102u8, 13u8, 251u8, 52u8, 206u8, + ] + { + let call = NoteStalled { + delay, + best_finalized_block_number, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_grandpa::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "New authority set has been applied."] + pub struct NewAuthorities { + pub authority_set: ::std::vec::Vec<( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + )>, + } + impl ::subxt::Event for NewAuthorities { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "NewAuthorities"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Current authority set has been paused."] + pub struct Paused; + impl ::subxt::Event for Paused { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "Paused"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Current authority set has been resumed."] + pub struct Resumed; + impl ::subxt::Event for Resumed { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "Resumed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct State; + impl ::subxt::StorageEntry for State { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "State"; + type Value = + runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct PendingChange; + impl ::subxt::StorageEntry for PendingChange { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "PendingChange"; + type Value = runtime_types::pallet_grandpa::StoredPendingChange< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextForced; + impl ::subxt::StorageEntry for NextForced { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "NextForced"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Stalled; + impl ::subxt::StorageEntry for Stalled { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "Stalled"; + type Value = (::core::primitive::u32, ::core::primitive::u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentSetId; + impl ::subxt::StorageEntry for CurrentSetId { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "CurrentSetId"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SetIdSession<'a>(pub &'a ::core::primitive::u64); + impl ::subxt::StorageEntry for SetIdSession<'_> { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "SetIdSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " State of the current authority set."] + pub async fn state( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " Pending change: (signaled at, scheduled change)."] + pub async fn pending_change( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_grandpa::StoredPendingChange< + ::core::primitive::u32, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " `true` if we are currently stalled."] + pub async fn stalled( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Max Authorities in use"] + pub fn max_authorities( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Grandpa", "MaxAuthorities")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Grandpa")?; + let constant = pallet.constant("MaxAuthorities")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod im_online { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Heartbeat { + pub heartbeat: + runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, + pub signature: + runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, + } + impl ::subxt::Call for Heartbeat { + const PALLET: &'static str = "ImOnline"; + const FUNCTION: &'static str = "heartbeat"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "# "] + #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] + #[doc = " length of `heartbeat.network_state.external_address`"] + #[doc = " - `O(K)`: decoding of length `K`"] + #[doc = " - `O(E)`: decoding/encoding of length `E`"] + #[doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] + #[doc = " `ReceivedHeartbeats`"] + #[doc = "- DbWrites: `ReceivedHeartbeats`"] + #[doc = "# "] + pub fn heartbeat( + &self, + heartbeat: runtime_types::pallet_im_online::Heartbeat< + ::core::primitive::u32, + >, + signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Heartbeat, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 246u8, 83u8, 28u8, 233u8, 69u8, 55u8, 28u8, 178u8, 82u8, + 159u8, 56u8, 241u8, 111u8, 78u8, 194u8, 15u8, 14u8, 250u8, + 172u8, 148u8, 208u8, 52u8, 33u8, 106u8, 159u8, 210u8, 196u8, + 79u8, 138u8, 194u8, 150u8, 201u8, + ] + { + let call = Heartbeat { + heartbeat, + signature, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_im_online::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new heartbeat was received from `AuthorityId`."] + pub struct HeartbeatReceived { + pub authority_id: + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + } + impl ::subxt::Event for HeartbeatReceived { + const PALLET: &'static str = "ImOnline"; + const EVENT: &'static str = "HeartbeatReceived"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "At the end of the session, no offence was committed."] + pub struct AllGood; + impl ::subxt::Event for AllGood { + const PALLET: &'static str = "ImOnline"; + const EVENT: &'static str = "AllGood"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "At the end of the session, at least one validator was found to be offline."] + pub struct SomeOffline { + pub offline: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, + } + impl ::subxt::Event for SomeOffline { + const PALLET: &'static str = "ImOnline"; + const EVENT: &'static str = "SomeOffline"; + } + } + pub mod storage { + use super::runtime_types; + pub struct HeartbeatAfter; + impl ::subxt::StorageEntry for HeartbeatAfter { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "HeartbeatAfter"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Keys; + impl ::subxt::StorageEntry for Keys { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "Keys"; + type Value = runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ReceivedHeartbeats<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for ReceivedHeartbeats<'_> { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "ReceivedHeartbeats"; + type Value = runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct AuthoredBlocks<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for AuthoredBlocks<'_> { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "AuthoredBlocks"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The block number after which it's ok to send heartbeats in the current"] + #[doc = " session."] + #[doc = ""] + #[doc = " At the beginning of each session we set this to a value that should fall"] + #[doc = " roughly in the middle of the session duration. The idea is to first wait for"] + #[doc = " the validators to produce a block in the current session, so that the"] + #[doc = " heartbeat later on will not be necessary."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " 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, + > { + if self + .client + .metadata() + .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 = " 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + _1: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " A configuration for base priority of unsigned transactions."] + #[doc = ""] + #[doc = " This is exposed so that it can be tuned for particular runtime, when"] + #[doc = " multiple pallets send unsigned transactions."] + pub fn unsigned_priority( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ImOnline", "UnsignedPriority")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self.client.metadata().pallet("ImOnline")?; + let constant = pallet.constant("UnsignedPriority")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod authority_discovery { + use super::{ + root_mod, + runtime_types, + }; + } + pub mod democracy { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Propose { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Second { + #[codec(compact)] + pub proposal: ::core::primitive::u32, + #[codec(compact)] + pub seconds_upper_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Second { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "second"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vote { + #[codec(compact)] + pub ref_index: ::core::primitive::u32, + pub vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "vote"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct EmergencyCancel { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Call for EmergencyCancel { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "emergency_cancel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalPropose { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for ExternalPropose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalProposeMajority { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for ExternalProposeMajority { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose_majority"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalProposeDefault { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for ExternalProposeDefault { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose_default"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct FastTrack { + pub proposal_hash: ::subxt::sp_core::H256, + pub voting_period: ::core::primitive::u32, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Call for FastTrack { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "fast_track"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VetoExternal { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for VetoExternal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "veto_external"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelReferendum { + #[codec(compact)] + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Call for CancelReferendum { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_referendum"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct CancelQueued { + pub which: ::core::primitive::u32, + } + impl ::subxt::Call for CancelQueued { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_queued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Delegate { + pub to: ::subxt::sp_core::crypto::AccountId32, + pub conviction: runtime_types::pallet_democracy::conviction::Conviction, + pub balance: ::core::primitive::u128, + } + impl ::subxt::Call for Delegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "delegate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Undelegate; + impl ::subxt::Call for Undelegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "undelegate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearPublicProposals; + impl ::subxt::Call for ClearPublicProposals { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "clear_public_proposals"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NotePreimage { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NotePreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NotePreimageOperational { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NotePreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage_operational"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NoteImminentPreimage { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NoteImminentPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NoteImminentPreimageOperational { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NoteImminentPreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage_operational"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReapPreimage { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub proposal_len_upper_bound: ::core::primitive::u32, + } + impl ::subxt::Call for ReapPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "reap_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Unlock { + pub target: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for Unlock { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "unlock"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct RemoveVote { + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for RemoveVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveOtherVote { + pub target: ::subxt::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for RemoveOtherVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_other_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EnactProposal { + pub proposal_hash: ::subxt::sp_core::H256, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for EnactProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "enact_proposal"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Blacklist { + pub proposal_hash: ::subxt::sp_core::H256, + pub maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for Blacklist { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "blacklist"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelProposal { + #[codec(compact)] + pub prop_index: ::core::primitive::u32, + } + impl ::subxt::Call for CancelProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Propose a sensitive action to be taken."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] + #[doc = "have funds to cover the deposit."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the proposal preimage."] + #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] + #[doc = ""] + #[doc = "Emits `Proposed`."] + #[doc = ""] + #[doc = "Weight: `O(p)`"] + pub fn propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Propose, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 149u8, 60u8, 16u8, 143u8, 114u8, 16u8, 124u8, 96u8, 97u8, + 5u8, 176u8, 137u8, 188u8, 164u8, 65u8, 145u8, 142u8, 104u8, + 74u8, 120u8, 248u8, 90u8, 109u8, 112u8, 29u8, 226u8, 208u8, + 230u8, 101u8, 8u8, 79u8, 12u8, + ] + { + let call = Propose { + proposal_hash, + value, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Signals agreement with a particular proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender"] + #[doc = "must have funds to cover the deposit, equal to the original deposit."] + #[doc = ""] + #[doc = "- `proposal`: The index of the proposal to second."] + #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] + #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] + #[doc = ""] + #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] + pub fn second( + &self, + proposal: ::core::primitive::u32, + seconds_upper_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Second, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 37u8, 226u8, 138u8, 26u8, 138u8, 46u8, 39u8, 147u8, 22u8, + 32u8, 245u8, 40u8, 49u8, 228u8, 218u8, 225u8, 72u8, 89u8, + 37u8, 90u8, 132u8, 31u8, 52u8, 22u8, 234u8, 124u8, 254u8, + 223u8, 56u8, 215u8, 255u8, 79u8, + ] + { + let call = Second { + proposal, + seconds_upper_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] + pub fn vote( + &self, + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Vote, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 1u8, 235u8, 77u8, 58u8, 54u8, 224u8, 30u8, 168u8, 150u8, + 169u8, 20u8, 172u8, 137u8, 191u8, 189u8, 184u8, 28u8, 118u8, + 204u8, 233u8, 146u8, 212u8, 45u8, 139u8, 58u8, 175u8, 231u8, + 169u8, 43u8, 164u8, 149u8, 16u8, + ] + { + let call = Vote { ref_index, vote }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancellationOrigin`."] + #[doc = ""] + #[doc = "-`ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + pub fn emergency_cancel( + &self, + ref_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + EmergencyCancel, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 4u8, 129u8, 205u8, 102u8, 202u8, 197u8, 75u8, 155u8, 24u8, + 125u8, 157u8, 73u8, 50u8, 243u8, 173u8, 103u8, 49u8, 60u8, + 50u8, 63u8, 54u8, 40u8, 34u8, 227u8, 29u8, 247u8, 179u8, + 102u8, 107u8, 177u8, 117u8, 161u8, + ] + { + let call = EmergencyCancel { ref_index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] + #[doc = " Decoding vec of length V. Charged as maximum"] + pub fn external_propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ExternalPropose, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 50u8, 82u8, 155u8, 206u8, 57u8, 61u8, 64u8, 43u8, 30u8, 71u8, + 89u8, 91u8, 221u8, 46u8, 15u8, 222u8, 15u8, 211u8, 56u8, + 176u8, 84u8, 225u8, 192u8, 92u8, 253u8, 56u8, 207u8, 29u8, + 252u8, 77u8, 245u8, 113u8, + ] + { + let call = ExternalPropose { proposal_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] + #[doc = "an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalMajorityOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn external_propose_majority( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ExternalProposeMajority, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 18u8, 92u8, 204u8, 120u8, 189u8, 60u8, 223u8, 166u8, 213u8, + 49u8, 20u8, 131u8, 202u8, 1u8, 87u8, 226u8, 168u8, 156u8, + 144u8, 110u8, 118u8, 125u8, 81u8, 111u8, 229u8, 244u8, 89u8, + 93u8, 202u8, 140u8, 16u8, 220u8, + ] + { + let call = ExternalProposeMajority { proposal_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] + #[doc = "schedule an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalDefaultOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn external_propose_default( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ExternalProposeDefault, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 51u8, 75u8, 236u8, 51u8, 53u8, 39u8, 26u8, 231u8, 212u8, + 191u8, 175u8, 233u8, 181u8, 156u8, 210u8, 221u8, 181u8, + 182u8, 113u8, 69u8, 171u8, 70u8, 219u8, 133u8, 88u8, 78u8, + 87u8, 228u8, 177u8, 53u8, 111u8, 115u8, + ] + { + let call = ExternalProposeDefault { proposal_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] + #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] + #[doc = "but it is not a majority-carries referendum then it fails."] + #[doc = ""] + #[doc = "The dispatch of this call must be `FastTrackOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the current external proposal."] + #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] + #[doc = " `FastTrackVotingPeriod` if too low."] + #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] + #[doc = " enacted. This doesn't have a minimum amount."] + #[doc = ""] + #[doc = "Emits `Started`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn fast_track( + &self, + proposal_hash: ::subxt::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + FastTrack, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 232u8, 255u8, 150u8, 13u8, 151u8, 28u8, 253u8, 37u8, 183u8, + 127u8, 53u8, 228u8, 160u8, 11u8, 223u8, 48u8, 74u8, 5u8, + 37u8, 3u8, 84u8, 224u8, 79u8, 172u8, 120u8, 220u8, 158u8, + 191u8, 127u8, 55u8, 126u8, 135u8, + ] + { + let call = FastTrack { + proposal_hash, + voting_period, + delay, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Veto and blacklist the external proposal hash."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `VetoOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal to veto and blacklist."] + #[doc = ""] + #[doc = "Emits `Vetoed`."] + #[doc = ""] + #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] + pub fn veto_external( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + VetoExternal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 230u8, 207u8, 43u8, 137u8, 173u8, 97u8, 143u8, 183u8, 193u8, + 78u8, 252u8, 104u8, 237u8, 32u8, 151u8, 164u8, 91u8, 247u8, + 233u8, 36u8, 198u8, 88u8, 63u8, 176u8, 77u8, 87u8, 26u8, + 242u8, 211u8, 47u8, 193u8, 180u8, + ] + { + let call = VetoExternal { proposal_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "# Weight: `O(1)`."] + pub fn cancel_referendum( + &self, + ref_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelReferendum, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 107u8, 144u8, 114u8, 224u8, 39u8, 217u8, 156u8, 202u8, 62u8, + 4u8, 196u8, 63u8, 145u8, 196u8, 107u8, 241u8, 3u8, 61u8, + 202u8, 20u8, 123u8, 158u8, 153u8, 45u8, 192u8, 192u8, 244u8, + 42u8, 224u8, 23u8, 243u8, 225u8, + ] + { + let call = CancelReferendum { ref_index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel a proposal queued for enactment."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `which`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] + pub fn cancel_queued( + &self, + which: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelQueued, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 130u8, 218u8, 212u8, 143u8, 89u8, 134u8, 207u8, 161u8, 165u8, + 202u8, 237u8, 237u8, 81u8, 125u8, 165u8, 147u8, 222u8, 198u8, + 236u8, 1u8, 223u8, 74u8, 200u8, 6u8, 208u8, 128u8, 215u8, + 50u8, 46u8, 117u8, 16u8, 143u8, + ] + { + let call = CancelQueued { which }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Delegate the voting power (with some given conviction) of the sending account."] + #[doc = ""] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed/consolidated"] + #[doc = " through `reap_vote` or `unvote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + pub fn delegate( + &self, + to: ::subxt::sp_core::crypto::AccountId32, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Delegate, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 33u8, 155u8, 180u8, 53u8, 39u8, 251u8, 59u8, 100u8, 16u8, + 124u8, 209u8, 40u8, 42u8, 152u8, 3u8, 109u8, 97u8, 211u8, + 129u8, 151u8, 82u8, 45u8, 16u8, 98u8, 114u8, 250u8, 145u8, + 176u8, 244u8, 39u8, 64u8, 11u8, + ] + { + let call = Delegate { + to, + conviction, + balance, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Undelegate the voting power of the sending account."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + pub fn undelegate( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Undelegate, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 165u8, 40u8, 183u8, 209u8, 57u8, 153u8, 111u8, 29u8, 114u8, + 109u8, 107u8, 235u8, 97u8, 61u8, 53u8, 155u8, 44u8, 245u8, + 28u8, 220u8, 56u8, 134u8, 43u8, 122u8, 248u8, 156u8, 191u8, + 154u8, 4u8, 121u8, 152u8, 153u8, + ] + { + let call = Undelegate {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Clears all public proposals."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + pub fn clear_public_proposals( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClearPublicProposals, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 59u8, 126u8, 254u8, 223u8, 252u8, 225u8, 75u8, 185u8, 188u8, + 181u8, 42u8, 179u8, 211u8, 73u8, 12u8, 141u8, 243u8, 197u8, + 46u8, 130u8, 215u8, 196u8, 225u8, 88u8, 48u8, 199u8, 231u8, + 249u8, 195u8, 53u8, 184u8, 204u8, + ] + { + let call = ClearPublicProposals {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] + #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + pub fn note_preimage( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NotePreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 121u8, 179u8, 204u8, 32u8, 104u8, 133u8, 99u8, 153u8, 226u8, + 190u8, 89u8, 121u8, 232u8, 154u8, 89u8, 133u8, 124u8, 222u8, + 237u8, 39u8, 50u8, 128u8, 80u8, 115u8, 186u8, 180u8, 151u8, + 139u8, 73u8, 112u8, 148u8, 232u8, + ] + { + let call = NotePreimage { encoded_proposal }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] + pub fn note_preimage_operational( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NotePreimageOperational, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 102u8, 20u8, 213u8, 32u8, 64u8, 28u8, 150u8, 241u8, 173u8, + 182u8, 201u8, 70u8, 52u8, 211u8, 95u8, 211u8, 127u8, 12u8, + 249u8, 57u8, 128u8, 64u8, 185u8, 239u8, 255u8, 191u8, 203u8, + 222u8, 123u8, 187u8, 106u8, 12u8, + ] + { + let call = NotePreimageOperational { encoded_proposal }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] + #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] + #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] + #[doc = "no fee is paid."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + pub fn note_imminent_preimage( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NoteImminentPreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 240u8, 77u8, 42u8, 178u8, 110u8, 117u8, 152u8, 158u8, 64u8, + 26u8, 49u8, 37u8, 177u8, 178u8, 203u8, 227u8, 23u8, 251u8, + 242u8, 112u8, 184u8, 234u8, 95u8, 73u8, 86u8, 37u8, 148u8, + 150u8, 6u8, 50u8, 239u8, 64u8, + ] + { + let call = NoteImminentPreimage { encoded_proposal }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] + pub fn note_imminent_preimage_operational( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NoteImminentPreimageOperational, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 119u8, 17u8, 140u8, 81u8, 7u8, 103u8, 162u8, 112u8, 160u8, + 179u8, 116u8, 34u8, 126u8, 150u8, 64u8, 117u8, 93u8, 225u8, + 197u8, 40u8, 62u8, 238u8, 174u8, 63u8, 148u8, 248u8, 214u8, + 212u8, 228u8, 86u8, 87u8, 195u8, + ] + { + let call = NoteImminentPreimageOperational { encoded_proposal }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove an expired proposal preimage and collect the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of a proposal."] + #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] + #[doc = " weighted according to this value with no refund."] + #[doc = ""] + #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] + #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] + #[doc = "work an additional `EnactmentPeriod` later."] + #[doc = ""] + #[doc = "Emits `PreimageReaped`."] + #[doc = ""] + #[doc = "Weight: `O(D)` where D is length of proposal."] + pub fn reap_preimage( + &self, + proposal_hash: ::subxt::sp_core::H256, + proposal_len_upper_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReapPreimage, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 45u8, 191u8, 46u8, 19u8, 87u8, 216u8, 48u8, 29u8, 124u8, + 205u8, 39u8, 178u8, 158u8, 95u8, 163u8, 116u8, 232u8, 58u8, + 6u8, 242u8, 52u8, 215u8, 251u8, 49u8, 1u8, 234u8, 99u8, + 142u8, 76u8, 182u8, 134u8, 173u8, + ] + { + let call = ReapPreimage { + proposal_hash, + proposal_len_upper_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unlock tokens that have an expired lock."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub fn unlock( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Unlock, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 106u8, 17u8, 189u8, 71u8, 208u8, 26u8, 49u8, 71u8, 162u8, + 196u8, 126u8, 192u8, 242u8, 239u8, 77u8, 196u8, 62u8, 171u8, + 58u8, 176u8, 157u8, 81u8, 65u8, 246u8, 210u8, 43u8, 1u8, + 226u8, 143u8, 149u8, 210u8, 192u8, + ] + { + let call = Unlock { target }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the referendum was cancelled, or"] + #[doc = "- the referendum is ongoing, or"] + #[doc = "- the referendum has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the referendum has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for referendum `index`."] + #[doc = ""] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_vote( + &self, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveVote, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 33u8, 72u8, 14u8, 166u8, 152u8, 18u8, 232u8, 153u8, 163u8, + 96u8, 146u8, 180u8, 98u8, 155u8, 119u8, 75u8, 247u8, 175u8, + 246u8, 183u8, 182u8, 108u8, 250u8, 80u8, 148u8, 86u8, 255u8, + 59u8, 93u8, 197u8, 209u8, 226u8, + ] + { + let call = RemoveVote { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the referendum was cancelled, because the voter lost the referendum or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for"] + #[doc = " referendum `index`."] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_other_vote( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveOtherVote, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 43u8, 194u8, 32u8, 219u8, 87u8, 143u8, 240u8, 34u8, 236u8, + 232u8, 128u8, 7u8, 99u8, 113u8, 106u8, 124u8, 92u8, 115u8, + 75u8, 228u8, 39u8, 234u8, 192u8, 134u8, 69u8, 109u8, 119u8, + 133u8, 194u8, 110u8, 167u8, 244u8, + ] + { + let call = RemoveOtherVote { target, index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] + pub fn enact_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + EnactProposal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 246u8, 188u8, 9u8, 244u8, 56u8, 81u8, 201u8, 59u8, 212u8, + 11u8, 204u8, 7u8, 173u8, 7u8, 212u8, 34u8, 173u8, 248u8, + 83u8, 225u8, 209u8, 105u8, 249u8, 167u8, 243u8, 49u8, 119u8, + 167u8, 28u8, 31u8, 60u8, 75u8, + ] + { + let call = EnactProposal { + proposal_hash, + index, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] + #[doc = "proposed again."] + #[doc = ""] + #[doc = "If called on a queued public or external proposal, then this will result in it being"] + #[doc = "removed. If the `ref_index` supplied is an active referendum with the proposal hash,"] + #[doc = "then it will be cancelled."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `BlacklistOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The proposal hash to blacklist permanently."] + #[doc = "- `ref_index`: An ongoing referendum whose hash is `proposal_hash`, which will be"] + #[doc = "cancelled."] + #[doc = ""] + #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] + #[doc = " reasonable value)."] + pub fn blacklist( + &self, + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Blacklist, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 105u8, 99u8, 153u8, 150u8, 122u8, 234u8, 105u8, 238u8, 152u8, + 152u8, 121u8, 181u8, 133u8, 246u8, 159u8, 35u8, 8u8, 65u8, + 15u8, 203u8, 206u8, 75u8, 28u8, 214u8, 111u8, 26u8, 40u8, + 141u8, 68u8, 57u8, 217u8, 244u8, + ] + { + let call = Blacklist { + proposal_hash, + maybe_ref_index, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] + #[doc = ""] + #[doc = "- `prop_index`: The index of the proposal to cancel."] + #[doc = ""] + #[doc = "Weight: `O(p)` where `p = PublicProps::::decode_len()`"] + pub fn cancel_proposal( + &self, + prop_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelProposal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 26u8, 117u8, 180u8, 24u8, 12u8, 177u8, 77u8, 254u8, 113u8, + 53u8, 146u8, 48u8, 164u8, 255u8, 45u8, 205u8, 207u8, 46u8, + 74u8, 184u8, 73u8, 95u8, 216u8, 190u8, 240u8, 64u8, 121u8, + 104u8, 147u8, 141u8, 128u8, 82u8, + ] + { + let call = CancelProposal { prop_index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_democracy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion has been proposed by a public account."] + pub struct Proposed { + pub proposal_index: ::core::primitive::u32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A public proposal has been tabled for referendum vote."] + pub struct Tabled { + pub proposal_index: ::core::primitive::u32, + pub deposit: ::core::primitive::u128, + pub depositors: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Event for Tabled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Tabled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An external proposal has been tabled."] + pub struct ExternalTabled; + impl ::subxt::Event for ExternalTabled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "ExternalTabled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A referendum has begun."] + pub struct Started { + pub ref_index: ::core::primitive::u32, + pub threshold: + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + } + impl ::subxt::Event for Started { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Started"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A proposal has been approved by referendum."] + pub struct Passed { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Event for Passed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Passed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A proposal has been rejected by referendum."] + pub struct NotPassed { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Event for NotPassed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "NotPassed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Event for Cancelled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Cancelled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal has been enacted."] + pub struct Executed { + pub ref_index: ::core::primitive::u32, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for Executed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Executed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has delegated their vote to another account."] + pub struct Delegated { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub target: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Delegated { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Delegated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has cancelled a previous delegation operation."] + pub struct Undelegated { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Undelegated { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Undelegated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An external proposal has been vetoed."] + pub struct Vetoed { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::sp_core::H256, + pub until: ::core::primitive::u32, + } + impl ::subxt::Event for Vetoed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Vetoed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal's preimage was noted, and the deposit taken."] + pub struct PreimageNoted { + pub proposal_hash: ::subxt::sp_core::H256, + pub who: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for PreimageNoted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageNoted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal preimage was removed and used (the deposit was returned)."] + pub struct PreimageUsed { + pub proposal_hash: ::subxt::sp_core::H256, + pub provider: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for PreimageUsed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageUsed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal could not be executed because its preimage was invalid."] + pub struct PreimageInvalid { + pub proposal_hash: ::subxt::sp_core::H256, + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Event for PreimageInvalid { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageInvalid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal could not be executed because its preimage was missing."] + pub struct PreimageMissing { + pub proposal_hash: ::subxt::sp_core::H256, + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Event for PreimageMissing { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageMissing"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A registered preimage was removed and the deposit collected by the reaper."] + pub struct PreimageReaped { + pub proposal_hash: ::subxt::sp_core::H256, + pub provider: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + pub reaper: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for PreimageReaped { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageReaped"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal_hash has been blacklisted permanently."] + pub struct Blacklisted { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Blacklisted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Blacklisted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has voted in a referendum"] + pub struct Voted { + pub voter: ::subxt::sp_core::crypto::AccountId32, + pub ref_index: ::core::primitive::u32, + pub vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + } + impl ::subxt::Event for Voted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Voted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has secconded a proposal"] + pub struct Seconded { + pub seconder: ::subxt::sp_core::crypto::AccountId32, + pub prop_index: ::core::primitive::u32, + } + impl ::subxt::Event for Seconded { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Seconded"; + } + } + pub mod storage { + use super::runtime_types; + pub struct PublicPropCount; + impl ::subxt::StorageEntry for PublicPropCount { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "PublicPropCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct PublicProps; + impl ::subxt::StorageEntry for PublicProps { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "PublicProps"; + type Value = ::std::vec::Vec<( + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DepositOf<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for DepositOf<'_> { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "DepositOf"; + type Value = ( + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Preimages<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Preimages<'_> { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Preimages"; + type Value = runtime_types::pallet_democracy::PreimageStatus< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct ReferendumCount; + impl ::subxt::StorageEntry for ReferendumCount { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "ReferendumCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct LowestUnbaked; + impl ::subxt::StorageEntry for LowestUnbaked { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "LowestUnbaked"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ReferendumInfoOf<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ReferendumInfoOf<'_> { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "ReferendumInfoOf"; + type Value = runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct VotingOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for VotingOf<'_> { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "VotingOf"; + type Value = runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct LastTabledWasExternal; + impl ::subxt::StorageEntry for LastTabledWasExternal { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "LastTabledWasExternal"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextExternal; + impl ::subxt::StorageEntry for NextExternal { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "NextExternal"; + type Value = ( + ::subxt::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Blacklist<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Blacklist<'_> { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Blacklist"; + type Value = ( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Cancellations<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Cancellations<'_> { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Cancellations"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_democracy::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The number of (public) proposals that have been made so far."] + pub async fn public_prop_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The public proposals. Unsorted. The second item is the proposal's hash."] + pub async 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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Those who have locked a deposit."] + #[doc = ""] + #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] + pub async fn deposit_of( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub async fn referendum_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self.client.metadata().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 = " 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( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Record of all proposals that have been subject to emergency cancellation."] + pub async fn cancellations( + &self, + _0: &::subxt::sp_core::H256, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The period between a proposal being approved and enacted."] + #[doc = ""] + #[doc = " It should generally be a little more than the unstake period to ensure that"] + #[doc = " voting stakers have an opportunity to remove themselves from the system in the case"] + #[doc = " where they are on the losing side of a vote."] + pub fn enactment_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "EnactmentPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("EnactmentPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " How often (in blocks) new public referenda are launched."] + pub fn launch_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "LaunchPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("LaunchPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " How often (in blocks) to check for new votes."] + pub fn voting_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "VotingPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("VotingPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The minimum period of vote locking."] + #[doc = ""] + #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] + #[doc = " those successful voters are locked into the consequences that their votes entail."] + pub fn vote_locking_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "VoteLockingPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("VoteLockingPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] + pub fn minimum_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "MinimumDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("MinimumDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Indicator for whether an emergency origin is even allowed to happen. Some chains may"] + #[doc = " want to set this permanently to `false`, others may want to condition it on things such"] + #[doc = " as an upgrade having happened recently."] + pub fn instant_allowed( + &self, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "InstantAllowed")? + == [ + 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, + 1u8, 68u8, 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, + 47u8, 126u8, 134u8, 100u8, 14u8, 86u8, 209u8, 39u8, 20u8, + 4u8, 233u8, 115u8, 102u8, 131u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("InstantAllowed")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Minimum voting period allowed for a fast-track referendum."] + pub fn fast_track_voting_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "FastTrackVotingPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("FastTrackVotingPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Period in blocks where an external proposal may not be re-submitted after being vetoed."] + pub fn cooloff_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "CooloffPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("CooloffPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount of balance that must be deposited per byte of preimage stored."] + pub fn preimage_byte_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "PreimageByteDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("PreimageByteDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of votes for an account."] + #[doc = ""] + #[doc = " Also used to compute weight, an overly big value can"] + #[doc = " lead to extrinsic with very big weight: see `delegate` for instance."] + pub fn max_votes( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "MaxVotes")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("MaxVotes")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of public proposals that can exist at any time."] + pub fn max_proposals( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Democracy", "MaxProposals")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Democracy")?; + let constant = pallet.constant("MaxProposals")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod council { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetMembers { + pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub old_count: ::core::primitive::u32, + } + impl ::subxt::Call for SetMembers { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "set_members"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Execute { + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "execute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vote { + pub proposal: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + pub approve: ::core::primitive::bool, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Close { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub proposal_weight_bound: ::core::primitive::u64, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Close { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "close"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisapproveProposal { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for DisapproveProposal { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "disapprove_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Set the collective's membership."] + #[doc = ""] + #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] + #[doc = "- `prime`: The prime member whose vote sets the default."] + #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] + #[doc = " weight estimation."] + #[doc = ""] + #[doc = "Requires root origin."] + #[doc = ""] + #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] + #[doc = " the weight estimations rely on it to estimate dispatchable weight."] + #[doc = ""] + #[doc = "# WARNING:"] + #[doc = ""] + #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] + #[doc = "implementation of the trait [`ChangeMembers`]."] + #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] + #[doc = "with other logic managing the member set."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(MP + N)` where:"] + #[doc = " - `M` old-members-count (code- and governance-bounded)"] + #[doc = " - `N` new-members-count (code- and governance-bounded)"] + #[doc = " - `P` proposals-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] + #[doc = " members"] + #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] + #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] + #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] + #[doc = "# "] + pub fn set_members( + &self, + new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMembers, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, + 200u8, 68u8, 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, + 95u8, 215u8, 36u8, 49u8, 0u8, 163u8, 172u8, 252u8, 221u8, + 9u8, 1u8, 222u8, 44u8, 214u8, + ] + { + let call = SetMembers { + new_members, + prime, + old_count, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Dispatch a proposal from a member using the `Member` origin."] + #[doc = ""] + #[doc = "Origin must be a member of the collective."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] + #[doc = " `proposal`"] + #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn execute( + &self, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Execute, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 170u8, 77u8, 65u8, 3u8, 95u8, 88u8, 81u8, 103u8, 220u8, 72u8, + 237u8, 80u8, 181u8, 46u8, 196u8, 106u8, 142u8, 55u8, 244u8, + 204u8, 219u8, 152u8, 219u8, 17u8, 80u8, 55u8, 178u8, 56u8, + 161u8, 169u8, 50u8, 37u8, + ] + { + let call = Execute { + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add a new proposal to either be voted on or executed directly."] + #[doc = ""] + #[doc = "Requires the sender to be member."] + #[doc = ""] + #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] + #[doc = "or put up for voting."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - branching is influenced by `threshold` where:"] + #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] + #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] + #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] + #[doc = " - DB accesses influenced by `threshold`:"] + #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] + #[doc = " - OR proposal insertion (`threshold <= 2`)"] + #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] + #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] + #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] + #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] + #[doc = " - 1 event"] + #[doc = "# "] + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Propose, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 180u8, 170u8, 72u8, 21u8, 96u8, 25u8, 177u8, 147u8, 98u8, + 143u8, 186u8, 112u8, 99u8, 197u8, 146u8, 170u8, 35u8, 195u8, + 154u8, 87u8, 119u8, 190u8, 148u8, 82u8, 134u8, 3u8, 163u8, + 182u8, 132u8, 130u8, 2u8, 48u8, + ] + { + let call = Propose { + threshold, + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "Requires the sender to be a member."] + #[doc = ""] + #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `Members` (codec `O(M)`)"] + #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Vote, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, + 27u8, 38u8, 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, + 220u8, 120u8, 231u8, 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, + 154u8, 183u8, 142u8, 165u8, 161u8, + ] + { + let call = Vote { + proposal, + index, + approve, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + pub fn close( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + proposal_weight_bound: ::core::primitive::u64, + length_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Close, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, + 217u8, 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, + 173u8, 172u8, 227u8, 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, + 135u8, 203u8, 69u8, 105u8, 47u8, + ] + { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + DisapproveProposal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, + 191u8, 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, + 219u8, 30u8, 51u8, 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, + 197u8, 95u8, 232u8, 59u8, 169u8, 133u8, + ] + { + let call = DisapproveProposal { proposal_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] + #[doc = "`MemberCount`)."] + pub struct Proposed { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub proposal_index: ::core::primitive::u32, + pub proposal_hash: ::subxt::sp_core::H256, + pub threshold: ::core::primitive::u32, + } + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion (given hash) has been voted on by given account, leaving"] + #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] + pub struct Voted { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::sp_core::H256, + pub voted: ::core::primitive::bool, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::Event for Voted { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Voted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion was approved by the required threshold."] + pub struct Approved { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Approved { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Approved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion was not approved by the required threshold."] + pub struct Disapproved { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Disapproved { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Disapproved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion was executed; result will be `Ok` if it returned without error."] + pub struct Executed { + pub proposal_hash: ::subxt::sp_core::H256, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for Executed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Executed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A single member did some action; result will be `Ok` if it returned without error."] + pub struct MemberExecuted { + pub proposal_hash: ::subxt::sp_core::H256, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for MemberExecuted { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "MemberExecuted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] + pub struct Closed { + pub proposal_hash: ::subxt::sp_core::H256, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::Event for Closed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Closed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proposals; + impl ::subxt::StorageEntry for Proposals { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "Proposals"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for ProposalOf<'_> { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "ProposalOf"; + type Value = runtime_types::polkadot_runtime::Call; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Voting<'_> { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "Voting"; + type Value = runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct ProposalCount; + impl ::subxt::StorageEntry for ProposalCount { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "ProposalCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "Members"; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The hashes of the active proposals."] + pub async 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().storage_hash::()? + == [ + 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, + 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, + 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, + 189u8, 198u8, 68u8, 189u8, 218u8, + ] + { + let entry = ProposalOf(_0); + self.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, + > { + if self.client.metadata().storage_hash::()? + == [ + 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, + 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, + 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, + 189u8, 198u8, 68u8, 189u8, 218u8, + ] + { + self.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( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Proposals so far."] + pub async fn proposal_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The current members of the collective. This is stored sorted (just by value)."] + pub async fn members( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] + pub async fn prime( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + } + pub mod technical_committee { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetMembers { + pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub old_count: ::core::primitive::u32, + } + impl ::subxt::Call for SetMembers { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "set_members"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Execute { + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "execute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vote { + pub proposal: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + pub approve: ::core::primitive::bool, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Close { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub proposal_weight_bound: ::core::primitive::u64, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Close { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "close"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisapproveProposal { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for DisapproveProposal { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "disapprove_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Set the collective's membership."] + #[doc = ""] + #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] + #[doc = "- `prime`: The prime member whose vote sets the default."] + #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] + #[doc = " weight estimation."] + #[doc = ""] + #[doc = "Requires root origin."] + #[doc = ""] + #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] + #[doc = " the weight estimations rely on it to estimate dispatchable weight."] + #[doc = ""] + #[doc = "# WARNING:"] + #[doc = ""] + #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] + #[doc = "implementation of the trait [`ChangeMembers`]."] + #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] + #[doc = "with other logic managing the member set."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(MP + N)` where:"] + #[doc = " - `M` old-members-count (code- and governance-bounded)"] + #[doc = " - `N` new-members-count (code- and governance-bounded)"] + #[doc = " - `P` proposals-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] + #[doc = " members"] + #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] + #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] + #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] + #[doc = "# "] + pub fn set_members( + &self, + new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMembers, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, + 200u8, 68u8, 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, + 95u8, 215u8, 36u8, 49u8, 0u8, 163u8, 172u8, 252u8, 221u8, + 9u8, 1u8, 222u8, 44u8, 214u8, + ] + { + let call = SetMembers { + new_members, + prime, + old_count, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Dispatch a proposal from a member using the `Member` origin."] + #[doc = ""] + #[doc = "Origin must be a member of the collective."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] + #[doc = " `proposal`"] + #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn execute( + &self, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Execute, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 170u8, 77u8, 65u8, 3u8, 95u8, 88u8, 81u8, 103u8, 220u8, 72u8, + 237u8, 80u8, 181u8, 46u8, 196u8, 106u8, 142u8, 55u8, 244u8, + 204u8, 219u8, 152u8, 219u8, 17u8, 80u8, 55u8, 178u8, 56u8, + 161u8, 169u8, 50u8, 37u8, + ] + { + let call = Execute { + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add a new proposal to either be voted on or executed directly."] + #[doc = ""] + #[doc = "Requires the sender to be member."] + #[doc = ""] + #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] + #[doc = "or put up for voting."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - branching is influenced by `threshold` where:"] + #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] + #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] + #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] + #[doc = " - DB accesses influenced by `threshold`:"] + #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] + #[doc = " - OR proposal insertion (`threshold <= 2`)"] + #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] + #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] + #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] + #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] + #[doc = " - 1 event"] + #[doc = "# "] + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Propose, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 180u8, 170u8, 72u8, 21u8, 96u8, 25u8, 177u8, 147u8, 98u8, + 143u8, 186u8, 112u8, 99u8, 197u8, 146u8, 170u8, 35u8, 195u8, + 154u8, 87u8, 119u8, 190u8, 148u8, 82u8, 134u8, 3u8, 163u8, + 182u8, 132u8, 130u8, 2u8, 48u8, + ] + { + let call = Propose { + threshold, + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "Requires the sender to be a member."] + #[doc = ""] + #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `Members` (codec `O(M)`)"] + #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Vote, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, + 27u8, 38u8, 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, + 220u8, 120u8, 231u8, 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, + 154u8, 183u8, 142u8, 165u8, 161u8, + ] + { + let call = Vote { + proposal, + index, + approve, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + pub fn close( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + proposal_weight_bound: ::core::primitive::u64, + length_bound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Close, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, + 217u8, 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, + 173u8, 172u8, 227u8, 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, + 135u8, 203u8, 69u8, 105u8, 47u8, + ] + { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + DisapproveProposal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, + 191u8, 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, + 219u8, 30u8, 51u8, 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, + 197u8, 95u8, 232u8, 59u8, 169u8, 133u8, + ] + { + let call = DisapproveProposal { proposal_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] + #[doc = "`MemberCount`)."] + pub struct Proposed { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub proposal_index: ::core::primitive::u32, + pub proposal_hash: ::subxt::sp_core::H256, + pub threshold: ::core::primitive::u32, + } + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion (given hash) has been voted on by given account, leaving"] + #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] + pub struct Voted { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::sp_core::H256, + pub voted: ::core::primitive::bool, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::Event for Voted { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Voted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion was approved by the required threshold."] + pub struct Approved { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Approved { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Approved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion was not approved by the required threshold."] + pub struct Disapproved { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Disapproved { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Disapproved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A motion was executed; result will be `Ok` if it returned without error."] + pub struct Executed { + pub proposal_hash: ::subxt::sp_core::H256, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for Executed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Executed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A single member did some action; result will be `Ok` if it returned without error."] + pub struct MemberExecuted { + pub proposal_hash: ::subxt::sp_core::H256, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for MemberExecuted { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "MemberExecuted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] + pub struct Closed { + pub proposal_hash: ::subxt::sp_core::H256, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::Event for Closed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Closed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proposals; + impl ::subxt::StorageEntry for Proposals { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "Proposals"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for ProposalOf<'_> { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "ProposalOf"; + type Value = runtime_types::polkadot_runtime::Call; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Voting<'_> { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "Voting"; + type Value = runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct ProposalCount; + impl ::subxt::StorageEntry for ProposalCount { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "ProposalCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "Members"; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The hashes of the active proposals."] + pub async 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().storage_hash::()? + == [ + 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, + 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, + 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, + 189u8, 198u8, 68u8, 189u8, 218u8, + ] + { + let entry = ProposalOf(_0); + self.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, + > { + if self.client.metadata().storage_hash::()? + == [ + 75u8, 36u8, 235u8, 242u8, 206u8, 251u8, 227u8, 94u8, 96u8, + 26u8, 160u8, 127u8, 226u8, 27u8, 55u8, 177u8, 75u8, 102u8, + 124u8, 107u8, 33u8, 214u8, 101u8, 215u8, 174u8, 149u8, 162u8, + 189u8, 198u8, 68u8, 189u8, 218u8, + ] + { + self.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( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Proposals so far."] + pub async fn proposal_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The current members of the collective. This is stored sorted (just by value)."] + pub async fn members( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] + pub async fn prime( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + } + pub mod phragmen_election { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vote { + pub votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveVoter; + impl ::subxt::Call for RemoveVoter { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "remove_voter"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubmitCandidacy { + #[codec(compact)] + pub candidate_count: ::core::primitive::u32, + } + impl ::subxt::Call for SubmitCandidacy { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "submit_candidacy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RenounceCandidacy { + pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + } + impl ::subxt::Call for RenounceCandidacy { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "renounce_candidacy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveMember { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub has_replacement: ::core::primitive::bool, + } + impl ::subxt::Call for RemoveMember { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "remove_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CleanDefunctVoters { + pub num_voters: ::core::primitive::u32, + pub num_defunct: ::core::primitive::u32, + } + impl ::subxt::Call for CleanDefunctVoters { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "clean_defunct_voters"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] + #[doc = "set the initial votes, or update already existing votes."] + #[doc = ""] + #[doc = "Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is"] + #[doc = "reserved. The deposit is based on the number of votes and can be updated over time."] + #[doc = ""] + #[doc = "The `votes` should:"] + #[doc = " - not be empty."] + #[doc = " - be less than the number of possible candidates. Note that all current members and"] + #[doc = " runners-up are also automatically candidates for the next round."] + #[doc = ""] + #[doc = "If `value` is more than `who`'s free balance, then the maximum of the two is used."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "It is the responsibility of the caller to **NOT** place all of their balance into the"] + #[doc = "lock and keep some for further operations."] + #[doc = ""] + #[doc = "# "] + #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] + #[doc = "# "] + pub fn vote( + &self, + votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Vote, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 245u8, 122u8, 160u8, 64u8, 234u8, 121u8, 191u8, 224u8, 12u8, + 16u8, 153u8, 70u8, 41u8, 236u8, 211u8, 145u8, 238u8, 112u8, + 11u8, 94u8, 92u8, 160u8, 67u8, 176u8, 126u8, 232u8, 63u8, + 226u8, 207u8, 205u8, 90u8, 61u8, + ] + { + let call = Vote { votes, value }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove `origin` as a voter."] + #[doc = ""] + #[doc = "This removes the lock and returns the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed and be a voter."] + pub fn remove_voter( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveVoter, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 254u8, 46u8, 140u8, 4u8, 218u8, 45u8, 150u8, 72u8, 67u8, + 131u8, 108u8, 201u8, 46u8, 157u8, 104u8, 161u8, 53u8, 155u8, + 130u8, 50u8, 88u8, 149u8, 255u8, 12u8, 17u8, 85u8, 95u8, + 69u8, 153u8, 130u8, 221u8, 1u8, + ] + { + let call = RemoveVoter {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] + #[doc = ""] + #[doc = "All candidates are wiped at the end of the term. They either become a member/runner-up,"] + #[doc = "or leave the system while their deposit is slashed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]"] + #[doc = "to get their deposit back. Losing the spot in an election will always lead to a slash."] + #[doc = ""] + #[doc = "# "] + #[doc = "The number of current candidates must be provided as witness data."] + #[doc = "# "] + pub fn submit_candidacy( + &self, + candidate_count: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SubmitCandidacy, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 100u8, 38u8, 146u8, 5u8, 234u8, 101u8, 193u8, 9u8, 245u8, + 237u8, 220u8, 21u8, 36u8, 64u8, 205u8, 103u8, 11u8, 194u8, + 18u8, 96u8, 44u8, 231u8, 125u8, 82u8, 63u8, 51u8, 51u8, + 183u8, 28u8, 33u8, 121u8, 89u8, + ] + { + let call = SubmitCandidacy { candidate_count }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] + #[doc = "outcomes exist:"] + #[doc = ""] + #[doc = "- `origin` is a candidate and not elected in any set. In this case, the deposit is"] + #[doc = " unreserved, returned and origin is removed as a candidate."] + #[doc = "- `origin` is a current runner-up. In this case, the deposit is unreserved, returned and"] + #[doc = " origin is removed as a runner-up."] + #[doc = "- `origin` is a current member. In this case, the deposit is unreserved and origin is"] + #[doc = " removed as a member, consequently not being a candidate for the next round anymore."] + #[doc = " Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they"] + #[doc = " are immediately used. If the prime is renouncing, then no prime will exist until the"] + #[doc = " next round."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed, and have one of the above roles."] + #[doc = ""] + #[doc = "# "] + #[doc = "The type of renouncing must be provided as witness data."] + #[doc = "# "] + pub fn renounce_candidacy( + &self, + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RenounceCandidacy, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 184u8, 45u8, 220u8, 198u8, 21u8, 54u8, 15u8, 235u8, 192u8, + 78u8, 96u8, 172u8, 12u8, 152u8, 147u8, 183u8, 172u8, 85u8, + 26u8, 243u8, 250u8, 248u8, 104u8, 76u8, 88u8, 150u8, 197u8, + 130u8, 221u8, 234u8, 53u8, 174u8, + ] + { + let call = RenounceCandidacy { renouncing }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] + #[doc = "the outgoing member is slashed."] + #[doc = ""] + #[doc = "If a runner-up is available, then the best runner-up will be removed and replaces the"] + #[doc = "outgoing member. Otherwise, a new phragmen election is started."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "Note that this does not affect the designated block number of the next election."] + #[doc = ""] + #[doc = "# "] + #[doc = "If we have a replacement, we use a small weight. Else, since this is a root call and"] + #[doc = "will go into phragmen, we assume full block for now."] + #[doc = "# "] + pub fn remove_member( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + has_replacement: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveMember, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 0u8, 99u8, 154u8, 250u8, 4u8, 102u8, 172u8, 220u8, 86u8, + 147u8, 113u8, 248u8, 152u8, 189u8, 179u8, 149u8, 73u8, 97u8, + 201u8, 143u8, 83u8, 11u8, 94u8, 123u8, 149u8, 253u8, 179u8, + 154u8, 132u8, 42u8, 70u8, 189u8, + ] + { + let call = RemoveMember { + who, + has_replacement, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] + #[doc = "deposit of the removed voters are returned."] + #[doc = ""] + #[doc = "This is an root function to be used only for cleaning the state."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "The total number of voters and those that are defunct must be provided as witness data."] + #[doc = "# "] + pub fn clean_defunct_voters( + &self, + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CleanDefunctVoters, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 80u8, 248u8, 122u8, 6u8, 88u8, 255u8, 17u8, 206u8, 104u8, + 208u8, 66u8, 191u8, 118u8, 163u8, 154u8, 9u8, 37u8, 106u8, + 232u8, 178u8, 17u8, 177u8, 225u8, 101u8, 76u8, 207u8, 175u8, + 117u8, 21u8, 203u8, 229u8, 140u8, + ] + { + let call = CleanDefunctVoters { + num_voters, + num_defunct, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] + #[doc = "the election, not that enough have has been elected. The inner value must be examined"] + #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] + #[doc = "slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to"] + #[doc = "begin with."] + pub struct NewTerm { + pub new_members: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + } + impl ::subxt::Event for NewTerm { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "NewTerm"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "No (or not enough) candidates existed for this round. This is different from"] + #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] + pub struct EmptyTerm; + impl ::subxt::Event for EmptyTerm { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "EmptyTerm"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Internal error happened while trying to perform election."] + pub struct ElectionError; + impl ::subxt::Event for ElectionError { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "ElectionError"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] + #[doc = "`EmptyTerm`."] + pub struct MemberKicked { + pub member: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for MemberKicked { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "MemberKicked"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Someone has renounced their candidacy."] + pub struct Renounced { + pub candidate: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Renounced { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "Renounced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] + #[doc = "runner-up."] + #[doc = ""] + #[doc = "Note that old members and runners-up are also candidates."] + pub struct CandidateSlashed { + pub candidate: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for CandidateSlashed { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "CandidateSlashed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] + pub struct SeatHolderSlashed { + pub seat_holder: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::Event for SeatHolderSlashed { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "SeatHolderSlashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "Members"; + type Value = ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct RunnersUp; + impl ::subxt::StorageEntry for RunnersUp { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "RunnersUp"; + type Value = ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Candidates; + impl ::subxt::StorageEntry for Candidates { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "Candidates"; + type Value = ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ElectionRounds; + impl ::subxt::StorageEntry for ElectionRounds { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "ElectionRounds"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Voting<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Voting<'_> { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "Voting"; + type Value = runtime_types::pallet_elections_phragmen::Voter< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The current elected members."] + #[doc = ""] + #[doc = " Invariant: Always sorted based on account id."] + pub async 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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The present candidate list. A current member or runner-up can never enter this vector"] + #[doc = " and is always implicitly assumed to be a candidate."] + #[doc = ""] + #[doc = " Second element is the deposit."] + #[doc = ""] + #[doc = " Invariant: Always sorted based on account id."] + pub async fn candidates( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The total number of vote rounds that have happened, excluding the upcoming one."] + pub async fn election_rounds( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Votes and locked stake of a particular voter."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] + pub async fn voting( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Identifier for the elections-phragmen pallet's lock"] + pub fn pallet_id( + &self, + ) -> ::core::result::Result< + [::core::primitive::u8; 8usize], + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "PalletId")? + == [ + 224u8, 197u8, 247u8, 125u8, 62u8, 180u8, 69u8, 91u8, 226u8, + 36u8, 82u8, 148u8, 70u8, 147u8, 209u8, 40u8, 210u8, 229u8, + 181u8, 191u8, 170u8, 205u8, 138u8, 97u8, 127u8, 59u8, 124u8, + 244u8, 252u8, 30u8, 213u8, 179u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("PalletId")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " How much should be locked up in order to submit one's candidacy."] + pub fn candidacy_bond( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "CandidacyBond")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("CandidacyBond")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Base deposit associated with voting."] + #[doc = ""] + #[doc = " This should be sensibly high to economically ensure the pallet cannot be attacked by"] + #[doc = " creating a gigantic number of votes."] + pub fn voting_bond_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "VotingBondBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("VotingBondBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount of bond that need to be locked for each vote (32 bytes)."] + pub fn voting_bond_factor( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "VotingBondFactor")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("VotingBondFactor")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Number of members to elect."] + pub fn desired_members( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "DesiredMembers")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("DesiredMembers")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Number of runners_up to keep."] + pub fn desired_runners_up( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "DesiredRunnersUp")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("DesiredRunnersUp")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " How long each seat is kept. This defines the next block number at which an election"] + #[doc = " round will happen. If set to zero, no elections are ever triggered and the module will"] + #[doc = " be in passive mode."] + pub fn term_duration( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("PhragmenElection", "TermDuration")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("PhragmenElection")?; + let constant = pallet.constant("TermDuration")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod technical_membership { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddMember { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for AddMember { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "add_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveMember { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for RemoveMember { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "remove_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SwapMember { + pub remove: ::subxt::sp_core::crypto::AccountId32, + pub add: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for SwapMember { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "swap_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ResetMembers { + pub members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for ResetMembers { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "reset_members"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ChangeKey { + pub new: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ChangeKey { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "change_key"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetPrime { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for SetPrime { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "set_prime"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearPrime; + impl ::subxt::Call for ClearPrime { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "clear_prime"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Add a member `who` to the set."] + #[doc = ""] + #[doc = "May only be called from `T::AddOrigin`."] + pub fn add_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddMember, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 1u8, 149u8, 115u8, 222u8, 93u8, 9u8, 208u8, 58u8, 22u8, + 148u8, 215u8, 141u8, 204u8, 48u8, 107u8, 210u8, 202u8, 165u8, + 43u8, 159u8, 45u8, 161u8, 255u8, 127u8, 225u8, 100u8, 161u8, + 195u8, 197u8, 206u8, 57u8, 166u8, + ] + { + let call = AddMember { who }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a member `who` from the set."] + #[doc = ""] + #[doc = "May only be called from `T::RemoveOrigin`."] + pub fn remove_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveMember, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 137u8, 249u8, 148u8, 139u8, 147u8, 47u8, 226u8, 228u8, 139u8, + 219u8, 109u8, 128u8, 254u8, 51u8, 227u8, 154u8, 105u8, 91u8, + 229u8, 69u8, 217u8, 241u8, 107u8, 229u8, 41u8, 202u8, 228u8, + 227u8, 160u8, 162u8, 45u8, 211u8, + ] + { + let call = RemoveMember { who }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Swap out one member `remove` for another `add`."] + #[doc = ""] + #[doc = "May only be called from `T::SwapOrigin`."] + #[doc = ""] + #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] + pub fn swap_member( + &self, + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SwapMember, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 159u8, 62u8, 254u8, 117u8, 56u8, 185u8, 99u8, 29u8, 146u8, + 210u8, 40u8, 77u8, 169u8, 224u8, 215u8, 34u8, 106u8, 95u8, + 204u8, 109u8, 72u8, 67u8, 11u8, 183u8, 33u8, 84u8, 133u8, + 4u8, 5u8, 13u8, 188u8, 123u8, + ] + { + let call = SwapMember { remove, add }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] + #[doc = "pass `members` pre-sorted."] + #[doc = ""] + #[doc = "May only be called from `T::ResetOrigin`."] + pub fn reset_members( + &self, + members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ResetMembers, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 246u8, 84u8, 91u8, 191u8, 61u8, 245u8, 171u8, 80u8, 18u8, + 120u8, 61u8, 86u8, 23u8, 115u8, 161u8, 203u8, 128u8, 34u8, + 166u8, 128u8, 33u8, 28u8, 229u8, 81u8, 103u8, 217u8, 173u8, + 151u8, 31u8, 118u8, 151u8, 217u8, + ] + { + let call = ResetMembers { members }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Swap out the sending member for some other key `new`."] + #[doc = ""] + #[doc = "May only be called from `Signed` origin of a current member."] + #[doc = ""] + #[doc = "Prime membership is passed from the origin account to `new`, if extant."] + pub fn change_key( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ChangeKey, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 198u8, 93u8, 41u8, 52u8, 241u8, 11u8, 225u8, 82u8, 30u8, + 114u8, 111u8, 204u8, 13u8, 31u8, 34u8, 82u8, 171u8, 58u8, + 180u8, 65u8, 3u8, 246u8, 33u8, 167u8, 200u8, 23u8, 150u8, + 235u8, 130u8, 172u8, 202u8, 216u8, + ] + { + let call = ChangeKey { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the prime member. Must be a current member."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + pub fn set_prime( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetPrime, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 185u8, 53u8, 61u8, 154u8, 234u8, 77u8, 195u8, 126u8, 19u8, + 39u8, 78u8, 205u8, 109u8, 210u8, 137u8, 245u8, 128u8, 110u8, + 2u8, 201u8, 20u8, 153u8, 146u8, 177u8, 4u8, 144u8, 229u8, + 125u8, 91u8, 131u8, 199u8, 15u8, + ] + { + let call = SetPrime { who }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove the prime member if it exists."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + pub fn clear_prime( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClearPrime, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 186u8, 182u8, 225u8, 90u8, 71u8, 124u8, 69u8, 100u8, 234u8, + 25u8, 53u8, 23u8, 182u8, 32u8, 176u8, 81u8, 54u8, 140u8, + 235u8, 126u8, 247u8, 7u8, 155u8, 62u8, 35u8, 135u8, 48u8, + 61u8, 88u8, 160u8, 183u8, 72u8, + ] + { + let call = ClearPrime {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_membership::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The given member was added; see the transaction for who."] + pub struct MemberAdded; + impl ::subxt::Event for MemberAdded { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MemberAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The given member was removed; see the transaction for who."] + pub struct MemberRemoved; + impl ::subxt::Event for MemberRemoved { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MemberRemoved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Two members were swapped; see the transaction for who."] + pub struct MembersSwapped; + impl ::subxt::Event for MembersSwapped { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MembersSwapped"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The membership was reset; see the transaction for who the new set is."] + pub struct MembersReset; + impl ::subxt::Event for MembersReset { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MembersReset"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "One of the members' keys changed."] + pub struct KeyChanged; + impl ::subxt::Event for KeyChanged { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Phantom member, never used."] + pub struct Dummy; + impl ::subxt::Event for Dummy { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "Dummy"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "TechnicalMembership"; + const STORAGE: &'static str = "Members"; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "TechnicalMembership"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The current membership, stored as an ordered Vec."] + pub async fn members( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The current prime member, if one exists."] + pub async fn prime( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + } + pub mod treasury { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeSpend { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for ProposeSpend { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "propose_spend"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RejectProposal { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + impl ::subxt::Call for RejectProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "reject_proposal"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ApproveProposal { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + impl ::subxt::Call for ApproveProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "approve_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] + #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] + #[doc = "proposal is awarded."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `ProposalCount`, `origin account`"] + #[doc = "- DbWrites: `ProposalCount`, `Proposals`, `origin account`"] + #[doc = "# "] + pub fn propose_spend( + &self, + value: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ProposeSpend, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 117u8, 11u8, 194u8, 76u8, 160u8, 114u8, 119u8, 94u8, 47u8, + 239u8, 193u8, 54u8, 42u8, 208u8, 225u8, 47u8, 22u8, 90u8, + 166u8, 169u8, 192u8, 145u8, 159u8, 38u8, 209u8, 134u8, 102u8, + 91u8, 65u8, 129u8, 251u8, 3u8, + ] + { + let call = ProposeSpend { value, beneficiary }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Reject a proposed spend. The original deposit will be slashed."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `Proposals`, `rejected proposer account`"] + #[doc = "- DbWrites: `Proposals`, `rejected proposer account`"] + #[doc = "# "] + pub fn reject_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RejectProposal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 153u8, 238u8, 223u8, 212u8, 86u8, 178u8, 184u8, 150u8, 117u8, + 91u8, 69u8, 30u8, 196u8, 134u8, 56u8, 54u8, 236u8, 145u8, + 202u8, 139u8, 135u8, 254u8, 80u8, 189u8, 40u8, 56u8, 148u8, + 108u8, 42u8, 118u8, 74u8, 242u8, + ] + { + let call = RejectProposal { proposal_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)."] + #[doc = "- DbReads: `Proposals`, `Approvals`"] + #[doc = "- DbWrite: `Approvals`"] + #[doc = "# "] + pub fn approve_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ApproveProposal, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 191u8, 81u8, 78u8, 230u8, 230u8, 192u8, 144u8, 232u8, 81u8, + 70u8, 227u8, 212u8, 194u8, 228u8, 231u8, 147u8, 57u8, 222u8, + 156u8, 77u8, 173u8, 60u8, 92u8, 84u8, 255u8, 64u8, 240u8, + 45u8, 131u8, 200u8, 206u8, 231u8, + ] + { + let call = ApproveProposal { proposal_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "New proposal."] + pub struct Proposed { + pub proposal_index: ::core::primitive::u32, + } + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Proposed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "We have ended a spend period and will now allocate funds."] + pub struct Spending { + pub budget_remaining: ::core::primitive::u128, + } + impl ::subxt::Event for Spending { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Spending"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some funds have been allocated."] + pub struct Awarded { + pub proposal_index: ::core::primitive::u32, + pub award: ::core::primitive::u128, + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Awarded { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Awarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proposal was rejected; funds were slashed."] + pub struct Rejected { + pub proposal_index: ::core::primitive::u32, + pub slashed: ::core::primitive::u128, + } + impl ::subxt::Event for Rejected { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "Some of our funds have been burnt."] + pub struct Burnt { + pub burnt_funds: ::core::primitive::u128, + } + impl ::subxt::Event for Burnt { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Burnt"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + pub struct Rollover { + pub rollover_balance: ::core::primitive::u128, + } + impl ::subxt::Event for Rollover { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rollover"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "Some funds have been deposited."] + pub struct Deposit { + pub value: ::core::primitive::u128, + } + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Deposit"; + } + } + pub mod storage { + use super::runtime_types; + pub struct ProposalCount; + impl ::subxt::StorageEntry for ProposalCount { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "ProposalCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Proposals<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Proposals<'_> { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "Proposals"; + type Value = runtime_types::pallet_treasury::Proposal< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Approvals; + impl ::subxt::StorageEntry for Approvals { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "Approvals"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Number of proposals that have been made."] + pub async fn proposal_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Proposals that have been made."] + pub async fn proposals( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Proposal indices that have been approved but not yet awarded."] + pub async fn approvals( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Fraction of a proposal's value that should be bonded in order to place the proposal."] + #[doc = " An accepted proposal gets these back. A rejected proposal does not."] + pub fn proposal_bond( + &self, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Permill, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Treasury", "ProposalBond")? + == [ + 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, + 91u8, 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, + 74u8, 83u8, 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, + 161u8, 119u8, 2u8, 38u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("ProposalBond")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] + pub fn proposal_bond_minimum( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Treasury", "ProposalBondMinimum")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("ProposalBondMinimum")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] + pub fn proposal_bond_maximum( + &self, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Treasury", "ProposalBondMaximum")? + == [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, + 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, + 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, + 43u8, 243u8, 122u8, 60u8, 216u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("ProposalBondMaximum")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Period between successive spends."] + pub fn spend_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Treasury", "SpendPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("SpendPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] + pub fn burn( + &self, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Permill, + ::subxt::BasicError, + > { + if self.client.metadata().constant_hash("Treasury", "Burn")? + == [ + 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, + 91u8, 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, + 74u8, 83u8, 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, + 161u8, 119u8, 2u8, 38u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("Burn")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] + pub fn pallet_id( + &self, + ) -> ::core::result::Result< + runtime_types::frame_support::PalletId, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Treasury", "PalletId")? + == [ + 11u8, 72u8, 189u8, 18u8, 254u8, 229u8, 67u8, 29u8, 4u8, + 241u8, 192u8, 5u8, 210u8, 194u8, 124u8, 31u8, 19u8, 174u8, + 240u8, 245u8, 169u8, 141u8, 67u8, 251u8, 106u8, 103u8, 15u8, + 167u8, 107u8, 31u8, 121u8, 239u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("PalletId")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of approvals that can wait in the spending queue."] + #[doc = ""] + #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] + pub fn max_approvals( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Treasury", "MaxApprovals")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Treasury")?; + let constant = pallet.constant("MaxApprovals")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod claims { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Claim { + pub dest: ::subxt::sp_core::crypto::AccountId32, + pub ethereum_signature: + runtime_types::polkadot_runtime_common::claims::EcdsaSignature, + } + impl ::subxt::Call for Claim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "claim"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MintClaim { + pub who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub value: ::core::primitive::u128, + pub vesting_schedule: ::core::option::Option<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + pub statement: ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + } + impl ::subxt::Call for MintClaim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "mint_claim"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClaimAttest { + pub dest: ::subxt::sp_core::crypto::AccountId32, + pub ethereum_signature: + runtime_types::polkadot_runtime_common::claims::EcdsaSignature, + pub statement: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for ClaimAttest { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "claim_attest"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Attest { + pub statement: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Attest { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "attest"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MoveClaim { + pub old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub maybe_preclaim: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for MoveClaim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "move_claim"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Make a claim to collect your DOTs."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to claim is deemed valid if the signature provided matches"] + #[doc = "the expected signed message of:"] + #[doc = ""] + #[doc = "> Ethereum Signed Message:"] + #[doc = "> (configured prefix string)(address)"] + #[doc = ""] + #[doc = "and `address` matches the `dest` account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `dest`: The destination account to payout the claim."] + #[doc = "- `ethereum_signature`: The signature of an ethereum signed message"] + #[doc = " matching the format described above."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to validate unsigned `claim` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn claim( + &self, + dest: ::subxt::sp_core::crypto::AccountId32, + ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Claim, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 8u8, 205u8, 188u8, 57u8, 197u8, 203u8, 156u8, 65u8, 246u8, + 236u8, 199u8, 6u8, 152u8, 34u8, 251u8, 178u8, 206u8, 127u8, + 167u8, 59u8, 43u8, 162u8, 154u8, 89u8, 215u8, 192u8, 18u8, + 100u8, 66u8, 7u8, 97u8, 229u8, + ] + { + let call = Claim { + dest, + ethereum_signature, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Mint a new claim to collect DOTs."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `who`: The Ethereum address allowed to collect this claim."] + #[doc = "- `value`: The number of DOTs that will be claimed."] + #[doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "We assume worst case that both vesting and statement is being inserted."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn mint_claim( + &self, + who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + value: ::core::primitive::u128, + vesting_schedule: ::core::option::Option<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + statement: ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + MintClaim, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 10u8, 141u8, 200u8, 102u8, 21u8, 205u8, 178u8, 247u8, 154u8, + 245u8, 172u8, 178u8, 26u8, 249u8, 179u8, 236u8, 198u8, 4u8, + 183u8, 239u8, 39u8, 188u8, 146u8, 231u8, 244u8, 6u8, 31u8, + 180u8, 101u8, 157u8, 53u8, 59u8, + ] + { + let call = MintClaim { + who, + value, + vesting_schedule, + statement, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Make a claim to collect your DOTs by signing a statement."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] + #[doc = "the expected signed message of:"] + #[doc = ""] + #[doc = "> Ethereum Signed Message:"] + #[doc = "> (configured prefix string)(address)(statement)"] + #[doc = ""] + #[doc = "and `address` matches the `dest` account; the `statement` must match that which is"] + #[doc = "expected according to your purchase arrangement."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `dest`: The destination account to payout the claim."] + #[doc = "- `ethereum_signature`: The signature of an ethereum signed message"] + #[doc = " matching the format described above."] + #[doc = "- `statement`: The identity of the statement which is being attested to in the signature."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to validate unsigned `claim_attest` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn claim_attest( + &self, + dest: ::subxt::sp_core::crypto::AccountId32, + ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, + statement: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClaimAttest, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 116u8, 181u8, 28u8, 215u8, 245u8, 86u8, 215u8, 114u8, 201u8, + 250u8, 168u8, 43u8, 91u8, 74u8, 0u8, 61u8, 40u8, 135u8, 6u8, + 241u8, 18u8, 24u8, 153u8, 152u8, 22u8, 165u8, 172u8, 94u8, + 200u8, 53u8, 92u8, 212u8, + ] + { + let call = ClaimAttest { + dest, + ethereum_signature, + statement, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Attest to a statement, needed to finalize the claims process."] + #[doc = ""] + #[doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] + #[doc = ""] + #[doc = "Unsigned Validation:"] + #[doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] + #[doc = "and provides a `statement` which is expected for the account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `statement`: The identity of the statement which is being attested to in the signature."] + #[doc = ""] + #[doc = ""] + #[doc = "The weight of this call is invariant over the input parameters."] + #[doc = "Weight includes logic to do pre-validation on `attest` call."] + #[doc = ""] + #[doc = "Total Complexity: O(1)"] + #[doc = ""] + pub fn attest( + &self, + statement: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Attest, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 7u8, 206u8, 87u8, 155u8, 225u8, 220u8, 145u8, 206u8, 87u8, + 132u8, 171u8, 67u8, 104u8, 91u8, 247u8, 39u8, 114u8, 156u8, + 185u8, 28u8, 194u8, 104u8, 32u8, 25u8, 50u8, 94u8, 249u8, + 196u8, 83u8, 36u8, 123u8, 106u8, + ] + { + let call = Attest { statement }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + pub fn move_claim( + &self, + old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + maybe_preclaim: ::core::option::Option< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + MoveClaim, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 7u8, 59u8, 57u8, 165u8, 149u8, 105u8, 40u8, 11u8, 62u8, + 212u8, 35u8, 185u8, 38u8, 244u8, 14u8, 170u8, 73u8, 160u8, + 100u8, 124u8, 20u8, 147u8, 12u8, 208u8, 124u8, 122u8, 148u8, + 12u8, 173u8, 61u8, 137u8, 20u8, + ] + { + let call = MoveClaim { + old, + new, + maybe_preclaim, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for Claimed { + const PALLET: &'static str = "Claims"; + const EVENT: &'static str = "Claimed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Claims<'a>( + pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Claims<'_> { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Claims"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Total; + impl ::subxt::StorageEntry for Total { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Total"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Vesting<'a>( + pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Vesting<'_> { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Vesting"; + type Value = ( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Signing<'a>( + pub &'a runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Signing<'_> { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Signing"; + type Value = + runtime_types::polkadot_runtime_common::claims::StatementKind; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Preclaims<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Preclaims<'_> { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Preclaims"; + type Value = + runtime_types::polkadot_runtime_common::claims::EthereumAddress; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub 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, + > { + if self.client.metadata().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 async fn claims_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Claims<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + pub async fn total( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The statement kind that must be signed, if any."] + pub async fn signing( + &self, + _0: &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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 async fn preclaims_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Preclaims<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn prefix( + &self, + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u8>, + ::subxt::BasicError, + > { + if self.client.metadata().constant_hash("Claims", "Prefix")? + == [ + 106u8, 50u8, 57u8, 116u8, 43u8, 202u8, 37u8, 248u8, 102u8, + 22u8, 62u8, 22u8, 242u8, 54u8, 152u8, 168u8, 107u8, 64u8, + 72u8, 172u8, 124u8, 40u8, 42u8, 110u8, 104u8, 145u8, 31u8, + 144u8, 242u8, 189u8, 145u8, 208u8, + ] + { + let pallet = self.client.metadata().pallet("Claims")?; + let constant = pallet.constant("Prefix")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod vesting { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vest; + impl ::subxt::Call for Vest { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VestOther { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for VestOther { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest_other"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VestedTransfer { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for VestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vested_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceVestedTransfer { + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for ForceVestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "force_vested_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MergeSchedules { + pub schedule1_index: ::core::primitive::u32, + pub schedule2_index: ::core::primitive::u32, + } + impl ::subxt::Call for MergeSchedules { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "merge_schedules"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Unlock any vested funds of the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 2 Reads, 2 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = "# "] + pub fn vest( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Vest, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 123u8, 54u8, 10u8, 208u8, 154u8, 24u8, 39u8, 166u8, 64u8, + 27u8, 74u8, 29u8, 243u8, 97u8, 155u8, 5u8, 130u8, 155u8, + 65u8, 181u8, 196u8, 125u8, 45u8, 133u8, 25u8, 33u8, 3u8, + 34u8, 21u8, 167u8, 172u8, 54u8, + ] + { + let call = Vest {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unlock any vested funds of a `target` account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] + #[doc = "# "] + pub fn vest_other( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + VestOther, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 220u8, 214u8, 201u8, 84u8, 89u8, 137u8, 126u8, 80u8, 57u8, + 1u8, 178u8, 144u8, 1u8, 79u8, 232u8, 136u8, 62u8, 227u8, + 26u8, 148u8, 78u8, 92u8, 222u8, 210u8, 5u8, 108u8, 245u8, + 51u8, 208u8, 98u8, 184u8, 8u8, + ] + { + let call = VestOther { target }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Create a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account receiving the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = "# "] + pub fn vested_transfer( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + VestedTransfer, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 117u8, 107u8, 28u8, 234u8, 240u8, 253u8, 122u8, 25u8, 134u8, + 41u8, 162u8, 36u8, 157u8, 82u8, 214u8, 174u8, 132u8, 24u8, + 241u8, 68u8, 126u8, 122u8, 162u8, 130u8, 62u8, 43u8, 145u8, + 90u8, 49u8, 200u8, 25u8, 137u8, + ] + { + let call = VestedTransfer { target, schedule }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `source`: The account whose funds should be transferred."] + #[doc = "- `target`: The account that should be transferred the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 4 Reads, 4 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = "# "] + pub fn force_vested_transfer( + &self, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceVestedTransfer, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 32u8, 195u8, 99u8, 57u8, 6u8, 182u8, 106u8, 47u8, 9u8, 19u8, + 255u8, 80u8, 244u8, 205u8, 129u8, 78u8, 6u8, 215u8, 224u8, + 151u8, 14u8, 219u8, 46u8, 11u8, 200u8, 160u8, 79u8, 193u8, + 49u8, 252u8, 180u8, 151u8, + ] + { + let call = ForceVestedTransfer { + source, + target, + schedule, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] + #[doc = "the highest possible start and end blocks. If both schedules have already started the"] + #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] + #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] + #[doc = "unmodified."] + #[doc = ""] + #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] + #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] + #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] + #[doc = "and both will be removed."] + #[doc = ""] + #[doc = "Merged schedule attributes:"] + #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] + #[doc = " current_block)`."] + #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] + #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `schedule1_index`: index of the first schedule to merge."] + #[doc = "- `schedule2_index`: index of the second schedule to merge."] + pub fn merge_schedules( + &self, + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + MergeSchedules, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 185u8, 253u8, 214u8, 24u8, 208u8, 226u8, 0u8, 212u8, 92u8, + 174u8, 252u8, 44u8, 250u8, 96u8, 66u8, 55u8, 88u8, 252u8, + 152u8, 238u8, 186u8, 85u8, 45u8, 213u8, 49u8, 42u8, 50u8, + 127u8, 30u8, 53u8, 73u8, 7u8, + ] + { + let call = MergeSchedules { + schedule1_index, + schedule2_index, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The amount vested has been updated. This could indicate a change in funds available."] + #[doc = "The balance given is the amount which is left unvested (and thus locked)."] + pub struct VestingUpdated { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub unvested: ::core::primitive::u128, + } + impl ::subxt::Event for VestingUpdated { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An \\[account\\] has become fully vested."] + pub struct VestingCompleted { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for VestingCompleted { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingCompleted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Vesting<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Vesting<'_> { + const PALLET: &'static str = "Vesting"; + const STORAGE: &'static str = "Vesting"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Vesting"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_vesting::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Information regarding the vesting of a given account."] + pub async fn vesting( + &self, + _0: &::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, + >, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The minimum amount transferred to call `vested_transfer`."] + pub fn min_vested_transfer( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Vesting", "MinVestedTransfer")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Vesting")?; + let constant = pallet.constant("MinVestedTransfer")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + pub fn max_vesting_schedules( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Vesting", "MaxVestingSchedules")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Vesting")?; + let constant = pallet.constant("MaxVestingSchedules")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod utility { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Batch { + pub calls: ::std::vec::Vec, + } + impl ::subxt::Call for Batch { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AsDerivative { + pub index: ::core::primitive::u16, + pub call: ::std::boxed::Box, + } + impl ::subxt::Call for AsDerivative { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "as_derivative"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BatchAll { + pub calls: ::std::vec::Vec, + } + impl ::subxt::Call for BatchAll { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch_all"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DispatchAs { + pub as_origin: + ::std::boxed::Box, + pub call: ::std::boxed::Box, + } + impl ::subxt::Call for DispatchAs { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "dispatch_as"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub fn batch( + &self, + calls: ::std::vec::Vec, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Batch, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 102u8, 106u8, 179u8, 188u8, 99u8, 111u8, 210u8, 69u8, 179u8, + 206u8, 207u8, 163u8, 116u8, 184u8, 55u8, 228u8, 157u8, 241u8, + 23u8, 78u8, 112u8, 158u8, 56u8, 192u8, 79u8, 222u8, 0u8, + 104u8, 21u8, 13u8, 54u8, 184u8, + ] + { + let call = Batch { calls }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn as_derivative( + &self, + index: ::core::primitive::u16, + call: runtime_types::polkadot_runtime::Call, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AsDerivative, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 195u8, 145u8, 176u8, 37u8, 226u8, 104u8, 213u8, 93u8, 246u8, + 7u8, 117u8, 101u8, 123u8, 125u8, 244u8, 74u8, 67u8, 118u8, + 106u8, 181u8, 172u8, 83u8, 17u8, 60u8, 133u8, 136u8, 219u8, + 67u8, 43u8, 93u8, 38u8, 89u8, + ] + { + let call = AsDerivative { + index, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + pub fn batch_all( + &self, + calls: ::std::vec::Vec, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + BatchAll, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 199u8, 220u8, 25u8, 148u8, 69u8, 105u8, 234u8, 113u8, 221u8, + 220u8, 186u8, 34u8, 184u8, 101u8, 41u8, 87u8, 134u8, 92u8, + 134u8, 241u8, 44u8, 116u8, 95u8, 81u8, 174u8, 253u8, 214u8, + 191u8, 88u8, 24u8, 211u8, 135u8, + ] + { + let call = BatchAll { calls }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] + #[doc = "# "] + pub fn dispatch_as( + &self, + as_origin: runtime_types::polkadot_runtime::OriginCaller, + call: runtime_types::polkadot_runtime::Call, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + DispatchAs, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 188u8, 19u8, 178u8, 56u8, 121u8, 41u8, 46u8, 232u8, 118u8, + 56u8, 66u8, 6u8, 174u8, 184u8, 92u8, 66u8, 178u8, 213u8, + 220u8, 88u8, 109u8, 223u8, 186u8, 2u8, 68u8, 152u8, 137u8, + 131u8, 191u8, 194u8, 221u8, 254u8, + ] + { + let call = DispatchAs { + as_origin: ::std::boxed::Box::new(as_origin), + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_utility::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + pub struct BatchInterrupted { + pub index: ::core::primitive::u32, + pub error: runtime_types::sp_runtime::DispatchError, + } + impl ::subxt::Event for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Batch of dispatches completed fully with no error."] + pub struct BatchCompleted; + impl ::subxt::Event for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A single item within a Batch of dispatches has completed with no error."] + pub struct ItemCompleted; + impl ::subxt::Event for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A call was dispatched."] + pub struct DispatchedAs { + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for DispatchedAs { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "DispatchedAs"; + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The limit on the number of batched calls."] + pub fn batched_calls_limit( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Utility", "batched_calls_limit")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Utility")?; + let constant = pallet.constant("batched_calls_limit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod identity { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddRegistrar { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for AddRegistrar { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "add_registrar"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetIdentity { + pub info: ::std::boxed::Box< + runtime_types::pallet_identity::types::IdentityInfo, + >, + } + impl ::subxt::Call for SetIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetSubs { + pub subs: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + } + impl ::subxt::Call for SetSubs { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_subs"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearIdentity; + impl ::subxt::Call for ClearIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "clear_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RequestJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + #[codec(compact)] + pub max_fee: ::core::primitive::u128, + } + impl ::subxt::Call for RequestJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "request_judgement"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct CancelRequest { + pub reg_index: ::core::primitive::u32, + } + impl ::subxt::Call for CancelRequest { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "cancel_request"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetFee { + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub fee: ::core::primitive::u128, + } + impl ::subxt::Call for SetFee { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fee"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetAccountId { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub new: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for SetAccountId { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_account_id"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetFields { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + } + impl ::subxt::Call for SetFields { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fields"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + } + impl ::subxt::Call for ProvideJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "provide_judgement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KillIdentity { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for KillIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "kill_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub data: runtime_types::pallet_identity::types::Data, + } + impl ::subxt::Call for AddSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "add_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RenameSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub data: runtime_types::pallet_identity::types::Data, + } + impl ::subxt::Call for RenameSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "rename_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for RemoveSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "remove_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct QuitSub; + impl ::subxt::Call for QuitSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "quit_sub"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Add a registrar to the system."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] + #[doc = ""] + #[doc = "- `account`: the account of the registrar."] + #[doc = ""] + #[doc = "Emits `RegistrarAdded` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)` where `R` registrar-count (governance-bounded and code-bounded)."] + #[doc = "- One storage mutation (codec `O(R)`)."] + #[doc = "- One event."] + #[doc = "# "] + pub fn add_registrar( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddRegistrar, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 252u8, 233u8, 148u8, 186u8, 42u8, 127u8, 183u8, 107u8, 205u8, + 34u8, 63u8, 170u8, 82u8, 218u8, 141u8, 136u8, 174u8, 45u8, + 3u8, 226u8, 175u8, 22u8, 18u8, 120u8, 70u8, 4u8, 164u8, + 147u8, 228u8, 52u8, 199u8, 196u8, + ] + { + let call = AddRegistrar { account }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set an account's identity information and reserve the appropriate deposit."] + #[doc = ""] + #[doc = "If the account already has identity information, the deposit is taken as part payment"] + #[doc = "for the new deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `info`: The identity information."] + #[doc = ""] + #[doc = "Emits `IdentitySet` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(X + X' + R)`"] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)"] + #[doc = " - where `R` judgements-count (registrar-count-bounded)"] + #[doc = "- One balance reserve operation."] + #[doc = "- One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`)."] + #[doc = "- One event."] + #[doc = "# "] + pub fn set_identity( + &self, + info: runtime_types::pallet_identity::types::IdentityInfo, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetIdentity, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 174u8, 5u8, 84u8, 201u8, 219u8, 147u8, 45u8, 241u8, 46u8, + 192u8, 221u8, 20u8, 233u8, 128u8, 206u8, 1u8, 71u8, 244u8, + 153u8, 167u8, 150u8, 164u8, 16u8, 58u8, 51u8, 168u8, 58u8, + 184u8, 204u8, 229u8, 135u8, 91u8, + ] + { + let call = SetIdentity { + info: ::std::boxed::Box::new(info), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the sub-accounts of the sender."] + #[doc = ""] + #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] + #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "- `subs`: The identity's (new) sub-accounts."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(P + S)`"] + #[doc = " - where `P` old-subs-count (hard- and deposit-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = "- At most one balance operations."] + #[doc = "- DB:"] + #[doc = " - `P + S` storage mutations (codec complexity `O(1)`)"] + #[doc = " - One storage read (codec complexity `O(P)`)."] + #[doc = " - One storage write (codec complexity `O(S)`)."] + #[doc = " - One storage-exists (`IdentityOf::contains_key`)."] + #[doc = "# "] + pub fn set_subs( + &self, + subs: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetSubs, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 157u8, 141u8, 52u8, 45u8, 109u8, 252u8, 84u8, 0u8, 38u8, + 209u8, 193u8, 212u8, 177u8, 47u8, 219u8, 132u8, 254u8, 234u8, + 43u8, 200u8, 104u8, 149u8, 250u8, 169u8, 119u8, 208u8, 111u8, + 184u8, 70u8, 161u8, 245u8, 33u8, + ] + { + let call = SetSubs { subs }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] + #[doc = ""] + #[doc = "Payment: All reserved balances on the account are returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "Emits `IdentityCleared` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`"] + #[doc = " - where `R` registrar-count (governance-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)."] + #[doc = "- One balance-unreserve operation."] + #[doc = "- `2` storage reads and `S + 2` storage deletions."] + #[doc = "- One event."] + #[doc = "# "] + pub fn clear_identity( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClearIdentity, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 75u8, 44u8, 74u8, 122u8, 149u8, 202u8, 114u8, 230u8, 0u8, + 255u8, 140u8, 122u8, 14u8, 196u8, 205u8, 249u8, 220u8, 94u8, + 216u8, 34u8, 63u8, 14u8, 8u8, 205u8, 74u8, 23u8, 181u8, + 129u8, 252u8, 110u8, 231u8, 114u8, + ] + { + let call = ClearIdentity {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Request a judgement from a registrar."] + #[doc = ""] + #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] + #[doc = "given."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] + #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] + #[doc = ""] + #[doc = "```nocompile"] + #[doc = "Self::registrars().get(reg_index).unwrap().fee"] + #[doc = "```"] + #[doc = ""] + #[doc = "Emits `JudgementRequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(X + R)`."] + #[doc = "- One event."] + #[doc = "# "] + pub fn request_judgement( + &self, + reg_index: ::core::primitive::u32, + max_fee: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RequestJudgement, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 90u8, 137u8, 162u8, 2u8, 124u8, 245u8, 7u8, 200u8, 235u8, + 138u8, 217u8, 247u8, 77u8, 87u8, 152u8, 2u8, 13u8, 175u8, + 106u8, 202u8, 204u8, 113u8, 24u8, 127u8, 105u8, 136u8, 191u8, + 133u8, 212u8, 138u8, 22u8, 173u8, + ] + { + let call = RequestJudgement { reg_index, max_fee }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel a previous request."] + #[doc = ""] + #[doc = "Payment: A previously reserved deposit is returned on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] + #[doc = ""] + #[doc = "Emits `JudgementUnrequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- One storage mutation `O(R + X)`."] + #[doc = "- One event"] + #[doc = "# "] + pub fn cancel_request( + &self, + reg_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelRequest, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 153u8, 44u8, 7u8, 70u8, 91u8, 44u8, 138u8, 219u8, 118u8, + 67u8, 166u8, 133u8, 90u8, 234u8, 248u8, 42u8, 108u8, 51u8, + 229u8, 196u8, 74u8, 167u8, 40u8, 229u8, 168u8, 159u8, 2u8, + 231u8, 236u8, 58u8, 109u8, 32u8, + ] + { + let call = CancelRequest { reg_index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the fee required for a judgement to be requested from a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fee`: the new fee."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.315 + R * 0.329 µs (min squares analysis)"] + #[doc = "# "] + pub fn set_fee( + &self, + index: ::core::primitive::u32, + fee: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetFee, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 222u8, 115u8, 155u8, 44u8, 68u8, 179u8, 201u8, 247u8, 141u8, + 226u8, 124u8, 20u8, 188u8, 47u8, 190u8, 21u8, 212u8, 192u8, + 213u8, 76u8, 241u8, 75u8, 87u8, 142u8, 157u8, 229u8, 136u8, + 254u8, 250u8, 28u8, 69u8, 218u8, + ] + { + let call = SetFee { index, fee }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Change the account associated with a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `new`: the new account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 8.823 + R * 0.32 µs (min squares analysis)"] + #[doc = "# "] + pub fn set_account_id( + &self, + index: ::core::primitive::u32, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetAccountId, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 191u8, 243u8, 30u8, 116u8, 109u8, 235u8, 23u8, 106u8, 24u8, + 23u8, 80u8, 203u8, 68u8, 40u8, 116u8, 38u8, 68u8, 161u8, + 219u8, 64u8, 249u8, 179u8, 203u8, 113u8, 55u8, 7u8, 180u8, + 161u8, 37u8, 66u8, 6u8, 90u8, + ] + { + let call = SetAccountId { index, new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the field information for a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fields`: the fields that the registrar concerns themselves with."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.464 + R * 0.325 µs (min squares analysis)"] + #[doc = "# "] + pub fn set_fields( + &self, + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetFields, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 253u8, 43u8, 154u8, 17u8, 161u8, 187u8, 72u8, 96u8, 20u8, + 240u8, 97u8, 43u8, 242u8, 79u8, 115u8, 38u8, 130u8, 243u8, + 176u8, 46u8, 16u8, 126u8, 191u8, 32u8, 106u8, 200u8, 134u8, + 72u8, 244u8, 189u8, 165u8, 125u8, + ] + { + let call = SetFields { index, fields }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Provide a judgement for an account's identity."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `reg_index`."] + #[doc = ""] + #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] + #[doc = ""] + #[doc = "Emits `JudgementGiven` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-transfer operation."] + #[doc = "- Up to one account-lookup operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(R + X)`."] + #[doc = "- One event."] + #[doc = "# "] + pub fn provide_judgement( + &self, + reg_index: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ProvideJudgement, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 238u8, 210u8, 71u8, 239u8, 251u8, 52u8, 145u8, 71u8, 68u8, + 185u8, 103u8, 82u8, 21u8, 164u8, 128u8, 189u8, 123u8, 141u8, + 213u8, 77u8, 139u8, 10u8, 6u8, 229u8, 227u8, 58u8, 236u8, + 123u8, 139u8, 192u8, 200u8, 170u8, + ] + { + let call = ProvideJudgement { + reg_index, + target, + judgement, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove an account's identity and sub-account information and slash the deposits."] + #[doc = ""] + #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] + #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] + #[doc = "manually using `cancel_request`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + #[doc = ""] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = ""] + #[doc = "Emits `IdentityKilled` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- `S + 2` storage mutations."] + #[doc = "- One event."] + #[doc = "# "] + pub fn kill_identity( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + KillIdentity, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 91u8, 164u8, 242u8, 44u8, 253u8, 203u8, 102u8, 89u8, 218u8, + 150u8, 227u8, 56u8, 179u8, 135u8, 93u8, 107u8, 166u8, 157u8, + 187u8, 180u8, 215u8, 129u8, 56u8, 110u8, 5u8, 243u8, 219u8, + 205u8, 11u8, 229u8, 29u8, 188u8, + ] + { + let call = KillIdentity { target }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add the given account to the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn add_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddSub, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 105u8, 38u8, 167u8, 99u8, 224u8, 183u8, 88u8, 133u8, 180u8, + 78u8, 211u8, 239u8, 49u8, 128u8, 224u8, 61u8, 23u8, 249u8, + 91u8, 16u8, 216u8, 40u8, 240u8, 77u8, 209u8, 91u8, 174u8, + 211u8, 175u8, 238u8, 131u8, 208u8, + ] + { + let call = AddSub { sub, data }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Alter the associated name of the given sub-account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn rename_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RenameSub, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 17u8, 110u8, 213u8, 124u8, 4u8, 76u8, 182u8, 53u8, 102u8, + 224u8, 240u8, 250u8, 94u8, 96u8, 181u8, 107u8, 114u8, 127u8, + 37u8, 15u8, 95u8, 7u8, 238u8, 172u8, 30u8, 125u8, 70u8, 7u8, + 97u8, 182u8, 3u8, 197u8, + ] + { + let call = RenameSub { sub, data }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove the given account from the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn remove_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveSub, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 161u8, 114u8, 68u8, 57u8, 166u8, 240u8, 150u8, 95u8, 176u8, + 93u8, 62u8, 67u8, 185u8, 226u8, 117u8, 97u8, 119u8, 139u8, + 86u8, 52u8, 161u8, 88u8, 30u8, 20u8, 123u8, 20u8, 130u8, + 17u8, 44u8, 17u8, 47u8, 14u8, + ] + { + let call = RemoveSub { sub }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove the sender as a sub-account."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender (*not* the original depositor)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "super-identity."] + #[doc = ""] + #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] + #[doc = "controller of an account is maliciously registered as a sub-account."] + pub fn quit_sub( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + QuitSub, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 62u8, 57u8, 73u8, 72u8, 119u8, 216u8, 250u8, 155u8, 57u8, + 169u8, 157u8, 44u8, 87u8, 51u8, 63u8, 231u8, 77u8, 7u8, 0u8, + 119u8, 244u8, 42u8, 179u8, 51u8, 254u8, 240u8, 55u8, 25u8, + 142u8, 38u8, 87u8, 44u8, + ] + { + let call = QuitSub {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_identity::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A name was set or reset (which will remove all judgements)."] + pub struct IdentitySet { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for IdentitySet { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentitySet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A name was cleared, and the given balance returned."] + pub struct IdentityCleared { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for IdentityCleared { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A name was removed and the given balance slashed."] + pub struct IdentityKilled { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for IdentityKilled { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityKilled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A judgement was asked from a registrar."] + pub struct JudgementRequested { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::Event for JudgementRequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementRequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A judgement request was retracted."] + pub struct JudgementUnrequested { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::Event for JudgementUnrequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementUnrequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A judgement was given by a registrar."] + pub struct JudgementGiven { + pub target: ::subxt::sp_core::crypto::AccountId32, + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::Event for JudgementGiven { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementGiven"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A registrar was added."] + pub struct RegistrarAdded { + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::Event for RegistrarAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "RegistrarAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A sub-identity was added to an identity and the deposit paid."] + pub struct SubIdentityAdded { + pub sub: ::subxt::sp_core::crypto::AccountId32, + pub main: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for SubIdentityAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A sub-identity was removed from an identity and the deposit freed."] + pub struct SubIdentityRemoved { + pub sub: ::subxt::sp_core::crypto::AccountId32, + pub main: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for SubIdentityRemoved { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRemoved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] + #[doc = "main identity account to the sub-identity account."] + pub struct SubIdentityRevoked { + pub sub: ::subxt::sp_core::crypto::AccountId32, + pub main: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for SubIdentityRevoked { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRevoked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct IdentityOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for IdentityOf<'_> { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "IdentityOf"; + type Value = runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct SuperOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuperOf<'_> { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SuperOf"; + type Value = ( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct SubsOf<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SubsOf<'_> { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SubsOf"; + type Value = ( + ::core::primitive::u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Registrars; + 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, + >, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " 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( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Alternative \"sub\" identities of this account."] + #[doc = ""] + #[doc = " The first item is the deposit, the second is a vector of the accounts."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub async fn subs_of( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Alternative \"sub\" identities of this account."] + #[doc = ""] + #[doc = " The first item is the deposit, the second is a vector of the accounts."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub async fn subs_of_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SubsOf<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &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, + >, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The amount held on deposit for a registered identity"] + pub fn basic_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Identity", "BasicDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Identity")?; + let constant = pallet.constant("BasicDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount held on deposit per additional field for a registered identity."] + pub fn field_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Identity", "FieldDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Identity")?; + let constant = pallet.constant("FieldDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount held on deposit for a registered subaccount. This should account for the fact"] + #[doc = " that one storage item's value will increase by the size of an account ID, and there will"] + #[doc = " be another trie item whose value is the size of an account ID plus 32 bytes."] + pub fn sub_account_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Identity", "SubAccountDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Identity")?; + let constant = pallet.constant("SubAccountDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of sub-accounts allowed per identified account."] + pub fn max_sub_accounts( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Identity", "MaxSubAccounts")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Identity")?; + let constant = pallet.constant("MaxSubAccounts")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O"] + #[doc = " required to access an identity, but can be pretty high."] + pub fn max_additional_fields( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Identity", "MaxAdditionalFields")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Identity")?; + let constant = pallet.constant("MaxAdditionalFields")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maxmimum number of registrars allowed in the system. Needed to bound the complexity"] + #[doc = " of, e.g., updating judgements."] + pub fn max_registrars( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Identity", "MaxRegistrars")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Identity")?; + let constant = pallet.constant("MaxRegistrars")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod proxy { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proxy { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: + ::core::option::Option, + pub call: ::std::boxed::Box, + } + impl ::subxt::Call for Proxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Call for AddProxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "add_proxy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Call for RemoveProxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveProxies; + impl ::subxt::Call for RemoveProxies { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxies"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Anonymous { + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: ::core::primitive::u32, + pub index: ::core::primitive::u16, + } + impl ::subxt::Call for Anonymous { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "anonymous"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KillAnonymous { + pub spawner: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub index: ::core::primitive::u16, + #[codec(compact)] + pub height: ::core::primitive::u32, + #[codec(compact)] + pub ext_index: ::core::primitive::u32, + } + impl ::subxt::Call for KillAnonymous { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "kill_anonymous"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Announce { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for Announce { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "announce"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveAnnouncement { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for RemoveAnnouncement { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_announcement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RejectAnnouncement { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for RejectAnnouncement { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "reject_announcement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProxyAnnounced { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: + ::core::option::Option, + pub call: ::std::boxed::Box, + } + impl ::subxt::Call for ProxyAnnounced { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy_announced"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "Removes any corresponding announcement(s)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + pub fn proxy( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::polkadot_runtime::ProxyType, + >, + call: runtime_types::polkadot_runtime::Call, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Proxy, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 182u8, 110u8, 37u8, 47u8, 200u8, 93u8, 71u8, 195u8, 61u8, + 58u8, 197u8, 39u8, 17u8, 203u8, 192u8, 222u8, 55u8, 103u8, + 91u8, 226u8, 255u8, 253u8, 20u8, 71u8, 59u8, 53u8, 11u8, + 193u8, 239u8, 216u8, 100u8, 47u8, + ] + { + let call = Proxy { + real, + force_proxy_type, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] + #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + pub fn add_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddProxy, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 97u8, 149u8, 34u8, 218u8, 51u8, 242u8, 47u8, 167u8, 203u8, + 128u8, 248u8, 193u8, 156u8, 141u8, 184u8, 221u8, 209u8, 79u8, + 162u8, 36u8, 48u8, 110u8, 208u8, 62u8, 105u8, 117u8, 192u8, + 18u8, 37u8, 185u8, 136u8, 66u8, + ] + { + let call = AddProxy { + delegate, + proxy_type, + delay, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unregister a proxy account for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] + #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + pub fn remove_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveProxy, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 246u8, 251u8, 192u8, 17u8, 128u8, 248u8, 24u8, 118u8, 127u8, + 101u8, 140u8, 72u8, 248u8, 161u8, 187u8, 89u8, 193u8, 44u8, + 0u8, 86u8, 16u8, 116u8, 28u8, 227u8, 108u8, 120u8, 177u8, + 213u8, 218u8, 20u8, 196u8, 7u8, + ] + { + let call = RemoveProxy { + delegate, + proxy_type, + delay, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unregister all proxy accounts for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] + #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + pub fn remove_proxies( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveProxies, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 15u8, 237u8, 27u8, 166u8, 254u8, 218u8, 92u8, 5u8, 213u8, + 239u8, 99u8, 59u8, 1u8, 26u8, 73u8, 252u8, 81u8, 94u8, 214u8, + 227u8, 169u8, 58u8, 40u8, 253u8, 187u8, 225u8, 192u8, 26u8, + 19u8, 23u8, 121u8, 129u8, + ] + { + let call = RemoveProxies {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] + #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] + #[doc = ""] + #[doc = "Requires a `Signed` origin."] + #[doc = ""] + #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] + #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] + #[doc = "allow for maximum flexibility."] + #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] + #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] + #[doc = "want to use `0`."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + #[doc = ""] + #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] + #[doc = "same sender, with the same parameters."] + #[doc = ""] + #[doc = "Fails if there are insufficient funds to pay for deposit."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + #[doc = "TODO: Might be over counting 1 read"] + pub fn anonymous( + &self, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + index: ::core::primitive::u16, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Anonymous, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 159u8, 186u8, 126u8, 58u8, 255u8, 163u8, 207u8, 66u8, 165u8, + 182u8, 248u8, 28u8, 134u8, 186u8, 1u8, 122u8, 40u8, 64u8, + 0u8, 124u8, 0u8, 5u8, 140u8, 131u8, 21u8, 66u8, 182u8, 216u8, + 202u8, 29u8, 75u8, 180u8, + ] + { + let call = Anonymous { + proxy_type, + delay, + index, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Removes a previously spawned anonymous proxy."] + #[doc = ""] + #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] + #[doc = "inaccessible."] + #[doc = ""] + #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] + #[doc = "`anonymous` with corresponding parameters."] + #[doc = ""] + #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] + #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] + #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] + #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] + #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] + #[doc = ""] + #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] + #[doc = "account whose `anonymous` call has corresponding parameters."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + pub fn kill_anonymous( + &self, + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + index: ::core::primitive::u16, + height: ::core::primitive::u32, + ext_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + KillAnonymous, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 59u8, 188u8, 45u8, 180u8, 9u8, 242u8, 36u8, 245u8, 25u8, + 57u8, 66u8, 216u8, 82u8, 220u8, 144u8, 233u8, 83u8, 1u8, + 182u8, 185u8, 27u8, 106u8, 33u8, 5u8, 22u8, 171u8, 222u8, + 130u8, 125u8, 73u8, 127u8, 156u8, + ] + { + let call = KillAnonymous { + spawner, + proxy_type, + index, + height, + ext_index, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Publish the hash of a proxy-call that will be made in the future."] + #[doc = ""] + #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] + #[doc = "if the delay associated with the proxy relationship is greater than zero."] + #[doc = ""] + #[doc = "No more than `MaxPending` announcements may be made at any one time."] + #[doc = ""] + #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] + #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + pub fn announce( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Announce, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 102u8, 8u8, 136u8, 179u8, 13u8, 47u8, 158u8, 24u8, 93u8, + 196u8, 52u8, 22u8, 118u8, 98u8, 17u8, 8u8, 12u8, 51u8, 181u8, + 75u8, 215u8, 133u8, 201u8, 180u8, 231u8, 122u8, 198u8, 190u8, + 188u8, 127u8, 228u8, 218u8, + ] + { + let call = Announce { real, call_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a given announcement."] + #[doc = ""] + #[doc = "May be called by a proxy account to remove a call they previously announced and return"] + #[doc = "the deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + pub fn remove_announcement( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RemoveAnnouncement, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 209u8, 156u8, 215u8, 188u8, 225u8, 230u8, 171u8, 228u8, + 241u8, 105u8, 43u8, 183u8, 234u8, 18u8, 170u8, 239u8, 232u8, + 188u8, 37u8, 84u8, 156u8, 50u8, 241u8, 170u8, 9u8, 148u8, + 185u8, 172u8, 204u8, 63u8, 187u8, 253u8, + ] + { + let call = RemoveAnnouncement { real, call_hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove the given announcement of a delegate."] + #[doc = ""] + #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] + #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `delegate`: The account that previously announced the call."] + #[doc = "- `call_hash`: The hash of the call to be made."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + pub fn reject_announcement( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RejectAnnouncement, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 26u8, 67u8, 197u8, 169u8, 243u8, 11u8, 94u8, 153u8, 50u8, + 22u8, 176u8, 103u8, 88u8, 2u8, 13u8, 10u8, 96u8, 7u8, 121u8, + 148u8, 13u8, 96u8, 20u8, 67u8, 76u8, 51u8, 81u8, 54u8, 244u8, + 44u8, 94u8, 52u8, + ] + { + let call = RejectAnnouncement { + delegate, + call_hash, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "Removes any corresponding announcement(s)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + pub fn proxy_announced( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::polkadot_runtime::ProxyType, + >, + call: runtime_types::polkadot_runtime::Call, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ProxyAnnounced, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 4u8, 205u8, 80u8, 128u8, 70u8, 110u8, 11u8, 69u8, 145u8, + 61u8, 218u8, 229u8, 208u8, 105u8, 190u8, 234u8, 189u8, 169u8, + 188u8, 10u8, 142u8, 144u8, 23u8, 200u8, 215u8, 180u8, 128u8, + 37u8, 95u8, 163u8, 205u8, 87u8, + ] + { + let call = ProxyAnnounced { + delegate, + real, + force_proxy_type, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proxy was executed correctly, with the given."] + pub struct ProxyExecuted { + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for ProxyExecuted { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyExecuted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Anonymous account has been created by new proxy with given"] + #[doc = "disambiguation index and proxy type."] + pub struct AnonymousCreated { + pub anonymous: ::subxt::sp_core::crypto::AccountId32, + pub who: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub disambiguation_index: ::core::primitive::u16, + } + impl ::subxt::Event for AnonymousCreated { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "AnonymousCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An announcement was placed to make a call in the future."] + pub struct Announced { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub proxy: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for Announced { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "Announced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proxy was added."] + pub struct ProxyAdded { + pub delegator: ::subxt::sp_core::crypto::AccountId32, + pub delegatee: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Event for ProxyAdded { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A proxy was removed."] + pub struct ProxyRemoved { + pub delegator: ::subxt::sp_core::crypto::AccountId32, + pub delegatee: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Event for ProxyRemoved { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyRemoved"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proxies<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Proxies<'_> { + const PALLET: &'static str = "Proxy"; + const STORAGE: &'static str = "Proxies"; + type Value = ( + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::ProxyDefinition< + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::ProxyType, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Announcements<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Announcements<'_> { + const PALLET: &'static str = "Proxy"; + const STORAGE: &'static str = "Announcements"; + type Value = ( + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::Announcement< + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[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( + &self, + _0: &::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, + >, + >, + ::core::primitive::u128, + ), + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The announcements made by the proxy (key)."] + pub async fn announcements( + &self, + _0: &::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, + >, + >, + ::core::primitive::u128, + ), + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The base amount of currency needed to reserve for creating a proxy."] + #[doc = ""] + #[doc = " This is held for an additional storage item whose value size is"] + #[doc = " `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes."] + pub fn proxy_deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Proxy", "ProxyDepositBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Proxy")?; + let constant = pallet.constant("ProxyDepositBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount of currency needed per proxy added."] + #[doc = ""] + #[doc = " This is held for adding 32 bytes plus an instance of `ProxyType` more into a"] + #[doc = " pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take"] + #[doc = " into account `32 + proxy_type.encode().len()` bytes of data."] + pub fn proxy_deposit_factor( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Proxy", "ProxyDepositFactor")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Proxy")?; + let constant = pallet.constant("ProxyDepositFactor")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum amount of proxies allowed for a single account."] + pub fn max_proxies( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Proxy", "MaxProxies")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Proxy")?; + let constant = pallet.constant("MaxProxies")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum amount of time-delayed announcements that are allowed to be pending."] + pub fn max_pending( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Proxy", "MaxPending")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Proxy")?; + let constant = pallet.constant("MaxPending")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The base amount of currency needed to reserve for creating an announcement."] + #[doc = ""] + #[doc = " This is held when a new storage item holding a `Balance` is created (typically 16"] + #[doc = " bytes)."] + pub fn announcement_deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Proxy", "AnnouncementDepositBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Proxy")?; + let constant = pallet.constant("AnnouncementDepositBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount of currency needed per announcement made."] + #[doc = ""] + #[doc = " This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)"] + #[doc = " into a pre-existing storage value."] + pub fn announcement_deposit_factor( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Proxy", "AnnouncementDepositFactor")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Proxy")?; + let constant = pallet.constant("AnnouncementDepositFactor")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod multisig { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AsMultiThreshold1 { + pub other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub call: ::std::boxed::Box, + } + impl ::subxt::Call for AsMultiThreshold1 { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi_threshold_1"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + pub call: + ::subxt::WrapperKeepOpaque, + pub store_call: ::core::primitive::bool, + pub max_weight: ::core::primitive::u64, + } + impl ::subxt::Call for AsMulti { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ApproveAsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + pub call_hash: [::core::primitive::u8; 32usize], + pub max_weight: ::core::primitive::u64, + } + impl ::subxt::Call for ApproveAsMulti { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "approve_as_multi"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelAsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::Call for CancelAsMulti { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "cancel_as_multi"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = "multi-signature, but do not participate in the approval process."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result."] + #[doc = ""] + #[doc = "# "] + #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight: None"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + pub fn as_multi_threshold_1( + &self, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, + call: runtime_types::polkadot_runtime::Call, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AsMultiThreshold1, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 95u8, 132u8, 202u8, 110u8, 113u8, 89u8, 78u8, 7u8, 190u8, + 143u8, 107u8, 158u8, 56u8, 3u8, 41u8, 167u8, 115u8, 34u8, + 214u8, 63u8, 135u8, 154u8, 60u8, 181u8, 71u8, 157u8, 189u8, + 37u8, 215u8, 212u8, 66u8, 186u8, + ] + { + let call = AsMultiThreshold1 { + other_signatories, + call: ::std::boxed::Box::new(call), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "If there are enough, then dispatch the call."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] + #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] + #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] + #[doc = "may be found in the deposited `MultisigExecuted` event."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S + Z + Call)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- The weight of the `call`."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + pub fn as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call: ::subxt::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AsMulti, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 248u8, 250u8, 144u8, 85u8, 79u8, 224u8, 92u8, 55u8, 76u8, + 55u8, 171u8, 48u8, 122u8, 6u8, 62u8, 155u8, 69u8, 41u8, + 121u8, 233u8, 40u8, 29u8, 224u8, 61u8, 245u8, 80u8, 50u8, + 30u8, 185u8, 92u8, 250u8, 160u8, + ] + { + let call = AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call, + store_call, + max_weight, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account]"] + #[doc = " - Write: Multisig Storage, [Caller Account]"] + #[doc = "# "] + pub fn approve_as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call_hash: [::core::primitive::u8; 32usize], + max_weight: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ApproveAsMulti, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 114u8, 29u8, 118u8, 154u8, 91u8, 4u8, 127u8, 126u8, 190u8, + 180u8, 57u8, 112u8, 72u8, 8u8, 248u8, 126u8, 25u8, 190u8, + 130u8, 86u8, 160u8, 164u8, 76u8, 64u8, 25u8, 175u8, 132u8, + 225u8, 147u8, 166u8, 12u8, 38u8, + ] + { + let call = ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] + #[doc = "for this operation will be unreserved on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] + #[doc = "transaction for this dispatch."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- One event."] + #[doc = "- I/O: 1 read `O(S)`, one remove."] + #[doc = "- Storage: removes one item."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = "# "] + pub fn cancel_as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, + timepoint: runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + call_hash: [::core::primitive::u8; 32usize], + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelAsMulti, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 195u8, 216u8, 37u8, 179u8, 9u8, 19u8, 238u8, 94u8, 156u8, + 5u8, 120u8, 78u8, 129u8, 99u8, 239u8, 142u8, 68u8, 12u8, + 254u8, 46u8, 251u8, 8u8, 193u8, 43u8, 37u8, 68u8, 249u8, + 85u8, 163u8, 85u8, 193u8, 47u8, + ] + { + let call = CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new multisig operation has begun."] + pub struct NewMultisig { + pub approving: ::subxt::sp_core::crypto::AccountId32, + pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::Event for NewMultisig { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "NewMultisig"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A multisig operation has been approved by someone."] + pub struct MultisigApproval { + pub approving: ::subxt::sp_core::crypto::AccountId32, + pub timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::Event for MultisigApproval { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigApproval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A multisig operation has been executed."] + pub struct MultisigExecuted { + pub approving: ::subxt::sp_core::crypto::AccountId32, + pub timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::Event for MultisigExecuted { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigExecuted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A multisig operation has been cancelled."] + pub struct MultisigCancelled { + pub cancelling: ::subxt::sp_core::crypto::AccountId32, + pub timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub multisig: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::Event for MultisigCancelled { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigCancelled"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Multisigs<'a>( + pub &'a ::subxt::sp_core::crypto::AccountId32, + pub &'a [::core::primitive::u8; 32usize], + ); + impl ::subxt::StorageEntry for Multisigs<'_> { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Multisigs"; + type Value = runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Calls<'a>(pub &'a [::core::primitive::u8; 32usize]); + impl ::subxt::StorageEntry for Calls<'_> { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Calls"; + type Value = ( + ::subxt::WrapperKeepOpaque, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The set of open multisig operations."] + pub async fn multisigs( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + _1: &[::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 async fn calls( + &self, + _0: &[::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, + > { + if self.client.metadata().storage_hash::()? + == [ + 51u8, 122u8, 79u8, 127u8, 1u8, 182u8, 39u8, 88u8, 57u8, + 227u8, 141u8, 253u8, 217u8, 23u8, 89u8, 94u8, 37u8, 244u8, + 136u8, 246u8, 87u8, 146u8, 97u8, 23u8, 135u8, 13u8, 32u8, + 14u8, 191u8, 15u8, 2u8, 51u8, + ] + { + let entry = Calls(_0); + self.client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + pub async fn calls_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Calls<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().storage_hash::()? + == [ + 51u8, 122u8, 79u8, 127u8, 1u8, 182u8, 39u8, 88u8, 57u8, + 227u8, 141u8, 253u8, 217u8, 23u8, 89u8, 94u8, 37u8, 244u8, + 136u8, 246u8, 87u8, 146u8, 97u8, 23u8, 135u8, 13u8, 32u8, + 14u8, 191u8, 15u8, 2u8, 51u8, + ] + { + self.client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The base amount of currency needed to reserve for creating a multisig execution or to"] + #[doc = " store a dispatch call for later."] + #[doc = ""] + #[doc = " This is held for an additional storage item whose value size is"] + #[doc = " `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is"] + #[doc = " `32 + sizeof(AccountId)` bytes."] + pub fn deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Multisig", "DepositBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Multisig")?; + let constant = pallet.constant("DepositBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount of currency needed per unit threshold when creating a multisig execution."] + #[doc = ""] + #[doc = " This is held for adding 32 bytes more into a pre-existing storage value."] + pub fn deposit_factor( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Multisig", "DepositFactor")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Multisig")?; + let constant = pallet.constant("DepositFactor")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum amount of signatories allowed in the multisig."] + pub fn max_signatories( + &self, + ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Multisig", "MaxSignatories")? + == [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, + 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, + 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, + 123u8, 128u8, 193u8, 29u8, 70u8, + ] + { + let pallet = self.client.metadata().pallet("Multisig")?; + let constant = pallet.constant("MaxSignatories")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod bounties { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeBounty { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub description: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for ProposeBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ApproveBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for ApproveBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "approve_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub fee: ::core::primitive::u128, + } + impl ::subxt::Call for ProposeCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnassignCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for UnassignCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "unassign_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AcceptCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for AcceptCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "accept_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for AwardBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "award_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClaimBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for ClaimBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "claim_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for CloseBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "close_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for ExtendBountyExpiry { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "extend_bounty_expiry"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Propose a new bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] + #[doc = "or slashed when rejected."] + #[doc = ""] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] + #[doc = "- `description`: The description of this bounty."] + pub fn propose_bounty( + &self, + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ProposeBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 208u8, 22u8, 157u8, 134u8, 214u8, 95u8, 249u8, 10u8, 67u8, + 223u8, 190u8, 192u8, 69u8, 32u8, 7u8, 235u8, 205u8, 145u8, + 90u8, 80u8, 60u8, 4u8, 16u8, 189u8, 59u8, 180u8, 68u8, 77u8, + 69u8, 121u8, 92u8, 33u8, + ] + { + let call = ProposeBounty { value, description }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn approve_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ApproveBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 127u8, 220u8, 25u8, 197u8, 19u8, 183u8, 177u8, 17u8, 164u8, + 29u8, 250u8, 136u8, 125u8, 90u8, 247u8, 177u8, 37u8, 180u8, + 77u8, 75u8, 164u8, 32u8, 195u8, 207u8, 58u8, 249u8, 141u8, + 11u8, 53u8, 184u8, 224u8, 135u8, + ] + { + let call = ApproveBounty { bounty_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Assign a curator to a funded bounty."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn propose_curator( + &self, + bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + fee: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ProposeCurator, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 180u8, 13u8, 171u8, 39u8, 160u8, 233u8, 162u8, 39u8, 100u8, + 144u8, 156u8, 212u8, 139u8, 128u8, 105u8, 49u8, 157u8, 16u8, + 125u8, 72u8, 36u8, 45u8, 199u8, 139u8, 165u8, 100u8, 40u8, + 163u8, 117u8, 32u8, 164u8, 23u8, + ] + { + let call = ProposeCurator { + bounty_id, + curator, + fee, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unassign curator from a bounty."] + #[doc = ""] + #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] + #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] + #[doc = ""] + #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] + #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] + #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] + #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] + #[doc = "we should pick a new curator. In this case the curator should also be slashed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn unassign_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + UnassignCurator, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 156u8, 163u8, 248u8, 148u8, 22u8, 231u8, 232u8, 182u8, 48u8, + 87u8, 85u8, 118u8, 169u8, 249u8, 123u8, 199u8, 248u8, 206u8, + 221u8, 196u8, 69u8, 69u8, 52u8, 116u8, 65u8, 165u8, 172u8, + 242u8, 61u8, 109u8, 143u8, 69u8, + ] + { + let call = UnassignCurator { bounty_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Accept the curator role for a bounty."] + #[doc = "A deposit will be reserved from curator and refund upon successful payout."] + #[doc = ""] + #[doc = "May only be called from the curator."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn accept_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AcceptCurator, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 50u8, 149u8, 252u8, 40u8, 169u8, 113u8, 60u8, 153u8, 123u8, + 146u8, 40u8, 196u8, 176u8, 195u8, 95u8, 94u8, 14u8, 81u8, + 136u8, 225u8, 24u8, 59u8, 87u8, 118u8, 77u8, 60u8, 150u8, + 102u8, 206u8, 219u8, 241u8, 99u8, + ] + { + let call = AcceptCurator { bounty_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] + #[doc = "after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to award."] + #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn award_bounty( + &self, + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AwardBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 42u8, 49u8, 134u8, 134u8, 5u8, 98u8, 72u8, 95u8, 227u8, + 156u8, 224u8, 249u8, 209u8, 42u8, 160u8, 15u8, 239u8, 195u8, + 128u8, 251u8, 217u8, 132u8, 15u8, 221u8, 191u8, 105u8, 39u8, + 228u8, 189u8, 174u8, 115u8, 53u8, + ] + { + let call = AwardBounty { + bounty_id, + beneficiary, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Claim the payout from an awarded bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to claim."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn claim_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClaimBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 119u8, 9u8, 122u8, 55u8, 224u8, 139u8, 26u8, 186u8, 3u8, + 178u8, 78u8, 41u8, 91u8, 183u8, 222u8, 197u8, 189u8, 172u8, + 154u8, 47u8, 2u8, 164u8, 141u8, 163u8, 211u8, 117u8, 186u8, + 121u8, 130u8, 91u8, 13u8, 241u8, + ] + { + let call = ClaimBounty { bounty_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] + #[doc = "the curator deposit will be unreserved if possible."] + #[doc = ""] + #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to cancel."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn close_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CloseBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 119u8, 47u8, 246u8, 188u8, 235u8, 22u8, 53u8, 70u8, 182u8, + 15u8, 247u8, 153u8, 208u8, 191u8, 144u8, 132u8, 30u8, 200u8, + 36u8, 186u8, 194u8, 225u8, 140u8, 160u8, 152u8, 194u8, 38u8, + 223u8, 33u8, 130u8, 120u8, 254u8, + ] + { + let call = CloseBounty { bounty_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Extend the expiry time of an active bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to extend."] + #[doc = "- `remark`: additional information."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn extend_bounty_expiry( + &self, + bounty_id: ::core::primitive::u32, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ExtendBountyExpiry, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 127u8, 142u8, 138u8, 230u8, 147u8, 187u8, 201u8, 210u8, + 216u8, 61u8, 62u8, 125u8, 168u8, 188u8, 16u8, 73u8, 157u8, + 53u8, 165u8, 236u8, 181u8, 26u8, 28u8, 67u8, 59u8, 234u8, + 189u8, 167u8, 92u8, 242u8, 138u8, 35u8, + ] + { + let call = ExtendBountyExpiry { bounty_id, remark }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_bounties::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "New bounty proposal."] + pub struct BountyProposed { + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for BountyProposed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyProposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A bounty proposal was rejected; funds were slashed."] + pub struct BountyRejected { + pub index: ::core::primitive::u32, + pub bond: ::core::primitive::u128, + } + impl ::subxt::Event for BountyRejected { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyRejected"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A bounty proposal is funded and became active."] + pub struct BountyBecameActive { + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for BountyBecameActive { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyBecameActive"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A bounty is awarded to a beneficiary."] + pub struct BountyAwarded { + pub index: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for BountyAwarded { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyAwarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A bounty is claimed by beneficiary."] + pub struct BountyClaimed { + pub index: ::core::primitive::u32, + pub payout: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for BountyClaimed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyClaimed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A bounty is cancelled."] + pub struct BountyCanceled { + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for BountyCanceled { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyCanceled"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A bounty expiry is extended."] + pub struct BountyExtended { + pub index: ::core::primitive::u32, + } + impl ::subxt::Event for BountyExtended { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyExtended"; + } + } + pub mod storage { + use super::runtime_types; + pub struct BountyCount; + impl ::subxt::StorageEntry for BountyCount { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bounties<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Bounties<'_> { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "Bounties"; + type Value = runtime_types::pallet_bounties::Bounty< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct BountyDescriptions<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for BountyDescriptions<'_> { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyDescriptions"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct BountyApprovals; + impl ::subxt::StorageEntry for BountyApprovals { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyApprovals"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Number of bounty proposals that have been made."] + pub async fn bounty_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Bounties that have been made."] + pub async fn bounties( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The description of each bounty."] + pub async fn bounty_descriptions( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Bounty indices that have been approved but not yet funded."] + pub async 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, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The amount held on deposit for placing a bounty proposal."] + pub fn bounty_deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Bounties", "BountyDepositBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("BountyDepositBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The delay period for which a bounty beneficiary need to wait before claim the payout."] + pub fn bounty_deposit_payout_delay( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Bounties", "BountyDepositPayoutDelay")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("BountyDepositPayoutDelay")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Bounty duration in blocks."] + pub fn bounty_update_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Bounties", "BountyUpdatePeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("BountyUpdatePeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The curator deposit is calculated as a percentage of the curator fee."] + #[doc = ""] + #[doc = " This deposit has optional upper and lower bounds with `CuratorDepositMax` and"] + #[doc = " `CuratorDepositMin`."] + pub fn curator_deposit_multiplier( + &self, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Permill, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Bounties", "CuratorDepositMultiplier")? + == [ + 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, + 91u8, 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, + 74u8, 83u8, 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, + 161u8, 119u8, 2u8, 38u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("CuratorDepositMultiplier")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] + pub fn curator_deposit_max( + &self, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Bounties", "CuratorDepositMax")? + == [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, + 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, + 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, + 43u8, 243u8, 122u8, 60u8, 216u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("CuratorDepositMax")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] + pub fn curator_deposit_min( + &self, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Bounties", "CuratorDepositMin")? + == [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, + 194u8, 88u8, 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, + 154u8, 237u8, 134u8, 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, + 43u8, 243u8, 122u8, 60u8, 216u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("CuratorDepositMin")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Minimum value for a bounty."] + pub fn bounty_value_minimum( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Bounties", "BountyValueMinimum")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("BountyValueMinimum")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] + pub fn data_deposit_per_byte( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Bounties", "DataDepositPerByte")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("DataDepositPerByte")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maximum acceptable reason length."] + #[doc = ""] + #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] + pub fn maximum_reason_length( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Bounties", "MaximumReasonLength")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Bounties")?; + let constant = pallet.constant("MaximumReasonLength")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod child_bounties { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub value: ::core::primitive::u128, + pub description: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for AddChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "add_child_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeCurator { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub fee: ::core::primitive::u128, + } + impl ::subxt::Call for ProposeCurator { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "propose_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AcceptCurator { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for AcceptCurator { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "accept_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnassignCurator { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for UnassignCurator { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "unassign_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AwardChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for AwardChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "award_child_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClaimChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for ClaimChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "claim_child_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for CloseChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "close_child_bounty"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Add a new child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of parent"] + #[doc = "bounty and the parent bounty must be in \"active\" state."] + #[doc = ""] + #[doc = "Child-bounty gets added successfully & fund gets transferred from"] + #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] + #[doc = "funds, else the call fails."] + #[doc = ""] + #[doc = "Upper bound to maximum number of active child-bounties that can be"] + #[doc = "added are managed via runtime trait config"] + #[doc = "[`Config::MaxActiveChildBountyCount`]."] + #[doc = ""] + #[doc = "If the call is success, the status of child-bounty is updated to"] + #[doc = "\"Added\"."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] + #[doc = "- `value`: Value for executing the proposal."] + #[doc = "- `description`: Text description for the child-bounty."] + pub fn add_child_bounty( + &self, + parent_bounty_id: ::core::primitive::u32, + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddChildBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 235u8, 216u8, 166u8, 226u8, 107u8, 159u8, 235u8, 35u8, 207u8, + 154u8, 124u8, 226u8, 242u8, 241u8, 4u8, 20u8, 1u8, 215u8, + 110u8, 127u8, 19u8, 211u8, 36u8, 159u8, 110u8, 146u8, 58u8, + 23u8, 210u8, 51u8, 193u8, 228u8, + ] + { + let call = AddChildBounty { + parent_bounty_id, + value, + description, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Propose curator for funded child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be curator of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `curator`: Address of child-bounty curator."] + #[doc = "- `fee`: payment fee to child-bounty curator for execution."] + pub fn propose_curator( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + fee: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ProposeCurator, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 34u8, 219u8, 159u8, 152u8, 29u8, 12u8, 222u8, 91u8, 193u8, + 218u8, 28u8, 0u8, 102u8, 15u8, 180u8, 155u8, 135u8, 175u8, + 182u8, 51u8, 220u8, 97u8, 169u8, 97u8, 135u8, 26u8, 237u8, + 22u8, 100u8, 8u8, 203u8, 229u8, + ] + { + let call = ProposeCurator { + parent_bounty_id, + child_bounty_id, + curator, + fee, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Accept the curator role for the child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this"] + #[doc = "child-bounty."] + #[doc = ""] + #[doc = "A deposit will be reserved from the curator and refund upon"] + #[doc = "successful payout or cancellation."] + #[doc = ""] + #[doc = "Fee for curator is deducted from curator fee of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] + #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn accept_curator( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AcceptCurator, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 115u8, 24u8, 36u8, 188u8, 30u8, 11u8, 184u8, 102u8, 151u8, + 96u8, 41u8, 162u8, 104u8, 54u8, 76u8, 251u8, 189u8, 50u8, + 190u8, 50u8, 15u8, 171u8, 231u8, 218u8, 45u8, 129u8, 137u8, + 69u8, 130u8, 39u8, 190u8, 223u8, + ] + { + let call = AcceptCurator { + parent_bounty_id, + child_bounty_id, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Unassign curator from a child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] + #[doc = "the curator of the parent bounty, or any signed origin."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] + #[doc = "curator, parent-bounty must be in active state, for this call to"] + #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] + #[doc = "this call irrespective of the parent-bounty state."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin` or the"] + #[doc = "parent-bounty curator, we assume that the child-bounty curator is"] + #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] + #[doc = "slashed."] + #[doc = ""] + #[doc = "If the origin is the child-bounty curator, we take this as a sign"] + #[doc = "that they are unable to do their job, and are willingly giving up."] + #[doc = "We could slash the deposit, but for now we allow them to unreserve"] + #[doc = "their deposit and exit without issue. (We may want to change this if"] + #[doc = "it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] + #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] + #[doc = "inactive state of child-bounty curator."] + #[doc = ""] + #[doc = "This allows anyone in the community to call out that a child-bounty"] + #[doc = "curator is not doing their due diligence, and we should pick a new"] + #[doc = "one. In this case the child-bounty curator deposit is slashed."] + #[doc = ""] + #[doc = "State of child-bounty is moved to Added state on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn unassign_curator( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + UnassignCurator, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 210u8, 24u8, 20u8, 200u8, 106u8, 200u8, 33u8, 43u8, 169u8, + 133u8, 157u8, 108u8, 220u8, 36u8, 110u8, 172u8, 218u8, 1u8, + 209u8, 254u8, 69u8, 117u8, 70u8, 173u8, 66u8, 177u8, 54u8, + 128u8, 239u8, 83u8, 60u8, 118u8, + ] + { + let call = UnassignCurator { + parent_bounty_id, + child_bounty_id, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Award child-bounty to a beneficiary."] + #[doc = ""] + #[doc = "The beneficiary will be able to claim the funds after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the master curator or"] + #[doc = "curator of this child-bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in active state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `beneficiary`: Beneficiary account."] + pub fn award_child_bounty( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AwardChildBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 135u8, 134u8, 237u8, 216u8, 152u8, 75u8, 11u8, 209u8, 152u8, + 99u8, 166u8, 78u8, 162u8, 34u8, 37u8, 158u8, 95u8, 74u8, + 137u8, 50u8, 43u8, 117u8, 166u8, 91u8, 212u8, 30u8, 243u8, + 67u8, 140u8, 66u8, 56u8, 206u8, + ] + { + let call = AwardChildBounty { + parent_bounty_id, + child_bounty_id, + beneficiary, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Claim the payout from an awarded child-bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call may be any signed origin."] + #[doc = ""] + #[doc = "Call works independent of parent bounty state, No need for parent"] + #[doc = "bounty to be in active state."] + #[doc = ""] + #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] + #[doc = "paid & curator deposit is unreserved."] + #[doc = ""] + #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] + #[doc = "call. And instance of child-bounty is removed from the state on"] + #[doc = "successful call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn claim_child_bounty( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClaimChildBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 54u8, 194u8, 203u8, 13u8, 230u8, 207u8, 25u8, 249u8, 203u8, + 199u8, 123u8, 79u8, 255u8, 85u8, 40u8, 125u8, 73u8, 5u8, + 126u8, 103u8, 205u8, 222u8, 232u8, 161u8, 178u8, 206u8, 39u8, + 5u8, 16u8, 167u8, 198u8, 93u8, + ] + { + let call = ClaimChildBounty { + parent_bounty_id, + child_bounty_id, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] + #[doc = "are transferred to parent bounty account. The child-bounty curator"] + #[doc = "deposit may be unreserved if possible."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be either parent curator or"] + #[doc = "`T::RejectOrigin`."] + #[doc = ""] + #[doc = "If the state of child-bounty is `Active`, curator deposit is"] + #[doc = "unreserved."] + #[doc = ""] + #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] + #[doc = "returns `PendingPayout` error."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] + #[doc = "active state, for this child-bounty call to work. For origin"] + #[doc = "T::RejectOrigin execution is forced."] + #[doc = ""] + #[doc = "Instance of child-bounty is removed from the state on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + pub fn close_child_bounty( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CloseChildBounty, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 123u8, 201u8, 206u8, 242u8, 80u8, 37u8, 113u8, 182u8, 237u8, + 187u8, 51u8, 229u8, 226u8, 250u8, 129u8, 203u8, 196u8, 22u8, + 91u8, 154u8, 118u8, 233u8, 254u8, 240u8, 113u8, 86u8, 55u8, + 5u8, 59u8, 15u8, 160u8, 204u8, + ] + { + let call = CloseChildBounty { + parent_bounty_id, + child_bounty_id, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_child_bounties::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A child-bounty is added."] + pub struct Added { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, + } + impl ::subxt::Event for Added { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Added"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A child-bounty is awarded to a beneficiary."] + pub struct Awarded { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Awarded { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Awarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A child-bounty is claimed by beneficiary."] + pub struct Claimed { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, + pub payout: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Claimed { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Claimed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A child-bounty is cancelled."] + pub struct Canceled { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, + } + impl ::subxt::Event for Canceled { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Canceled"; + } + } + pub mod storage { + use super::runtime_types; + pub struct ChildBountyCount; + impl ::subxt::StorageEntry for ChildBountyCount { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildBountyCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParentChildBounties<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ParentChildBounties<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ParentChildBounties"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ChildBounties<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for ChildBounties<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildBounties"; + type Value = runtime_types::pallet_child_bounties::ChildBounty< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ChildBountyDescriptions<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ChildBountyDescriptions<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildBountyDescriptions"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ChildrenCuratorFees<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ChildrenCuratorFees<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildrenCuratorFees"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Number of total child bounties."] + pub async fn child_bounty_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Child-bounties that have been added."] + pub async fn child_bounties( + &self, + _0: &::core::primitive::u32, + _1: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The description of each child-bounty."] + pub async fn child_bounty_descriptions( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The cumulative child-bounty curator fee for each parent bounty."] + pub async fn children_curator_fees( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Maximum number of child-bounties that can be added to a parent bounty."] + pub fn max_active_child_bounty_count( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ChildBounties", "MaxActiveChildBountyCount")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("ChildBounties")?; + let constant = pallet.constant("MaxActiveChildBountyCount")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Minimum value for a child-bounty."] + pub fn child_bounty_value_minimum( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ChildBounties", "ChildBountyValueMinimum")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("ChildBounties")?; + let constant = pallet.constant("ChildBountyValueMinimum")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod tips { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReportAwesome { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ReportAwesome { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "report_awesome"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RetractTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for RetractTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "retract_tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipNew { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, + } + impl ::subxt::Call for TipNew { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip_new"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Tip { + pub hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, + } + impl ::subxt::Call for Tip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for CloseTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "close_tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SlashTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for SlashTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "slash_tip"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R)` where `R` length of `reason`."] + #[doc = " - encoding and hashing of 'reason'"] + #[doc = "- DbReads: `Reasons`, `Tips`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + pub fn report_awesome( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReportAwesome, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 90u8, 58u8, 149u8, 226u8, 88u8, 237u8, 150u8, 165u8, 172u8, + 179u8, 195u8, 226u8, 200u8, 20u8, 152u8, 103u8, 157u8, 208u8, + 86u8, 101u8, 178u8, 54u8, 42u8, 171u8, 172u8, 201u8, 20u8, + 254u8, 165u8, 7u8, 15u8, 197u8, + ] + { + let call = ReportAwesome { reason, who }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] + #[doc = ""] + #[doc = "If successful, the original deposit will be unreserved."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the tip identified by `hash`"] + #[doc = "must have been reported by the signing account through `report_awesome` (and not"] + #[doc = "through `tip_new`)."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "Emits `TipRetracted` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`"] + #[doc = " - Depends on the length of `T::Hash` which is fixed."] + #[doc = "- DbReads: `Tips`, `origin account`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] + #[doc = "# "] + pub fn retract_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RetractTip, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 213u8, 70u8, 11u8, 81u8, 39u8, 125u8, 42u8, 247u8, 80u8, + 55u8, 123u8, 247u8, 45u8, 18u8, 86u8, 205u8, 26u8, 229u8, + 21u8, 106u8, 196u8, 125u8, 63u8, 65u8, 117u8, 219u8, 138u8, + 163u8, 161u8, 115u8, 157u8, 231u8, + ] + { + let call = RetractTip { hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Give a tip for something new; no finder's fee will be taken."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R + T)` where `R` length of `reason`, `T` is the number of tippers."] + #[doc = " - `O(T)`: decoding `Tipper` vec of length `T`. `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of"] + #[doc = " `T::Tippers`."] + #[doc = " - `O(R)`: hashing and encoding of reason of length `R`"] + #[doc = "- DbReads: `Tippers`, `Reasons`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + pub fn tip_new( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + tip_value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + TipNew, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 137u8, 119u8, 91u8, 139u8, 238u8, 180u8, 247u8, 5u8, 194u8, + 35u8, 33u8, 151u8, 50u8, 212u8, 208u8, 134u8, 98u8, 133u8, + 83u8, 212u8, 27u8, 218u8, 186u8, 188u8, 111u8, 102u8, 34u8, + 211u8, 112u8, 48u8, 98u8, 206u8, + ] + { + let call = TipNew { + reason, + who, + tip_value, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Declare a tip value for an already-open tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the hash of the original tip `reason` and the beneficiary"] + #[doc = " account ID."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `TipClosing` if the threshold of tippers has been reached and the countdown period"] + #[doc = "has started."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`, insert tip and check closing, `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of `T::Tippers`."] + #[doc = ""] + #[doc = " Actually weight could be lower as it depends on how many tips are in `OpenTip` but it"] + #[doc = " is weighted as if almost full i.e of length `T-1`."] + #[doc = "- DbReads: `Tippers`, `Tips`"] + #[doc = "- DbWrites: `Tips`"] + #[doc = "# "] + pub fn tip( + &self, + hash: ::subxt::sp_core::H256, + tip_value: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Tip, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 2u8, 38u8, 219u8, 220u8, 183u8, 243u8, 108u8, 40u8, 179u8, + 21u8, 218u8, 158u8, 126u8, 19u8, 22u8, 115u8, 95u8, 17u8, + 73u8, 219u8, 179u8, 69u8, 60u8, 115u8, 196u8, 170u8, 23u8, + 218u8, 75u8, 9u8, 227u8, 204u8, + ] + { + let call = Tip { hash, tip_value }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Close and payout a tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "The tip identified by `hash` must have finished its countdown period."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`. `T` is charged as upper bound given by `ContainsLengthBound`. The actual cost"] + #[doc = " depends on the implementation of `T::Tippers`."] + #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] + #[doc = "# "] + pub fn close_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CloseTip, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 85u8, 180u8, 115u8, 177u8, 2u8, 252u8, 139u8, 37u8, 233u8, + 127u8, 115u8, 4u8, 169u8, 169u8, 214u8, 223u8, 181u8, 150u8, + 137u8, 226u8, 99u8, 23u8, 205u8, 31u8, 160u8, 185u8, 97u8, + 128u8, 197u8, 110u8, 142u8, 160u8, + ] + { + let call = CloseTip { hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove and slash an already-open tip."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "As a result, the finder is slashed and the deposits are lost."] + #[doc = ""] + #[doc = "Emits `TipSlashed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] + #[doc = " The actual cost depends on the implementation of `T::Tippers`."] + #[doc = "# "] + pub fn slash_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SlashTip, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 135u8, 7u8, 55u8, 167u8, 26u8, 108u8, 43u8, 20u8, 162u8, + 185u8, 209u8, 88u8, 148u8, 181u8, 51u8, 102u8, 17u8, 105u8, + 162u8, 223u8, 126u8, 46u8, 254u8, 79u8, 64u8, 248u8, 193u8, + 10u8, 110u8, 40u8, 5u8, 199u8, + ] + { + let call = SlashTip { hash }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_tips::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new tip suggestion has been opened."] + pub struct NewTip { + pub tip_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for NewTip { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "NewTip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A tip suggestion has reached threshold and is closing."] + pub struct TipClosing { + pub tip_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for TipClosing { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosing"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A tip suggestion has been closed."] + pub struct TipClosed { + pub tip_hash: ::subxt::sp_core::H256, + pub who: ::subxt::sp_core::crypto::AccountId32, + pub payout: ::core::primitive::u128, + } + impl ::subxt::Event for TipClosed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A tip suggestion has been retracted."] + pub struct TipRetracted { + pub tip_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for TipRetracted { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipRetracted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A tip suggestion has been slashed."] + pub struct TipSlashed { + pub tip_hash: ::subxt::sp_core::H256, + pub finder: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::Event for TipSlashed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipSlashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Tips<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Tips<'_> { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Tips"; + type Value = runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Reasons<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reasons<'_> { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Reasons"; + type Value = ::std::vec::Vec<::core::primitive::u8>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[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( + &self, + _0: &::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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::subxt::sp_core::H256, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Maximum acceptable reason length."] + #[doc = ""] + #[doc = " Benchmarks depend on this value, be sure to update weights file when changing this value"] + pub fn maximum_reason_length( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Tips", "MaximumReasonLength")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Tips")?; + let constant = pallet.constant("MaximumReasonLength")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] + pub fn data_deposit_per_byte( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Tips", "DataDepositPerByte")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Tips")?; + let constant = pallet.constant("DataDepositPerByte")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The period for which a tip remains open after is has achieved threshold tippers."] + pub fn tip_countdown( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Tips", "TipCountdown")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Tips")?; + let constant = pallet.constant("TipCountdown")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The percent of the final tip which goes to the original reporter of the tip."] + pub fn tip_finders_fee( + &self, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Percent, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Tips", "TipFindersFee")? + == [ + 51u8, 95u8, 57u8, 159u8, 25u8, 64u8, 29u8, 36u8, 82u8, 174u8, + 29u8, 154u8, 123u8, 113u8, 231u8, 89u8, 161u8, 252u8, 237u8, + 17u8, 50u8, 5u8, 239u8, 138u8, 157u8, 114u8, 246u8, 90u8, + 225u8, 146u8, 157u8, 192u8, + ] + { + let pallet = self.client.metadata().pallet("Tips")?; + let constant = pallet.constant("TipFindersFee")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The amount held on deposit for placing a tip report."] + pub fn tip_report_deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Tips", "TipReportDepositBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Tips")?; + let constant = pallet.constant("TipReportDepositBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod election_provider_multi_phase { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubmitUnsigned { pub raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , pub witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } + impl ::subxt::Call for SubmitUnsigned { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit_unsigned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: ::core::option::Option< + runtime_types::sp_npos_elections::ElectionScore, + >, + } + impl ::subxt::Call for SetMinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_minimum_untrusted_score"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetEmergencyElectionResult { + pub supports: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + } + impl ::subxt::Call for SetEmergencyElectionResult { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_emergency_election_result"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Submit { + pub raw_solution: ::std::boxed::Box< + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::polkadot_runtime::NposCompactSolution16, + >, + >, + } + impl ::subxt::Call for Submit { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct GovernanceFallback { + pub maybe_max_voters: ::core::option::Option<::core::primitive::u32>, + pub maybe_max_targets: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for GovernanceFallback { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "governance_fallback"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Submit a solution for the unsigned phase."] + #[doc = ""] + #[doc = "The dispatch origin fo this call must be __none__."] + #[doc = ""] + #[doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] + #[doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] + #[doc = "that only active validators can submit this transaction when authoring a block (similar"] + #[doc = "to an inherent)."] + #[doc = ""] + #[doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] + #[doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] + #[doc = "putting their authoring reward at risk."] + #[doc = ""] + #[doc = "No deposit or reward is associated with this submission."] + pub fn submit_unsigned( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SubmitUnsigned, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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, + ] + { + let call = SubmitUnsigned { + raw_solution: ::std::boxed::Box::new(raw_solution), + witness, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set a new value for `MinimumUntrustedScore`."] + #[doc = ""] + #[doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] + #[doc = ""] + #[doc = "This check can be turned off by setting the value to `None`."] + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: ::core::option::Option< + runtime_types::sp_npos_elections::ElectionScore, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMinimumUntrustedScore, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 207u8, 31u8, 247u8, 72u8, 55u8, 18u8, 99u8, 157u8, 155u8, + 89u8, 59u8, 156u8, 254u8, 3u8, 181u8, 85u8, 48u8, 42u8, 73u8, + 243u8, 35u8, 90u8, 142u8, 14u8, 62u8, 48u8, 15u8, 125u8, + 194u8, 103u8, 2u8, 175u8, + ] + { + let call = SetMinimumUntrustedScore { maybe_next_score }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] + #[doc = "call to `ElectionProvider::elect`."] + #[doc = ""] + #[doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] + #[doc = ""] + #[doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] + #[doc = "feasibility check itself can in principle cause the election process to fail (due to"] + #[doc = "memory/weight constrains)."] + pub fn set_emergency_election_result( + &self, + supports: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetEmergencyElectionResult, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 195u8, 164u8, 133u8, 193u8, 58u8, 154u8, 182u8, 83u8, 231u8, + 217u8, 199u8, 27u8, 239u8, 143u8, 60u8, 103u8, 139u8, 253u8, + 49u8, 242u8, 8u8, 41u8, 160u8, 192u8, 123u8, 98u8, 137u8, + 13u8, 170u8, 167u8, 246u8, 175u8, + ] + { + let call = SetEmergencyElectionResult { supports }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Submit a solution for the signed phase."] + #[doc = ""] + #[doc = "The dispatch origin fo this call must be __signed__."] + #[doc = ""] + #[doc = "The solution is potentially queued, based on the claimed score and processed at the end"] + #[doc = "of the signed phase."] + #[doc = ""] + #[doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] + #[doc = "might be rewarded, slashed, or get all or a part of the deposit back."] + pub fn submit( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Submit, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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, + ] + { + let call = Submit { + raw_solution: ::std::boxed::Box::new(raw_solution), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Trigger the governance fallback."] + #[doc = ""] + #[doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] + #[doc = "calling [`Call::set_emergency_election_result`]."] + pub fn governance_fallback( + &self, + maybe_max_voters: ::core::option::Option<::core::primitive::u32>, + maybe_max_targets: ::core::option::Option<::core::primitive::u32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + GovernanceFallback, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 195u8, 190u8, 140u8, 94u8, 209u8, 100u8, 92u8, 194u8, 78u8, + 226u8, 16u8, 168u8, 52u8, 117u8, 88u8, 178u8, 84u8, 248u8, + 117u8, 38u8, 152u8, 71u8, 37u8, 158u8, 77u8, 204u8, 59u8, + 184u8, 22u8, 239u8, 92u8, 209u8, + ] + { + let call = GovernanceFallback { + maybe_max_voters, + maybe_max_targets, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = + runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A solution was stored with the given compute."] + #[doc = ""] + #[doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] + #[doc = "solution is unsigned, this means that it has also been processed."] + #[doc = ""] + #[doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] + pub struct SolutionStored { + pub election_compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub prev_ejected: ::core::primitive::bool, + } + impl ::subxt::Event for SolutionStored { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SolutionStored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The election has been finalized, with `Some` of the given computation, or else if the"] + #[doc = "election failed, `None`."] + pub struct ElectionFinalized { + pub election_compute: ::core::option::Option< + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + >, + } + impl ::subxt::Event for ElectionFinalized { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "ElectionFinalized"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has been rewarded for their signed submission being finalized."] + pub struct Rewarded { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + } + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An account has been slashed for submitting an invalid signed submission."] + pub struct Slashed { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + } + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Slashed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "The signed phase of the given round has started."] + pub struct SignedPhaseStarted { + pub round: ::core::primitive::u32, + } + impl ::subxt::Event for SignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SignedPhaseStarted"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "The unsigned phase of the given round has started."] + pub struct UnsignedPhaseStarted { + pub round: ::core::primitive::u32, + } + impl ::subxt::Event for UnsignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "UnsignedPhaseStarted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Round; + impl ::subxt::StorageEntry for Round { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Round"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentPhase; + impl ::subxt::StorageEntry for CurrentPhase { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "CurrentPhase"; + type Value = runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct QueuedSolution; + impl ::subxt::StorageEntry for QueuedSolution { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "QueuedSolution"; + type Value = + runtime_types::pallet_election_provider_multi_phase::ReadySolution< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Snapshot; + impl ::subxt::StorageEntry for Snapshot { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Snapshot"; + type Value = + runtime_types::pallet_election_provider_multi_phase::RoundSnapshot; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DesiredTargets; + impl ::subxt::StorageEntry for DesiredTargets { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "DesiredTargets"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SnapshotMetadata; + impl ::subxt::StorageEntry for SnapshotMetadata { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SnapshotMetadata"; + type Value = runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionNextIndex; + impl ::subxt::StorageEntry for SignedSubmissionNextIndex { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionNextIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionIndices; + impl ::subxt::StorageEntry for SignedSubmissionIndices { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionIndices"; + type Value = runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionsMap<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for SignedSubmissionsMap<'_> { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionsMap"; + type Value = runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct MinimumUntrustedScore; + impl ::subxt::StorageEntry for MinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "MinimumUntrustedScore"; + type Value = runtime_types::sp_npos_elections::ElectionScore; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Internal counter for the number of rounds."] + #[doc = ""] + #[doc = " This is useful for de-duplication of transactions submitted to the pool, and general"] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Current phase."] + pub async 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, + > { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " 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 >{ + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " The next index to be assigned to an incoming signed submission."] + #[doc = ""] + #[doc = " Every accepted submission is assigned a unique index; that index is bound to that particular"] + #[doc = " submission for the duration of the election. On election finalization, the next index is"] + #[doc = " reset to 0."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[doc = " A sorted, bounded set of `(score, index)`, where each `index` points to a value in"] + #[doc = " `SignedSubmissions`."] + #[doc = ""] + #[doc = " We never need to process more than a single signed submission at a time. Signed submissions"] + #[doc = " can be quite large, so we're willing to pay the cost of multiple database accesses to access"] + #[doc = " them one at a time instead of reading and decoding all of them at once."] pub 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 >{ + if self + .client + .metadata() + .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 = " Unchecked, signed solutions."] + #[doc = ""] + #[doc = " Together with `SubmissionIndices`, this stores a bounded set of `SignedSubmissions` while"] + #[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 >{ + if self + .client + .metadata() + .storage_hash::()? + == [ + 94u8, 51u8, 117u8, 215u8, 100u8, 250u8, 9u8, 70u8, 131u8, + 21u8, 2u8, 142u8, 177u8, 117u8, 21u8, 190u8, 10u8, 15u8, + 183u8, 214u8, 6u8, 169u8, 141u8, 169u8, 23u8, 136u8, 231u8, + 130u8, 48u8, 126u8, 198u8, 173u8, + ] + { + let entry = SignedSubmissionsMap(_0); + self.client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Unchecked, signed solutions."] + #[doc = ""] + #[doc = " Together with `SubmissionIndices`, this stores a bounded set of `SignedSubmissions` while"] + #[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_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SignedSubmissionsMap<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .storage_hash::()? + == [ + 94u8, 51u8, 117u8, 215u8, 100u8, 250u8, 9u8, 70u8, 131u8, + 21u8, 2u8, 142u8, 177u8, 117u8, 21u8, 190u8, 10u8, 15u8, + 183u8, 214u8, 6u8, 169u8, 141u8, 169u8, 23u8, 136u8, 231u8, + 130u8, 48u8, 126u8, 198u8, 173u8, + ] + { + self.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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_npos_elections::ElectionScore, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Duration of the unsigned phase."] + pub fn unsigned_phase( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "UnsignedPhase")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("UnsignedPhase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Duration of the signed phase."] + pub fn signed_phase( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "SignedPhase")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedPhase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The minimum amount of improvement to the solution score that defines a solution as"] + #[doc = " \"better\" (in any phase)."] + pub fn solution_improvement_threshold( + &self, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Perbill, + ::subxt::BasicError, + > { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "SolutionImprovementThreshold", + )? == [ + 26u8, 148u8, 47u8, 190u8, 51u8, 71u8, 203u8, 119u8, 167u8, 91u8, + 70u8, 11u8, 149u8, 155u8, 138u8, 91u8, 119u8, 0u8, 74u8, 83u8, + 16u8, 47u8, 129u8, 11u8, 81u8, 169u8, 79u8, 31u8, 161u8, 119u8, + 2u8, 38u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SolutionImprovementThreshold")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The repeat threshold of the offchain worker."] + #[doc = ""] + #[doc = " For example, if it is 5, that means that at least 5 blocks will elapse between attempts"] + #[doc = " to submit the worker's solution."] + pub fn offchain_repeat( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "OffchainRepeat")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("OffchainRepeat")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The priority of the unsigned transaction submitted in the unsigned-phase"] + pub fn miner_tx_priority( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "MinerTxPriority")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("MinerTxPriority")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[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> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "MinerMaxWeight")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self + .client + .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"] + #[doc = " structures. In particular, `SignedSubmissionIndices` is bounded on this value. If you"] + #[doc = " update this value during an election, you _must_ ensure that"] + #[doc = " `SignedSubmissionIndices.len()` is less than or equal to the new value. Otherwise,"] + #[doc = " attempts to submit new solutions may cause a runtime panic."] + pub fn signed_max_submissions( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "SignedMaxSubmissions", + )? == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, + 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, + 41u8, 145u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedMaxSubmissions")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Maximum weight of a signed solution."] + #[doc = ""] + #[doc = " This should probably be similar to [`Config::MinerMaxWeight`]."] + pub fn signed_max_weight( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "SignedMaxWeight")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedMaxWeight")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Base reward for a signed solution"] + pub fn signed_reward_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "SignedRewardBase")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedRewardBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Base deposit for a signed solution."] + pub fn signed_deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "SignedDepositBase", + )? == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, + 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, + 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, + 98u8, 148u8, 156u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedDepositBase")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Per-byte deposit for a signed solution."] + pub fn signed_deposit_byte( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "SignedDepositByte", + )? == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, + 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, + 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, + 98u8, 148u8, 156u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedDepositByte")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Per-weight deposit for a signed solution."] + pub fn signed_deposit_weight( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "SignedDepositWeight", + )? == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, + 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, + 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, + 98u8, 148u8, 156u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("SignedDepositWeight")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of electing voters to put in the snapshot. At the moment, snapshots"] + #[doc = " are only over a single block, but once multi-block elections are introduced they will"] + #[doc = " take place over multiple blocks."] + pub fn max_electing_voters( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "MaxElectingVoters", + )? == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, + 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, + 41u8, 145u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("MaxElectingVoters")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The maximum number of electable targets to put in the snapshot."] + pub fn max_electable_targets( + &self, + ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> + { + if self.client.metadata().constant_hash( + "ElectionProviderMultiPhase", + "MaxElectableTargets", + )? == [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, + 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, + 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, + 193u8, 29u8, 70u8, + ] { + let pallet = self + .client + .metadata() + .pallet("ElectionProviderMultiPhase")?; + let constant = pallet.constant("MaxElectableTargets")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[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> + { + if self + .client + .metadata() + .constant_hash("ElectionProviderMultiPhase", "MinerMaxLength")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self + .client + .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 { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rebag { + pub dislocated: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for Rebag { + const PALLET: &'static str = "BagsList"; + const FUNCTION: &'static str = "rebag"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PutInFrontOf { + pub lighter: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for PutInFrontOf { + const PALLET: &'static str = "BagsList"; + const FUNCTION: &'static str = "put_in_front_of"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] + #[doc = "changed its score that it should properly fall into a different bag than its current"] + #[doc = "one."] + #[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`."] + pub fn rebag( + &self, + dislocated: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Rebag, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 46u8, 138u8, 28u8, 6u8, 58u8, 153u8, 5u8, 41u8, 44u8, 7u8, + 228u8, 72u8, 135u8, 184u8, 185u8, 132u8, 146u8, 181u8, 47u8, + 166u8, 149u8, 21u8, 155u8, 29u8, 159u8, 79u8, 83u8, 137u8, + 156u8, 17u8, 60u8, 23u8, + ] + { + let call = Rebag { dislocated }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Move the caller's Id directly in front of `lighter`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and can only be called by the Id of"] + #[doc = "the account going in front of `lighter`."] + #[doc = ""] + #[doc = "Only works if"] + #[doc = "- both nodes are within the same bag,"] + #[doc = "- and `origin` has a greater `Score` than `lighter`."] + pub fn put_in_front_of( + &self, + lighter: ::subxt::sp_core::crypto::AccountId32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + PutInFrontOf, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 79u8, 254u8, 222u8, 19u8, 17u8, 80u8, 7u8, 68u8, 54u8, 9u8, + 23u8, 133u8, 108u8, 29u8, 166u8, 177u8, 230u8, 247u8, 226u8, + 189u8, 3u8, 241u8, 100u8, 178u8, 234u8, 204u8, 118u8, 215u8, + 84u8, 28u8, 21u8, 136u8, + ] + { + let call = PutInFrontOf { lighter }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_bags_list::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Moved an account from one bag to another."] + pub struct Rebagged { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub from: ::core::primitive::u64, + pub to: ::core::primitive::u64, + } + impl ::subxt::Event for Rebagged { + const PALLET: &'static str = "BagsList"; + const EVENT: &'static str = "Rebagged"; + } + } + 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 STORAGE: &'static str = "ListNodes"; + type Value = runtime_types::pallet_bags_list::list::Node; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CounterForListNodes; + impl ::subxt::StorageEntry for CounterForListNodes { + const PALLET: &'static str = "BagsList"; + const STORAGE: &'static str = "CounterForListNodes"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ListBags<'a>(pub &'a ::core::primitive::u64); + impl ::subxt::StorageEntry for ListBags<'_> { + const PALLET: &'static str = "BagsList"; + const STORAGE: &'static str = "ListBags"; + type Value = runtime_types::pallet_bags_list::list::Bag; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " A single node, within some bag."] + #[doc = ""] + #[doc = " Nodes store links forward and back within their respective bags."] + pub async fn list_nodes( + &self, + _0: &::subxt::sp_core::crypto::AccountId32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = "Counter for the related counted storage map"] + pub async fn counter_for_list_nodes( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &::core::primitive::u64, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The list of thresholds separating the various bags."] + #[doc = ""] + #[doc = " Ids are separated into unsorted bags according to their score. This specifies the"] + #[doc = " thresholds separating the bags. An id's bag is the largest bag for which the id's score"] + #[doc = " is less than or equal to its upper threshold."] + #[doc = ""] + #[doc = " When ids are iterated, higher bags are iterated completely before lower bags. This means"] + #[doc = " that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower"] + #[doc = " score, but peer ids within a particular bag are sorted in insertion order."] + #[doc = ""] + #[doc = " # Expressing the constant"] + #[doc = ""] + #[doc = " This constant must be sorted in strictly increasing order. Duplicate items are not"] + #[doc = " permitted."] + #[doc = ""] + #[doc = " There is an implied upper limit of `Score::MAX`; that value does not need to be"] + #[doc = " specified within the bag. For any two threshold lists, if one ends with"] + #[doc = " `Score::MAX`, the other one does not, and they are otherwise equal, the two"] + #[doc = " lists will behave identically."] + #[doc = ""] + #[doc = " # Calculation"] + #[doc = ""] + #[doc = " It is recommended to generate the set of thresholds in a geometric series, such that"] + #[doc = " there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *"] + #[doc = " constant_ratio).max(threshold[k] + 1)` for all `k`."] + #[doc = ""] + #[doc = " The helpers in the `/utils/frame/generate-bags` module can simplify this calculation."] + #[doc = ""] + #[doc = " # Examples"] + #[doc = ""] + #[doc = " - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and"] + #[doc = " iteration is strictly in insertion order."] + #[doc = " - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to"] + #[doc = " the procedure given above, then the constant ratio is equal to 2."] + #[doc = " - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to"] + #[doc = " the procedure given above, then the constant ratio is approximately equal to 1.248."] + #[doc = " - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall"] + #[doc = " into bag 0, an id with score 2 will fall into bag 1, etc."] + #[doc = ""] + #[doc = " # Migration"] + #[doc = ""] + #[doc = " In the event that this list ever changes, a copy of the old bags list must be retained."] + #[doc = " With that `List::migrate` can be called, which will perform the appropriate migration."] + pub fn bag_thresholds( + &self, + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u64>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("BagsList", "BagThresholds")? + == [ + 103u8, 102u8, 255u8, 165u8, 124u8, 54u8, 5u8, 172u8, 112u8, + 234u8, 25u8, 175u8, 178u8, 19u8, 251u8, 73u8, 91u8, 192u8, + 227u8, 81u8, 249u8, 45u8, 126u8, 116u8, 7u8, 37u8, 9u8, + 200u8, 167u8, 182u8, 12u8, 131u8, + ] + { + let pallet = self.client.metadata().pallet("BagsList")?; + let constant = pallet.constant("BagThresholds")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod parachains_origin { + use super::{ + root_mod, + runtime_types, + }; + } + pub mod configuration { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetValidationUpgradeCooldown { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetValidationUpgradeCooldown { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_validation_upgrade_cooldown"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetValidationUpgradeDelay { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetValidationUpgradeDelay { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_validation_upgrade_delay"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetCodeRetentionPeriod { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetCodeRetentionPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_code_retention_period"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxCodeSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxCodeSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_code_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxPovSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxPovSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_pov_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxHeadDataSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxHeadDataSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_head_data_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetParathreadCores { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetParathreadCores { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_parathread_cores"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetParathreadRetries { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetParathreadRetries { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_parathread_retries"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetGroupRotationFrequency { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetGroupRotationFrequency { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_group_rotation_frequency"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetChainAvailabilityPeriod { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetChainAvailabilityPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_chain_availability_period"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetThreadAvailabilityPeriod { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetThreadAvailabilityPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_thread_availability_period"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetSchedulingLookahead { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetSchedulingLookahead { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_scheduling_lookahead"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetMaxValidatorsPerCore { + pub new: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for SetMaxValidatorsPerCore { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_validators_per_core"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetMaxValidators { + pub new: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for SetMaxValidators { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_validators"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetDisputePeriod { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetDisputePeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_dispute_period"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetDisputePostConclusionAcceptancePeriod { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetDisputePostConclusionAcceptancePeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = + "set_dispute_post_conclusion_acceptance_period"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetDisputeMaxSpamSlots { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetDisputeMaxSpamSlots { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_dispute_max_spam_slots"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetDisputeConclusionByTimeOutPeriod { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetDisputeConclusionByTimeOutPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = + "set_dispute_conclusion_by_time_out_period"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetNoShowSlots { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetNoShowSlots { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_no_show_slots"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetNDelayTranches { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetNDelayTranches { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_n_delay_tranches"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetZerothDelayTrancheWidth { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetZerothDelayTrancheWidth { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetNeededApprovals { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetNeededApprovals { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_needed_approvals"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetRelayVrfModuloSamples { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetRelayVrfModuloSamples { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxUpwardQueueCount { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxUpwardQueueCount { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_queue_count"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxUpwardQueueSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxUpwardQueueSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_queue_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxDownwardMessageSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxDownwardMessageSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_downward_message_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetUmpServiceTotalWeight { + pub new: ::core::primitive::u64, + } + impl ::subxt::Call for SetUmpServiceTotalWeight { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_ump_service_total_weight"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxUpwardMessageSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxUpwardMessageSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_message_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMaxUpwardMessageNumPerCandidate { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxUpwardMessageNumPerCandidate { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_message_num_per_candidate"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpOpenRequestTtl { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpOpenRequestTtl { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_open_request_ttl"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpSenderDeposit { + pub new: ::core::primitive::u128, + } + impl ::subxt::Call for SetHrmpSenderDeposit { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_sender_deposit"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpRecipientDeposit { + pub new: ::core::primitive::u128, + } + impl ::subxt::Call for SetHrmpRecipientDeposit { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_recipient_deposit"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpChannelMaxCapacity { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpChannelMaxCapacity { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_channel_max_capacity"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpChannelMaxTotalSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpChannelMaxTotalSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_channel_max_total_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpMaxParachainInboundChannels { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpMaxParachainInboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpMaxParathreadInboundChannels { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpMaxParathreadInboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpChannelMaxMessageSize { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpChannelMaxMessageSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpMaxParachainOutboundChannels { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpMaxParachainOutboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpMaxParathreadOutboundChannels { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpMaxParathreadOutboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = + "set_hrmp_max_parathread_outbound_channels"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetHrmpMaxMessageNumPerCandidate { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetHrmpMaxMessageNumPerCandidate { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetUmpMaxIndividualWeight { + pub new: ::core::primitive::u64, + } + impl ::subxt::Call for SetUmpMaxIndividualWeight { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_ump_max_individual_weight"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetPvfCheckingEnabled { + pub new: ::core::primitive::bool, + } + impl ::subxt::Call for SetPvfCheckingEnabled { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_pvf_checking_enabled"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetPvfVotingTtl { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetPvfVotingTtl { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_pvf_voting_ttl"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SetMinimumValidationUpgradeDelay { + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetMinimumValidationUpgradeDelay { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_minimum_validation_upgrade_delay"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetBypassConsistencyCheck { + pub new: ::core::primitive::bool, + } + impl ::subxt::Call for SetBypassConsistencyCheck { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_bypass_consistency_check"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Set the validation upgrade cooldown."] + pub fn set_validation_upgrade_cooldown( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetValidationUpgradeCooldown, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 153u8, 60u8, 171u8, 164u8, 241u8, 214u8, 235u8, 141u8, 4u8, + 32u8, 129u8, 253u8, 128u8, 148u8, 185u8, 51u8, 65u8, 34u8, + 68u8, 72u8, 202u8, 159u8, 74u8, 243u8, 35u8, 138u8, 208u8, + 26u8, 182u8, 189u8, 41u8, 11u8, + ] + { + let call = SetValidationUpgradeCooldown { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the validation upgrade delay."] + pub fn set_validation_upgrade_delay( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetValidationUpgradeDelay, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 136u8, 220u8, 63u8, 166u8, 202u8, 19u8, 241u8, 32u8, 100u8, + 14u8, 101u8, 244u8, 241u8, 141u8, 144u8, 213u8, 185u8, 88u8, + 193u8, 2u8, 55u8, 154u8, 24u8, 77u8, 66u8, 167u8, 69u8, + 245u8, 224u8, 63u8, 196u8, 200u8, + ] + { + let call = SetValidationUpgradeDelay { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the acceptance period for an included candidate."] + pub fn set_code_retention_period( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetCodeRetentionPeriod, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 94u8, 104u8, 13u8, 127u8, 95u8, 137u8, 66u8, 224u8, 22u8, + 53u8, 14u8, 161u8, 67u8, 85u8, 78u8, 161u8, 92u8, 81u8, + 190u8, 213u8, 113u8, 235u8, 64u8, 19u8, 112u8, 164u8, 71u8, + 88u8, 183u8, 234u8, 237u8, 9u8, + ] + { + let call = SetCodeRetentionPeriod { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the max validation code size for incoming upgrades."] + pub fn set_max_code_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxCodeSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 74u8, 39u8, 190u8, 155u8, 121u8, 60u8, 233u8, 95u8, 177u8, + 57u8, 116u8, 107u8, 200u8, 44u8, 2u8, 215u8, 209u8, 50u8, + 37u8, 112u8, 136u8, 107u8, 202u8, 142u8, 114u8, 25u8, 43u8, + 134u8, 250u8, 15u8, 81u8, 13u8, + ] + { + let call = SetMaxCodeSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the max POV block size for incoming upgrades."] + pub fn set_max_pov_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxPovSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 77u8, 199u8, 18u8, 53u8, 223u8, 107u8, 57u8, 141u8, 8u8, + 138u8, 180u8, 175u8, 73u8, 88u8, 205u8, 185u8, 56u8, 106u8, + 43u8, 87u8, 109u8, 9u8, 103u8, 103u8, 50u8, 158u8, 11u8, + 77u8, 162u8, 38u8, 57u8, 27u8, + ] + { + let call = SetMaxPovSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the max head data size for paras."] + pub fn set_max_head_data_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxHeadDataSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 30u8, 132u8, 5u8, 207u8, 126u8, 145u8, 187u8, 129u8, 36u8, + 235u8, 179u8, 61u8, 243u8, 87u8, 178u8, 107u8, 8u8, 21u8, + 43u8, 39u8, 119u8, 138u8, 146u8, 146u8, 109u8, 189u8, 56u8, + 160u8, 14u8, 78u8, 230u8, 149u8, + ] + { + let call = SetMaxHeadDataSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the number of parathread execution cores."] + pub fn set_parathread_cores( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetParathreadCores, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 5u8, 198u8, 156u8, 226u8, 125u8, 16u8, 2u8, 64u8, 28u8, + 189u8, 213u8, 85u8, 6u8, 112u8, 173u8, 183u8, 174u8, 207u8, + 129u8, 110u8, 201u8, 161u8, 163u8, 191u8, 20u8, 14u8, 65u8, + 106u8, 234u8, 203u8, 39u8, 75u8, + ] + { + let call = SetParathreadCores { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the number of retries for a particular parathread."] + pub fn set_parathread_retries( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetParathreadRetries, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 146u8, 134u8, 204u8, 109u8, 167u8, 35u8, 255u8, 245u8, 98u8, + 24u8, 213u8, 33u8, 144u8, 194u8, 196u8, 196u8, 66u8, 220u8, + 168u8, 156u8, 171u8, 179u8, 154u8, 30u8, 221u8, 45u8, 65u8, + 192u8, 194u8, 130u8, 87u8, 100u8, + ] + { + let call = SetParathreadRetries { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the parachain validator-group rotation frequency"] + pub fn set_group_rotation_frequency( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetGroupRotationFrequency, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 102u8, 192u8, 226u8, 120u8, 69u8, 117u8, 239u8, 156u8, 111u8, + 239u8, 197u8, 191u8, 221u8, 18u8, 140u8, 214u8, 154u8, 212u8, + 151u8, 35u8, 176u8, 2u8, 162u8, 131u8, 115u8, 102u8, 177u8, + 106u8, 35u8, 214u8, 151u8, 227u8, + ] + { + let call = SetGroupRotationFrequency { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the availability period for parachains."] + pub fn set_chain_availability_period( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetChainAvailabilityPeriod, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 3u8, 83u8, 31u8, 241u8, 73u8, 137u8, 18u8, 95u8, 119u8, + 143u8, 28u8, 110u8, 151u8, 229u8, 172u8, 208u8, 50u8, 25u8, + 89u8, 222u8, 128u8, 125u8, 112u8, 25u8, 204u8, 141u8, 175u8, + 69u8, 57u8, 161u8, 189u8, 167u8, + ] + { + let call = SetChainAvailabilityPeriod { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the availability period for parathreads."] + pub fn set_thread_availability_period( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetThreadAvailabilityPeriod, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 242u8, 204u8, 158u8, 5u8, 123u8, 163u8, 6u8, 209u8, 44u8, + 73u8, 112u8, 249u8, 96u8, 160u8, 188u8, 151u8, 107u8, 21u8, + 9u8, 100u8, 104u8, 184u8, 97u8, 77u8, 122u8, 254u8, 88u8, + 94u8, 22u8, 15u8, 57u8, 44u8, + ] + { + let call = SetThreadAvailabilityPeriod { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] + pub fn set_scheduling_lookahead( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetSchedulingLookahead, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 146u8, 149u8, 10u8, 57u8, 122u8, 116u8, 61u8, 181u8, 97u8, + 240u8, 87u8, 37u8, 227u8, 233u8, 123u8, 26u8, 243u8, 58u8, + 54u8, 93u8, 111u8, 204u8, 108u8, 18u8, 167u8, 20u8, 255u8, + 173u8, 46u8, 212u8, 246u8, 201u8, + ] + { + let call = SetSchedulingLookahead { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the maximum number of validators to assign to any core."] + pub fn set_max_validators_per_core( + &self, + new: ::core::option::Option<::core::primitive::u32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxValidatorsPerCore, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 27u8, 160u8, 153u8, 252u8, 121u8, 42u8, 94u8, 131u8, 199u8, + 216u8, 15u8, 65u8, 94u8, 69u8, 127u8, 130u8, 179u8, 236u8, + 49u8, 32u8, 239u8, 37u8, 58u8, 0u8, 50u8, 5u8, 255u8, 30u8, + 203u8, 230u8, 135u8, 202u8, + ] + { + let call = SetMaxValidatorsPerCore { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the maximum number of validators to use in parachain consensus."] + pub fn set_max_validators( + &self, + new: ::core::option::Option<::core::primitive::u32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxValidators, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 192u8, 156u8, 115u8, 10u8, 225u8, 94u8, 190u8, 180u8, 242u8, + 131u8, 202u8, 13u8, 82u8, 27u8, 8u8, 144u8, 70u8, 92u8, + 136u8, 206u8, 205u8, 3u8, 242u8, 130u8, 77u8, 114u8, 242u8, + 111u8, 99u8, 24u8, 238u8, 55u8, + ] + { + let call = SetMaxValidators { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the dispute period, in number of sessions to keep for disputes."] + pub fn set_dispute_period( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetDisputePeriod, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 232u8, 96u8, 104u8, 249u8, 183u8, 148u8, 126u8, 80u8, 64u8, + 39u8, 2u8, 208u8, 183u8, 189u8, 139u8, 201u8, 61u8, 63u8, + 42u8, 155u8, 215u8, 32u8, 212u8, 158u8, 90u8, 80u8, 159u8, + 23u8, 249u8, 204u8, 218u8, 217u8, + ] + { + let call = SetDisputePeriod { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the dispute post conclusion acceptance period."] + pub fn set_dispute_post_conclusion_acceptance_period( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetDisputePostConclusionAcceptancePeriod, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 45u8, 140u8, 213u8, 62u8, 212u8, 31u8, 126u8, 94u8, 102u8, + 176u8, 203u8, 240u8, 28u8, 25u8, 116u8, 77u8, 187u8, 147u8, + 32u8, 20u8, 25u8, 124u8, 164u8, 162u8, 246u8, 223u8, 146u8, + 28u8, 35u8, 4u8, 174u8, 47u8, + ] + { + let call = SetDisputePostConclusionAcceptancePeriod { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the maximum number of dispute spam slots."] + pub fn set_dispute_max_spam_slots( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetDisputeMaxSpamSlots, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 180u8, 195u8, 6u8, 141u8, 89u8, 252u8, 245u8, 202u8, 36u8, + 123u8, 105u8, 35u8, 161u8, 60u8, 233u8, 213u8, 191u8, 65u8, + 68u8, 4u8, 19u8, 201u8, 226u8, 103u8, 124u8, 181u8, 201u8, + 91u8, 84u8, 170u8, 48u8, 154u8, + ] + { + let call = SetDisputeMaxSpamSlots { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the dispute conclusion by time out period."] + pub fn set_dispute_conclusion_by_time_out_period( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetDisputeConclusionByTimeOutPeriod, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 50u8, 221u8, 129u8, 199u8, 147u8, 98u8, 11u8, 104u8, 133u8, + 161u8, 53u8, 163u8, 100u8, 155u8, 228u8, 167u8, 146u8, 87u8, + 186u8, 228u8, 147u8, 44u8, 142u8, 160u8, 119u8, 146u8, 10u8, + 155u8, 5u8, 35u8, 8u8, 165u8, + ] + { + let call = SetDisputeConclusionByTimeOutPeriod { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the no show slots, in number of number of consensus slots."] + #[doc = "Must be at least 1."] + pub fn set_no_show_slots( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetNoShowSlots, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 235u8, 5u8, 35u8, 159u8, 200u8, 58u8, 171u8, 179u8, 78u8, + 70u8, 161u8, 47u8, 237u8, 245u8, 77u8, 81u8, 1u8, 138u8, + 145u8, 137u8, 45u8, 126u8, 255u8, 227u8, 130u8, 217u8, 36u8, + 251u8, 72u8, 235u8, 16u8, 231u8, + ] + { + let call = SetNoShowSlots { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the total number of delay tranches."] + pub fn set_n_delay_tranches( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetNDelayTranches, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 109u8, 208u8, 13u8, 18u8, 178u8, 117u8, 101u8, 169u8, 162u8, + 255u8, 28u8, 88u8, 199u8, 89u8, 83u8, 59u8, 46u8, 105u8, + 186u8, 4u8, 7u8, 171u8, 78u8, 122u8, 197u8, 110u8, 63u8, + 164u8, 140u8, 59u8, 179u8, 236u8, + ] + { + let call = SetNDelayTranches { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the zeroth delay tranche width."] + pub fn set_zeroth_delay_tranche_width( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetZerothDelayTrancheWidth, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 162u8, 20u8, 162u8, 90u8, 59u8, 194u8, 147u8, 255u8, 198u8, + 203u8, 50u8, 13u8, 134u8, 142u8, 6u8, 156u8, 205u8, 128u8, + 222u8, 225u8, 150u8, 68u8, 198u8, 212u8, 198u8, 238u8, 3u8, + 209u8, 224u8, 19u8, 118u8, 147u8, + ] + { + let call = SetZerothDelayTrancheWidth { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the number of validators needed to approve a block."] + pub fn set_needed_approvals( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetNeededApprovals, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 83u8, 164u8, 204u8, 168u8, 93u8, 165u8, 118u8, 111u8, 149u8, + 129u8, 126u8, 250u8, 95u8, 148u8, 193u8, 173u8, 239u8, 1u8, + 14u8, 102u8, 77u8, 150u8, 149u8, 55u8, 82u8, 179u8, 2u8, + 117u8, 19u8, 34u8, 223u8, 173u8, + ] + { + let call = SetNeededApprovals { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] + pub fn set_relay_vrf_modulo_samples( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetRelayVrfModuloSamples, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 22u8, 11u8, 132u8, 96u8, 58u8, 253u8, 183u8, 31u8, 137u8, + 231u8, 187u8, 145u8, 119u8, 164u8, 55u8, 142u8, 37u8, 151u8, + 227u8, 112u8, 113u8, 18u8, 200u8, 247u8, 238u8, 10u8, 223u8, + 74u8, 4u8, 132u8, 115u8, 119u8, + ] + { + let call = SetRelayVrfModuloSamples { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] + pub fn set_max_upward_queue_count( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxUpwardQueueCount, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 16u8, 31u8, 245u8, 94u8, 243u8, 122u8, 55u8, 155u8, 161u8, + 239u8, 5u8, 59u8, 186u8, 207u8, 136u8, 253u8, 255u8, 176u8, + 135u8, 242u8, 199u8, 96u8, 226u8, 150u8, 15u8, 160u8, 60u8, + 101u8, 66u8, 143u8, 93u8, 104u8, + ] + { + let call = SetMaxUpwardQueueCount { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] + pub fn set_max_upward_queue_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxUpwardQueueSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 203u8, 170u8, 21u8, 149u8, 170u8, 246u8, 91u8, 54u8, 197u8, + 91u8, 41u8, 114u8, 210u8, 239u8, 73u8, 236u8, 68u8, 194u8, + 157u8, 116u8, 229u8, 1u8, 34u8, 135u8, 144u8, 191u8, 56u8, + 77u8, 13u8, 92u8, 221u8, 4u8, + ] + { + let call = SetMaxUpwardQueueSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the critical downward message size."] + pub fn set_max_downward_message_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxDownwardMessageSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 55u8, 181u8, 6u8, 126u8, 31u8, 154u8, 42u8, 194u8, 64u8, + 23u8, 34u8, 255u8, 151u8, 186u8, 52u8, 32u8, 168u8, 233u8, + 44u8, 35u8, 152u8, 78u8, 230u8, 242u8, 169u8, 85u8, 103u8, + 133u8, 177u8, 239u8, 175u8, 119u8, + ] + { + let call = SetMaxDownwardMessageSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] + pub fn set_ump_service_total_weight( + &self, + new: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetUmpServiceTotalWeight, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 14u8, 179u8, 217u8, 169u8, 84u8, 45u8, 193u8, 3u8, 7u8, + 196u8, 56u8, 209u8, 50u8, 148u8, 32u8, 205u8, 99u8, 202u8, + 72u8, 246u8, 151u8, 230u8, 145u8, 98u8, 188u8, 1u8, 136u8, + 241u8, 217u8, 37u8, 6u8, 101u8, + ] + { + let call = SetUmpServiceTotalWeight { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] + pub fn set_max_upward_message_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxUpwardMessageSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 134u8, 232u8, 5u8, 70u8, 81u8, 177u8, 81u8, 235u8, 93u8, + 145u8, 193u8, 42u8, 150u8, 61u8, 236u8, 20u8, 38u8, 176u8, + 124u8, 170u8, 248u8, 149u8, 57u8, 88u8, 17u8, 46u8, 202u8, + 74u8, 35u8, 82u8, 190u8, 223u8, + ] + { + let call = SetMaxUpwardMessageSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of messages that a candidate can contain."] + pub fn set_max_upward_message_num_per_candidate( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMaxUpwardMessageNumPerCandidate, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 14u8, 79u8, 128u8, 66u8, 119u8, 24u8, 26u8, 116u8, 249u8, + 254u8, 86u8, 228u8, 248u8, 75u8, 111u8, 90u8, 101u8, 96u8, + 124u8, 25u8, 245u8, 115u8, 119u8, 14u8, 213u8, 180u8, 224u8, + 224u8, 188u8, 172u8, 152u8, 16u8, + ] + { + let call = SetMaxUpwardMessageNumPerCandidate { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] + pub fn set_hrmp_open_request_ttl( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpOpenRequestTtl, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 168u8, 254u8, 189u8, 22u8, 61u8, 90u8, 131u8, 1u8, 103u8, + 208u8, 179u8, 85u8, 80u8, 215u8, 9u8, 3u8, 34u8, 73u8, 130u8, + 19u8, 166u8, 77u8, 131u8, 148u8, 183u8, 86u8, 186u8, 148u8, + 109u8, 173u8, 74u8, 94u8, + ] + { + let call = SetHrmpOpenRequestTtl { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] + pub fn set_hrmp_sender_deposit( + &self, + new: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpSenderDeposit, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 250u8, 23u8, 196u8, 206u8, 34u8, 86u8, 28u8, 14u8, 110u8, + 189u8, 38u8, 39u8, 2u8, 16u8, 212u8, 32u8, 65u8, 249u8, + 120u8, 163u8, 89u8, 232u8, 3u8, 49u8, 155u8, 174u8, 96u8, + 21u8, 240u8, 185u8, 140u8, 243u8, + ] + { + let call = SetHrmpSenderDeposit { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] + #[doc = "channel."] + pub fn set_hrmp_recipient_deposit( + &self, + new: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpRecipientDeposit, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 104u8, 35u8, 129u8, 31u8, 111u8, 57u8, 190u8, 42u8, 159u8, + 220u8, 86u8, 136u8, 200u8, 4u8, 62u8, 241u8, 141u8, 90u8, + 200u8, 132u8, 141u8, 154u8, 117u8, 206u8, 79u8, 160u8, 124u8, + 186u8, 231u8, 250u8, 86u8, 87u8, + ] + { + let call = SetHrmpRecipientDeposit { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] + pub fn set_hrmp_channel_max_capacity( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpChannelMaxCapacity, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 211u8, 49u8, 82u8, 59u8, 16u8, 97u8, 253u8, 64u8, 185u8, + 216u8, 235u8, 10u8, 84u8, 194u8, 231u8, 115u8, 153u8, 20u8, + 31u8, 86u8, 47u8, 226u8, 245u8, 214u8, 134u8, 194u8, 13u8, + 254u8, 230u8, 66u8, 54u8, 240u8, + ] + { + let call = SetHrmpChannelMaxCapacity { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] + pub fn set_hrmp_channel_max_total_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpChannelMaxTotalSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 254u8, 196u8, 171u8, 29u8, 208u8, 179u8, 204u8, 58u8, 64u8, + 41u8, 52u8, 73u8, 153u8, 245u8, 29u8, 132u8, 129u8, 29u8, + 94u8, 241u8, 136u8, 20u8, 12u8, 20u8, 255u8, 244u8, 252u8, + 98u8, 136u8, 222u8, 7u8, 19u8, + ] + { + let call = SetHrmpChannelMaxTotalSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] + pub fn set_hrmp_max_parachain_inbound_channels( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpMaxParachainInboundChannels, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 219u8, 88u8, 3u8, 249u8, 16u8, 182u8, 182u8, 233u8, 152u8, + 24u8, 29u8, 96u8, 227u8, 50u8, 156u8, 98u8, 71u8, 196u8, + 158u8, 103u8, 114u8, 55u8, 65u8, 199u8, 211u8, 225u8, 235u8, + 172u8, 218u8, 123u8, 158u8, 57u8, + ] + { + let call = SetHrmpMaxParachainInboundChannels { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] + pub fn set_hrmp_max_parathread_inbound_channels( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpMaxParathreadInboundChannels, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 153u8, 169u8, 153u8, 141u8, 45u8, 21u8, 26u8, 33u8, 207u8, + 234u8, 186u8, 154u8, 12u8, 148u8, 2u8, 226u8, 55u8, 125u8, + 58u8, 127u8, 154u8, 176u8, 3u8, 47u8, 164u8, 63u8, 25u8, + 42u8, 66u8, 131u8, 143u8, 254u8, + ] + { + let call = SetHrmpMaxParathreadInboundChannels { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] + pub fn set_hrmp_channel_max_message_size( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpChannelMaxMessageSize, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 237u8, 103u8, 126u8, 197u8, 164u8, 247u8, 67u8, 144u8, 30u8, + 192u8, 161u8, 243u8, 254u8, 26u8, 254u8, 33u8, 59u8, 216u8, + 159u8, 105u8, 166u8, 138u8, 38u8, 124u8, 248u8, 81u8, 11u8, + 223u8, 120u8, 75u8, 176u8, 177u8, + ] + { + let call = SetHrmpChannelMaxMessageSize { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] + pub fn set_hrmp_max_parachain_outbound_channels( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpMaxParachainOutboundChannels, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 173u8, 184u8, 49u8, 66u8, 158u8, 142u8, 95u8, 225u8, 90u8, + 171u8, 4u8, 20u8, 210u8, 180u8, 54u8, 236u8, 60u8, 5u8, 76u8, + 173u8, 226u8, 203u8, 7u8, 156u8, 54u8, 9u8, 198u8, 171u8, + 250u8, 1u8, 120u8, 240u8, + ] + { + let call = SetHrmpMaxParachainOutboundChannels { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] + pub fn set_hrmp_max_parathread_outbound_channels( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpMaxParathreadOutboundChannels, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 166u8, 73u8, 121u8, 53u8, 27u8, 77u8, 150u8, 115u8, 29u8, + 202u8, 34u8, 4u8, 35u8, 161u8, 113u8, 15u8, 66u8, 60u8, + 214u8, 129u8, 157u8, 143u8, 227u8, 134u8, 213u8, 9u8, 231u8, + 224u8, 187u8, 36u8, 16u8, 68u8, + ] + { + let call = SetHrmpMaxParathreadOutboundChannels { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] + pub fn set_hrmp_max_message_num_per_candidate( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetHrmpMaxMessageNumPerCandidate, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 235u8, 47u8, 114u8, 29u8, 87u8, 198u8, 62u8, 200u8, 235u8, + 184u8, 204u8, 35u8, 251u8, 210u8, 88u8, 150u8, 22u8, 61u8, + 242u8, 196u8, 240u8, 76u8, 45u8, 54u8, 155u8, 111u8, 244u8, + 31u8, 158u8, 48u8, 68u8, 233u8, + ] + { + let call = SetHrmpMaxMessageNumPerCandidate { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the maximum amount of weight any individual upward message may consume."] + pub fn set_ump_max_individual_weight( + &self, + new: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetUmpMaxIndividualWeight, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 61u8, 174u8, 42u8, 53u8, 120u8, 56u8, 252u8, 117u8, 173u8, + 223u8, 100u8, 141u8, 209u8, 29u8, 173u8, 240u8, 180u8, 113u8, + 27u8, 24u8, 4u8, 157u8, 107u8, 247u8, 235u8, 121u8, 152u8, + 6u8, 176u8, 254u8, 18u8, 70u8, + ] + { + let call = SetUmpMaxIndividualWeight { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] + pub fn set_pvf_checking_enabled( + &self, + new: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetPvfCheckingEnabled, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 224u8, 199u8, 197u8, 208u8, 178u8, 211u8, 14u8, 102u8, 174u8, + 205u8, 207u8, 181u8, 75u8, 125u8, 209u8, 69u8, 85u8, 1u8, + 98u8, 251u8, 17u8, 42u8, 73u8, 9u8, 252u8, 184u8, 81u8, + 202u8, 132u8, 236u8, 97u8, 121u8, + ] + { + let call = SetPvfCheckingEnabled { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] + pub fn set_pvf_voting_ttl( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetPvfVotingTtl, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 179u8, 71u8, 42u8, 140u8, 187u8, 43u8, 138u8, 16u8, 104u8, + 41u8, 30u8, 220u8, 131u8, 179u8, 200u8, 184u8, 105u8, 58u8, + 131u8, 225u8, 169u8, 253u8, 46u8, 186u8, 102u8, 52u8, 147u8, + 244u8, 22u8, 255u8, 41u8, 6u8, + ] + { + let call = SetPvfVotingTtl { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] + #[doc = "upgrade taking place."] + #[doc = ""] + #[doc = "See the field documentation for information and constraints for the new value."] + pub fn set_minimum_validation_upgrade_delay( + &self, + new: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMinimumValidationUpgradeDelay, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 225u8, 178u8, 41u8, 194u8, 154u8, 222u8, 247u8, 129u8, 35u8, + 102u8, 248u8, 144u8, 21u8, 74u8, 42u8, 239u8, 135u8, 205u8, + 173u8, 190u8, 112u8, 30u8, 240u8, 106u8, 10u8, 217u8, 208u8, + 11u8, 79u8, 47u8, 198u8, 37u8, + ] + { + let call = SetMinimumValidationUpgradeDelay { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Setting this to true will disable consistency checks for the configuration setters."] + #[doc = "Use with caution."] + pub fn set_bypass_consistency_check( + &self, + new: ::core::primitive::bool, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetBypassConsistencyCheck, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 5u8, 54u8, 178u8, 218u8, 46u8, 61u8, 99u8, 23u8, 227u8, + 202u8, 201u8, 164u8, 121u8, 226u8, 65u8, 253u8, 29u8, 164u8, + 170u8, 130u8, 32u8, 85u8, 222u8, 10u8, 232u8, 252u8, 73u8, + 23u8, 69u8, 30u8, 1u8, 87u8, + ] + { + let call = SetBypassConsistencyCheck { new }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct ActiveConfig; + impl ::subxt::StorageEntry for ActiveConfig { + const PALLET: &'static str = "Configuration"; + const STORAGE: &'static str = "ActiveConfig"; + type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct PendingConfig<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for PendingConfig<'_> { + const PALLET: &'static str = "Configuration"; + const STORAGE: &'static str = "PendingConfig"; + type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: migration :: v1 :: HostConfiguration < :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PendingConfigs; + impl ::subxt::StorageEntry for PendingConfigs { + const PALLET: &'static str = "Configuration"; + const STORAGE: &'static str = "PendingConfigs"; + type Value = :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct BypassConsistencyCheck; + impl ::subxt::StorageEntry for BypassConsistencyCheck { + const PALLET: &'static str = "Configuration"; + const STORAGE: &'static str = "BypassConsistencyCheck"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The active configuration for the current session."] pub 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 >{ + if self.client.metadata().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 = " Pending configuration (if any) for the next session."] + #[doc = ""] + #[doc = " DEPRECATED: This is no longer used, and will be removed in the future."] pub async fn pending_config (& self , _0 : & :: core :: primitive :: u32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: configuration :: migration :: v1 :: HostConfiguration < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ + if self.client.metadata().storage_hash::()? + == [ + 152u8, 192u8, 135u8, 74u8, 174u8, 47u8, 192u8, 95u8, 147u8, + 137u8, 41u8, 219u8, 149u8, 198u8, 186u8, 16u8, 158u8, 160u8, + 51u8, 31u8, 187u8, 244u8, 112u8, 238u8, 194u8, 85u8, 198u8, + 73u8, 148u8, 62u8, 74u8, 6u8, + ] + { + let entry = PendingConfig(_0); + self.client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Pending configuration (if any) for the next session."] + #[doc = ""] + #[doc = " DEPRECATED: This is no longer used, and will be removed in the future."] + pub async fn pending_config_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, PendingConfig<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().storage_hash::()? + == [ + 152u8, 192u8, 135u8, 74u8, 174u8, 47u8, 192u8, 95u8, 147u8, + 137u8, 41u8, 219u8, 149u8, 198u8, 186u8, 16u8, 158u8, 160u8, + 51u8, 31u8, 187u8, 244u8, 112u8, 238u8, 194u8, 85u8, 198u8, + 73u8, 148u8, 62u8, 74u8, 6u8, + ] + { + self.client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Pending configuration changes."] + #[doc = ""] + #[doc = " This is a list of configuration changes, each with a session index at which it should"] + #[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 >{ + if self.client.metadata().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 = " 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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + } + } + } + pub mod paras_shared { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct CurrentSessionIndex; + impl ::subxt::StorageEntry for CurrentSessionIndex { + const PALLET: &'static str = "ParasShared"; + const STORAGE: &'static str = "CurrentSessionIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ActiveValidatorIndices; + impl ::subxt::StorageEntry for ActiveValidatorIndices { + const PALLET: &'static str = "ParasShared"; + const STORAGE: &'static str = "ActiveValidatorIndices"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ActiveValidatorKeys; + impl ::subxt::StorageEntry for ActiveValidatorKeys { + const PALLET: &'static str = "ParasShared"; + const STORAGE: &'static str = "ActiveValidatorKeys"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::validator_app::Public, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The current session index."] + pub async fn current_session_index( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[doc = " All the validators actively participating in parachain consensus."] + #[doc = " Indices are into the broader validator set."] + pub async fn active_validator_indices( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::validator_app::Public, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + } + } + } + pub mod para_inclusion { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + } + } + pub type Event = + runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A candidate was backed. `[candidate, head_data]`"] + pub struct CandidateBacked( + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v2::CoreIndex, + pub runtime_types::polkadot_primitives::v2::GroupIndex, + ); + impl ::subxt::Event for CandidateBacked { + const PALLET: &'static str = "ParaInclusion"; + const EVENT: &'static str = "CandidateBacked"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A candidate was included. `[candidate, head_data]`"] + pub struct CandidateIncluded( + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v2::CoreIndex, + pub runtime_types::polkadot_primitives::v2::GroupIndex, + ); + impl ::subxt::Event for CandidateIncluded { + const PALLET: &'static str = "ParaInclusion"; + const EVENT: &'static str = "CandidateIncluded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A candidate timed out. `[candidate, head_data]`"] + pub struct CandidateTimedOut( + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v2::CoreIndex, + ); + impl ::subxt::Event for CandidateTimedOut { + const PALLET: &'static str = "ParaInclusion"; + const EVENT: &'static str = "CandidateTimedOut"; + } + } + pub mod storage { + use super::runtime_types; + pub struct AvailabilityBitfields<'a>( + pub &'a runtime_types::polkadot_primitives::v2::ValidatorIndex, + ); + impl ::subxt::StorageEntry for AvailabilityBitfields<'_> { + const PALLET: &'static str = "ParaInclusion"; + const STORAGE: &'static str = "AvailabilityBitfields"; + type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PendingAvailability<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for PendingAvailability<'_> { + const PALLET: &'static str = "ParaInclusion"; + const STORAGE: &'static str = "PendingAvailability"; + type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PendingAvailabilityCommitments<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for PendingAvailabilityCommitments<'_> { + const PALLET: &'static str = "ParaInclusion"; + const STORAGE: &'static str = "PendingAvailabilityCommitments"; + type Value = runtime_types::polkadot_primitives::v2::CandidateCommitments< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] pub 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 >{ + if self + .client + .metadata() + .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 async fn availability_bitfields_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, AvailabilityBitfields<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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 >{ + if self + .client + .metadata() + .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 async fn pending_availability_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, PendingAvailability<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The commitments of candidates pending availability, by `ParaId`."] + pub async fn pending_availability_commitments( + &self, + _0: &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, + >, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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 mod para_inherent { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Enter { + pub data: runtime_types::polkadot_primitives::v2::InherentData< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + } + impl ::subxt::Call for Enter { + const PALLET: &'static str = "ParaInherent"; + const FUNCTION: &'static str = "enter"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] + pub fn enter( + &self, + data: runtime_types::polkadot_primitives::v2::InherentData< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Enter, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 208u8, 134u8, 126u8, 30u8, 50u8, 219u8, 225u8, 133u8, 3u8, + 2u8, 121u8, 154u8, 133u8, 141u8, 159u8, 193u8, 66u8, 252u8, + 236u8, 234u8, 38u8, 169u8, 202u8, 154u8, 28u8, 171u8, 248u8, + 77u8, 31u8, 114u8, 21u8, 215u8, + ] + { + let call = Enter { data }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct Included; + impl ::subxt::StorageEntry for Included { + const PALLET: &'static str = "ParaInherent"; + const STORAGE: &'static str = "Included"; + type Value = (); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct OnChainVotes; + impl ::subxt::StorageEntry for OnChainVotes { + const PALLET: &'static str = "ParaInherent"; + const STORAGE: &'static str = "OnChainVotes"; + type Value = runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Whether the paras inherent was included within this block."] + #[doc = ""] + #[doc = " The `Option<()>` is effectively a `bool`, but it never hits storage in the `None` variant"] + #[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> + { + if self.client.metadata().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()) + } + } + #[doc = " Scraped on chain data for extracting resolved disputes as well as backing votes."] + pub async 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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + } + pub mod para_scheduler { + use super::{ + root_mod, + runtime_types, + }; + pub mod storage { + use super::runtime_types; + pub struct ValidatorGroups; + impl ::subxt::StorageEntry for ValidatorGroups { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "ValidatorGroups"; + type Value = ::std::vec::Vec< + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParathreadQueue; + impl ::subxt::StorageEntry for ParathreadQueue { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "ParathreadQueue"; + type Value = runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct AvailabilityCores; + impl ::subxt::StorageEntry for AvailabilityCores { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "AvailabilityCores"; + type Value = ::std::vec::Vec< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::CoreOccupied, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParathreadClaimIndex; + impl ::subxt::StorageEntry for ParathreadClaimIndex { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "ParathreadClaimIndex"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SessionStartBlock; + impl ::subxt::StorageEntry for SessionStartBlock { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "SessionStartBlock"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Scheduled; + impl ::subxt::StorageEntry for Scheduled { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "Scheduled"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " All the validator groups. One for each core. Indices are into `ActiveValidators` - not the"] + #[doc = " broader set of Polkadot validators, but instead just the subset used for parachains during"] + #[doc = " this session."] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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 >{ + if self.client.metadata().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 = " One entry for each availability core. Entries are `None` if the core is not currently occupied. Can be"] + #[doc = " temporarily `Some` if scheduled but not occupied."] + #[doc = " The i'th parachain belongs to the i'th core, with the remaining cores all being"] + #[doc = " parathread-multiplexers."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::CoreOccupied, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The block number where the session start occurred. Used to track how many group rotations have occurred."] + #[doc = ""] + #[doc = " Note that in the context of parachains modules the session change is signaled during"] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Currently scheduled cores - free but up to be occupied."] + #[doc = ""] + #[doc = " Bounded by the number of cores: one for each parachain and parathread multiplexer."] + #[doc = ""] + #[doc = " The value contained here will not be valid after the end of a block. Runtime APIs should be used to determine scheduled cores/"] + #[doc = " for the upcoming block."] pub 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 >{ + if self.client.metadata().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()) + } + } + } + } + } + pub mod paras { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceSetCurrentCode { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + } + impl ::subxt::Call for ForceSetCurrentCode { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "force_set_current_code"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceSetCurrentHead { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, + } + impl ::subxt::Call for ForceSetCurrentHead { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "force_set_current_head"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceScheduleCodeUpgrade { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + pub relay_parent_number: ::core::primitive::u32, + } + impl ::subxt::Call for ForceScheduleCodeUpgrade { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "force_schedule_code_upgrade"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNoteNewHead { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, + } + impl ::subxt::Call for ForceNoteNewHead { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "force_note_new_head"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceQueueAction { + pub para: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for ForceQueueAction { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "force_queue_action"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddTrustedValidationCode { + pub validation_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + } + impl ::subxt::Call for AddTrustedValidationCode { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "add_trusted_validation_code"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PokeUnusedValidationCode { + pub validation_code_hash: + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + } + impl ::subxt::Call for PokeUnusedValidationCode { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "poke_unused_validation_code"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IncludePvfCheckStatement { + pub stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, + pub signature: + runtime_types::polkadot_primitives::v2::validator_app::Signature, + } + impl ::subxt::Call for IncludePvfCheckStatement { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "include_pvf_check_statement"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Set the storage for the parachain validation code immediately."] + pub fn force_set_current_code( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceSetCurrentCode, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 100u8, 36u8, 105u8, 246u8, 77u8, 252u8, 162u8, 139u8, 60u8, + 37u8, 12u8, 148u8, 206u8, 160u8, 134u8, 105u8, 50u8, 52u8, + 156u8, 252u8, 217u8, 174u8, 211u8, 208u8, 88u8, 81u8, 236u8, + 66u8, 27u8, 59u8, 126u8, 5u8, + ] + { + let call = ForceSetCurrentCode { para, new_code }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set the storage for the current parachain head data immediately."] + pub fn force_set_current_head( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_head: runtime_types::polkadot_parachain::primitives::HeadData, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceSetCurrentHead, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 119u8, 46u8, 120u8, 202u8, 138u8, 190u8, 179u8, 78u8, 155u8, + 167u8, 220u8, 233u8, 170u8, 248u8, 202u8, 92u8, 73u8, 246u8, + 224u8, 56u8, 208u8, 124u8, 215u8, 19u8, 235u8, 246u8, 89u8, + 189u8, 19u8, 205u8, 22u8, 70u8, + ] + { + let call = ForceSetCurrentHead { para, new_head }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] + pub fn force_schedule_code_upgrade( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + relay_parent_number: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceScheduleCodeUpgrade, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 254u8, 60u8, 105u8, 37u8, 116u8, 190u8, 30u8, 255u8, 210u8, + 24u8, 120u8, 99u8, 174u8, 215u8, 233u8, 83u8, 57u8, 200u8, + 24u8, 49u8, 220u8, 12u8, 103u8, 30u8, 165u8, 10u8, 125u8, + 255u8, 88u8, 134u8, 199u8, 3u8, + ] + { + let call = ForceScheduleCodeUpgrade { + para, + new_code, + relay_parent_number, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Note a new block head for para within the context of the current block."] + pub fn force_note_new_head( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_head: runtime_types::polkadot_parachain::primitives::HeadData, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceNoteNewHead, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 203u8, 31u8, 68u8, 125u8, 105u8, 218u8, 177u8, 205u8, 248u8, + 131u8, 25u8, 170u8, 140u8, 56u8, 183u8, 106u8, 2u8, 118u8, + 79u8, 22u8, 228u8, 91u8, 33u8, 66u8, 245u8, 144u8, 147u8, + 142u8, 14u8, 171u8, 125u8, 233u8, + ] + { + let call = ForceNoteNewHead { para, new_head }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Put a parachain directly into the next session's action queue."] + #[doc = "We can't queue it any sooner than this without going into the"] + #[doc = "initializer..."] + pub fn force_queue_action( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceQueueAction, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 141u8, 235u8, 245u8, 93u8, 24u8, 155u8, 106u8, 136u8, 190u8, + 236u8, 216u8, 131u8, 245u8, 5u8, 186u8, 131u8, 159u8, 240u8, + 95u8, 139u8, 231u8, 12u8, 255u8, 74u8, 194u8, 13u8, 112u8, + 78u8, 110u8, 95u8, 26u8, 133u8, + ] + { + let call = ForceQueueAction { para }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Adds the validation code to the storage."] + #[doc = ""] + #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] + #[doc = "is running for that code, it will be instantly accepted."] + #[doc = ""] + #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] + #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] + #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] + #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] + #[doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] + #[doc = ""] + #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] + #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] + pub fn add_trusted_validation_code( + &self, + validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddTrustedValidationCode, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 110u8, 255u8, 249u8, 176u8, 109u8, 54u8, 87u8, 19u8, 7u8, + 62u8, 220u8, 143u8, 196u8, 99u8, 66u8, 49u8, 18u8, 225u8, + 14u8, 42u8, 243u8, 228u8, 232u8, 207u8, 246u8, 34u8, 179u8, + 127u8, 246u8, 239u8, 30u8, 214u8, + ] + { + let call = AddTrustedValidationCode { validation_code }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove the validation code from the storage iff the reference count is 0."] + #[doc = ""] + #[doc = "This is better than removing the storage directly, because it will not remove the code"] + #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] + #[doc = "dispatching."] + pub fn poke_unused_validation_code( + &self, + validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + PokeUnusedValidationCode, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 159u8, 142u8, 14u8, 7u8, 29u8, 74u8, 213u8, 165u8, 206u8, + 45u8, 135u8, 121u8, 0u8, 146u8, 217u8, 59u8, 189u8, 120u8, + 169u8, 227u8, 225u8, 135u8, 15u8, 45u8, 197u8, 201u8, 29u8, + 128u8, 49u8, 165u8, 106u8, 80u8, + ] + { + let call = PokeUnusedValidationCode { + validation_code_hash, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] + #[doc = "enacts the results if that was the last vote before achieving the supermajority."] + pub fn include_pvf_check_statement( + &self, + stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, + signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + IncludePvfCheckStatement, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 187u8, 231u8, 113u8, 29u8, 177u8, 92u8, 2u8, 116u8, 88u8, + 114u8, 19u8, 170u8, 167u8, 254u8, 149u8, 142u8, 24u8, 57u8, + 187u8, 210u8, 72u8, 239u8, 32u8, 75u8, 39u8, 47u8, 158u8, + 205u8, 82u8, 50u8, 175u8, 31u8, + ] + { + let call = IncludePvfCheckStatement { stmt, signature }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Current code has been updated for a Para. `para_id`"] + pub struct CurrentCodeUpdated( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for CurrentCodeUpdated { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "CurrentCodeUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Current head has been updated for a Para. `para_id`"] + pub struct CurrentHeadUpdated( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for CurrentHeadUpdated { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "CurrentHeadUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A code upgrade has been scheduled for a Para. `para_id`"] + pub struct CodeUpgradeScheduled( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for CodeUpgradeScheduled { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "CodeUpgradeScheduled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A new head has been noted for a Para. `para_id`"] + pub struct NewHeadNoted( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for NewHeadNoted { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "NewHeadNoted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A para has been queued to execute pending actions. `para_id`"] + pub struct ActionQueued( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for ActionQueued { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "ActionQueued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] + #[doc = "code. `code_hash` `para_id`"] + pub struct PvfCheckStarted( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for PvfCheckStarted { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "PvfCheckStarted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The given validation code was accepted by the PVF pre-checking vote."] + #[doc = "`code_hash` `para_id`"] + pub struct PvfCheckAccepted( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for PvfCheckAccepted { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "PvfCheckAccepted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The given validation code was rejected by the PVF pre-checking vote."] + #[doc = "`code_hash` `para_id`"] + pub struct PvfCheckRejected( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for PvfCheckRejected { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "PvfCheckRejected"; + } + } + pub mod storage { + use super::runtime_types; + pub struct PvfActiveVoteMap<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + ); + impl ::subxt::StorageEntry for PvfActiveVoteMap<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "PvfActiveVoteMap"; + type Value = runtime_types :: polkadot_runtime_parachains :: paras :: PvfCheckActiveVoteState < :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PvfActiveVoteList; + impl ::subxt::StorageEntry for PvfActiveVoteList { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "PvfActiveVoteList"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Parachains; + impl ::subxt::StorageEntry for Parachains { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "Parachains"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParaLifecycles<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for ParaLifecycles<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "ParaLifecycles"; + type Value = + runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Heads<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for Heads<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "Heads"; + type Value = runtime_types::polkadot_parachain::primitives::HeadData; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CurrentCodeHash<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for CurrentCodeHash<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "CurrentCodeHash"; + type Value = + runtime_types::polkadot_parachain::primitives::ValidationCodeHash; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PastCodeHash<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + pub &'a ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for PastCodeHash<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "PastCodeHash"; + type Value = + runtime_types::polkadot_parachain::primitives::ValidationCodeHash; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &(&self.0, &self.1), + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PastCodeMeta<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for PastCodeMeta<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "PastCodeMeta"; + type Value = + runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PastCodePruning; + impl ::subxt::StorageEntry for PastCodePruning { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "PastCodePruning"; + type Value = ::std::vec::Vec<( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct FutureCodeUpgrades<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for FutureCodeUpgrades<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "FutureCodeUpgrades"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct FutureCodeHash<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for FutureCodeHash<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "FutureCodeHash"; + type Value = + runtime_types::polkadot_parachain::primitives::ValidationCodeHash; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct UpgradeGoAheadSignal<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for UpgradeGoAheadSignal<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "UpgradeGoAheadSignal"; + type Value = runtime_types::polkadot_primitives::v2::UpgradeGoAhead; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct UpgradeRestrictionSignal<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for UpgradeRestrictionSignal<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "UpgradeRestrictionSignal"; + type Value = runtime_types::polkadot_primitives::v2::UpgradeRestriction; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct UpgradeCooldowns; + impl ::subxt::StorageEntry for UpgradeCooldowns { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "UpgradeCooldowns"; + type Value = ::std::vec::Vec<( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UpcomingUpgrades; + impl ::subxt::StorageEntry for UpcomingUpgrades { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "UpcomingUpgrades"; + type Value = ::std::vec::Vec<( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ActionsQueue<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ActionsQueue<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "ActionsQueue"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct UpcomingParasGenesis<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for UpcomingParasGenesis<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "UpcomingParasGenesis"; + type Value = + runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CodeByHashRefs<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + ); + impl ::subxt::StorageEntry for CodeByHashRefs<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "CodeByHashRefs"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct CodeByHash<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + ); + impl ::subxt::StorageEntry for CodeByHash<'_> { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "CodeByHash"; + type Value = + runtime_types::polkadot_parachain::primitives::ValidationCode; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[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 >{ + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 = " All parachains. Ordered ascending by `ParaId`. Parathreads are not included."] + #[doc = ""] + #[doc = " Consider using the [`ParachainsCache`] type of modifying."] + pub async fn parachains( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 async fn para_lifecycles_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ParaLifecycles<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The head-data of every registered para."] + pub async fn heads( + &self, + _0: &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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Which paras have past code that needs pruning and the relay-chain block at which the code was replaced."] + #[doc = " Note that this is the actual height of the included block, not the expected height at which the"] + #[doc = " code upgrade would be applied, although they may be equal."] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] + #[doc = ""] + #[doc = " This value is absent when there are no upgrades scheduled or during the time the relay chain"] + #[doc = " performs the checks. It is set at the first relay-chain block when the corresponding parachain"] + #[doc = " can switch its upgrade function. As soon as the parachain's block is included, the value"] + #[doc = " gets reset to `None`."] + #[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( + &self, + _0: &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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade procedure."] + #[doc = ""] + #[doc = " This value is absent when there are no upgrades scheduled or during the time the relay chain"] + #[doc = " performs the checks. It is set at the first relay-chain block when the corresponding parachain"] + #[doc = " can switch its upgrade function. As soon as the parachain's block is included, the value"] + #[doc = " gets reset to `None`."] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] + #[doc = " an upgrade for this parachain."] + #[doc = ""] + #[doc = " This may be a because the parachain waits for the upgrade cooldown to expire. Another"] + #[doc = " potential use case is when we want to perform some maintenance (such as storage migration)"] + #[doc = " we could restrict upgrades to make the process simpler."] + #[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( + &self, + _0: &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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] + #[doc = " an upgrade for this parachain."] + #[doc = ""] + #[doc = " This may be a because the parachain waits for the upgrade cooldown to expire. Another"] + #[doc = " potential use case is when we want to perform some maintenance (such as storage migration)"] + #[doc = " we could restrict upgrades to make the process simpler."] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The actions to perform during the start of a specific session index."] + pub async fn actions_queue( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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 >{ + if self + .client + .metadata() + .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 = " 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] + pub async fn code_by_hash_refs( + &self, + _0 : & runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0 : & 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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn unsigned_priority( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Paras", "UnsignedPriority")? + == [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, + 190u8, 146u8, 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, + 65u8, 18u8, 191u8, 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, + 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, + ] + { + let pallet = self.client.metadata().pallet("Paras")?; + let constant = pallet.constant("UnsignedPriority")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod initializer { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct ForceApprove { + pub up_to: ::core::primitive::u32, + } + impl ::subxt::Call for ForceApprove { + const PALLET: &'static str = "Initializer"; + const FUNCTION: &'static str = "force_approve"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] + #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] + #[doc = "chain are valid and should be finalized."] + pub fn force_approve( + &self, + up_to: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceApprove, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 61u8, 29u8, 75u8, 222u8, 82u8, 250u8, 124u8, 164u8, 70u8, + 114u8, 150u8, 28u8, 103u8, 53u8, 185u8, 147u8, 168u8, 239u8, + 207u8, 197u8, 23u8, 158u8, 16u8, 255u8, 139u8, 18u8, 214u8, + 174u8, 53u8, 191u8, 49u8, 73u8, + ] + { + let call = ForceApprove { up_to }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct HasInitialized; + impl ::subxt::StorageEntry for HasInitialized { + const PALLET: &'static str = "Initializer"; + const STORAGE: &'static str = "HasInitialized"; + type Value = (); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct BufferedSessionChanges; + impl ::subxt::StorageEntry for BufferedSessionChanges { + const PALLET: &'static str = "Initializer"; + const STORAGE: &'static str = "BufferedSessionChanges"; + type Value = :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Whether the parachains modules have been initialized within this block."] + #[doc = ""] + #[doc = " Semantically a `bool`, but this guarantees it should never hit the trie,"] + #[doc = " as this is cleared in `on_finalize` and Frame optimizes `None` values to be empty values."] + #[doc = ""] + #[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> + { + if self.client.metadata().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()) + } + } + #[doc = " Buffered session changes along with the block number at which they should be applied."] + #[doc = ""] + #[doc = " Typically this will be empty or one element long. Apart from that this item never hits"] + #[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 >{ + if self + .client + .metadata() + .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()) + } + } + } + } + } + pub mod dmp { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct DownwardMessageQueues<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for DownwardMessageQueues<'_> { + const PALLET: &'static str = "Dmp"; + const STORAGE: &'static str = "DownwardMessageQueues"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_core_primitives::InboundDownwardMessage< + ::core::primitive::u32, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct DownwardMessageQueueHeads<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for DownwardMessageQueueHeads<'_> { + const PALLET: &'static str = "Dmp"; + const STORAGE: &'static str = "DownwardMessageQueueHeads"; + type Value = ::subxt::sp_core::H256; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The downward messages addressed for a certain para."] + pub 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, + > { + if self + .client + .metadata() + .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 async fn downward_message_queues_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, DownwardMessageQueues<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " A mapping that stores the downward message queue MQC head for each para."] + #[doc = ""] + #[doc = " Each link in this chain has a form:"] + #[doc = " `(prev_head, B, H(M))`, where"] + #[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( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[doc = " A mapping that stores the downward message queue MQC head for each para."] + #[doc = ""] + #[doc = " Each link in this chain has a form:"] + #[doc = " `(prev_head, B, H(M))`, where"] + #[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, + > { + if self + .client + .metadata() + .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 mod ump { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ServiceOverweight { + pub index: ::core::primitive::u64, + pub weight_limit: ::core::primitive::u64, + } + impl ::subxt::Call for ServiceOverweight { + const PALLET: &'static str = "Ump"; + const FUNCTION: &'static str = "service_overweight"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Service a single overweight upward message."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] + #[doc = "- `index`: The index of the overweight message to service."] + #[doc = "- `weight_limit`: The amount of weight that message execution may take."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `UnknownMessageIndex`: Message of `index` is unknown."] + #[doc = "- `WeightOverLimit`: Message execution may use greater than `weight_limit`."] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OverweightServiced`: On success."] + pub fn service_overweight( + &self, + index: ::core::primitive::u64, + weight_limit: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ServiceOverweight, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 229u8, 167u8, 106u8, 63u8, 141u8, 80u8, 8u8, 201u8, 156u8, + 34u8, 47u8, 104u8, 116u8, 57u8, 35u8, 216u8, 132u8, 3u8, + 201u8, 169u8, 38u8, 107u8, 149u8, 120u8, 42u8, 130u8, 100u8, + 133u8, 214u8, 48u8, 99u8, 146u8, + ] + { + let call = ServiceOverweight { + index, + weight_limit, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Upward message is invalid XCM."] + #[doc = "\\[ id \\]"] + pub struct InvalidFormat(pub [::core::primitive::u8; 32usize]); + impl ::subxt::Event for InvalidFormat { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "InvalidFormat"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Upward message is unsupported version of XCM."] + #[doc = "\\[ id \\]"] + pub struct UnsupportedVersion(pub [::core::primitive::u8; 32usize]); + impl ::subxt::Event for UnsupportedVersion { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "UnsupportedVersion"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Upward message executed with the given outcome."] + #[doc = "\\[ id, outcome \\]"] + pub struct ExecutedUpward( + pub [::core::primitive::u8; 32usize], + pub runtime_types::xcm::v2::traits::Outcome, + ); + impl ::subxt::Event for ExecutedUpward { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "ExecutedUpward"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The weight limit for handling upward messages was reached."] + #[doc = "\\[ id, remaining, required \\]"] + pub struct WeightExhausted( + pub [::core::primitive::u8; 32usize], + pub ::core::primitive::u64, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for WeightExhausted { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "WeightExhausted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some upward messages have been received and will be processed."] + #[doc = "\\[ para, count, size \\]"] + pub struct UpwardMessagesReceived( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for UpwardMessagesReceived { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "UpwardMessagesReceived"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The weight budget was exceeded for an individual upward message."] + #[doc = ""] + #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] + #[doc = "using the assigned `overweight_index`."] + #[doc = ""] + #[doc = "\\[ para, id, overweight_index, required \\]"] + pub struct OverweightEnqueued( + pub runtime_types::polkadot_parachain::primitives::Id, + pub [::core::primitive::u8; 32usize], + pub ::core::primitive::u64, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for OverweightEnqueued { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "OverweightEnqueued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Upward message from the overweight queue was executed with the given actual weight"] + #[doc = "used."] + #[doc = ""] + #[doc = "\\[ overweight_index, used \\]"] + pub struct OverweightServiced( + pub ::core::primitive::u64, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for OverweightServiced { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "OverweightServiced"; + } + } + pub mod storage { + use super::runtime_types; + pub struct RelayDispatchQueues<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for RelayDispatchQueues<'_> { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "RelayDispatchQueues"; + type Value = ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct RelayDispatchQueueSize<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for RelayDispatchQueueSize<'_> { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "RelayDispatchQueueSize"; + type Value = (::core::primitive::u32, ::core::primitive::u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct NeedsDispatch; + impl ::subxt::StorageEntry for NeedsDispatch { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "NeedsDispatch"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextDispatchRoundStartWith; + impl ::subxt::StorageEntry for NextDispatchRoundStartWith { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "NextDispatchRoundStartWith"; + type Value = runtime_types::polkadot_parachain::primitives::Id; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Overweight<'a>(pub &'a ::core::primitive::u64); + impl ::subxt::StorageEntry for Overweight<'_> { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "Overweight"; + type Value = ( + runtime_types::polkadot_parachain::primitives::Id, + ::std::vec::Vec<::core::primitive::u8>, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct OverweightCount; + impl ::subxt::StorageEntry for OverweightCount { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "OverweightCount"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] + #[doc = ""] + #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] + #[doc = " channel management messages."] + #[doc = ""] + #[doc = " The messages are processed in FIFO order."] + pub async fn relay_dispatch_queues( + &self, + _0: &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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] + #[doc = ""] + #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] + #[doc = ""] + #[doc = " First item in the tuple is the count of messages and second"] + #[doc = " is the total length (in bytes) of the message payloads."] + #[doc = ""] + #[doc = " Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of"] + #[doc = " messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of"] + #[doc = " loading the whole message queue if only the total size and count are required."] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] + #[doc = ""] + #[doc = " First item in the tuple is the count of messages and second"] + #[doc = " is the total length (in bytes) of the message payloads."] + #[doc = ""] + #[doc = " Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of"] + #[doc = " messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of"] + #[doc = " loading the whole message queue if only the total size and count are required."] + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " This is the para that gets will get dispatched first during the next upward dispatchable queue"] + #[doc = " execution round."] + #[doc = ""] + #[doc = " Invariant:"] + #[doc = " - If `Some(para)`, then `para` must be present in `NeedsDispatch`."] + pub async 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The messages that exceeded max individual message weight budget."] + #[doc = ""] + #[doc = " These messages stay there until manually dispatched."] + pub async fn overweight( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The number of overweight messages ever recorded in `Overweight` (and thus the lowest free"] + #[doc = " index)."] + pub async fn overweight_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + } + } + } + pub mod hrmp { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct HrmpInitOpenChannel { + pub recipient: runtime_types::polkadot_parachain::primitives::Id, + pub proposed_max_capacity: ::core::primitive::u32, + pub proposed_max_message_size: ::core::primitive::u32, + } + impl ::subxt::Call for HrmpInitOpenChannel { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "hrmp_init_open_channel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct HrmpAcceptOpenChannel { + pub sender: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for HrmpAcceptOpenChannel { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "hrmp_accept_open_channel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct HrmpCloseChannel { + pub channel_id: + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + } + impl ::subxt::Call for HrmpCloseChannel { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "hrmp_close_channel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceCleanHrmp { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub inbound: ::core::primitive::u32, + pub outbound: ::core::primitive::u32, + } + impl ::subxt::Call for ForceCleanHrmp { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "force_clean_hrmp"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct ForceProcessHrmpOpen { + pub channels: ::core::primitive::u32, + } + impl ::subxt::Call for ForceProcessHrmpOpen { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "force_process_hrmp_open"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct ForceProcessHrmpClose { + pub channels: ::core::primitive::u32, + } + impl ::subxt::Call for ForceProcessHrmpClose { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "force_process_hrmp_close"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct HrmpCancelOpenRequest { + pub channel_id: + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + pub open_requests: ::core::primitive::u32, + } + impl ::subxt::Call for HrmpCancelOpenRequest { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "hrmp_cancel_open_request"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] + #[doc = "parameters."] + #[doc = ""] + #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] + #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] + #[doc = ""] + #[doc = "These numbers are a subject to the relay-chain configuration limits."] + #[doc = ""] + #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] + #[doc = "change."] + pub fn hrmp_init_open_channel( + &self, + recipient: runtime_types::polkadot_parachain::primitives::Id, + proposed_max_capacity: ::core::primitive::u32, + proposed_max_message_size: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + HrmpInitOpenChannel, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 244u8, 142u8, 161u8, 144u8, 109u8, 104u8, 164u8, 198u8, + 201u8, 79u8, 178u8, 136u8, 107u8, 104u8, 83u8, 11u8, 167u8, + 164u8, 223u8, 147u8, 135u8, 35u8, 133u8, 176u8, 236u8, 112u8, + 107u8, 131u8, 184u8, 105u8, 174u8, 12u8, + ] + { + let call = HrmpInitOpenChannel { + recipient, + proposed_max_capacity, + proposed_max_message_size, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Accept a pending open channel request from the given sender."] + #[doc = ""] + #[doc = "The channel will be opened only on the next session boundary."] + pub fn hrmp_accept_open_channel( + &self, + sender: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + HrmpAcceptOpenChannel, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 95u8, 196u8, 155u8, 220u8, 235u8, 120u8, 67u8, 247u8, 245u8, + 20u8, 162u8, 41u8, 4u8, 204u8, 125u8, 16u8, 224u8, 72u8, + 198u8, 237u8, 84u8, 46u8, 201u8, 17u8, 172u8, 55u8, 115u8, + 51u8, 16u8, 140u8, 4u8, 253u8, + ] + { + let call = HrmpAcceptOpenChannel { sender }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] + #[doc = "recipient in the channel being closed."] + #[doc = ""] + #[doc = "The closure can only happen on a session change."] + pub fn hrmp_close_channel( + &self, + channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + HrmpCloseChannel, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 199u8, 9u8, 55u8, 184u8, 196u8, 45u8, 46u8, 251u8, 48u8, + 23u8, 132u8, 74u8, 188u8, 121u8, 41u8, 18u8, 71u8, 65u8, + 129u8, 14u8, 38u8, 48u8, 253u8, 119u8, 171u8, 202u8, 9u8, + 65u8, 250u8, 98u8, 185u8, 220u8, + ] + { + let call = HrmpCloseChannel { channel_id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] + #[doc = "a para may have. Normally this happens once per session, but this allows"] + #[doc = "you to trigger the cleanup immediately for a specific parachain."] + #[doc = ""] + #[doc = "Origin must be Root."] + #[doc = ""] + #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] + pub fn force_clean_hrmp( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + inbound: ::core::primitive::u32, + outbound: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceCleanHrmp, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 182u8, 231u8, 99u8, 129u8, 130u8, 109u8, 97u8, 108u8, 37u8, + 107u8, 203u8, 70u8, 133u8, 106u8, 226u8, 77u8, 110u8, 189u8, + 227u8, 26u8, 129u8, 189u8, 234u8, 215u8, 112u8, 22u8, 127u8, + 185u8, 152u8, 157u8, 14u8, 66u8, + ] + { + let call = ForceCleanHrmp { + para, + inbound, + outbound, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force process HRMP open channel requests."] + #[doc = ""] + #[doc = "If there are pending HRMP open channel requests, you can use this"] + #[doc = "function process all of those requests immediately."] + #[doc = ""] + #[doc = "Total number of opening channels must be provided as witness data of weighing."] + pub fn force_process_hrmp_open( + &self, + channels: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceProcessHrmpOpen, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 162u8, 53u8, 194u8, 175u8, 117u8, 32u8, 217u8, 177u8, 9u8, + 255u8, 88u8, 40u8, 8u8, 174u8, 8u8, 11u8, 26u8, 82u8, 213u8, + 40u8, 20u8, 89u8, 227u8, 209u8, 95u8, 162u8, 221u8, 97u8, + 230u8, 98u8, 110u8, 85u8, + ] + { + let call = ForceProcessHrmpOpen { channels }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force process HRMP close channel requests."] + #[doc = ""] + #[doc = "If there are pending HRMP close channel requests, you can use this"] + #[doc = "function process all of those requests immediately."] + #[doc = ""] + #[doc = "Total number of closing channels must be provided as witness data of weighing."] + pub fn force_process_hrmp_close( + &self, + channels: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceProcessHrmpClose, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 128u8, 141u8, 191u8, 255u8, 204u8, 137u8, 27u8, 170u8, 180u8, + 166u8, 93u8, 144u8, 70u8, 56u8, 132u8, 100u8, 5u8, 114u8, + 252u8, 163u8, 164u8, 246u8, 234u8, 152u8, 193u8, 79u8, 89u8, + 137u8, 46u8, 171u8, 32u8, 119u8, + ] + { + let call = ForceProcessHrmpClose { channels }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] + #[doc = "or the recipient for that request. The origin must be either of those."] + #[doc = ""] + #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] + #[doc = "already accepted."] + #[doc = ""] + #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] + #[doc = "witness data."] + pub fn hrmp_cancel_open_request( + &self, + channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, + open_requests: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + HrmpCancelOpenRequest, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 8u8, 83u8, 32u8, 187u8, 220u8, 1u8, 212u8, 226u8, 72u8, 61u8, + 110u8, 211u8, 238u8, 119u8, 95u8, 48u8, 150u8, 51u8, 177u8, + 182u8, 209u8, 174u8, 245u8, 25u8, 194u8, 199u8, 212u8, 131u8, + 77u8, 72u8, 9u8, 120u8, + ] + { + let call = HrmpCancelOpenRequest { + channel_id, + open_requests, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Open HRMP channel requested."] + #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] + pub struct OpenChannelRequested( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for OpenChannelRequested { + const PALLET: &'static str = "Hrmp"; + const EVENT: &'static str = "OpenChannelRequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] + #[doc = "`[by_parachain, channel_id]`"] + pub struct OpenChannelCanceled( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::Event for OpenChannelCanceled { + const PALLET: &'static str = "Hrmp"; + const EVENT: &'static str = "OpenChannelCanceled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] + pub struct OpenChannelAccepted( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for OpenChannelAccepted { + const PALLET: &'static str = "Hrmp"; + const EVENT: &'static str = "OpenChannelAccepted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] + pub struct ChannelClosed( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::Event for ChannelClosed { + const PALLET: &'static str = "Hrmp"; + const EVENT: &'static str = "ChannelClosed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct HrmpOpenChannelRequests<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::StorageEntry for HrmpOpenChannelRequests<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpOpenChannelRequests"; + type Value = runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpOpenChannelRequestsList; + impl ::subxt::StorageEntry for HrmpOpenChannelRequestsList { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpOpenChannelRequestsList"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct HrmpOpenChannelRequestCount<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpOpenChannelRequestCount<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpOpenChannelRequestCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpAcceptedChannelRequestCount<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpAcceptedChannelRequestCount<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpAcceptedChannelRequestCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpCloseChannelRequests<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::StorageEntry for HrmpCloseChannelRequests<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpCloseChannelRequests"; + type Value = (); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpCloseChannelRequestsList; + impl ::subxt::StorageEntry for HrmpCloseChannelRequestsList { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpCloseChannelRequestsList"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct HrmpWatermarks<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpWatermarks<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpWatermarks"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpChannels<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::StorageEntry for HrmpChannels<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpChannels"; + type Value = + runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpIngressChannelsIndex<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpIngressChannelsIndex<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpIngressChannelsIndex"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpEgressChannelsIndex<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpEgressChannelsIndex<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpEgressChannelsIndex"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpChannelContents<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::StorageEntry for HrmpChannelContents<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpChannelContents"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpChannelDigests<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpChannelDigests<'_> { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpChannelDigests"; + type Value = ::std::vec::Vec<( + ::core::primitive::u32, + ::std::vec::Vec, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The set of pending HRMP open channel requests."] + #[doc = ""] + #[doc = " The set is accompanied by a list for iteration."] + #[doc = ""] + #[doc = " Invariant:"] + #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub 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 >{ + if self + .client + .metadata() + .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 = " The set of pending HRMP open channel requests."] + #[doc = ""] + #[doc = " The set is accompanied by a list for iteration."] + #[doc = ""] + #[doc = " Invariant:"] + #[doc = " - There are no channels that exists in list but not in the set and vice versa."] + pub async fn hrmp_open_channel_requests_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpOpenChannelRequests<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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 async 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] + #[doc = " change. Used for checking if a given channel is registered for closure."] + #[doc = ""] + #[doc = " The set is accompanied by a list for iteration."] + #[doc = ""] + #[doc = " Invariant:"] + #[doc = " - There are no channels that exists in list but not in the set and vice versa."] + pub 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> + { + if self + .client + .metadata() + .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()) + } + } + #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] + #[doc = " change. Used for checking if a given channel is registered for closure."] + #[doc = ""] + #[doc = " The set is accompanied by a list for iteration."] + #[doc = ""] + #[doc = " Invariant:"] + #[doc = " - There are no channels that exists in list but not in the set and vice versa."] + pub async fn hrmp_close_channel_requests_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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 async 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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] + #[doc = " I.e."] + #[doc = ""] + #[doc = " (a) ingress index allows to find all the senders for a given recipient."] + #[doc = " (b) egress index allows to find all the recipients for a given sender."] + #[doc = ""] + #[doc = " Invariants:"] + #[doc = " - for each ingress index entry for `P` each item `I` in the index should present in"] + #[doc = " `HrmpChannels` as `(I, P)`."] + #[doc = " - for each egress index entry for `P` each item `E` in the index should present in"] + #[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( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] + #[doc = " I.e."] + #[doc = ""] + #[doc = " (a) ingress index allows to find all the senders for a given recipient."] + #[doc = " (b) egress index allows to find all the recipients for a given sender."] + #[doc = ""] + #[doc = " Invariants:"] + #[doc = " - for each ingress index entry for `P` each item `I` in the index should present in"] + #[doc = " `HrmpChannels` as `(I, P)`."] + #[doc = " - for each egress index entry for `P` each item `E` in the index should present in"] + #[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, + > { + if self + .client + .metadata() + .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 async fn hrmp_egress_channels_index( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + pub async fn hrmp_egress_channels_index_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &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, + >, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] + #[doc = " the given block number for a given receiver. Invariants:"] + #[doc = " - The inner `Vec` is never empty."] + #[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( + &self, + _0: &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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] + #[doc = " the given block number for a given receiver. Invariants:"] + #[doc = " - The inner `Vec` is never empty."] + #[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, + > { + if self + .client + .metadata() + .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 mod para_session_info { + use super::{ + root_mod, + runtime_types, + }; + pub mod storage { + use super::runtime_types; + pub struct AssignmentKeysUnsafe; + impl ::subxt::StorageEntry for AssignmentKeysUnsafe { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "AssignmentKeysUnsafe"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::assignment_app::Public, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EarliestStoredSession; + impl ::subxt::StorageEntry for EarliestStoredSession { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "EarliestStoredSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Sessions<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Sessions<'_> { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "Sessions"; + type Value = runtime_types::polkadot_primitives::v2::SessionInfo; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " 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, + > { + if self + .client + .metadata() + .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 = " The earliest session for which previous session info is stored."] + pub async fn earliest_stored_session( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::SessionInfo, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Sessions<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + } + pub mod paras_disputes { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceUnfreeze; + impl ::subxt::Call for ForceUnfreeze { + const PALLET: &'static str = "ParasDisputes"; + const FUNCTION: &'static str = "force_unfreeze"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn force_unfreeze( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceUnfreeze, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 212u8, 211u8, 58u8, 159u8, 23u8, 220u8, 64u8, 175u8, 65u8, + 50u8, 192u8, 122u8, 113u8, 189u8, 74u8, 191u8, 48u8, 93u8, + 251u8, 50u8, 237u8, 240u8, 91u8, 139u8, 193u8, 114u8, 131u8, + 125u8, 124u8, 236u8, 191u8, 190u8, + ] + { + let call = ForceUnfreeze {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = + runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] + pub struct DisputeInitiated( + pub runtime_types::polkadot_core_primitives::CandidateHash, + pub runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation, + ); + impl ::subxt::Event for DisputeInitiated { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "DisputeInitiated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A dispute has concluded for or against a candidate."] + #[doc = "`\\[para id, candidate hash, dispute result\\]`"] + pub struct DisputeConcluded( + pub runtime_types::polkadot_core_primitives::CandidateHash, + pub runtime_types::polkadot_runtime_parachains::disputes::DisputeResult, + ); + impl ::subxt::Event for DisputeConcluded { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "DisputeConcluded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A dispute has timed out due to insufficient participation."] + #[doc = "`\\[para id, candidate hash\\]`"] + pub struct DisputeTimedOut( + pub runtime_types::polkadot_core_primitives::CandidateHash, + ); + impl ::subxt::Event for DisputeTimedOut { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "DisputeTimedOut"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A dispute has concluded with supermajority against a candidate."] + #[doc = "Block authors should no longer build on top of this head and should"] + #[doc = "instead revert the block at the given height. This should be the"] + #[doc = "number of the child of the last known valid block in the chain."] + pub struct Revert(pub ::core::primitive::u32); + impl ::subxt::Event for Revert { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "Revert"; + } + } + pub mod storage { + use super::runtime_types; + pub struct LastPrunedSession; + impl ::subxt::StorageEntry for LastPrunedSession { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "LastPrunedSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Disputes<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::polkadot_core_primitives::CandidateHash, + ); + impl ::subxt::StorageEntry for Disputes<'_> { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "Disputes"; + type Value = runtime_types::polkadot_primitives::v2::DisputeState< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Included<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::polkadot_core_primitives::CandidateHash, + ); + impl ::subxt::StorageEntry for Included<'_> { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "Included"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct SpamSlots<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for SpamSlots<'_> { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "SpamSlots"; + type Value = ::std::vec::Vec<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Frozen; + impl ::subxt::StorageEntry for Frozen { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "Frozen"; + type Value = ::core::option::Option<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " All ongoing or concluded disputes for the last several sessions."] + pub async fn disputes( + &self, + _0: &::core::primitive::u32, + _1: &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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] + #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] + #[doc = " fewer than `byzantine_threshold + 1` validators."] + #[doc = ""] + #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] + pub 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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] + #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] + #[doc = " fewer than `byzantine_threshold + 1` validators."] + #[doc = ""] + #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] + pub async fn spam_slots_iter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SpamSlots<'a>>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod registrar { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Register { + pub id: runtime_types::polkadot_parachain::primitives::Id, + pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, + pub validation_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + } + impl ::subxt::Call for Register { + const PALLET: &'static str = "Registrar"; + const FUNCTION: &'static str = "register"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceRegister { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + pub id: runtime_types::polkadot_parachain::primitives::Id, + pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, + pub validation_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + } + impl ::subxt::Call for ForceRegister { + const PALLET: &'static str = "Registrar"; + const FUNCTION: &'static str = "force_register"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Deregister { + pub id: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for Deregister { + const PALLET: &'static str = "Registrar"; + const FUNCTION: &'static str = "deregister"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Swap { + pub id: runtime_types::polkadot_parachain::primitives::Id, + pub other: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for Swap { + const PALLET: &'static str = "Registrar"; + const FUNCTION: &'static str = "swap"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceRemoveLock { + pub para: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for ForceRemoveLock { + const PALLET: &'static str = "Registrar"; + const FUNCTION: &'static str = "force_remove_lock"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Reserve; + impl ::subxt::Call for Reserve { + const PALLET: &'static str = "Registrar"; + const FUNCTION: &'static str = "reserve"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Register head data and validation code for a reserved Para Id."] + #[doc = ""] + #[doc = "## Arguments"] + #[doc = "- `origin`: Must be called by a `Signed` origin."] + #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] + #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] + #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] + #[doc = ""] + #[doc = "## Deposits/Fees"] + #[doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] + #[doc = "reserved previously for this para ID is accounted for."] + #[doc = ""] + #[doc = "## Events"] + #[doc = "The `Registered` event is emitted in case of success."] + pub fn register( + &self, + id: runtime_types::polkadot_parachain::primitives::Id, + genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, + validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Register, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 180u8, 21u8, 142u8, 73u8, 21u8, 31u8, 64u8, 210u8, 196u8, + 4u8, 142u8, 153u8, 172u8, 207u8, 95u8, 209u8, 177u8, 75u8, + 202u8, 85u8, 95u8, 208u8, 123u8, 237u8, 190u8, 148u8, 5u8, + 64u8, 65u8, 191u8, 221u8, 203u8, + ] + { + let call = Register { + id, + genesis_head, + validation_code, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Force the registration of a Para Id on the relay chain."] + #[doc = ""] + #[doc = "This function must be called by a Root origin."] + #[doc = ""] + #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] + #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] + pub fn force_register( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + id: runtime_types::polkadot_parachain::primitives::Id, + genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, + validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceRegister, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 191u8, 198u8, 172u8, 68u8, 118u8, 126u8, 110u8, 47u8, 193u8, + 147u8, 61u8, 27u8, 122u8, 107u8, 49u8, 222u8, 87u8, 199u8, + 184u8, 247u8, 153u8, 137u8, 205u8, 153u8, 6u8, 15u8, 246u8, + 8u8, 36u8, 76u8, 54u8, 63u8, + ] + { + let call = ForceRegister { + who, + deposit, + id, + genesis_head, + validation_code, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] + #[doc = ""] + #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] + pub fn deregister( + &self, + id: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Deregister, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 147u8, 4u8, 172u8, 215u8, 67u8, 142u8, 93u8, 245u8, 108u8, + 83u8, 5u8, 250u8, 87u8, 138u8, 231u8, 10u8, 159u8, 216u8, + 85u8, 233u8, 244u8, 200u8, 37u8, 33u8, 160u8, 143u8, 119u8, + 11u8, 70u8, 177u8, 8u8, 123u8, + ] + { + let call = Deregister { id }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Swap a parachain with another parachain or parathread."] + #[doc = ""] + #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] + #[doc = ""] + #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] + #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] + #[doc = ""] + #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] + #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] + #[doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] + #[doc = "and the auction deposit are switched."] + pub fn swap( + &self, + id: runtime_types::polkadot_parachain::primitives::Id, + other: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Swap, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 145u8, 163u8, 246u8, 239u8, 241u8, 209u8, 58u8, 241u8, 63u8, + 134u8, 102u8, 55u8, 217u8, 125u8, 176u8, 91u8, 27u8, 32u8, + 220u8, 236u8, 18u8, 20u8, 7u8, 187u8, 100u8, 116u8, 161u8, + 133u8, 127u8, 187u8, 86u8, 109u8, + ] + { + let call = Swap { id, other }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a manager lock from a para. This will allow the manager of a"] + #[doc = "previously locked para to deregister or swap a para without using governance."] + #[doc = ""] + #[doc = "Can only be called by the Root origin."] + pub fn force_remove_lock( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceRemoveLock, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 205u8, 174u8, 132u8, 188u8, 1u8, 59u8, 82u8, 135u8, 123u8, + 55u8, 144u8, 39u8, 205u8, 171u8, 13u8, 252u8, 65u8, 56u8, + 98u8, 216u8, 23u8, 175u8, 16u8, 200u8, 198u8, 252u8, 133u8, + 238u8, 81u8, 142u8, 254u8, 124u8, + ] + { + let call = ForceRemoveLock { para }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Reserve a Para Id on the relay chain."] + #[doc = ""] + #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] + #[doc = "The origin account is able to register head data and validation code using `register` to create"] + #[doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] + #[doc = ""] + #[doc = "## Arguments"] + #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] + #[doc = ""] + #[doc = "## Deposits/Fees"] + #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] + #[doc = ""] + #[doc = "## Events"] + #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] + pub fn reserve( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Reserve, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 22u8, 210u8, 13u8, 54u8, 253u8, 13u8, 89u8, 174u8, 232u8, + 119u8, 148u8, 206u8, 130u8, 133u8, 199u8, 127u8, 201u8, + 205u8, 8u8, 213u8, 108u8, 93u8, 135u8, 88u8, 238u8, 171u8, + 31u8, 193u8, 23u8, 113u8, 106u8, 135u8, + ] + { + let call = Reserve {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = + runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Registered( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Registered { + const PALLET: &'static str = "Registrar"; + const EVENT: &'static str = "Registered"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Deregistered( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for Deregistered { + const PALLET: &'static str = "Registrar"; + const EVENT: &'static str = "Deregistered"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Reserved( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Reserved { + const PALLET: &'static str = "Registrar"; + const EVENT: &'static str = "Reserved"; + } + } + pub mod storage { + use super::runtime_types; + pub struct PendingSwap<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for PendingSwap<'_> { + const PALLET: &'static str = "Registrar"; + const STORAGE: &'static str = "PendingSwap"; + type Value = runtime_types::polkadot_parachain::primitives::Id; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Paras<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for Paras<'_> { + const PALLET: &'static str = "Registrar"; + const STORAGE: &'static str = "Paras"; + type Value = + runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct NextFreeParaId; + impl ::subxt::StorageEntry for NextFreeParaId { + const PALLET: &'static str = "Registrar"; + const STORAGE: &'static str = "NextFreeParaId"; + type Value = runtime_types::polkadot_parachain::primitives::Id; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Pending swap operations."] + pub async fn pending_swap( + &self, + _0: &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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 = " 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, + > { + if self.client.metadata().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()) + } + } + #[doc = " The next free `ParaId`."] + pub async fn next_free_para_id( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The deposit to be paid to run a parathread."] + #[doc = " This should include the cost for storing the genesis head and validation code."] + pub fn para_deposit( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Registrar", "ParaDeposit")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Registrar")?; + let constant = pallet.constant("ParaDeposit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The deposit to be paid per byte stored on chain."] + pub fn data_deposit_per_byte( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Registrar", "DataDepositPerByte")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Registrar")?; + let constant = pallet.constant("DataDepositPerByte")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod slots { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceLease { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub leaser: ::subxt::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + pub period_begin: ::core::primitive::u32, + pub period_count: ::core::primitive::u32, + } + impl ::subxt::Call for ForceLease { + const PALLET: &'static str = "Slots"; + const FUNCTION: &'static str = "force_lease"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearAllLeases { + pub para: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for ClearAllLeases { + const PALLET: &'static str = "Slots"; + const FUNCTION: &'static str = "clear_all_leases"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TriggerOnboard { + pub para: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for TriggerOnboard { + const PALLET: &'static str = "Slots"; + const FUNCTION: &'static str = "trigger_onboard"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] + #[doc = "independently of any other on-chain mechanism to use it."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + pub fn force_lease( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + leaser: ::subxt::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + period_begin: ::core::primitive::u32, + period_count: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceLease, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 110u8, 205u8, 106u8, 226u8, 3u8, 177u8, 198u8, 116u8, 52u8, + 161u8, 90u8, 240u8, 43u8, 160u8, 144u8, 63u8, 97u8, 231u8, + 232u8, 176u8, 92u8, 253u8, 16u8, 243u8, 187u8, 94u8, 20u8, + 114u8, 23u8, 46u8, 231u8, 249u8, + ] + { + let call = ForceLease { + para, + leaser, + amount, + period_begin, + period_count, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + pub fn clear_all_leases( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ClearAllLeases, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 101u8, 225u8, 10u8, 139u8, 34u8, 12u8, 48u8, 76u8, 97u8, + 178u8, 5u8, 110u8, 19u8, 3u8, 237u8, 183u8, 54u8, 113u8, 7u8, + 138u8, 180u8, 201u8, 245u8, 151u8, 61u8, 40u8, 69u8, 31u8, + 28u8, 172u8, 253u8, 227u8, + ] + { + let call = ClearAllLeases { para }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Try to onboard a parachain that has a lease for the current lease period."] + #[doc = ""] + #[doc = "This function can be useful if there was some state issue with a para that should"] + #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] + #[doc = "let them onboard from here."] + #[doc = ""] + #[doc = "Origin must be signed, but can be called by anyone."] + pub fn trigger_onboard( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + TriggerOnboard, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 85u8, 246u8, 247u8, 252u8, 46u8, 143u8, 200u8, 102u8, 105u8, + 51u8, 148u8, 164u8, 27u8, 25u8, 139u8, 167u8, 150u8, 129u8, + 131u8, 187u8, 153u8, 6u8, 169u8, 153u8, 192u8, 116u8, 130u8, + 12u8, 22u8, 199u8, 52u8, 8u8, + ] + { + let call = TriggerOnboard { para }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "A new `[lease_period]` is beginning."] + pub struct NewLeasePeriod(pub ::core::primitive::u32); + impl ::subxt::Event for NewLeasePeriod { + const PALLET: &'static str = "Slots"; + const EVENT: &'static str = "NewLeasePeriod"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A para has won the right to a continuous set of lease periods as a parachain."] + #[doc = "First balance is any extra amount reserved on top of the para's existing deposit."] + #[doc = "Second balance is the total amount reserved."] + #[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, + ); + impl ::subxt::Event for Leased { + const PALLET: &'static str = "Slots"; + const EVENT: &'static str = "Leased"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Leases<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for Leases<'_> { + const PALLET: &'static str = "Slots"; + const STORAGE: &'static str = "Leases"; + type Value = ::std::vec::Vec< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] + #[doc = ""] + #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the second values"] + #[doc = " of the items in this list whose first value is the account."] + #[doc = ""] + #[doc = " The first item in the list is the amount locked for the current Lease Period. Following"] + #[doc = " items are for the subsequent lease periods."] + #[doc = ""] + #[doc = " The default value (an empty list) implies that the parachain no longer exists (or never"] + #[doc = " existed) as far as this pallet is concerned."] + #[doc = ""] + #[doc = " If a parachain doesn't exist *yet* but is scheduled to exist in the future, then it"] + #[doc = " will be left-padded with one or more `None`s to denote the fact that nothing is held on"] + #[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( + &self, + _0: &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, + > { + if self.client.metadata().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()) + } + } + #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] + #[doc = ""] + #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the second values"] + #[doc = " of the items in this list whose first value is the account."] + #[doc = ""] + #[doc = " The first item in the list is the amount locked for the current Lease Period. Following"] + #[doc = " items are for the subsequent lease periods."] + #[doc = ""] + #[doc = " The default value (an empty list) implies that the parachain no longer exists (or never"] + #[doc = " existed) as far as this pallet is concerned."] + #[doc = ""] + #[doc = " If a parachain doesn't exist *yet* but is scheduled to exist in the future, then it"] + #[doc = " will be left-padded with one or more `None`s to denote the fact that nothing is held on"] + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The number of blocks over which a single period lasts."] + pub fn lease_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Slots", "LeasePeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Slots")?; + let constant = pallet.constant("LeasePeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The number of blocks to offset each lease period by."] + pub fn lease_offset( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Slots", "LeaseOffset")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Slots")?; + let constant = pallet.constant("LeaseOffset")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod auctions { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NewAuction { + #[codec(compact)] + pub duration: ::core::primitive::u32, + #[codec(compact)] + pub lease_period_index: ::core::primitive::u32, + } + impl ::subxt::Call for NewAuction { + const PALLET: &'static str = "Auctions"; + const FUNCTION: &'static str = "new_auction"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bid { + #[codec(compact)] + pub para: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub auction_index: ::core::primitive::u32, + #[codec(compact)] + pub first_slot: ::core::primitive::u32, + #[codec(compact)] + pub last_slot: ::core::primitive::u32, + #[codec(compact)] + pub amount: ::core::primitive::u128, + } + impl ::subxt::Call for Bid { + const PALLET: &'static str = "Auctions"; + const FUNCTION: &'static str = "bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelAuction; + impl ::subxt::Call for CancelAuction { + const PALLET: &'static str = "Auctions"; + const FUNCTION: &'static str = "cancel_auction"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Create a new auction."] + #[doc = ""] + #[doc = "This can only happen when there isn't already an auction in progress and may only be"] + #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] + #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] + pub fn new_auction( + &self, + duration: ::core::primitive::u32, + lease_period_index: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + NewAuction, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 12u8, 43u8, 152u8, 0u8, 229u8, 15u8, 32u8, 205u8, 208u8, + 71u8, 57u8, 169u8, 201u8, 177u8, 52u8, 10u8, 93u8, 183u8, + 5u8, 156u8, 231u8, 188u8, 77u8, 238u8, 119u8, 238u8, 87u8, + 251u8, 121u8, 199u8, 18u8, 129u8, + ] + { + let call = NewAuction { + duration, + lease_period_index, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] + #[doc = "parachain."] + #[doc = ""] + #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] + #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] + #[doc = ""] + #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] + #[doc = "funded by) the same account."] + #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] + #[doc = "value of `AuctionCounter`."] + #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] + #[doc = "bid win. This amount is held throughout the range."] + pub fn bid( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + auction_index: ::core::primitive::u32, + first_slot: ::core::primitive::u32, + last_slot: ::core::primitive::u32, + amount: ::core::primitive::u128, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Bid, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 206u8, 22u8, 15u8, 251u8, 222u8, 193u8, 192u8, 125u8, 160u8, + 131u8, 209u8, 129u8, 105u8, 46u8, 77u8, 204u8, 107u8, 112u8, + 13u8, 188u8, 193u8, 73u8, 225u8, 232u8, 179u8, 205u8, 39u8, + 69u8, 242u8, 79u8, 36u8, 121u8, + ] + { + let call = Bid { + para, + auction_index, + first_slot, + last_slot, + amount, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Cancel an in-progress auction."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + pub fn cancel_auction( + &self, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CancelAuction, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 182u8, 223u8, 178u8, 136u8, 1u8, 115u8, 229u8, 78u8, 166u8, + 128u8, 28u8, 106u8, 6u8, 248u8, 46u8, 55u8, 110u8, 120u8, + 213u8, 11u8, 90u8, 217u8, 42u8, 120u8, 47u8, 83u8, 126u8, + 216u8, 236u8, 251u8, 255u8, 50u8, + ] + { + let call = CancelAuction {}; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for AuctionStarted { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "AuctionStarted"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] + pub struct AuctionClosed(pub ::core::primitive::u32); + impl ::subxt::Event for AuctionClosed { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "AuctionClosed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for Reserved { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "Reserved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for Unreserved { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "Unreserved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for ReserveConfiscated { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "ReserveConfiscated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for BidAccepted { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "BidAccepted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for WinningOffset { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "WinningOffset"; + } + } + pub mod storage { + use super::runtime_types; + pub struct AuctionCounter; + impl ::subxt::StorageEntry for AuctionCounter { + const PALLET: &'static str = "Auctions"; + const STORAGE: &'static str = "AuctionCounter"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct AuctionInfo; + impl ::subxt::StorageEntry for AuctionInfo { + const PALLET: &'static str = "Auctions"; + const STORAGE: &'static str = "AuctionInfo"; + type Value = (::core::primitive::u32, ::core::primitive::u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ReservedAmounts<'a>( + pub &'a ::subxt::sp_core::crypto::AccountId32, + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for ReservedAmounts<'_> { + const PALLET: &'static str = "Auctions"; + const STORAGE: &'static str = "ReservedAmounts"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &(&self.0, &self.1), + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Winning<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Winning<'_> { + const PALLET: &'static str = "Auctions"; + const STORAGE: &'static str = "Winning"; + type Value = [::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u128, + )>; 36usize]; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Number of auctions started so far."] + pub async fn auction_counter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Information relating to the current auction, if there is one."] + #[doc = ""] + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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 mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The number of blocks over which an auction may be retroactively ended."] + pub fn ending_period( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Auctions", "EndingPeriod")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Auctions")?; + let constant = pallet.constant("EndingPeriod")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The length of each sample to take during the ending period."] + #[doc = ""] + #[doc = " `EndingPeriod` / `SampleLength` = Total # of Samples"] + pub fn sample_length( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Auctions", "SampleLength")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Auctions")?; + let constant = pallet.constant("SampleLength")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + pub fn slot_range_count( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Auctions", "SlotRangeCount")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Auctions")?; + let constant = pallet.constant("SlotRangeCount")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + pub fn lease_periods_per_slot( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Auctions", "LeasePeriodsPerSlot")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Auctions")?; + let constant = pallet.constant("LeasePeriodsPerSlot")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod crowdloan { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Create { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub cap: ::core::primitive::u128, + #[codec(compact)] + pub first_period: ::core::primitive::u32, + #[codec(compact)] + pub last_period: ::core::primitive::u32, + #[codec(compact)] + pub end: ::core::primitive::u32, + pub verifier: + ::core::option::Option, + } + impl ::subxt::Call for Create { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "create"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Contribute { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub value: ::core::primitive::u128, + pub signature: + ::core::option::Option, + } + impl ::subxt::Call for Contribute { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "contribute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Withdraw { + pub who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for Withdraw { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "withdraw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Refund { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for Refund { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "refund"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Dissolve { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for Dissolve { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "dissolve"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Edit { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub cap: ::core::primitive::u128, + #[codec(compact)] + pub first_period: ::core::primitive::u32, + #[codec(compact)] + pub last_period: ::core::primitive::u32, + #[codec(compact)] + pub end: ::core::primitive::u32, + pub verifier: + ::core::option::Option, + } + impl ::subxt::Call for Edit { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "edit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddMemo { + pub index: runtime_types::polkadot_parachain::primitives::Id, + pub memo: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for AddMemo { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "add_memo"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Poke { + pub index: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for Poke { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "poke"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ContributeAll { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + pub signature: + ::core::option::Option, + } + impl ::subxt::Call for ContributeAll { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "contribute_all"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] + #[doc = ""] + #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] + #[doc = "by the parachain manager."] + pub fn create( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + cap: ::core::primitive::u128, + first_period: ::core::primitive::u32, + last_period: ::core::primitive::u32, + end: ::core::primitive::u32, + verifier: ::core::option::Option< + runtime_types::sp_runtime::MultiSigner, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Create, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 94u8, 115u8, 154u8, 239u8, 215u8, 180u8, 175u8, 240u8, 137u8, + 240u8, 74u8, 159u8, 67u8, 54u8, 69u8, 199u8, 161u8, 155u8, + 243u8, 222u8, 205u8, 163u8, 142u8, 251u8, 156u8, 94u8, 65u8, + 153u8, 39u8, 226u8, 79u8, 195u8, + ] + { + let call = Create { + index, + cap, + first_period, + last_period, + end, + verifier, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] + #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] + pub fn contribute( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + value: ::core::primitive::u128, + signature: ::core::option::Option< + runtime_types::sp_runtime::MultiSignature, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Contribute, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 95u8, 255u8, 35u8, 30u8, 44u8, 150u8, 10u8, 166u8, 0u8, + 204u8, 106u8, 59u8, 150u8, 254u8, 216u8, 128u8, 232u8, 129u8, + 30u8, 101u8, 196u8, 198u8, 180u8, 156u8, 122u8, 252u8, 139u8, + 28u8, 164u8, 115u8, 153u8, 109u8, + ] + { + let call = Contribute { + index, + value, + signature, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Withdraw full balance of a specific contributor."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + #[doc = ""] + #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement, then the retirement"] + #[doc = "flag must be set. For a fund to be ready for retirement, then:"] + #[doc = "- it must not already be in retirement;"] + #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] + #[doc = "- and either:"] + #[doc = " - the block number must be at least `end`; or"] + #[doc = " - the current lease period must be greater than the fund's `last_period`."] + #[doc = ""] + #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current block"] + #[doc = "number."] + #[doc = ""] + #[doc = "- `who`: The account whose contribution should be withdrawn."] + #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] + pub fn withdraw( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Withdraw, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 67u8, 65u8, 89u8, 108u8, 193u8, 99u8, 74u8, 32u8, 163u8, + 13u8, 81u8, 131u8, 64u8, 107u8, 72u8, 23u8, 35u8, 177u8, + 130u8, 171u8, 70u8, 232u8, 246u8, 254u8, 67u8, 219u8, 84u8, + 96u8, 165u8, 20u8, 183u8, 209u8, + ] + { + let call = Withdraw { who, index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Automatically refund contributors of an ended crowdloan."] + #[doc = "Due to weight restrictions, this function may need to be called multiple"] + #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + pub fn refund( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Refund, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 202u8, 206u8, 79u8, 226u8, 114u8, 228u8, 110u8, 18u8, 178u8, + 173u8, 23u8, 83u8, 64u8, 11u8, 201u8, 19u8, 57u8, 75u8, + 181u8, 241u8, 231u8, 189u8, 211u8, 48u8, 82u8, 64u8, 220u8, + 22u8, 247u8, 7u8, 68u8, 211u8, + ] + { + let call = Refund { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] + pub fn dissolve( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Dissolve, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 210u8, 3u8, 221u8, 185u8, 64u8, 178u8, 56u8, 132u8, 72u8, + 127u8, 105u8, 31u8, 167u8, 107u8, 127u8, 224u8, 174u8, 221u8, + 111u8, 105u8, 47u8, 247u8, 10u8, 5u8, 37u8, 180u8, 61u8, + 180u8, 3u8, 164u8, 196u8, 194u8, + ] + { + let call = Dissolve { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Edit the configuration for an in-progress crowdloan."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + pub fn edit( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + cap: ::core::primitive::u128, + first_period: ::core::primitive::u32, + last_period: ::core::primitive::u32, + end: ::core::primitive::u32, + verifier: ::core::option::Option< + runtime_types::sp_runtime::MultiSigner, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Edit, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 34u8, 43u8, 47u8, 39u8, 106u8, 245u8, 49u8, 40u8, 191u8, + 195u8, 202u8, 113u8, 137u8, 98u8, 143u8, 172u8, 191u8, 55u8, + 240u8, 75u8, 234u8, 180u8, 90u8, 206u8, 93u8, 214u8, 115u8, + 215u8, 140u8, 144u8, 105u8, 89u8, + ] + { + let call = Edit { + index, + cap, + first_period, + last_period, + end, + verifier, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Add an optional memo to an existing crowdloan contribution."] + #[doc = ""] + #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] + pub fn add_memo( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + memo: ::std::vec::Vec<::core::primitive::u8>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + AddMemo, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 97u8, 218u8, 115u8, 187u8, 167u8, 70u8, 229u8, 231u8, 148u8, + 77u8, 169u8, 139u8, 16u8, 15u8, 116u8, 128u8, 32u8, 59u8, + 154u8, 146u8, 12u8, 65u8, 36u8, 36u8, 69u8, 19u8, 74u8, 79u8, + 66u8, 25u8, 215u8, 57u8, + ] + { + let call = AddMemo { index, memo }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Poke the fund into `NewRaise`"] + #[doc = ""] + #[doc = "Origin must be Signed, and the fund has non-zero raise."] + pub fn poke( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Poke, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 99u8, 158u8, 48u8, 3u8, 228u8, 210u8, 249u8, 42u8, 44u8, + 49u8, 24u8, 212u8, 69u8, 69u8, 189u8, 194u8, 124u8, 251u8, + 25u8, 123u8, 234u8, 3u8, 184u8, 227u8, 1u8, 195u8, 219u8, + 118u8, 235u8, 237u8, 11u8, 159u8, + ] + { + let call = Poke { index }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] + #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] + pub fn contribute_all( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + signature: ::core::option::Option< + runtime_types::sp_runtime::MultiSignature, + >, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ContributeAll, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 64u8, 224u8, 233u8, 196u8, 182u8, 109u8, 69u8, 220u8, 46u8, + 60u8, 189u8, 125u8, 17u8, 28u8, 207u8, 63u8, 129u8, 56u8, + 32u8, 239u8, 182u8, 214u8, 237u8, 95u8, 228u8, 171u8, 209u8, + 233u8, 205u8, 212u8, 147u8, 176u8, + ] + { + let call = ContributeAll { index, signature }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] + pub struct Created(pub runtime_types::polkadot_parachain::primitives::Id); + impl ::subxt::Event for Created { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Created"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for Contributed { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Contributed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for Withdrew { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Withdrew"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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, + ); + impl ::subxt::Event for PartiallyRefunded { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "PartiallyRefunded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "All loans in a fund have been refunded. `[fund_index]`"] + pub struct AllRefunded(pub runtime_types::polkadot_parachain::primitives::Id); + impl ::subxt::Event for AllRefunded { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "AllRefunded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Fund is dissolved. `[fund_index]`"] + pub struct Dissolved(pub runtime_types::polkadot_parachain::primitives::Id); + impl ::subxt::Event for Dissolved { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Dissolved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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>, + ); + impl ::subxt::Event for HandleBidResult { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "HandleBidResult"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The configuration to a crowdloan has been edited. `[fund_index]`"] + pub struct Edited(pub runtime_types::polkadot_parachain::primitives::Id); + impl ::subxt::Event for Edited { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Edited"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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>, + ); + impl ::subxt::Event for MemoUpdated { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "MemoUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A parachain has been moved to `NewRaise`"] + pub struct AddedToNewRaise( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::Event for AddedToNewRaise { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "AddedToNewRaise"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Funds<'a>( + pub &'a runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for Funds<'_> { + const PALLET: &'static str = "Crowdloan"; + const STORAGE: &'static str = "Funds"; + type Value = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct NewRaise; + impl ::subxt::StorageEntry for NewRaise { + const PALLET: &'static str = "Crowdloan"; + const STORAGE: &'static str = "NewRaise"; + type Value = + ::std::vec::Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EndingsCount; + impl ::subxt::StorageEntry for EndingsCount { + const PALLET: &'static str = "Crowdloan"; + const STORAGE: &'static str = "EndingsCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextFundIndex; + impl ::subxt::StorageEntry for NextFundIndex { + const PALLET: &'static str = "Crowdloan"; + const STORAGE: &'static str = "NextFundIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " Info on all of the funds."] + pub async fn funds( + &self, + _0: &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, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[doc = " The number of auctions that have entered into their ending period so far."] + pub async fn endings_count( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " Tracker for the next available fund index"] + pub async fn next_fund_index( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b\"py/cfund\")`"] + pub fn pallet_id( + &self, + ) -> ::core::result::Result< + runtime_types::frame_support::PalletId, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .constant_hash("Crowdloan", "PalletId")? + == [ + 11u8, 72u8, 189u8, 18u8, 254u8, 229u8, 67u8, 29u8, 4u8, + 241u8, 192u8, 5u8, 210u8, 194u8, 124u8, 31u8, 19u8, 174u8, + 240u8, 245u8, 169u8, 141u8, 67u8, 251u8, 106u8, 103u8, 15u8, + 167u8, 107u8, 31u8, 121u8, 239u8, + ] + { + let pallet = self.client.metadata().pallet("Crowdloan")?; + let constant = pallet.constant("PalletId")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " The minimum amount that may be contributed into a crowdloan. Should almost certainly be at"] + #[doc = " least `ExistentialDeposit`."] + pub fn min_contribution( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Crowdloan", "MinContribution")? + == [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, + 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, + 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, + 15u8, 178u8, 98u8, 148u8, 156u8, + ] + { + let pallet = self.client.metadata().pallet("Crowdloan")?; + let constant = pallet.constant("MinContribution")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = " Max number of storage keys to remove per extrinsic call."] + pub fn remove_keys_limit( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self + .client + .metadata() + .constant_hash("Crowdloan", "RemoveKeysLimit")? + == [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ] + { + let pallet = self.client.metadata().pallet("Crowdloan")?; + let constant = pallet.constant("RemoveKeysLimit")?; + let value = + ::subxt::codec::Decode::decode(&mut &constant.value[..])?; + Ok(value) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + } + pub mod xcm_pallet { + use super::{ + root_mod, + runtime_types, + }; + pub mod calls { + use super::{ + root_mod, + runtime_types, + }; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Send { + pub dest: ::std::boxed::Box, + pub message: ::std::boxed::Box, + } + impl ::subxt::Call for Send { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "send"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TeleportAssets { + pub dest: ::std::boxed::Box, + pub beneficiary: + ::std::boxed::Box, + pub assets: ::std::boxed::Box, + pub fee_asset_item: ::core::primitive::u32, + } + impl ::subxt::Call for TeleportAssets { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "teleport_assets"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReserveTransferAssets { + pub dest: ::std::boxed::Box, + pub beneficiary: + ::std::boxed::Box, + pub assets: ::std::boxed::Box, + pub fee_asset_item: ::core::primitive::u32, + } + impl ::subxt::Call for ReserveTransferAssets { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "reserve_transfer_assets"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Execute { + pub message: ::std::boxed::Box, + pub max_weight: ::core::primitive::u64, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "execute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceXcmVersion { + pub location: ::std::boxed::Box< + runtime_types::xcm::v1::multilocation::MultiLocation, + >, + pub xcm_version: ::core::primitive::u32, + } + impl ::subxt::Call for ForceXcmVersion { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "force_xcm_version"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceDefaultXcmVersion { + pub maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for ForceDefaultXcmVersion { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "force_default_xcm_version"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceSubscribeVersionNotify { + pub location: + ::std::boxed::Box, + } + impl ::subxt::Call for ForceSubscribeVersionNotify { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "force_subscribe_version_notify"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceUnsubscribeVersionNotify { + pub location: + ::std::boxed::Box, + } + impl ::subxt::Call for ForceUnsubscribeVersionNotify { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "force_unsubscribe_version_notify"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct LimitedReserveTransferAssets { + pub dest: ::std::boxed::Box, + pub beneficiary: + ::std::boxed::Box, + pub assets: ::std::boxed::Box, + pub fee_asset_item: ::core::primitive::u32, + pub weight_limit: runtime_types::xcm::v2::WeightLimit, + } + impl ::subxt::Call for LimitedReserveTransferAssets { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "limited_reserve_transfer_assets"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct LimitedTeleportAssets { + pub dest: ::std::boxed::Box, + pub beneficiary: + ::std::boxed::Box, + pub assets: ::std::boxed::Box, + pub fee_asset_item: ::core::primitive::u32, + pub weight_limit: runtime_types::xcm::v2::WeightLimit, + } + impl ::subxt::Call for LimitedTeleportAssets { + const PALLET: &'static str = "XcmPallet"; + const FUNCTION: &'static str = "limited_teleport_assets"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn send( + &self, + dest: runtime_types::xcm::VersionedMultiLocation, + message: runtime_types::xcm::VersionedXcm, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Send, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 232u8, 188u8, 205u8, 27u8, 92u8, 141u8, 251u8, 24u8, 90u8, + 155u8, 20u8, 139u8, 7u8, 160u8, 39u8, 85u8, 205u8, 11u8, + 111u8, 1u8, 250u8, 168u8, 134u8, 61u8, 19u8, 216u8, 239u8, + 127u8, 137u8, 136u8, 48u8, 19u8, + ] + { + let call = Send { + dest: ::std::boxed::Box::new(dest), + message: ::std::boxed::Box::new(message), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] + #[doc = " `dest` side. May not be empty."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub fn teleport_assets( + &self, + dest: runtime_types::xcm::VersionedMultiLocation, + beneficiary: runtime_types::xcm::VersionedMultiLocation, + assets: runtime_types::xcm::VersionedMultiAssets, + fee_asset_item: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + TeleportAssets, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 55u8, 192u8, 217u8, 186u8, 230u8, 234u8, 26u8, 194u8, 243u8, + 199u8, 16u8, 227u8, 225u8, 88u8, 130u8, 219u8, 228u8, 110u8, + 20u8, 255u8, 233u8, 147u8, 121u8, 173u8, 126u8, 248u8, 192u8, + 243u8, 211u8, 91u8, 115u8, 148u8, + ] + { + let call = TeleportAssets { + dest: ::std::boxed::Box::new(dest), + beneficiary: ::std::boxed::Box::new(beneficiary), + assets: ::std::boxed::Box::new(assets), + fee_asset_item, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] + #[doc = "chain and forward a notification XCM."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] + #[doc = " `dest` side."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub fn reserve_transfer_assets( + &self, + dest: runtime_types::xcm::VersionedMultiLocation, + beneficiary: runtime_types::xcm::VersionedMultiLocation, + assets: runtime_types::xcm::VersionedMultiAssets, + fee_asset_item: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ReserveTransferAssets, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 134u8, 229u8, 104u8, 209u8, 160u8, 7u8, 99u8, 175u8, 128u8, + 110u8, 189u8, 225u8, 141u8, 1u8, 10u8, 17u8, 247u8, 233u8, + 146u8, 19u8, 31u8, 145u8, 217u8, 144u8, 85u8, 223u8, 197u8, + 249u8, 1u8, 222u8, 98u8, 13u8, + ] + { + let call = ReserveTransferAssets { + dest: ::std::boxed::Box::new(dest), + beneficiary: ::std::boxed::Box::new(beneficiary), + assets: ::std::boxed::Box::new(assets), + fee_asset_item, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Execute an XCM message from a local, signed, origin."] + #[doc = ""] + #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] + #[doc = "partially."] + #[doc = ""] + #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than the"] + #[doc = "maximum amount of weight that the message could take to be executed, then no execution"] + #[doc = "attempt will be made."] + #[doc = ""] + #[doc = "NOTE: A successful return to this does *not* imply that the `msg` was executed successfully"] + #[doc = "to completion; only that *some* of it was executed."] + pub fn execute( + &self, + message: runtime_types::xcm::VersionedXcm, + max_weight: ::core::primitive::u64, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Execute, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 95u8, 48u8, 201u8, 232u8, 83u8, 23u8, 20u8, 126u8, 116u8, + 116u8, 176u8, 206u8, 145u8, 9u8, 155u8, 109u8, 141u8, 226u8, + 253u8, 196u8, 37u8, 230u8, 243u8, 68u8, 39u8, 133u8, 233u8, + 108u8, 226u8, 87u8, 5u8, 247u8, + ] + { + let call = Execute { + message: ::std::boxed::Box::new(message), + max_weight, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Extoll that a particular destination can be communicated with through a particular"] + #[doc = "version of XCM."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `location`: The destination that is being described."] + #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] + pub fn force_xcm_version( + &self, + location: runtime_types::xcm::v1::multilocation::MultiLocation, + xcm_version: ::core::primitive::u32, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceXcmVersion, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self.client.metadata().call_hash::()? + == [ + 32u8, 219u8, 213u8, 152u8, 203u8, 73u8, 121u8, 64u8, 78u8, + 53u8, 110u8, 23u8, 87u8, 93u8, 34u8, 166u8, 205u8, 189u8, + 25u8, 160u8, 172u8, 178u8, 125u8, 182u8, 37u8, 254u8, 220u8, + 179u8, 70u8, 252u8, 63u8, 94u8, + ] + { + let call = ForceXcmVersion { + location: ::std::boxed::Box::new(location), + xcm_version, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] + #[doc = "version a destination can accept is unknown)."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] + pub fn force_default_xcm_version( + &self, + maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceDefaultXcmVersion, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 44u8, 161u8, 28u8, 189u8, 162u8, 221u8, 14u8, 31u8, 8u8, + 211u8, 181u8, 51u8, 197u8, 14u8, 87u8, 198u8, 3u8, 240u8, + 90u8, 78u8, 141u8, 131u8, 205u8, 250u8, 211u8, 150u8, 237u8, + 160u8, 239u8, 226u8, 233u8, 29u8, + ] + { + let call = ForceDefaultXcmVersion { maybe_xcm_version }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] + pub fn force_subscribe_version_notify( + &self, + location: runtime_types::xcm::VersionedMultiLocation, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceSubscribeVersionNotify, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 41u8, 248u8, 187u8, 195u8, 146u8, 143u8, 0u8, 246u8, 248u8, + 38u8, 128u8, 200u8, 143u8, 149u8, 127u8, 73u8, 3u8, 247u8, + 106u8, 6u8, 56u8, 50u8, 207u8, 234u8, 137u8, 201u8, 16u8, + 21u8, 226u8, 148u8, 181u8, 44u8, + ] + { + let call = ForceSubscribeVersionNotify { + location: ::std::boxed::Box::new(location), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] + #[doc = "version changes."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] + #[doc = " notifications which we no longer desire."] + pub fn force_unsubscribe_version_notify( + &self, + location: runtime_types::xcm::VersionedMultiLocation, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceUnsubscribeVersionNotify, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 150u8, 202u8, 148u8, 13u8, 187u8, 169u8, 5u8, 60u8, 25u8, + 144u8, 43u8, 196u8, 35u8, 215u8, 184u8, 72u8, 143u8, 220u8, + 176u8, 27u8, 100u8, 245u8, 31u8, 243u8, 0u8, 83u8, 165u8, + 7u8, 102u8, 172u8, 218u8, 133u8, + ] + { + let call = ForceUnsubscribeVersionNotify { + location: ::std::boxed::Box::new(location), + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] + #[doc = "chain and forward a notification XCM."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] + #[doc = " `dest` side."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn limited_reserve_transfer_assets( + &self, + dest: runtime_types::xcm::VersionedMultiLocation, + beneficiary: runtime_types::xcm::VersionedMultiLocation, + assets: runtime_types::xcm::VersionedMultiAssets, + fee_asset_item: ::core::primitive::u32, + weight_limit: runtime_types::xcm::v2::WeightLimit, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + LimitedReserveTransferAssets, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 242u8, 206u8, 126u8, 164u8, 44u8, 116u8, 181u8, 90u8, 121u8, + 124u8, 120u8, 240u8, 129u8, 217u8, 131u8, 100u8, 248u8, + 149u8, 56u8, 154u8, 35u8, 91u8, 210u8, 118u8, 207u8, 110u8, + 42u8, 249u8, 160u8, 155u8, 251u8, 68u8, + ] + { + let call = LimitedReserveTransferAssets { + dest: ::std::boxed::Box::new(dest), + beneficiary: ::std::boxed::Box::new(beneficiary), + assets: ::std::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] + #[doc = " `dest` side. May not be empty."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn limited_teleport_assets( + &self, + dest: runtime_types::xcm::VersionedMultiLocation, + beneficiary: runtime_types::xcm::VersionedMultiLocation, + assets: runtime_types::xcm::VersionedMultiAssets, + fee_asset_item: ::core::primitive::u32, + weight_limit: runtime_types::xcm::v2::WeightLimit, + ) -> Result< + ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + LimitedTeleportAssets, + DispatchError, + root_mod::Event, + >, + ::subxt::BasicError, + > { + if self + .client + .metadata() + .call_hash::()? + == [ + 189u8, 233u8, 43u8, 16u8, 158u8, 114u8, 154u8, 233u8, 179u8, + 144u8, 81u8, 179u8, 169u8, 38u8, 4u8, 130u8, 95u8, 237u8, + 172u8, 167u8, 2u8, 169u8, 53u8, 252u8, 159u8, 42u8, 143u8, + 216u8, 112u8, 155u8, 48u8, 129u8, + ] + { + let call = LimitedTeleportAssets { + dest: ::std::boxed::Box::new(dest), + beneficiary: ::std::boxed::Box::new(beneficiary), + assets: ::std::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }; + Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } + } + } + } + pub type Event = runtime_types::pallet_xcm::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Execution of an XCM message was attempted."] + #[doc = ""] + #[doc = "\\[ outcome \\]"] + pub struct Attempted(pub runtime_types::xcm::v2::traits::Outcome); + impl ::subxt::Event for Attempted { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "Attempted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A XCM message was sent."] + #[doc = ""] + #[doc = "\\[ origin, destination, message \\]"] + pub struct Sent( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub runtime_types::xcm::v2::Xcm, + ); + impl ::subxt::Event for Sent { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "Sent"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Query response received which does not match a registered query. This may be because a"] + #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] + #[doc = "because the query timed out."] + #[doc = ""] + #[doc = "\\[ origin location, id \\]"] + pub struct UnexpectedResponse( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for UnexpectedResponse { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "UnexpectedResponse"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] + #[doc = "no registered notification call."] + #[doc = ""] + #[doc = "\\[ id, response \\]"] + pub struct ResponseReady( + pub ::core::primitive::u64, + pub runtime_types::xcm::v2::Response, + ); + impl ::subxt::Event for ResponseReady { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "ResponseReady"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Query response has been received and query is removed. The registered notification has"] + #[doc = "been dispatched and executed successfully."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index \\]"] + pub struct Notified( + pub ::core::primitive::u64, + pub ::core::primitive::u8, + pub ::core::primitive::u8, + ); + impl ::subxt::Event for Notified { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "Notified"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Query response has been received and query is removed. The registered notification could"] + #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] + #[doc = "originally budgeted by this runtime for the query result."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index, actual weight, max budgeted weight \\]"] + pub struct NotifyOverweight( + pub ::core::primitive::u64, + pub ::core::primitive::u8, + pub ::core::primitive::u8, + pub ::core::primitive::u64, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for NotifyOverweight { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "NotifyOverweight"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Query response has been received and query is removed. There was a general error with"] + #[doc = "dispatching the notification call."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index \\]"] + pub struct NotifyDispatchError( + pub ::core::primitive::u64, + pub ::core::primitive::u8, + pub ::core::primitive::u8, + ); + impl ::subxt::Event for NotifyDispatchError { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "NotifyDispatchError"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] + #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] + #[doc = "is not `(origin, QueryId, Response)`."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index \\]"] + pub struct NotifyDecodeFailed( + pub ::core::primitive::u64, + pub ::core::primitive::u8, + pub ::core::primitive::u8, + ); + impl ::subxt::Event for NotifyDecodeFailed { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "NotifyDecodeFailed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Expected query response has been received but the origin location of the response does"] + #[doc = "not match that expected. The query remains registered for a later, valid, response to"] + #[doc = "be received and acted upon."] + #[doc = ""] + #[doc = "\\[ origin location, id, expected location \\]"] + pub struct InvalidResponder( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub ::core::primitive::u64, + pub ::core::option::Option< + runtime_types::xcm::v1::multilocation::MultiLocation, + >, + ); + impl ::subxt::Event for InvalidResponder { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "InvalidResponder"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Expected query response has been received but the expected origin location placed in"] + #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] + #[doc = ""] + #[doc = "This is unexpected (since a location placed in storage in a previously executing"] + #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] + #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] + #[doc = "needed."] + #[doc = ""] + #[doc = "\\[ origin location, id \\]"] + pub struct InvalidResponderVersion( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for InvalidResponderVersion { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "InvalidResponderVersion"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + #[doc = "Received query response has been read and removed."] + #[doc = ""] + #[doc = "\\[ id \\]"] + pub struct ResponseTaken(pub ::core::primitive::u64); + impl ::subxt::Event for ResponseTaken { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "ResponseTaken"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "Some assets have been placed in an asset trap."] + #[doc = ""] + #[doc = "\\[ hash, origin, assets \\]"] + pub struct AssetsTrapped( + pub ::subxt::sp_core::H256, + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub runtime_types::xcm::VersionedMultiAssets, + ); + impl ::subxt::Event for AssetsTrapped { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "AssetsTrapped"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "An XCM version change notification message has been attempted to be sent."] + #[doc = ""] + #[doc = "\\[ destination, result \\]"] + pub struct VersionChangeNotified( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for VersionChangeNotified { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "VersionChangeNotified"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "The supported version of a location has been changed. This might be through an"] + #[doc = "automatic notification or a manual intervention."] + #[doc = ""] + #[doc = "\\[ location, XCM version \\]"] + pub struct SupportedVersionChanged( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for SupportedVersionChanged { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "SupportedVersionChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "sending the notification to it."] + #[doc = ""] + #[doc = "\\[ location, query ID, error \\]"] + pub struct NotifyTargetSendFail( + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub ::core::primitive::u64, + pub runtime_types::xcm::v2::traits::Error, + ); + impl ::subxt::Event for NotifyTargetSendFail { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "NotifyTargetSendFail"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "migrating the location to our new XCM format."] + #[doc = ""] + #[doc = "\\[ location, query ID \\]"] + pub struct NotifyTargetMigrationFail( + pub runtime_types::xcm::VersionedMultiLocation, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for NotifyTargetMigrationFail { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "NotifyTargetMigrationFail"; + } + } + pub mod storage { + use super::runtime_types; + pub struct QueryCounter; + impl ::subxt::StorageEntry for QueryCounter { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "QueryCounter"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Queries<'a>(pub &'a ::core::primitive::u64); + impl ::subxt::StorageEntry for Queries<'_> { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "Queries"; + type Value = runtime_types::pallet_xcm::pallet::QueryStatus< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct AssetTraps<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for AssetTraps<'_> { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "AssetTraps"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct SafeXcmVersion; + impl ::subxt::StorageEntry for SafeXcmVersion { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "SafeXcmVersion"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SupportedVersion<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::xcm::VersionedMultiLocation, + ); + impl ::subxt::StorageEntry for SupportedVersion<'_> { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "SupportedVersion"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct VersionNotifiers<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::xcm::VersionedMultiLocation, + ); + impl ::subxt::StorageEntry for VersionNotifiers<'_> { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "VersionNotifiers"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct VersionNotifyTargets<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::xcm::VersionedMultiLocation, + ); + impl ::subxt::StorageEntry for VersionNotifyTargets<'_> { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "VersionNotifyTargets"; + type Value = ( + ::core::primitive::u64, + ::core::primitive::u64, + ::core::primitive::u32, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct VersionDiscoveryQueue; + impl ::subxt::StorageEntry for VersionDiscoveryQueue { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "VersionDiscoveryQueue"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + runtime_types::xcm::VersionedMultiLocation, + ::core::primitive::u32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentMigration; + impl ::subxt::StorageEntry for CurrentMigration { + const PALLET: &'static str = "XcmPallet"; + const STORAGE: &'static str = "CurrentMigration"; + type Value = runtime_types::pallet_xcm::pallet::VersionMigrationStage; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + #[doc = " The latest available query index."] + pub async fn query_counter( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[doc = " The ongoing queries."] + pub async fn queries( + &self, + _0: &::core::primitive::u64, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_xcm::pallet::QueryStatus< + ::core::primitive::u32, + >, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::subxt::sp_core::H256, + block_hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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, + > { + if self.client.metadata().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()) + } + } + #[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( + &self, + _0: &::core::primitive::u32, + _1: &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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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, + > { + if self + .client + .metadata() + .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()) + } + } + #[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( + &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, + > { + if self + .client + .metadata() + .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()) + } + } + #[doc = " The current migration's stage, if any."] + pub async fn current_migration( + &self, + block_hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_xcm::pallet::VersionMigrationStage, + >, + ::subxt::BasicError, + > { + if self.client.metadata().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()) + } + } + } + } + } + pub mod runtime_types { + use super::runtime_types; + pub mod bitvec { + use super::runtime_types; + pub mod order { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Lsb0; + } + } + pub mod finality_grandpa { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Equivocation<_0, _1, _2> { + pub round_number: ::core::primitive::u64, + pub identity: _0, + pub first: (_1, _2), + pub second: (_1, _2), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Precommit<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Prevote<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + } + pub mod frame_support { + use super::runtime_types; + pub mod dispatch { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Root, + #[codec(index = 1)] + Signed(_0), + #[codec(index = 2)] + None, + } + } + pub mod storage { + use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BoundedBTreeMap<_0, _1>(pub ::subxt::KeyedVec<_0, _1>); + } + pub mod bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BoundedVec<_0>(pub ::std::vec::Vec<_0>); + } + pub mod weak_bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); + } + } + pub mod traits { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct WrapperKeepOpaque<_0>( + #[codec(compact)] pub ::core::primitive::u32, + pub _0, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct WrapperOpaque<_0>( + #[codec(compact)] pub ::core::primitive::u32, + pub _0, + ); + } + pub mod schedule { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum LookupError { + #[codec(index = 0)] + Unknown, + #[codec(index = 1)] + BadFormat, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum MaybeHashed<_0, _1> { + #[codec(index = 0)] + Value(_0), + #[codec(index = 1)] + Hash(_1), + } + } + pub mod tokens { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + )] + pub enum BalanceStatus { + #[codec(index = 0)] + Free, + #[codec(index = 1)] + Reserved, + } + } + } + } + pub mod weights { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DispatchClass { + #[codec(index = 0)] + Normal, + #[codec(index = 1)] + Operational, + #[codec(index = 2)] + Mandatory, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct DispatchInfo { + pub weight: ::core::primitive::u64, + pub class: runtime_types::frame_support::weights::DispatchClass, + pub pays_fee: runtime_types::frame_support::weights::Pays, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Pays { + #[codec(index = 0)] + Yes, + #[codec(index = 1)] + No, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PerDispatchClass<_0> { + pub normal: _0, + pub operational: _0, + pub mandatory: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct RuntimeDbWeight { + pub read: ::core::primitive::u64, + pub write: ::core::primitive::u64, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PalletId(pub [::core::primitive::u8; 8usize]); + } + pub mod frame_system { + use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod check_genesis { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckGenesis; + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckMortality( + pub runtime_types::sp_runtime::generic::era::Era, + ); + } + pub mod check_non_zero_sender { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckNonZeroSender; + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckSpecVersion; + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckTxVersion; + } + pub mod check_weight { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CheckWeight; + } + } + pub mod limits { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BlockLength { + pub max: runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BlockWeights { + pub base_block: ::core::primitive::u64, + pub max_block: ::core::primitive::u64, + pub per_class: + runtime_types::frame_support::weights::PerDispatchClass< + runtime_types::frame_system::limits::WeightsPerClass, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct WeightsPerClass { + pub base_extrinsic: ::core::primitive::u64, + pub max_extrinsic: ::core::option::Option<::core::primitive::u64>, + pub max_total: ::core::option::Option<::core::primitive::u64>, + pub reserved: ::core::option::Option<::core::primitive::u64>, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "A dispatch that will fill the block weight up to the given ratio."] + fill_block { + ratio: runtime_types::sp_arithmetic::per_things::Perbill, + }, + #[codec(index = 1)] + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`"] + #[doc = "# "] + remark { + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 2)] + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + set_heap_pages { pages: ::core::primitive::u64 }, + #[codec(index = 3)] + #[doc = "Set the new runtime code."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] + #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] + #[doc = " expensive)."] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] + #[doc = "expensive. We will treat this as a full block."] + #[doc = "# "] + set_code { + code: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C)` where `C` length of `code`"] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] + #[doc = "block. # "] + set_code_without_checks { + code: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 5)] + #[doc = "Set some items of storage."] + set_storage { + items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, + }, + #[codec(index = 6)] + #[doc = "Kill some items from storage."] + kill_storage { + keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + }, + #[codec(index = 7)] + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + kill_prefix { + prefix: ::std::vec::Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, + }, + #[codec(index = 8)] + #[doc = "Make some on-chain remark and emit event."] + remark_with_event { + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The name of specification does not match between the current runtime"] + #[doc = "and the new runtime."] + InvalidSpecName, + #[codec(index = 1)] + #[doc = "The specification version is not allowed to decrease between the current runtime"] + #[doc = "and the new runtime."] + SpecVersionNeedsToIncrease, + #[codec(index = 2)] + #[doc = "Failed to extract the runtime version from the new runtime."] + #[doc = ""] + #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] + FailedToExtractRuntimeVersion, + #[codec(index = 3)] + #[doc = "Suicide called when the account has non-default composite data."] + NonDefaultComposite, + #[codec(index = 4)] + #[doc = "There is a non-zero reference count preventing the account from being purged."] + NonZeroRefCount, + #[codec(index = 5)] + #[doc = "The origin filter prevent the call to be dispatched."] + CallFiltered, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "An extrinsic completed successfully."] + ExtrinsicSuccess { + dispatch_info: + runtime_types::frame_support::weights::DispatchInfo, + }, + #[codec(index = 1)] + #[doc = "An extrinsic failed."] + ExtrinsicFailed { + dispatch_error: runtime_types::sp_runtime::DispatchError, + dispatch_info: + runtime_types::frame_support::weights::DispatchInfo, + }, + #[codec(index = 2)] + #[doc = "`:code` was updated."] + CodeUpdated, + #[codec(index = 3)] + #[doc = "A new account was created."] + NewAccount { + account: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "An account was reaped."] + KilledAccount { + account: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "On on-chain remark happened."] + Remarked { + sender: ::subxt::sp_core::crypto::AccountId32, + hash: ::subxt::sp_core::H256, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AccountInfo<_0, _1> { + pub nonce: _0, + pub consumers: _0, + pub providers: _0, + pub sufficients: _0, + pub data: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: ::std::vec::Vec<_1>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: ::core::primitive::u32, + pub spec_name: ::std::string::String, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Phase { + #[codec(index = 0)] + ApplyExtrinsic(::core::primitive::u32), + #[codec(index = 1)] + Finalization, + #[codec(index = 2)] + Initialization, + } + } + pub mod pallet_authorship { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Provide a set of uncles."] + set_uncles { + new_uncles: ::std::vec::Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The uncle parent not in the chain."] + InvalidUncleParent, + #[codec(index = 1)] + #[doc = "Uncles already set in the block."] + UnclesAlreadySet, + #[codec(index = 2)] + #[doc = "Too many uncles."] + TooManyUncles, + #[codec(index = 3)] + #[doc = "The uncle is genesis."] + GenesisUncle, + #[codec(index = 4)] + #[doc = "The uncle is too high in chain."] + TooHighUncle, + #[codec(index = 5)] + #[doc = "The uncle is already included."] + UncleAlreadyIncluded, + #[codec(index = 6)] + #[doc = "The uncle isn't recent enough to be included."] + OldUncle, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum UncleEntryItem<_0, _1, _2> { + #[codec(index = 0)] + InclusionHeight(_0), + #[codec(index = 1)] + Uncle(_1, ::core::option::Option<_2>), + } + } + pub mod pallet_babe { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] report_equivocation { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 1)] # [doc = "Report authority equivocation/misbehavior. This method will verify"] # [doc = "the equivocation proof and validate the given key ownership proof"] # [doc = "against the extracted offender. If both are valid, the offence will"] # [doc = "be reported."] # [doc = "This extrinsic must be called unsigned and it is expected that only"] # [doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] # [doc = "if the block author is defined it will be defined as the equivocation"] # [doc = "reporter."] report_equivocation_unsigned { equivocation_proof : :: std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , # [codec (index = 2)] # [doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] # [doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] # [doc = "Multiple calls to this method will replace any existing planned config change that had"] # [doc = "not been enacted yet."] plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] + InvalidEquivocationProof, + #[codec(index = 1)] + #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] + InvalidKeyOwnershipProof, + #[codec(index = 2)] + #[doc = "A given equivocation report is valid but already previously reported."] + DuplicateOffenceReport, + } + } + } + pub mod pallet_bags_list { + use super::runtime_types; + pub mod list { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Bag { + pub head: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub tail: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Node { + pub id: ::subxt::sp_core::crypto::AccountId32, + pub prev: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub next: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub bag_upper: ::core::primitive::u64, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] + #[doc = "changed its score that it should properly fall into a different bag than its current"] + #[doc = "one."] + #[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`."] + rebag { + dislocated: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Move the caller's Id directly in front of `lighter`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and can only be called by the Id of"] + #[doc = "the account going in front of `lighter`."] + #[doc = ""] + #[doc = "Only works if"] + #[doc = "- both nodes are within the same bag,"] + #[doc = "- and `origin` has a greater `Score` than `lighter`."] + put_in_front_of { + lighter: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Attempted to place node in front of a node in another bag."] + NotInSameBag, + #[codec(index = 1)] + #[doc = "Id not found in list."] + IdNotFound, + #[codec(index = 2)] + #[doc = "An Id does not have a greater score than another Id."] + NotHeavier, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Moved an account from one bag to another."] + Rebagged { + who: ::subxt::sp_core::crypto::AccountId32, + from: ::core::primitive::u64, + to: ::core::primitive::u64, + }, + } + } + } + pub mod pallet_balances { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] + #[doc = " types. See related functions below."] + #[doc = "- It contains a limited number of reads and writes internally and no complex"] + #[doc = " computation."] + #[doc = ""] + #[doc = "Related functions:"] + #[doc = ""] + #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] + #[doc = " - Transferring balances to accounts that did not exist before will cause"] + #[doc = " `T::OnNewAccount::on_new_account` to be called."] + #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] + #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] + #[doc = " that the transfer will not kill the origin account."] + #[doc = "---------------------------------"] + #[doc = "- Origin account is already in memory, so no DB operations for them."] + #[doc = "# "] + transfer { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Set the balances of a given account."] + #[doc = ""] + #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] + #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] + #[doc = "If the new free or reserved balance is below the existential deposit,"] + #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + set_balance { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + new_free: ::core::primitive::u128, + #[codec(compact)] + new_reserved: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] + #[doc = "specified."] + #[doc = "# "] + #[doc = "- Same as transfer, but additional read and write because the source account is not"] + #[doc = " assumed to be in the overlay."] + #[doc = "# "] + force_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] + #[doc = "origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer`] instead."] + #[doc = ""] + #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] + transfer_keep_alive { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true). # "] + #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] + #[doc = " #"] + transfer_all { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + keep_alive: ::core::primitive::bool, + }, + #[codec(index = 5)] + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + force_unreserve { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + amount: ::core::primitive::u128, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Vesting balance too high to send value"] + VestingBalance, + #[codec(index = 1)] + #[doc = "Account liquidity restrictions prevent withdrawal"] + LiquidityRestrictions, + #[codec(index = 2)] + #[doc = "Balance too low to send value"] + InsufficientBalance, + #[codec(index = 3)] + #[doc = "Value too low to create account due to existential deposit"] + ExistentialDeposit, + #[codec(index = 4)] + #[doc = "Transfer/payment would kill account"] + KeepAlive, + #[codec(index = 5)] + #[doc = "A vesting schedule already exists for this account"] + ExistingVestingSchedule, + #[codec(index = 6)] + #[doc = "Beneficiary account must pre-exist"] + DeadAccount, + #[codec(index = 7)] + #[doc = "Number of named reserves exceed MaxReserves"] + TooManyReserves, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] # [doc = "An account was created with some free balance."] Endowed { account : :: subxt :: sp_core :: crypto :: AccountId32 , free_balance : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] # [doc = "resulting in an outright loss."] DustLost { account : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 2)] # [doc = "Transfer succeeded."] Transfer { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "A balance was set by root."] BalanceSet { who : :: subxt :: sp_core :: crypto :: AccountId32 , free : :: core :: primitive :: u128 , reserved : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Some balance was reserved (moved from free to reserved)."] Reserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 5)] # [doc = "Some balance was unreserved (moved from reserved to free)."] Unreserved { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 6)] # [doc = "Some balance was moved from the reserve of the first account to the second account."] # [doc = "Final argument indicates the destination balance type."] ReserveRepatriated { from : :: subxt :: sp_core :: crypto :: AccountId32 , to : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , destination_status : runtime_types :: frame_support :: traits :: tokens :: misc :: BalanceStatus , } , # [codec (index = 7)] # [doc = "Some amount was deposited (e.g. for transaction fees)."] Deposit { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 8)] # [doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] Withdraw { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , # [codec (index = 9)] # [doc = "Some amount was removed from the account (e.g. for misbehavior)."] Slashed { who : :: subxt :: sp_core :: crypto :: AccountId32 , amount : :: core :: primitive :: u128 , } , } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AccountData<_0> { + pub free: _0, + pub reserved: _0, + pub misc_frozen: _0, + pub fee_frozen: _0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BalanceLock<_0> { + pub id: [::core::primitive::u8; 8usize], + pub amount: _0, + pub reasons: runtime_types::pallet_balances::Reasons, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Reasons { + #[codec(index = 0)] + Fee, + #[codec(index = 1)] + Misc, + #[codec(index = 2)] + All, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1_0_0, + #[codec(index = 1)] + V2_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReserveData<_0, _1> { + pub id: _0, + pub amount: _1, + } + } + pub mod pallet_bounties { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Propose a new bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] + #[doc = "or slashed when rejected."] + #[doc = ""] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] + #[doc = "- `description`: The description of this bounty."] + propose_bounty { + #[codec(compact)] + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + approve_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Assign a curator to a funded bounty."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + propose_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Unassign curator from a bounty."] + #[doc = ""] + #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] + #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] + #[doc = ""] + #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] + #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] + #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] + #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] + #[doc = "we should pick a new curator. In this case the curator should also be slashed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + unassign_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Accept the curator role for a bounty."] + #[doc = "A deposit will be reserved from curator and refund upon successful payout."] + #[doc = ""] + #[doc = "May only be called from the curator."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + accept_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] + #[doc = "after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to award."] + #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + award_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 6)] + #[doc = "Claim the payout from an awarded bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to claim."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + claim_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 7)] + #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] + #[doc = "the curator deposit will be unreserved if possible."] + #[doc = ""] + #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to cancel."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + close_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 8)] + #[doc = "Extend the expiry time of an active bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to extend."] + #[doc = "- `remark`: additional information."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + extend_bounty_expiry { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Proposer's balance is too low."] + InsufficientProposersBalance, + #[codec(index = 1)] + #[doc = "No proposal or bounty at that index."] + InvalidIndex, + #[codec(index = 2)] + #[doc = "The reason given is just too big."] + ReasonTooBig, + #[codec(index = 3)] + #[doc = "The bounty status is unexpected."] + UnexpectedStatus, + #[codec(index = 4)] + #[doc = "Require bounty curator."] + RequireCurator, + #[codec(index = 5)] + #[doc = "Invalid bounty value."] + InvalidValue, + #[codec(index = 6)] + #[doc = "Invalid bounty fee."] + InvalidFee, + #[codec(index = 7)] + #[doc = "A bounty payout is pending."] + #[doc = "To cancel the bounty, you must unassign and slash the curator."] + PendingPayout, + #[codec(index = 8)] + #[doc = "The bounties cannot be claimed/closed because it's still in the countdown period."] + Premature, + #[codec(index = 9)] + #[doc = "The bounty cannot be closed because it has active child-bounties."] + HasActiveChildBounty, + #[codec(index = 10)] + #[doc = "Too many approvals are already queued."] + TooManyQueued, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "New bounty proposal."] + BountyProposed { index: ::core::primitive::u32 }, + #[codec(index = 1)] + #[doc = "A bounty proposal was rejected; funds were slashed."] + BountyRejected { + index: ::core::primitive::u32, + bond: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "A bounty proposal is funded and became active."] + BountyBecameActive { index: ::core::primitive::u32 }, + #[codec(index = 3)] + #[doc = "A bounty is awarded to a beneficiary."] + BountyAwarded { + index: ::core::primitive::u32, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "A bounty is claimed by beneficiary."] + BountyClaimed { + index: ::core::primitive::u32, + payout: ::core::primitive::u128, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "A bounty is cancelled."] + BountyCanceled { index: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "A bounty expiry is extended."] + BountyExtended { index: ::core::primitive::u32 }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bounty<_0, _1, _2> { + pub proposer: _0, + pub value: _1, + pub fee: _1, + pub curator_deposit: _1, + pub bond: _1, + pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum BountyStatus<_0, _1> { + #[codec(index = 0)] + Proposed, + #[codec(index = 1)] + Approved, + #[codec(index = 2)] + Funded, + #[codec(index = 3)] + CuratorProposed { curator: _0 }, + #[codec(index = 4)] + Active { curator: _0, update_due: _1 }, + #[codec(index = 5)] + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, + } + } + pub mod pallet_child_bounties { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Add a new child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of parent"] + #[doc = "bounty and the parent bounty must be in \"active\" state."] + #[doc = ""] + #[doc = "Child-bounty gets added successfully & fund gets transferred from"] + #[doc = "parent bounty to child-bounty account, if parent bounty has enough"] + #[doc = "funds, else the call fails."] + #[doc = ""] + #[doc = "Upper bound to maximum number of active child-bounties that can be"] + #[doc = "added are managed via runtime trait config"] + #[doc = "[`Config::MaxActiveChildBountyCount`]."] + #[doc = ""] + #[doc = "If the call is success, the status of child-bounty is updated to"] + #[doc = "\"Added\"."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty for which child-bounty is being added."] + #[doc = "- `value`: Value for executing the proposal."] + #[doc = "- `description`: Text description for the child-bounty."] + add_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Propose curator for funded child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be curator of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"Added\" state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"CuratorProposed\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `curator`: Address of child-bounty curator."] + #[doc = "- `fee`: payment fee to child-bounty curator for execution."] + propose_curator { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Accept the curator role for the child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this"] + #[doc = "child-bounty."] + #[doc = ""] + #[doc = "A deposit will be reserved from the curator and refund upon"] + #[doc = "successful payout or cancellation."] + #[doc = ""] + #[doc = "Fee for curator is deducted from curator fee of parent bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in \"CuratorProposed\" state, for processing the"] + #[doc = "call. And state of child-bounty is moved to \"Active\" on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + accept_curator { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Unassign curator from a child-bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call can be either `RejectOrigin`, or"] + #[doc = "the curator of the parent bounty, or any signed origin."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin and the child-bounty"] + #[doc = "curator, parent-bounty must be in active state, for this call to"] + #[doc = "work. We allow child-bounty curator and T::RejectOrigin to execute"] + #[doc = "this call irrespective of the parent-bounty state."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin` or the"] + #[doc = "parent-bounty curator, we assume that the child-bounty curator is"] + #[doc = "malicious or inactive. As a result, child-bounty curator deposit is"] + #[doc = "slashed."] + #[doc = ""] + #[doc = "If the origin is the child-bounty curator, we take this as a sign"] + #[doc = "that they are unable to do their job, and are willingly giving up."] + #[doc = "We could slash the deposit, but for now we allow them to unreserve"] + #[doc = "their deposit and exit without issue. (We may want to change this if"] + #[doc = "it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone iff the child-bounty curator is"] + #[doc = "\"inactive\". Expiry update due of parent bounty is used to estimate"] + #[doc = "inactive state of child-bounty curator."] + #[doc = ""] + #[doc = "This allows anyone in the community to call out that a child-bounty"] + #[doc = "curator is not doing their due diligence, and we should pick a new"] + #[doc = "one. In this case the child-bounty curator deposit is slashed."] + #[doc = ""] + #[doc = "State of child-bounty is moved to Added state on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + unassign_curator { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Award child-bounty to a beneficiary."] + #[doc = ""] + #[doc = "The beneficiary will be able to claim the funds after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the master curator or"] + #[doc = "curator of this child-bounty."] + #[doc = ""] + #[doc = "Parent bounty must be in active state, for this child-bounty call to"] + #[doc = "work."] + #[doc = ""] + #[doc = "Child-bounty must be in active state, for processing the call. And"] + #[doc = "state of child-bounty is moved to \"PendingPayout\" on successful call"] + #[doc = "completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + #[doc = "- `beneficiary`: Beneficiary account."] + award_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 5)] + #[doc = "Claim the payout from an awarded child-bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call may be any signed origin."] + #[doc = ""] + #[doc = "Call works independent of parent bounty state, No need for parent"] + #[doc = "bounty to be in active state."] + #[doc = ""] + #[doc = "The Beneficiary is paid out with agreed bounty value. Curator fee is"] + #[doc = "paid & curator deposit is unreserved."] + #[doc = ""] + #[doc = "Child-bounty must be in \"PendingPayout\" state, for processing the"] + #[doc = "call. And instance of child-bounty is removed from the state on"] + #[doc = "successful call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + claim_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "Cancel a proposed or active child-bounty. Child-bounty account funds"] + #[doc = "are transferred to parent bounty account. The child-bounty curator"] + #[doc = "deposit may be unreserved if possible."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be either parent curator or"] + #[doc = "`T::RejectOrigin`."] + #[doc = ""] + #[doc = "If the state of child-bounty is `Active`, curator deposit is"] + #[doc = "unreserved."] + #[doc = ""] + #[doc = "If the state of child-bounty is `PendingPayout`, call fails &"] + #[doc = "returns `PendingPayout` error."] + #[doc = ""] + #[doc = "For the origin other than T::RejectOrigin, parent bounty must be in"] + #[doc = "active state, for this child-bounty call to work. For origin"] + #[doc = "T::RejectOrigin execution is forced."] + #[doc = ""] + #[doc = "Instance of child-bounty is removed from the state on successful"] + #[doc = "call completion."] + #[doc = ""] + #[doc = "- `parent_bounty_id`: Index of parent bounty."] + #[doc = "- `child_bounty_id`: Index of child bounty."] + close_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The parent bounty is not in active state."] + ParentBountyNotActive, + #[codec(index = 1)] + #[doc = "The bounty balance is not enough to add new child-bounty."] + InsufficientBountyBalance, + #[codec(index = 2)] + #[doc = "Number of child-bounties exceeds limit `MaxActiveChildBountyCount`."] + TooManyChildBounties, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A child-bounty is added."] + Added { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "A child-bounty is awarded to a beneficiary."] + Awarded { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 2)] + #[doc = "A child-bounty is claimed by beneficiary."] + Claimed { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + payout: ::core::primitive::u128, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + #[doc = "A child-bounty is cancelled."] + Canceled { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ChildBounty<_0, _1, _2> { + pub parent_bounty: _2, + pub value: _1, + pub fee: _1, + pub curator_deposit: _1, + pub status: + runtime_types::pallet_child_bounties::ChildBountyStatus<_0, _2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum ChildBountyStatus<_0, _1> { + #[codec(index = 0)] + Added, + #[codec(index = 1)] + CuratorProposed { curator: _0 }, + #[codec(index = 2)] + Active { curator: _0 }, + #[codec(index = 3)] + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, + } + } + pub mod pallet_collective { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Set the collective's membership."] + #[doc = ""] + #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] + #[doc = "- `prime`: The prime member whose vote sets the default."] + #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] + #[doc = " weight estimation."] + #[doc = ""] + #[doc = "Requires root origin."] + #[doc = ""] + #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] + #[doc = " the weight estimations rely on it to estimate dispatchable weight."] + #[doc = ""] + #[doc = "# WARNING:"] + #[doc = ""] + #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] + #[doc = "implementation of the trait [`ChangeMembers`]."] + #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] + #[doc = "with other logic managing the member set."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(MP + N)` where:"] + #[doc = " - `M` old-members-count (code- and governance-bounded)"] + #[doc = " - `N` new-members-count (code- and governance-bounded)"] + #[doc = " - `P` proposals-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] + #[doc = " members"] + #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] + #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] + #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] + #[doc = "# "] + set_members { + new_members: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + prime: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Dispatch a proposal from a member using the `Member` origin."] + #[doc = ""] + #[doc = "Origin must be a member of the collective."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] + #[doc = " `proposal`"] + #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] + #[doc = "- 1 event"] + #[doc = "# "] + execute { + proposal: + ::std::boxed::Box, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Add a new proposal to either be voted on or executed directly."] + #[doc = ""] + #[doc = "Requires the sender to be member."] + #[doc = ""] + #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] + #[doc = "or put up for voting."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - branching is influenced by `threshold` where:"] + #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] + #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] + #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] + #[doc = " - DB accesses influenced by `threshold`:"] + #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] + #[doc = " - OR proposal insertion (`threshold <= 2`)"] + #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] + #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] + #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] + #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] + #[doc = " - 1 event"] + #[doc = "# "] + propose { + #[codec(compact)] + threshold: ::core::primitive::u32, + proposal: + ::std::boxed::Box, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "Requires the sender to be a member."] + #[doc = ""] + #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `Members` (codec `O(M)`)"] + #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] + #[doc = "- 1 event"] + #[doc = "# "] + vote { + proposal: ::subxt::sp_core::H256, + #[codec(compact)] + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + }, + #[codec(index = 4)] + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + close { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + index: ::core::primitive::u32, + #[codec(compact)] + proposal_weight_bound: ::core::primitive::u64, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + disapprove_proposal { + proposal_hash: ::subxt::sp_core::H256, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Account is not a member"] + NotMember, + #[codec(index = 1)] + #[doc = "Duplicate proposals not allowed"] + DuplicateProposal, + #[codec(index = 2)] + #[doc = "Proposal must exist"] + ProposalMissing, + #[codec(index = 3)] + #[doc = "Mismatched index"] + WrongIndex, + #[codec(index = 4)] + #[doc = "Duplicate vote ignored"] + DuplicateVote, + #[codec(index = 5)] + #[doc = "Members are already initialized!"] + AlreadyInitialized, + #[codec(index = 6)] + #[doc = "The close call was made too early, before the end of the voting."] + TooEarly, + #[codec(index = 7)] + #[doc = "There can only be a maximum of `MaxProposals` active proposals."] + TooManyProposals, + #[codec(index = 8)] + #[doc = "The given weight bound for the proposal was too low."] + WrongProposalWeight, + #[codec(index = 9)] + #[doc = "The given length bound for the proposal was too low."] + WrongProposalLength, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] + #[doc = "`MemberCount`)."] + Proposed { + account: ::subxt::sp_core::crypto::AccountId32, + proposal_index: ::core::primitive::u32, + proposal_hash: ::subxt::sp_core::H256, + threshold: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "A motion (given hash) has been voted on by given account, leaving"] + #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] + Voted { + account: ::subxt::sp_core::crypto::AccountId32, + proposal_hash: ::subxt::sp_core::H256, + voted: ::core::primitive::bool, + yes: ::core::primitive::u32, + no: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "A motion was approved by the required threshold."] + Approved { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 3)] + #[doc = "A motion was not approved by the required threshold."] + Disapproved { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 4)] + #[doc = "A motion was executed; result will be `Ok` if it returned without error."] + Executed { + proposal_hash: ::subxt::sp_core::H256, + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + #[codec(index = 5)] + #[doc = "A single member did some action; result will be `Ok` if it returned without error."] + MemberExecuted { + proposal_hash: ::subxt::sp_core::H256, + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + #[codec(index = 6)] + #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] + Closed { + proposal_hash: ::subxt::sp_core::H256, + yes: ::core::primitive::u32, + no: ::core::primitive::u32, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Members(::core::primitive::u32, ::core::primitive::u32), + #[codec(index = 1)] + Member(_0), + #[codec(index = 2)] + _Phantom, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Votes<_0, _1> { + pub index: _1, + pub threshold: _1, + pub ayes: ::std::vec::Vec<_0>, + pub nays: ::std::vec::Vec<_0>, + pub end: _1, + } + } + pub mod pallet_democracy { + use super::runtime_types; + pub mod conviction { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Conviction { + #[codec(index = 0)] + None, + #[codec(index = 1)] + Locked1x, + #[codec(index = 2)] + Locked2x, + #[codec(index = 3)] + Locked3x, + #[codec(index = 4)] + Locked4x, + #[codec(index = 5)] + Locked5x, + #[codec(index = 6)] + Locked6x, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Propose a sensitive action to be taken."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] + #[doc = "have funds to cover the deposit."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the proposal preimage."] + #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] + #[doc = ""] + #[doc = "Emits `Proposed`."] + #[doc = ""] + #[doc = "Weight: `O(p)`"] + propose { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Signals agreement with a particular proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender"] + #[doc = "must have funds to cover the deposit, equal to the original deposit."] + #[doc = ""] + #[doc = "- `proposal`: The index of the proposal to second."] + #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] + #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] + #[doc = ""] + #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] + second { + #[codec(compact)] + proposal: ::core::primitive::u32, + #[codec(compact)] + seconds_upper_bound: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] + vote { + #[codec(compact)] + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + }, + #[codec(index = 3)] + #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancellationOrigin`."] + #[doc = ""] + #[doc = "-`ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + emergency_cancel { ref_index: ::core::primitive::u32 }, + #[codec(index = 4)] + #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] + #[doc = " Decoding vec of length V. Charged as maximum"] + external_propose { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 5)] + #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] + #[doc = "an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalMajorityOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + external_propose_majority { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 6)] + #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] + #[doc = "schedule an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalDefaultOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + external_propose_default { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 7)] + #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] + #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] + #[doc = "but it is not a majority-carries referendum then it fails."] + #[doc = ""] + #[doc = "The dispatch of this call must be `FastTrackOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the current external proposal."] + #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] + #[doc = " `FastTrackVotingPeriod` if too low."] + #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] + #[doc = " enacted. This doesn't have a minimum amount."] + #[doc = ""] + #[doc = "Emits `Started`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + fast_track { + proposal_hash: ::subxt::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + }, + #[codec(index = 8)] + #[doc = "Veto and blacklist the external proposal hash."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `VetoOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal to veto and blacklist."] + #[doc = ""] + #[doc = "Emits `Vetoed`."] + #[doc = ""] + #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] + veto_external { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 9)] + #[doc = "Remove a referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "# Weight: `O(1)`."] + cancel_referendum { + #[codec(compact)] + ref_index: ::core::primitive::u32, + }, + #[codec(index = 10)] + #[doc = "Cancel a proposal queued for enactment."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `which`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] + cancel_queued { which: ::core::primitive::u32 }, + #[codec(index = 11)] + #[doc = "Delegate the voting power (with some given conviction) of the sending account."] + #[doc = ""] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed/consolidated"] + #[doc = " through `reap_vote` or `unvote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + delegate { + to: ::subxt::sp_core::crypto::AccountId32, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + }, + #[codec(index = 12)] + #[doc = "Undelegate the voting power of the sending account."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + undelegate, + #[codec(index = 13)] + #[doc = "Clears all public proposals."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + clear_public_proposals, + #[codec(index = 14)] + #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] + #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + note_preimage { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 15)] + #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] + note_preimage_operational { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 16)] + #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] + #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] + #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] + #[doc = "no fee is paid."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + note_imminent_preimage { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 17)] + #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] + note_imminent_preimage_operational { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 18)] + #[doc = "Remove an expired proposal preimage and collect the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of a proposal."] + #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] + #[doc = " weighted according to this value with no refund."] + #[doc = ""] + #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] + #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] + #[doc = "work an additional `EnactmentPeriod` later."] + #[doc = ""] + #[doc = "Emits `PreimageReaped`."] + #[doc = ""] + #[doc = "Weight: `O(D)` where D is length of proposal."] + reap_preimage { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + proposal_len_upper_bound: ::core::primitive::u32, + }, + #[codec(index = 19)] + #[doc = "Unlock tokens that have an expired lock."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + unlock { + target: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 20)] + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the referendum was cancelled, or"] + #[doc = "- the referendum is ongoing, or"] + #[doc = "- the referendum has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the referendum has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for referendum `index`."] + #[doc = ""] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + remove_vote { index: ::core::primitive::u32 }, + #[codec(index = 21)] + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the referendum was cancelled, because the voter lost the referendum or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for"] + #[doc = " referendum `index`."] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + remove_other_vote { + target: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 22)] + #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] + enact_proposal { + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + }, + #[codec(index = 23)] + #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] + #[doc = "proposed again."] + #[doc = ""] + #[doc = "If called on a queued public or external proposal, then this will result in it being"] + #[doc = "removed. If the `ref_index` supplied is an active referendum with the proposal hash,"] + #[doc = "then it will be cancelled."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `BlacklistOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The proposal hash to blacklist permanently."] + #[doc = "- `ref_index`: An ongoing referendum whose hash is `proposal_hash`, which will be"] + #[doc = "cancelled."] + #[doc = ""] + #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] + #[doc = " reasonable value)."] + blacklist { + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 24)] + #[doc = "Remove a proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] + #[doc = ""] + #[doc = "- `prop_index`: The index of the proposal to cancel."] + #[doc = ""] + #[doc = "Weight: `O(p)` where `p = PublicProps::::decode_len()`"] + cancel_proposal { + #[codec(compact)] + prop_index: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Value too low"] + ValueLow, + #[codec(index = 1)] + #[doc = "Proposal does not exist"] + ProposalMissing, + #[codec(index = 2)] + #[doc = "Cannot cancel the same proposal twice"] + AlreadyCanceled, + #[codec(index = 3)] + #[doc = "Proposal already made"] + DuplicateProposal, + #[codec(index = 4)] + #[doc = "Proposal still blacklisted"] + ProposalBlacklisted, + #[codec(index = 5)] + #[doc = "Next external proposal not simple majority"] + NotSimpleMajority, + #[codec(index = 6)] + #[doc = "Invalid hash"] + InvalidHash, + #[codec(index = 7)] + #[doc = "No external proposal"] + NoProposal, + #[codec(index = 8)] + #[doc = "Identity may not veto a proposal twice"] + AlreadyVetoed, + #[codec(index = 9)] + #[doc = "Preimage already noted"] + DuplicatePreimage, + #[codec(index = 10)] + #[doc = "Not imminent"] + NotImminent, + #[codec(index = 11)] + #[doc = "Too early"] + TooEarly, + #[codec(index = 12)] + #[doc = "Imminent"] + Imminent, + #[codec(index = 13)] + #[doc = "Preimage not found"] + PreimageMissing, + #[codec(index = 14)] + #[doc = "Vote given for invalid referendum"] + ReferendumInvalid, + #[codec(index = 15)] + #[doc = "Invalid preimage"] + PreimageInvalid, + #[codec(index = 16)] + #[doc = "No proposals waiting"] + NoneWaiting, + #[codec(index = 17)] + #[doc = "The given account did not vote on the referendum."] + NotVoter, + #[codec(index = 18)] + #[doc = "The actor has no permission to conduct the action."] + NoPermission, + #[codec(index = 19)] + #[doc = "The account is already delegating."] + AlreadyDelegating, + #[codec(index = 20)] + #[doc = "Too high a balance was provided that the account cannot afford."] + InsufficientFunds, + #[codec(index = 21)] + #[doc = "The account is not currently delegating."] + NotDelegating, + #[codec(index = 22)] + #[doc = "The account currently has votes attached to it and the operation cannot succeed until"] + #[doc = "these are removed, either through `unvote` or `reap_vote`."] + VotesExist, + #[codec(index = 23)] + #[doc = "The instant referendum origin is currently disallowed."] + InstantNotAllowed, + #[codec(index = 24)] + #[doc = "Delegation to oneself makes no sense."] + Nonsense, + #[codec(index = 25)] + #[doc = "Invalid upper bound."] + WrongUpperBound, + #[codec(index = 26)] + #[doc = "Maximum number of votes reached."] + MaxVotesReached, + #[codec(index = 27)] + #[doc = "Maximum number of proposals reached."] + TooManyProposals, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 , } , } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Delegations<_0> { + pub votes: _0, + pub capital: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ReferendumInfo<_0, _1, _2> { + #[codec(index = 0)] + Ongoing( + runtime_types::pallet_democracy::types::ReferendumStatus< + _0, + _1, + _2, + >, + ), + #[codec(index = 1)] + Finished { + approved: ::core::primitive::bool, + end: _0, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ReferendumStatus<_0, _1, _2> { + pub end: _0, + pub proposal_hash: _1, + pub threshold: + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + pub delay: _0, + pub tally: runtime_types::pallet_democracy::types::Tally<_2>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Tally<_0> { + pub ayes: _0, + pub nays: _0, + pub turnout: _0, + } + } + pub mod vote { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum AccountVote<_0> { + #[codec(index = 0)] + Standard { + vote: runtime_types::pallet_democracy::vote::Vote, + balance: _0, + }, + #[codec(index = 1)] + Split { aye: _0, nay: _0 }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PriorLock<_0, _1>(pub _0, pub _1); + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Vote(pub ::core::primitive::u8); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Voting<_0, _1, _2> { + #[codec(index = 0)] + Direct { + votes: ::std::vec::Vec<( + _2, + runtime_types::pallet_democracy::vote::AccountVote<_0>, + )>, + delegations: + runtime_types::pallet_democracy::types::Delegations<_0>, + prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, + }, + #[codec(index = 1)] + Delegating { + balance: _0, + target: _1, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + delegations: + runtime_types::pallet_democracy::types::Delegations<_0>, + prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, + }, + } + } + pub mod vote_threshold { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum VoteThreshold { + #[codec(index = 0)] + SuperMajorityApprove, + #[codec(index = 1)] + SuperMajorityAgainst, + #[codec(index = 2)] + SimpleMajority, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum PreimageStatus<_0, _1, _2> { + #[codec(index = 0)] + Missing(_2), + #[codec(index = 1)] + Available { + data: ::std::vec::Vec<::core::primitive::u8>, + provider: _0, + deposit: _1, + since: _2, + expiry: ::core::option::Option<_2>, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1, + } + } + pub mod pallet_election_provider_multi_phase { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "Submit a solution for the unsigned phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __none__."] # [doc = ""] # [doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] # [doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] # [doc = "that only active validators can submit this transaction when authoring a block (similar"] # [doc = "to an inherent)."] # [doc = ""] # [doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] # [doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] # [doc = "putting their authoring reward at risk."] # [doc = ""] # [doc = "No deposit or reward is associated with this submission."] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] # [doc = "Set a new value for `MinimumUntrustedScore`."] # [doc = ""] # [doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] # [doc = ""] # [doc = "This check can be turned off by setting the value to `None`."] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < runtime_types :: sp_npos_elections :: ElectionScore > , } , # [codec (index = 2)] # [doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] # [doc = "call to `ElectionProvider::elect`."] # [doc = ""] # [doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] # [doc = ""] # [doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] # [doc = "feasibility check itself can in principle cause the election process to fail (due to"] # [doc = "memory/weight constrains)."] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] # [doc = "Submit a solution for the signed phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __signed__."] # [doc = ""] # [doc = "The solution is potentially queued, based on the claimed score and processed at the end"] # [doc = "of the signed phase."] # [doc = ""] # [doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] # [doc = "might be rewarded, slashed, or get all or a part of the deposit back."] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , } , # [codec (index = 4)] # [doc = "Trigger the governance fallback."] # [doc = ""] # [doc = "This can only be called when [`Phase::Emergency`] is enabled, as an alternative to"] # [doc = "calling [`Call::set_emergency_election_result`]."] governance_fallback { maybe_max_voters : :: core :: option :: Option < :: core :: primitive :: u32 > , maybe_max_targets : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Submission was too early."] + PreDispatchEarlySubmission, + #[codec(index = 1)] + #[doc = "Wrong number of winners presented."] + PreDispatchWrongWinnerCount, + #[codec(index = 2)] + #[doc = "Submission was too weak, score-wise."] + PreDispatchWeakSubmission, + #[codec(index = 3)] + #[doc = "The queue was full, and the solution was not better than any of the existing ones."] + SignedQueueFull, + #[codec(index = 4)] + #[doc = "The origin failed to pay the deposit."] + SignedCannotPayDeposit, + #[codec(index = 5)] + #[doc = "Witness data to dispatchable is invalid."] + SignedInvalidWitness, + #[codec(index = 6)] + #[doc = "The signed submission consumes too much weight"] + SignedTooMuchWeight, + #[codec(index = 7)] + #[doc = "OCW submitted solution for wrong round"] + OcwCallWrongEra, + #[codec(index = 8)] + #[doc = "Snapshot metadata should exist but didn't."] + MissingSnapshotMetadata, + #[codec(index = 9)] + #[doc = "`Self::insert_submission` returned an invalid index."] + InvalidSubmissionIndex, + #[codec(index = 10)] + #[doc = "The call is not allowed at this point."] + CallNotAllowed, + #[codec(index = 11)] + #[doc = "The fallback failed"] + FallbackFailed, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] # [doc = "A solution was stored with the given compute."] # [doc = ""] # [doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] # [doc = "solution is unsigned, this means that it has also been processed."] # [doc = ""] # [doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] SolutionStored { election_compute : runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , prev_ejected : :: core :: primitive :: bool , } , # [codec (index = 1)] # [doc = "The election has been finalized, with `Some` of the given computation, or else if the"] # [doc = "election failed, `None`."] ElectionFinalized { election_compute : :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > , } , # [codec (index = 2)] # [doc = "An account has been rewarded for their signed submission being finalized."] Rewarded { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 3)] # [doc = "An account has been slashed for submitting an invalid signed submission."] Slashed { account : :: subxt :: sp_core :: crypto :: AccountId32 , value : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "The signed phase of the given round has started."] SignedPhaseStarted { round : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "The unsigned phase of the given round has started."] UnsignedPhaseStarted { round : :: core :: primitive :: u32 , } , } + } + pub mod signed { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SignedSubmission<_0, _1, _2> { + pub who: _0, + pub deposit: _1, + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution< + _2, + >, + pub reward: _1, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum ElectionCompute { + #[codec(index = 0)] + OnChain, + #[codec(index = 1)] + Signed, + #[codec(index = 2)] + Unsigned, + #[codec(index = 3)] + Fallback, + #[codec(index = 4)] + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Phase<_0> { + #[codec(index = 0)] + Off, + #[codec(index = 1)] + Signed, + #[codec(index = 2)] + Unsigned((::core::primitive::bool, _0)), + #[codec(index = 3)] + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RawSolution<_0> { + pub solution: _0, + pub score: runtime_types::sp_npos_elections::ElectionScore, + pub round: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReadySolution<_0> { + pub supports: + ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub score: runtime_types::sp_npos_elections::ElectionScore, + pub compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RoundSnapshot { + pub voters: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + pub targets: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SolutionOrSnapshotSize { + #[codec(compact)] + pub voters: ::core::primitive::u32, + #[codec(compact)] + pub targets: ::core::primitive::u32, + } + } + pub mod pallet_elections_phragmen { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] + #[doc = "set the initial votes, or update already existing votes."] + #[doc = ""] + #[doc = "Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is"] + #[doc = "reserved. The deposit is based on the number of votes and can be updated over time."] + #[doc = ""] + #[doc = "The `votes` should:"] + #[doc = " - not be empty."] + #[doc = " - be less than the number of possible candidates. Note that all current members and"] + #[doc = " runners-up are also automatically candidates for the next round."] + #[doc = ""] + #[doc = "If `value` is more than `who`'s free balance, then the maximum of the two is used."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "It is the responsibility of the caller to **NOT** place all of their balance into the"] + #[doc = "lock and keep some for further operations."] + #[doc = ""] + #[doc = "# "] + #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] + #[doc = "# "] + vote { + votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Remove `origin` as a voter."] + #[doc = ""] + #[doc = "This removes the lock and returns the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed and be a voter."] + remove_voter, + #[codec(index = 2)] + #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] + #[doc = ""] + #[doc = "All candidates are wiped at the end of the term. They either become a member/runner-up,"] + #[doc = "or leave the system while their deposit is slashed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]"] + #[doc = "to get their deposit back. Losing the spot in an election will always lead to a slash."] + #[doc = ""] + #[doc = "# "] + #[doc = "The number of current candidates must be provided as witness data."] + #[doc = "# "] + submit_candidacy { + #[codec(compact)] + candidate_count: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] + #[doc = "outcomes exist:"] + #[doc = ""] + #[doc = "- `origin` is a candidate and not elected in any set. In this case, the deposit is"] + #[doc = " unreserved, returned and origin is removed as a candidate."] + #[doc = "- `origin` is a current runner-up. In this case, the deposit is unreserved, returned and"] + #[doc = " origin is removed as a runner-up."] + #[doc = "- `origin` is a current member. In this case, the deposit is unreserved and origin is"] + #[doc = " removed as a member, consequently not being a candidate for the next round anymore."] + #[doc = " Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they"] + #[doc = " are immediately used. If the prime is renouncing, then no prime will exist until the"] + #[doc = " next round."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed, and have one of the above roles."] + #[doc = ""] + #[doc = "# "] + #[doc = "The type of renouncing must be provided as witness data."] + #[doc = "# "] + renounce_candidacy { + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + }, + #[codec(index = 4)] + #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] + #[doc = "the outgoing member is slashed."] + #[doc = ""] + #[doc = "If a runner-up is available, then the best runner-up will be removed and replaces the"] + #[doc = "outgoing member. Otherwise, a new phragmen election is started."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "Note that this does not affect the designated block number of the next election."] + #[doc = ""] + #[doc = "# "] + #[doc = "If we have a replacement, we use a small weight. Else, since this is a root call and"] + #[doc = "will go into phragmen, we assume full block for now."] + #[doc = "# "] + remove_member { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + has_replacement: ::core::primitive::bool, + }, + #[codec(index = 5)] + #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] + #[doc = "deposit of the removed voters are returned."] + #[doc = ""] + #[doc = "This is an root function to be used only for cleaning the state."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "The total number of voters and those that are defunct must be provided as witness data."] + #[doc = "# "] + clean_defunct_voters { + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Cannot vote when no candidates or members exist."] + UnableToVote, + #[codec(index = 1)] + #[doc = "Must vote for at least one candidate."] + NoVotes, + #[codec(index = 2)] + #[doc = "Cannot vote more than candidates."] + TooManyVotes, + #[codec(index = 3)] + #[doc = "Cannot vote more than maximum allowed."] + MaximumVotesExceeded, + #[codec(index = 4)] + #[doc = "Cannot vote with stake less than minimum balance."] + LowBalance, + #[codec(index = 5)] + #[doc = "Voter can not pay voting bond."] + UnableToPayBond, + #[codec(index = 6)] + #[doc = "Must be a voter."] + MustBeVoter, + #[codec(index = 7)] + #[doc = "Cannot report self."] + ReportSelf, + #[codec(index = 8)] + #[doc = "Duplicated candidate submission."] + DuplicatedCandidate, + #[codec(index = 9)] + #[doc = "Member cannot re-submit candidacy."] + MemberSubmit, + #[codec(index = 10)] + #[doc = "Runner cannot re-submit candidacy."] + RunnerUpSubmit, + #[codec(index = 11)] + #[doc = "Candidate does not have enough funds."] + InsufficientCandidateFunds, + #[codec(index = 12)] + #[doc = "Not a member."] + NotMember, + #[codec(index = 13)] + #[doc = "The provided count of number of candidates is incorrect."] + InvalidWitnessData, + #[codec(index = 14)] + #[doc = "The provided count of number of votes is incorrect."] + InvalidVoteCount, + #[codec(index = 15)] + #[doc = "The renouncing origin presented a wrong `Renouncing` parameter."] + InvalidRenouncing, + #[codec(index = 16)] + #[doc = "Prediction regarding replacement after member removal is wrong."] + InvalidReplacement, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] + #[doc = "the election, not that enough have has been elected. The inner value must be examined"] + #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] + #[doc = "slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to"] + #[doc = "begin with."] + NewTerm { + new_members: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + }, + #[codec(index = 1)] + #[doc = "No (or not enough) candidates existed for this round. This is different from"] + #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] + EmptyTerm, + #[codec(index = 2)] + #[doc = "Internal error happened while trying to perform election."] + ElectionError, + #[codec(index = 3)] + #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] + #[doc = "`EmptyTerm`."] + MemberKicked { + member: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "Someone has renounced their candidacy."] + Renounced { + candidate: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] + #[doc = "runner-up."] + #[doc = ""] + #[doc = "Note that old members and runners-up are also candidates."] + CandidateSlashed { + candidate: ::subxt::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] + SeatHolderSlashed { + seat_holder: ::subxt::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Renouncing { + #[codec(index = 0)] + Member, + #[codec(index = 1)] + RunnerUp, + #[codec(index = 2)] + Candidate(#[codec(compact)] ::core::primitive::u32), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SeatHolder<_0, _1> { + pub who: _0, + pub stake: _1, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Voter<_0, _1> { + pub votes: ::std::vec::Vec<_0>, + pub stake: _1, + pub deposit: _1, + } + } + pub mod pallet_grandpa { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + report_equivocation { + equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + ::core::primitive::u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + #[codec(index = 1)] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + report_equivocation_unsigned { + equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + ::core::primitive::u32, + >, + >, + 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 = "Only callable by root."] + note_stalled { + delay: ::core::primitive::u32, + best_finalized_block_number: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Attempt to signal GRANDPA pause when the authority set isn't live"] + #[doc = "(either paused or already pending pause)."] + PauseFailed, + #[codec(index = 1)] + #[doc = "Attempt to signal GRANDPA resume when the authority set isn't paused"] + #[doc = "(either live or already pending resume)."] + ResumeFailed, + #[codec(index = 2)] + #[doc = "Attempt to signal GRANDPA change with one already pending."] + ChangePending, + #[codec(index = 3)] + #[doc = "Cannot signal forced change so soon after last."] + TooSoon, + #[codec(index = 4)] + #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] + InvalidKeyOwnershipProof, + #[codec(index = 5)] + #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] + InvalidEquivocationProof, + #[codec(index = 6)] + #[doc = "A given equivocation report is valid but already previously reported."] + DuplicateOffenceReport, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "New authority set has been applied."] + NewAuthorities { + authority_set: ::std::vec::Vec<( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + )>, + }, + #[codec(index = 1)] + #[doc = "Current authority set has been paused."] + Paused, + #[codec(index = 2)] + #[doc = "Current authority set has been resumed."] + Resumed, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 > , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum StoredState<_0> { + #[codec(index = 0)] + Live, + #[codec(index = 1)] + PendingPause { scheduled_at: _0, delay: _0 }, + #[codec(index = 2)] + Paused, + #[codec(index = 3)] + PendingResume { scheduled_at: _0, delay: _0 }, + } + } + pub mod pallet_identity { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Add a registrar to the system."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] + #[doc = ""] + #[doc = "- `account`: the account of the registrar."] + #[doc = ""] + #[doc = "Emits `RegistrarAdded` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)` where `R` registrar-count (governance-bounded and code-bounded)."] + #[doc = "- One storage mutation (codec `O(R)`)."] + #[doc = "- One event."] + #[doc = "# "] + add_registrar { + account: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Set an account's identity information and reserve the appropriate deposit."] + #[doc = ""] + #[doc = "If the account already has identity information, the deposit is taken as part payment"] + #[doc = "for the new deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `info`: The identity information."] + #[doc = ""] + #[doc = "Emits `IdentitySet` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(X + X' + R)`"] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)"] + #[doc = " - where `R` judgements-count (registrar-count-bounded)"] + #[doc = "- One balance reserve operation."] + #[doc = "- One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`)."] + #[doc = "- One event."] + #[doc = "# "] + set_identity { + info: ::std::boxed::Box< + runtime_types::pallet_identity::types::IdentityInfo, + >, + }, + #[codec(index = 2)] + #[doc = "Set the sub-accounts of the sender."] + #[doc = ""] + #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] + #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "- `subs`: The identity's (new) sub-accounts."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(P + S)`"] + #[doc = " - where `P` old-subs-count (hard- and deposit-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = "- At most one balance operations."] + #[doc = "- DB:"] + #[doc = " - `P + S` storage mutations (codec complexity `O(1)`)"] + #[doc = " - One storage read (codec complexity `O(P)`)."] + #[doc = " - One storage write (codec complexity `O(S)`)."] + #[doc = " - One storage-exists (`IdentityOf::contains_key`)."] + #[doc = "# "] + set_subs { + subs: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + }, + #[codec(index = 3)] + #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] + #[doc = ""] + #[doc = "Payment: All reserved balances on the account are returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "Emits `IdentityCleared` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`"] + #[doc = " - where `R` registrar-count (governance-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)."] + #[doc = "- One balance-unreserve operation."] + #[doc = "- `2` storage reads and `S + 2` storage deletions."] + #[doc = "- One event."] + #[doc = "# "] + clear_identity, + #[codec(index = 4)] + #[doc = "Request a judgement from a registrar."] + #[doc = ""] + #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] + #[doc = "given."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] + #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] + #[doc = ""] + #[doc = "```nocompile"] + #[doc = "Self::registrars().get(reg_index).unwrap().fee"] + #[doc = "```"] + #[doc = ""] + #[doc = "Emits `JudgementRequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(X + R)`."] + #[doc = "- One event."] + #[doc = "# "] + request_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + #[codec(compact)] + max_fee: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Cancel a previous request."] + #[doc = ""] + #[doc = "Payment: A previously reserved deposit is returned on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] + #[doc = ""] + #[doc = "Emits `JudgementUnrequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- One storage mutation `O(R + X)`."] + #[doc = "- One event"] + #[doc = "# "] + cancel_request { reg_index: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "Set the fee required for a judgement to be requested from a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fee`: the new fee."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.315 + R * 0.329 µs (min squares analysis)"] + #[doc = "# "] + set_fee { + #[codec(compact)] + index: ::core::primitive::u32, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 7)] + #[doc = "Change the account associated with a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `new`: the new account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 8.823 + R * 0.32 µs (min squares analysis)"] + #[doc = "# "] + set_account_id { + #[codec(compact)] + index: ::core::primitive::u32, + new: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 8)] + #[doc = "Set the field information for a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fields`: the fields that the registrar concerns themselves with."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.464 + R * 0.325 µs (min squares analysis)"] + #[doc = "# "] + set_fields { + #[codec(compact)] + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + }, + #[codec(index = 9)] + #[doc = "Provide a judgement for an account's identity."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `reg_index`."] + #[doc = ""] + #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] + #[doc = ""] + #[doc = "Emits `JudgementGiven` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-transfer operation."] + #[doc = "- Up to one account-lookup operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(R + X)`."] + #[doc = "- One event."] + #[doc = "# "] + provide_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + }, + #[codec(index = 10)] + #[doc = "Remove an account's identity and sub-account information and slash the deposits."] + #[doc = ""] + #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] + #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] + #[doc = "manually using `cancel_request`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + #[doc = ""] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = ""] + #[doc = "Emits `IdentityKilled` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- `S + 2` storage mutations."] + #[doc = "- One event."] + #[doc = "# "] + kill_identity { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 11)] + #[doc = "Add the given account to the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + add_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + #[codec(index = 12)] + #[doc = "Alter the associated name of the given sub-account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + rename_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + #[codec(index = 13)] + #[doc = "Remove the given account from the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + remove_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 14)] + #[doc = "Remove the sender as a sub-account."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender (*not* the original depositor)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "super-identity."] + #[doc = ""] + #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] + #[doc = "controller of an account is maliciously registered as a sub-account."] + quit_sub, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Too many subs-accounts."] + TooManySubAccounts, + #[codec(index = 1)] + #[doc = "Account isn't found."] + NotFound, + #[codec(index = 2)] + #[doc = "Account isn't named."] + NotNamed, + #[codec(index = 3)] + #[doc = "Empty index."] + EmptyIndex, + #[codec(index = 4)] + #[doc = "Fee is changed."] + FeeChanged, + #[codec(index = 5)] + #[doc = "No identity found."] + NoIdentity, + #[codec(index = 6)] + #[doc = "Sticky judgement."] + StickyJudgement, + #[codec(index = 7)] + #[doc = "Judgement given."] + JudgementGiven, + #[codec(index = 8)] + #[doc = "Invalid judgement."] + InvalidJudgement, + #[codec(index = 9)] + #[doc = "The index is invalid."] + InvalidIndex, + #[codec(index = 10)] + #[doc = "The target is invalid."] + InvalidTarget, + #[codec(index = 11)] + #[doc = "Too many additional fields."] + TooManyFields, + #[codec(index = 12)] + #[doc = "Maximum amount of registrars reached. Cannot add any more."] + TooManyRegistrars, + #[codec(index = 13)] + #[doc = "Account ID is already named."] + AlreadyClaimed, + #[codec(index = 14)] + #[doc = "Sender is not a sub-account."] + NotSub, + #[codec(index = 15)] + #[doc = "Sub-account isn't owned by sender."] + NotOwned, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A name was set or reset (which will remove all judgements)."] + IdentitySet { + who: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "A name was cleared, and the given balance returned."] + IdentityCleared { + who: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "A name was removed and the given balance slashed."] + IdentityKilled { + who: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A judgement was asked from a registrar."] + JudgementRequested { + who: ::subxt::sp_core::crypto::AccountId32, + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "A judgement request was retracted."] + JudgementUnrequested { + who: ::subxt::sp_core::crypto::AccountId32, + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "A judgement was given by a registrar."] + JudgementGiven { + target: ::subxt::sp_core::crypto::AccountId32, + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "A registrar was added."] + RegistrarAdded { + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 7)] + #[doc = "A sub-identity was added to an identity and the deposit paid."] + SubIdentityAdded { + sub: ::subxt::sp_core::crypto::AccountId32, + main: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 8)] + #[doc = "A sub-identity was removed from an identity and the deposit freed."] + SubIdentityRemoved { + sub: ::subxt::sp_core::crypto::AccountId32, + main: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] + #[doc = "main identity account to the sub-identity account."] + SubIdentityRevoked { + sub: ::subxt::sp_core::crypto::AccountId32, + main: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct BitFlags<_0>( + pub ::core::primitive::u64, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Data { + #[codec(index = 0)] + None, + #[codec(index = 1)] + Raw0([::core::primitive::u8; 0usize]), + #[codec(index = 2)] + Raw1([::core::primitive::u8; 1usize]), + #[codec(index = 3)] + Raw2([::core::primitive::u8; 2usize]), + #[codec(index = 4)] + Raw3([::core::primitive::u8; 3usize]), + #[codec(index = 5)] + Raw4([::core::primitive::u8; 4usize]), + #[codec(index = 6)] + Raw5([::core::primitive::u8; 5usize]), + #[codec(index = 7)] + Raw6([::core::primitive::u8; 6usize]), + #[codec(index = 8)] + Raw7([::core::primitive::u8; 7usize]), + #[codec(index = 9)] + Raw8([::core::primitive::u8; 8usize]), + #[codec(index = 10)] + Raw9([::core::primitive::u8; 9usize]), + #[codec(index = 11)] + Raw10([::core::primitive::u8; 10usize]), + #[codec(index = 12)] + Raw11([::core::primitive::u8; 11usize]), + #[codec(index = 13)] + Raw12([::core::primitive::u8; 12usize]), + #[codec(index = 14)] + Raw13([::core::primitive::u8; 13usize]), + #[codec(index = 15)] + Raw14([::core::primitive::u8; 14usize]), + #[codec(index = 16)] + Raw15([::core::primitive::u8; 15usize]), + #[codec(index = 17)] + Raw16([::core::primitive::u8; 16usize]), + #[codec(index = 18)] + Raw17([::core::primitive::u8; 17usize]), + #[codec(index = 19)] + Raw18([::core::primitive::u8; 18usize]), + #[codec(index = 20)] + Raw19([::core::primitive::u8; 19usize]), + #[codec(index = 21)] + Raw20([::core::primitive::u8; 20usize]), + #[codec(index = 22)] + Raw21([::core::primitive::u8; 21usize]), + #[codec(index = 23)] + Raw22([::core::primitive::u8; 22usize]), + #[codec(index = 24)] + Raw23([::core::primitive::u8; 23usize]), + #[codec(index = 25)] + Raw24([::core::primitive::u8; 24usize]), + #[codec(index = 26)] + Raw25([::core::primitive::u8; 25usize]), + #[codec(index = 27)] + Raw26([::core::primitive::u8; 26usize]), + #[codec(index = 28)] + Raw27([::core::primitive::u8; 27usize]), + #[codec(index = 29)] + Raw28([::core::primitive::u8; 28usize]), + #[codec(index = 30)] + Raw29([::core::primitive::u8; 29usize]), + #[codec(index = 31)] + Raw30([::core::primitive::u8; 30usize]), + #[codec(index = 32)] + Raw31([::core::primitive::u8; 31usize]), + #[codec(index = 33)] + Raw32([::core::primitive::u8; 32usize]), + #[codec(index = 34)] + BlakeTwo256([::core::primitive::u8; 32usize]), + #[codec(index = 35)] + Sha256([::core::primitive::u8; 32usize]), + #[codec(index = 36)] + Keccak256([::core::primitive::u8; 32usize]), + #[codec(index = 37)] + ShaThree256([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum IdentityField { + #[codec(index = 1)] + Display, + #[codec(index = 2)] + Legal, + #[codec(index = 4)] + Web, + #[codec(index = 8)] + Riot, + #[codec(index = 16)] + Email, + #[codec(index = 32)] + PgpFingerprint, + #[codec(index = 64)] + Image, + #[codec(index = 128)] + Twitter, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct IdentityInfo { + pub additional: + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + runtime_types::pallet_identity::types::Data, + runtime_types::pallet_identity::types::Data, + )>, + pub display: runtime_types::pallet_identity::types::Data, + pub legal: runtime_types::pallet_identity::types::Data, + pub web: runtime_types::pallet_identity::types::Data, + pub riot: runtime_types::pallet_identity::types::Data, + pub email: runtime_types::pallet_identity::types::Data, + pub pgp_fingerprint: + ::core::option::Option<[::core::primitive::u8; 20usize]>, + pub image: runtime_types::pallet_identity::types::Data, + pub twitter: runtime_types::pallet_identity::types::Data, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Judgement<_0> { + #[codec(index = 0)] + Unknown, + #[codec(index = 1)] + FeePaid(_0), + #[codec(index = 2)] + Reasonable, + #[codec(index = 3)] + KnownGood, + #[codec(index = 4)] + OutOfDate, + #[codec(index = 5)] + LowQuality, + #[codec(index = 6)] + Erroneous, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct RegistrarInfo<_0, _1> { + pub account: _1, + pub fee: _0, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Registration<_0> { + pub judgements: + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + ::core::primitive::u32, + runtime_types::pallet_identity::types::Judgement<_0>, + )>, + pub deposit: _0, + pub info: runtime_types::pallet_identity::types::IdentityInfo, + } + } + } + pub mod pallet_im_online { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "# "] # [doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] # [doc = " length of `heartbeat.network_state.external_address`"] # [doc = " - `O(K)`: decoding of length `K`"] # [doc = " - `O(E)`: decoding/encoding of length `E`"] # [doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] # [doc = " `ReceivedHeartbeats`"] # [doc = "- DbWrites: `ReceivedHeartbeats`"] # [doc = "# "] heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < :: core :: primitive :: u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Non existent public key."] + InvalidKey, + #[codec(index = 1)] + #[doc = "Duplicated heartbeat."] + DuplicatedHeartbeat, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new heartbeat was received from `AuthorityId`."] + HeartbeatReceived { + authority_id: + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + }, + #[codec(index = 1)] + #[doc = "At the end of the session, no offence was committed."] + AllGood, + #[codec(index = 2)] + #[doc = "At the end of the session, at least one validator was found to be offline."] + SomeOffline { + offline: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, + }, + } + } + pub mod sr25519 { + use super::runtime_types; + pub mod app_sr25519 { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 > > , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Heartbeat<_0> { + pub block_number: _0, + pub network_state: runtime_types::sp_core::offchain::OpaqueNetworkState, + pub session_index: _0, + pub authority_index: _0, + pub validators_len: _0, + } + } + pub mod pallet_indices { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Assign an previously unassigned index."] + #[doc = ""] + #[doc = "Payment: `Deposit` is reserved from the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be claimed. This must not be in use."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + claim { index: ::core::primitive::u32 }, + #[codec(index = 1)] + #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] + #[doc = "is effectively transferred to the new account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One transfer operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (recipient)"] + #[doc = " - Writes: Indices Accounts, System Account (recipient)"] + #[doc = "# "] + transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Free up an index owned by the sender."] + #[doc = ""] + #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] + #[doc = ""] + #[doc = "- `index`: the index to be freed. This must be owned by the sender."] + #[doc = ""] + #[doc = "Emits `IndexFreed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + free { index: ::core::primitive::u32 }, + #[codec(index = 3)] + #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] + #[doc = "held, then any deposit is reimbursed to its current owner."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `index`: the index to be (re-)assigned."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (original owner)"] + #[doc = " - Writes: Indices Accounts, System Account (original owner)"] + #[doc = "# "] + force_transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + freeze: ::core::primitive::bool, + }, + #[codec(index = 4)] + #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] + #[doc = "deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "- `index`: the index to be frozen in place."] + #[doc = ""] + #[doc = "Emits `IndexFrozen` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one slash operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + freeze { index: ::core::primitive::u32 }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The index was not already assigned."] + NotAssigned, + #[codec(index = 1)] + #[doc = "The index is assigned to another account."] + NotOwner, + #[codec(index = 2)] + #[doc = "The index was not available."] + InUse, + #[codec(index = 3)] + #[doc = "The source and destination accounts are identical."] + NotTransfer, + #[codec(index = 4)] + #[doc = "The index is permanent and may not be freed/changed."] + Permanent, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A account index was assigned."] + IndexAssigned { + who: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "A account index has been freed up (unassigned)."] + IndexFreed { index: ::core::primitive::u32 }, + #[codec(index = 2)] + #[doc = "A account index has been frozen to its current account ID."] + IndexFrozen { + index: ::core::primitive::u32, + who: ::subxt::sp_core::crypto::AccountId32, + }, + } + } + } + pub mod pallet_membership { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Add a member `who` to the set."] + #[doc = ""] + #[doc = "May only be called from `T::AddOrigin`."] + add_member { + who: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Remove a member `who` from the set."] + #[doc = ""] + #[doc = "May only be called from `T::RemoveOrigin`."] + remove_member { + who: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 2)] + #[doc = "Swap out one member `remove` for another `add`."] + #[doc = ""] + #[doc = "May only be called from `T::SwapOrigin`."] + #[doc = ""] + #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] + swap_member { + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] + #[doc = "pass `members` pre-sorted."] + #[doc = ""] + #[doc = "May only be called from `T::ResetOrigin`."] + reset_members { + members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + }, + #[codec(index = 4)] + #[doc = "Swap out the sending member for some other key `new`."] + #[doc = ""] + #[doc = "May only be called from `Signed` origin of a current member."] + #[doc = ""] + #[doc = "Prime membership is passed from the origin account to `new`, if extant."] + change_key { + new: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "Set the prime member. Must be a current member."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + set_prime { + who: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Remove the prime member if it exists."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + clear_prime, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Already a member."] + AlreadyMember, + #[codec(index = 1)] + #[doc = "Not a member."] + NotMember, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "The given member was added; see the transaction for who."] + MemberAdded, + #[codec(index = 1)] + #[doc = "The given member was removed; see the transaction for who."] + MemberRemoved, + #[codec(index = 2)] + #[doc = "Two members were swapped; see the transaction for who."] + MembersSwapped, + #[codec(index = 3)] + #[doc = "The membership was reset; see the transaction for who the new set is."] + MembersReset, + #[codec(index = 4)] + #[doc = "One of the members' keys changed."] + KeyChanged, + #[codec(index = 5)] + #[doc = "Phantom member, never used."] + Dummy, + } + } + } + pub mod pallet_multisig { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = "multi-signature, but do not participate in the approval process."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result."] + #[doc = ""] + #[doc = "# "] + #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight: None"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + as_multi_threshold_1 { + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + call: ::std::boxed::Box, + }, + #[codec(index = 1)] + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "If there are enough, then dispatch the call."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] + #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] + #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] + #[doc = "may be found in the deposited `MultisigExecuted` event."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S + Z + Call)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- The weight of the `call`."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + as_multi { + threshold: ::core::primitive::u16, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + >, + call: ::subxt::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + }, + #[codec(index = 2)] + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account]"] + #[doc = " - Write: Multisig Storage, [Caller Account]"] + #[doc = "# "] + approve_as_multi { + threshold: ::core::primitive::u16, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + >, + call_hash: [::core::primitive::u8; 32usize], + max_weight: ::core::primitive::u64, + }, + #[codec(index = 3)] + #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] + #[doc = "for this operation will be unreserved on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] + #[doc = "transaction for this dispatch."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- One event."] + #[doc = "- I/O: 1 read `O(S)`, one remove."] + #[doc = "- Storage: removes one item."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = "# "] + cancel_as_multi { + threshold: ::core::primitive::u16, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + call_hash: [::core::primitive::u8; 32usize], + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Threshold must be 2 or greater."] + MinimumThreshold, + #[codec(index = 1)] + #[doc = "Call is already approved by this signatory."] + AlreadyApproved, + #[codec(index = 2)] + #[doc = "Call doesn't need any (more) approvals."] + NoApprovalsNeeded, + #[codec(index = 3)] + #[doc = "There are too few signatories in the list."] + TooFewSignatories, + #[codec(index = 4)] + #[doc = "There are too many signatories in the list."] + TooManySignatories, + #[codec(index = 5)] + #[doc = "The signatories were provided out of order; they should be ordered."] + SignatoriesOutOfOrder, + #[codec(index = 6)] + #[doc = "The sender was contained in the other signatories; it shouldn't be."] + SenderInSignatories, + #[codec(index = 7)] + #[doc = "Multisig operation not found when attempting to cancel."] + NotFound, + #[codec(index = 8)] + #[doc = "Only the account that originally created the multisig is able to cancel it."] + NotOwner, + #[codec(index = 9)] + #[doc = "No timepoint was given, yet the multisig operation is already underway."] + NoTimepoint, + #[codec(index = 10)] + #[doc = "A different timepoint was given to the multisig operation that is underway."] + WrongTimepoint, + #[codec(index = 11)] + #[doc = "A timepoint was given, yet no multisig operation is underway."] + UnexpectedTimepoint, + #[codec(index = 12)] + #[doc = "The maximum weight information provided was too low."] + MaxWeightTooLow, + #[codec(index = 13)] + #[doc = "The data to be stored is already stored."] + AlreadyStored, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new multisig operation has begun."] + NewMultisig { + approving: ::subxt::sp_core::crypto::AccountId32, + multisig: ::subxt::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 1)] + #[doc = "A multisig operation has been approved by someone."] + MultisigApproval { + approving: ::subxt::sp_core::crypto::AccountId32, + timepoint: runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + multisig: ::subxt::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + #[doc = "A multisig operation has been executed."] + MultisigExecuted { + approving: ::subxt::sp_core::crypto::AccountId32, + timepoint: runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + multisig: ::subxt::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + #[codec(index = 3)] + #[doc = "A multisig operation has been cancelled."] + MultisigCancelled { + cancelling: ::subxt::sp_core::crypto::AccountId32, + timepoint: runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + multisig: ::subxt::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Multisig<_0, _1, _2> { + pub when: runtime_types::pallet_multisig::Timepoint<_0>, + pub deposit: _1, + pub depositor: _2, + pub approvals: ::std::vec::Vec<_2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Timepoint<_0> { + pub height: _0, + pub index: _0, + } + } + pub mod pallet_offences { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] + #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] + #[doc = "\\[kind, timeslot\\]."] + Offence { + kind: [::core::primitive::u8; 16usize], + timeslot: ::std::vec::Vec<::core::primitive::u8>, + }, + } + } + } + pub mod pallet_preimage { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Register a preimage on-chain."] + #[doc = ""] + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + note_preimage { + bytes: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Clear an unrequested preimage from the runtime storage."] + unnote_preimage { hash: ::subxt::sp_core::H256 }, + #[codec(index = 2)] + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] + #[doc = ""] + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + request_preimage { hash: ::subxt::sp_core::H256 }, + #[codec(index = 3)] + #[doc = "Clear a previously made request for a preimage."] + #[doc = ""] + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + unrequest_preimage { hash: ::subxt::sp_core::H256 }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Preimage is too large to store on-chain."] + TooLarge, + #[codec(index = 1)] + #[doc = "Preimage has already been noted on-chain."] + AlreadyNoted, + #[codec(index = 2)] + #[doc = "The user is not authorized to perform this action."] + NotAuthorized, + #[codec(index = 3)] + #[doc = "The preimage cannot be removed since it has not yet been noted."] + NotNoted, + #[codec(index = 4)] + #[doc = "A preimage may not be removed when there are outstanding requests."] + Requested, + #[codec(index = 5)] + #[doc = "The preimage request cannot be removed since no outstanding requests exist."] + NotRequested, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A preimage has been noted."] + Noted { hash: ::subxt::sp_core::H256 }, + #[codec(index = 1)] + #[doc = "A preimage has been requested."] + Requested { hash: ::subxt::sp_core::H256 }, + #[codec(index = 2)] + #[doc = "A preimage has ben cleared."] + Cleared { hash: ::subxt::sp_core::H256 }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum RequestStatus<_0, _1> { + #[codec(index = 0)] + Unrequested(::core::option::Option<(_0, _1)>), + #[codec(index = 1)] + Requested(::core::primitive::u32), + } + } + pub mod pallet_proxy { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "Removes any corresponding announcement(s)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + proxy { + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::polkadot_runtime::ProxyType, + >, + call: ::std::boxed::Box, + }, + #[codec(index = 1)] + #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] + #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + add_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Unregister a proxy account for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] + #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + remove_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Unregister all proxy accounts for the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] + #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + remove_proxies, + #[codec(index = 4)] + #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] + #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] + #[doc = ""] + #[doc = "Requires a `Signed` origin."] + #[doc = ""] + #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] + #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] + #[doc = "allow for maximum flexibility."] + #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] + #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] + #[doc = "want to use `0`."] + #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] + #[doc = "zero."] + #[doc = ""] + #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] + #[doc = "same sender, with the same parameters."] + #[doc = ""] + #[doc = "Fails if there are insufficient funds to pay for deposit."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + #[doc = "TODO: Might be over counting 1 read"] + anonymous { + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + index: ::core::primitive::u16, + }, + #[codec(index = 5)] + #[doc = "Removes a previously spawned anonymous proxy."] + #[doc = ""] + #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] + #[doc = "inaccessible."] + #[doc = ""] + #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] + #[doc = "`anonymous` with corresponding parameters."] + #[doc = ""] + #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] + #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] + #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] + #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] + #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] + #[doc = ""] + #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] + #[doc = "account whose `anonymous` call has corresponding parameters."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of the number of proxies the user has (P)."] + #[doc = "# "] + kill_anonymous { + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + index: ::core::primitive::u16, + #[codec(compact)] + height: ::core::primitive::u32, + #[codec(compact)] + ext_index: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "Publish the hash of a proxy-call that will be made in the future."] + #[doc = ""] + #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] + #[doc = "if the delay associated with the proxy relationship is greater than zero."] + #[doc = ""] + #[doc = "No more than `MaxPending` announcements may be made at any one time."] + #[doc = ""] + #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] + #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + announce { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 7)] + #[doc = "Remove a given announcement."] + #[doc = ""] + #[doc = "May be called by a proxy account to remove a call they previously announced and return"] + #[doc = "the deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + remove_announcement { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 8)] + #[doc = "Remove the given announcement of a delegate."] + #[doc = ""] + #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] + #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `delegate`: The account that previously announced the call."] + #[doc = "- `call_hash`: The hash of the call to be made."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + reject_announcement { + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 9)] + #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] + #[doc = "`add_proxy`."] + #[doc = ""] + #[doc = "Removes any corresponding announcement(s)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `real`: The account that the proxy will make a call on behalf of."] + #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] + #[doc = "- `call`: The call to be made by the `real` account."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight is a function of:"] + #[doc = "- A: the number of announcements made."] + #[doc = "- P: the number of proxies the user has."] + #[doc = "# "] + proxy_announced { + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::polkadot_runtime::ProxyType, + >, + call: ::std::boxed::Box, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "There are too many proxies registered or too many announcements pending."] + TooMany, + #[codec(index = 1)] + #[doc = "Proxy registration not found."] + NotFound, + #[codec(index = 2)] + #[doc = "Sender is not a proxy of the account to be proxied."] + NotProxy, + #[codec(index = 3)] + #[doc = "A call which is incompatible with the proxy type's filter was attempted."] + Unproxyable, + #[codec(index = 4)] + #[doc = "Account is already a proxy."] + Duplicate, + #[codec(index = 5)] + #[doc = "Call may not be made by proxy because it may escalate its privileges."] + NoPermission, + #[codec(index = 6)] + #[doc = "Announcement, if made at all, was made too recently."] + Unannounced, + #[codec(index = 7)] + #[doc = "Cannot add self as proxy."] + NoSelfProxy, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A proxy was executed correctly, with the given."] + ProxyExecuted { + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + #[codec(index = 1)] + #[doc = "Anonymous account has been created by new proxy with given"] + #[doc = "disambiguation index and proxy type."] + AnonymousCreated { + anonymous: ::subxt::sp_core::crypto::AccountId32, + who: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + disambiguation_index: ::core::primitive::u16, + }, + #[codec(index = 2)] + #[doc = "An announcement was placed to make a call in the future."] + Announced { + real: ::subxt::sp_core::crypto::AccountId32, + proxy: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 3)] + #[doc = "A proxy was added."] + ProxyAdded { + delegator: ::subxt::sp_core::crypto::AccountId32, + delegatee: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "A proxy was removed."] + ProxyRemoved { + delegator: ::subxt::sp_core::crypto::AccountId32, + delegatee: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Announcement<_0, _1, _2> { + pub real: _0, + pub call_hash: _1, + pub height: _2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProxyDefinition<_0, _1, _2> { + pub delegate: _0, + pub proxy_type: _1, + pub delay: _2, + } + } + pub mod pallet_scheduler { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Anonymously schedule a task."] + schedule { + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + }, + #[codec(index = 1)] + #[doc = "Cancel an anonymously scheduled task."] + cancel { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Schedule a named task."] + schedule_named { + id: ::std::vec::Vec<::core::primitive::u8>, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + }, + #[codec(index = 3)] + #[doc = "Cancel a named scheduled task."] + cancel_named { + id: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Anonymously schedule a task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule`]."] + #[doc = "# "] + schedule_after { + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + }, + #[codec(index = 5)] + #[doc = "Schedule a named task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule_named`](Self::schedule_named)."] + #[doc = "# "] + schedule_named_after { + id: ::std::vec::Vec<::core::primitive::u8>, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::polkadot_runtime::Call, + ::subxt::sp_core::H256, + >, + >, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Failed to schedule a call"] + FailedToSchedule, + #[codec(index = 1)] + #[doc = "Cannot find the scheduled call."] + NotFound, + #[codec(index = 2)] + #[doc = "Given target block number is in the past."] + TargetBlockNumberInPast, + #[codec(index = 3)] + #[doc = "Reschedule failed because it does not change scheduled time."] + RescheduleNoChange, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Scheduled some task."] + Scheduled { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Canceled some task."] + Canceled { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Dispatched some task."] + Dispatched { + task: (::core::primitive::u32, ::core::primitive::u32), + id: ::core::option::Option< + ::std::vec::Vec<::core::primitive::u8>, + >, + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + #[codec(index = 3)] + #[doc = "The call for the provided hash was not found so the task has been aborted."] + CallLookupFailed { + task: (::core::primitive::u32, ::core::primitive::u32), + id: ::core::option::Option< + ::std::vec::Vec<::core::primitive::u8>, + >, + error: + runtime_types::frame_support::traits::schedule::LookupError, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduledV3<_0, _1, _2, _3> { + pub maybe_id: + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub priority: ::core::primitive::u8, + pub call: _0, + pub maybe_periodic: ::core::option::Option<(_1, _1)>, + pub origin: _2, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, + } + } + pub mod pallet_session { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be signed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] + #[doc = " `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] + #[doc = "- DbWrites: `origin account`, `NextKeys`"] + #[doc = "- DbReads per key id: `KeyOwner`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + set_keys { + keys: runtime_types::polkadot_runtime::SessionKeys, + proof: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] + #[doc = " of `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] + #[doc = "- DbWrites: `NextKeys`, `origin account`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + purge_keys, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Invalid ownership proof."] + InvalidProof, + #[codec(index = 1)] + #[doc = "No associated validator ID for account."] + NoAssociatedValidatorId, + #[codec(index = 2)] + #[doc = "Registered duplicate key."] + DuplicatedKey, + #[codec(index = 3)] + #[doc = "No keys are associated with this account."] + NoKeys, + #[codec(index = 4)] + #[doc = "Key setting account is not live, so it's impossible to associate keys."] + NoAccount, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "New session has happened. Note that the argument is the session index, not the"] + #[doc = "block number as the type might suggest."] + NewSession { + session_index: ::core::primitive::u32, + }, + } + } + } + pub mod pallet_staking { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] + #[doc = "be the account that controls it."] + #[doc = ""] + #[doc = "`value` must be more than the `minimum_balance` specified by `T::Currency`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash account."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = "# "] + #[doc = "- Independent of the arguments. Moderate complexity."] + #[doc = "- O(1)."] + #[doc = "- Three extra DB entries."] + #[doc = ""] + #[doc = "NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned"] + #[doc = "unless the `origin` falls below _existential deposit_ and gets removed as dust."] + #[doc = "------------------"] + #[doc = "# "] + bond { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 1)] + #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] + #[doc = "for staking."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "Use this if there are additional funds in your stash account that you wish to bond."] + #[doc = "Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose"] + #[doc = "any limitation on the amount that can be added."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- O(1)."] + #[doc = "# "] + bond_extra { + #[codec(compact)] + max_additional: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] + #[doc = "period ends. If this leaves an amount actively bonded less than"] + #[doc = "T::Currency::minimum_balance(), then it is increased to the full amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "Once the unlock period is done, you can call `withdraw_unbonded` to actually move"] + #[doc = "the funds out of management ready for transfer."] + #[doc = ""] + #[doc = "No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)"] + #[doc = "can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need"] + #[doc = "to be called first to remove some of the chunks (if possible)."] + #[doc = ""] + #[doc = "If a user encounters the `InsufficientBond` error when calling this extrinsic,"] + #[doc = "they should call `chill` first in order to free up their bonded funds."] + #[doc = ""] + #[doc = "Emits `Unbonded`."] + #[doc = ""] + #[doc = "See also [`Call::withdraw_unbonded`]."] + unbond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] + #[doc = ""] + #[doc = "This essentially frees up that balance to be used by the stash account to do"] + #[doc = "whatever it wants."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller."] + #[doc = ""] + #[doc = "Emits `Withdrawn`."] + #[doc = ""] + #[doc = "See also [`Call::unbond`]."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity O(S) where S is the number of slashing spans to remove"] + #[doc = "NOTE: Weight annotation is the kill scenario, we refund otherwise."] + #[doc = "# "] + withdraw_unbonded { + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Declare the desire to validate for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + validate { + prefs: runtime_types::pallet_staking::ValidatorPrefs, + }, + #[codec(index = 5)] + #[doc = "Declare the desire to nominate `targets` for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- The transaction's complexity is proportional to the size of `targets` (N)"] + #[doc = "which is capped at CompactAssignments::LIMIT (T::MaxNominations)."] + #[doc = "- Both the reads and writes follow a similar pattern."] + #[doc = "# "] + nominate { + targets: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + }, + #[codec(index = 6)] + #[doc = "Declare no desire to either validate or nominate."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains one read."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "# "] + chill, + #[codec(index = 7)] + #[doc = "(Re-)set the payment target for a controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "---------"] + #[doc = "- Weight: O(1)"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Ledger"] + #[doc = " - Write: Payee"] + #[doc = "# "] + set_payee { + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 8)] + #[doc = "(Re-)set the controller of a stash."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "----------"] + #[doc = "Weight: O(1)"] + #[doc = "DB Weight:"] + #[doc = "- Read: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "# "] + set_controller { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 9)] + #[doc = "Sets the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight: O(1)"] + #[doc = "Write: Validator Count"] + #[doc = "# "] + set_validator_count { + #[codec(compact)] + new: ::core::primitive::u32, + }, + #[codec(index = 10)] + #[doc = "Increments the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + increase_validator_count { + #[codec(compact)] + additional: ::core::primitive::u32, + }, + #[codec(index = 11)] + #[doc = "Scale up the ideal number of validators by a factor."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + scale_validator_count { + factor: runtime_types::sp_arithmetic::per_things::Percent, + }, + #[codec(index = 12)] + #[doc = "Force there to be no new eras indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "Thus the election process may be ongoing when this is called. In this case the"] + #[doc = "election will continue until the next era is triggered."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write: ForceEra"] + #[doc = "# "] + force_no_eras, + #[codec(index = 13)] + #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] + #[doc = "reset to normal (non-forced) behaviour."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write ForceEra"] + #[doc = "# "] + force_new_era, + #[codec(index = 14)] + #[doc = "Set the validators who cannot be slashed (if any)."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + set_invulnerables { + invulnerables: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + }, + #[codec(index = 15)] + #[doc = "Force a current staker to become completely unstaked, immediately."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + force_unstake { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 16)] + #[doc = "Force there to be a new era at the end of sessions indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + force_new_era_always, + #[codec(index = 17)] + #[doc = "Cancel enactment of a deferred slash."] + #[doc = ""] + #[doc = "Can be called by the `T::SlashCancelOrigin`."] + #[doc = ""] + #[doc = "Parameters: era and indices of the slashes for that era to kill."] + cancel_deferred_slash { + era: ::core::primitive::u32, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, + }, + #[codec(index = 18)] + #[doc = "Pay out all the stakers behind a single validator for a single era."] + #[doc = ""] + #[doc = "- `validator_stash` is the stash account of the validator. Their nominators, up to"] + #[doc = " `T::MaxNominatorRewardedPerValidator`, will also receive their rewards."] + #[doc = "- `era` may be any era between `[current_era - history_depth; current_era]`."] + #[doc = ""] + #[doc = "The origin of this call must be _Signed_. Any account can call this function, even if"] + #[doc = "it is not one of the stakers."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: at most O(MaxNominatorRewardedPerValidator)."] + #[doc = "- Contains a limited number of reads and writes."] + #[doc = "-----------"] + #[doc = "N is the Number of payouts for the validator (including the validator)"] + #[doc = "Weight:"] + #[doc = "- Reward Destination Staked: O(N)"] + #[doc = "- Reward Destination Controller (Creating): O(N)"] + #[doc = ""] + #[doc = " NOTE: weights are assuming that payouts are made to alive stash account (Staked)."] + #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] + #[doc = "# "] + payout_stakers { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + }, + #[codec(index = 19)] + #[doc = "Rebond a portion of the stash scheduled to be unlocked."] + #[doc = ""] + #[doc = "The dispatch origin must be signed by the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: O(L), where L is unlocking chunks"] + #[doc = "- Bounded by `MaxUnlockingChunks`."] + #[doc = "- Storage changes: Can't increase storage, only decrease it."] + #[doc = "# "] + rebond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 20)] + #[doc = "Set `HistoryDepth` value. This function will delete any history information"] + #[doc = "when `HistoryDepth` is reduced."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `new_history_depth`: The new history depth you would like to set."] + #[doc = "- `era_items_deleted`: The number of items that will be deleted by this dispatch. This"] + #[doc = " should report all the storage items that will be deleted by clearing old era history."] + #[doc = " Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an"] + #[doc = " accurate number."] + #[doc = ""] + #[doc = "Origin must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "- E: Number of history depths removed, i.e. 10 -> 7 = 3"] + #[doc = "- Weight: O(E)"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Current Era, History Depth"] + #[doc = " - Writes: History Depth"] + #[doc = " - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs"] + #[doc = " - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,"] + #[doc = " ErasStartSessionIndex"] + #[doc = "# "] + set_history_depth { + #[codec(compact)] + new_history_depth: ::core::primitive::u32, + #[codec(compact)] + era_items_deleted: ::core::primitive::u32, + }, + #[codec(index = 21)] + #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] + #[doc = "be considered `dust` in the staking system. The requirements are:"] + #[doc = ""] + #[doc = "1. the `total_balance` of the stash is below existential deposit."] + #[doc = "2. or, the `ledger.total` of the stash is below existential deposit."] + #[doc = ""] + #[doc = "The former can happen in cases like a slash; the latter when a fully unbonded account"] + #[doc = "is still receiving staking rewards in `RewardDestination::Staked`."] + #[doc = ""] + #[doc = "It can be called by anyone, as long as `stash` meets the above requirements."] + #[doc = ""] + #[doc = "Refunds the transaction fees upon successful execution."] + reap_stash { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 22)] + #[doc = "Remove the given nominations from the calling validator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "- `who`: A list of nominator stash accounts who are nominating this validator which"] + #[doc = " should no longer be nominating this validator."] + #[doc = ""] + #[doc = "Note: Making this call only makes sense if you first set the validator preferences to"] + #[doc = "block any further nominations."] + kick { + who: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + }, + #[codec(index = 23)] + #[doc = "Update the various staking configurations ."] + #[doc = ""] + #[doc = "* `min_nominator_bond`: The minimum active bond needed to be a nominator."] + #[doc = "* `min_validator_bond`: The minimum active bond needed to be a validator."] + #[doc = "* `max_nominator_count`: The max number of users who can be a nominator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `max_validator_count`: The max number of users who can be a validator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which"] + #[doc = " should be filled in order for the `chill_other` transaction to work."] + #[doc = "* `min_commission`: The minimum amount of commission that each validators must maintain."] + #[doc = " This is checked only upon calling `validate`. Existing validators are not affected."] + #[doc = ""] + #[doc = "Origin must be Root to call this function."] + #[doc = ""] + #[doc = "NOTE: Existing nominators and validators will not be affected by this update."] + #[doc = "to kick people under the new limits, `chill_other` should be called."] + set_staking_configs { + min_nominator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + min_validator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + max_nominator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + max_validator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + chill_threshold: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, + min_commission: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + }, + #[codec(index = 24)] + #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_, but can be called by anyone."] + #[doc = ""] + #[doc = "If the caller is the same as the controller being targeted, then no further checks are"] + #[doc = "enforced, and this function behaves just like `chill`."] + #[doc = ""] + #[doc = "If the caller is different than the controller being targeted, the following conditions"] + #[doc = "must be met:"] + #[doc = ""] + #[doc = "* `controller` must belong to a nominator who has become non-decodable,"] + #[doc = ""] + #[doc = "Or:"] + #[doc = ""] + #[doc = "* A `ChillThreshold` must be set and checked which defines how close to the max"] + #[doc = " nominators or validators we must reach before users can start chilling one-another."] + #[doc = "* A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine"] + #[doc = " how close we are to the threshold."] + #[doc = "* A `MinNominatorBond` and `MinValidatorBond` must be set and checked, which determines"] + #[doc = " if this is a person that should be chilled because they have not met the threshold"] + #[doc = " bond required."] + #[doc = ""] + #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] + #[doc = "who do not satisfy these requirements."] + chill_other { + controller: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 25)] + #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] + #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] + #[doc = "can call this."] + force_apply_min_commission { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ConfigOp<_0> { + #[codec(index = 0)] + Noop, + #[codec(index = 1)] + Set(_0), + #[codec(index = 2)] + Remove, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Not a controller account."] + NotController, + #[codec(index = 1)] + #[doc = "Not a stash account."] + NotStash, + #[codec(index = 2)] + #[doc = "Stash is already bonded."] + AlreadyBonded, + #[codec(index = 3)] + #[doc = "Controller is already paired."] + AlreadyPaired, + #[codec(index = 4)] + #[doc = "Targets cannot be empty."] + EmptyTargets, + #[codec(index = 5)] + #[doc = "Duplicate index."] + DuplicateIndex, + #[codec(index = 6)] + #[doc = "Slash record index out of bounds."] + InvalidSlashIndex, + #[codec(index = 7)] + #[doc = "Cannot have a validator or nominator role, with value less than the minimum defined by"] + #[doc = "governance (see `MinValidatorBond` and `MinNominatorBond`). If unbonding is the"] + #[doc = "intention, `chill` first to remove one's role as validator/nominator."] + InsufficientBond, + #[codec(index = 8)] + #[doc = "Can not schedule more unlock chunks."] + NoMoreChunks, + #[codec(index = 9)] + #[doc = "Can not rebond without unlocking chunks."] + NoUnlockChunk, + #[codec(index = 10)] + #[doc = "Attempting to target a stash that still has funds."] + FundedTarget, + #[codec(index = 11)] + #[doc = "Invalid era to reward."] + InvalidEraToReward, + #[codec(index = 12)] + #[doc = "Invalid number of nominations."] + InvalidNumberOfNominations, + #[codec(index = 13)] + #[doc = "Items are not sorted and unique."] + NotSortedAndUnique, + #[codec(index = 14)] + #[doc = "Rewards for this era have already been claimed for this validator."] + AlreadyClaimed, + #[codec(index = 15)] + #[doc = "Incorrect previous history depth input provided."] + IncorrectHistoryDepth, + #[codec(index = 16)] + #[doc = "Incorrect number of slashing spans provided."] + IncorrectSlashingSpans, + #[codec(index = 17)] + #[doc = "Internal state has become somehow corrupted and the operation cannot continue."] + BadState, + #[codec(index = 18)] + #[doc = "Too many nomination targets supplied."] + TooManyTargets, + #[codec(index = 19)] + #[doc = "A nomination target was supplied that was blocked or otherwise not a validator."] + BadTarget, + #[codec(index = 20)] + #[doc = "The user has enough bond and thus cannot be chilled forcefully by an external person."] + CannotChillOther, + #[codec(index = 21)] + #[doc = "There are too many nominators in the system. Governance needs to adjust the staking"] + #[doc = "settings to keep things safe for the runtime."] + TooManyNominators, + #[codec(index = 22)] + #[doc = "There are too many validators in the system. Governance needs to adjust the staking"] + #[doc = "settings to keep things safe for the runtime."] + TooManyValidators, + #[codec(index = 23)] + #[doc = "Commission is too low. Must be at least `MinCommission`."] + CommissionTooLow, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] + #[doc = "the remainder from the maximum amount of reward."] + #[doc = "\\[era_index, validator_payout, remainder\\]"] + EraPaid( + ::core::primitive::u32, + ::core::primitive::u128, + ::core::primitive::u128, + ), + #[codec(index = 1)] + #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] + Rewarded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 2)] + #[doc = "One validator (and its nominators) has been slashed by the given amount."] + #[doc = "\\[validator, amount\\]"] + Slashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 3)] + #[doc = "An old slashing report from a prior era was discarded because it could"] + #[doc = "not be processed. \\[session_index\\]"] + OldSlashingReportDiscarded(::core::primitive::u32), + #[codec(index = 4)] + #[doc = "A new set of stakers was elected."] + StakersElected, + #[codec(index = 5)] + #[doc = "An account has bonded this amount. \\[stash, amount\\]"] + #[doc = ""] + #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] + #[doc = "it will not be emitted for staking rewards when they are added to stake."] + Bonded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 6)] + #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] + Unbonded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 7)] + #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] + #[doc = "from the unlocking queue. \\[stash, amount\\]"] + Withdrawn( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 8)] + #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] + Kicked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 9)] + #[doc = "The election failed. No new era is planned."] + StakingElectionFailed, + #[codec(index = 10)] + #[doc = "An account has stopped participating as either a validator or nominator."] + #[doc = "\\[stash\\]"] + Chilled(::subxt::sp_core::crypto::AccountId32), + #[codec(index = 11)] + #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] + PayoutStarted( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + } + } + } + pub mod slashing { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SlashingSpans { + pub span_index: ::core::primitive::u32, + pub last_start: ::core::primitive::u32, + pub last_nonzero_slash: ::core::primitive::u32, + pub prior: ::std::vec::Vec<::core::primitive::u32>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SpanRecord<_0> { + pub slashed: _0, + pub paid_out: _0, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ActiveEraInfo { + pub index: ::core::primitive::u32, + pub start: ::core::option::Option<::core::primitive::u64>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EraRewardPoints<_0> { + pub total: ::core::primitive::u32, + pub individual: ::subxt::KeyedVec<_0, ::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Exposure<_0, _1> { + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub own: _1, + pub others: ::std::vec::Vec< + runtime_types::pallet_staking::IndividualExposure<_0, _1>, + >, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Forcing { + #[codec(index = 0)] + NotForcing, + #[codec(index = 1)] + ForceNew, + #[codec(index = 2)] + ForceNone, + #[codec(index = 3)] + ForceAlways, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IndividualExposure<_0, _1> { + pub who: _0, + #[codec(compact)] + pub value: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Nominations { + pub targets: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + pub submitted_in: ::core::primitive::u32, + pub suppressed: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1_0_0Ancient, + #[codec(index = 1)] + V2_0_0, + #[codec(index = 2)] + V3_0_0, + #[codec(index = 3)] + V4_0_0, + #[codec(index = 4)] + V5_0_0, + #[codec(index = 5)] + V6_0_0, + #[codec(index = 6)] + V7_0_0, + #[codec(index = 7)] + V8_0_0, + #[codec(index = 8)] + V9_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum RewardDestination<_0> { + #[codec(index = 0)] + Staked, + #[codec(index = 1)] + Stash, + #[codec(index = 2)] + Controller, + #[codec(index = 3)] + Account(_0), + #[codec(index = 4)] + None, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct StakingLedger<_0, _1> { + pub stash: _0, + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub active: _1, + pub unlocking: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_staking::UnlockChunk<_1>, + >, + pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnappliedSlash<_0, _1> { + pub validator: _0, + pub own: _1, + pub others: ::std::vec::Vec<(_0, _1)>, + pub reporters: ::std::vec::Vec<_0>, + pub payout: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnlockChunk<_0> { + #[codec(compact)] + pub value: _0, + #[codec(compact)] + pub era: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ValidatorPrefs { + #[codec(compact)] + pub commission: runtime_types::sp_arithmetic::per_things::Perbill, + pub blocked: ::core::primitive::bool, + } + } + pub mod pallet_timestamp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "`MinimumPeriod`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Inherent`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + #[doc = "# "] + set { + #[codec(compact)] + now: ::core::primitive::u64, + }, + } + } + } + pub mod pallet_tips { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R)` where `R` length of `reason`."] + #[doc = " - encoding and hashing of 'reason'"] + #[doc = "- DbReads: `Reasons`, `Tips`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + report_awesome { + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] + #[doc = ""] + #[doc = "If successful, the original deposit will be unreserved."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the tip identified by `hash`"] + #[doc = "must have been reported by the signing account through `report_awesome` (and not"] + #[doc = "through `tip_new`)."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "Emits `TipRetracted` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`"] + #[doc = " - Depends on the length of `T::Hash` which is fixed."] + #[doc = "- DbReads: `Tips`, `origin account`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] + #[doc = "# "] + retract_tip { hash: ::subxt::sp_core::H256 }, + #[codec(index = 2)] + #[doc = "Give a tip for something new; no finder's fee will be taken."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R + T)` where `R` length of `reason`, `T` is the number of tippers."] + #[doc = " - `O(T)`: decoding `Tipper` vec of length `T`. `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of"] + #[doc = " `T::Tippers`."] + #[doc = " - `O(R)`: hashing and encoding of reason of length `R`"] + #[doc = "- DbReads: `Tippers`, `Reasons`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + tip_new { + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Declare a tip value for an already-open tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the hash of the original tip `reason` and the beneficiary"] + #[doc = " account ID."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `TipClosing` if the threshold of tippers has been reached and the countdown period"] + #[doc = "has started."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`, insert tip and check closing, `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of `T::Tippers`."] + #[doc = ""] + #[doc = " Actually weight could be lower as it depends on how many tips are in `OpenTip` but it"] + #[doc = " is weighted as if almost full i.e of length `T-1`."] + #[doc = "- DbReads: `Tippers`, `Tips`"] + #[doc = "- DbWrites: `Tips`"] + #[doc = "# "] + tip { + hash: ::subxt::sp_core::H256, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Close and payout a tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "The tip identified by `hash` must have finished its countdown period."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`. `T` is charged as upper bound given by `ContainsLengthBound`. The actual cost"] + #[doc = " depends on the implementation of `T::Tippers`."] + #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] + #[doc = "# "] + close_tip { hash: ::subxt::sp_core::H256 }, + #[codec(index = 5)] + #[doc = "Remove and slash an already-open tip."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "As a result, the finder is slashed and the deposits are lost."] + #[doc = ""] + #[doc = "Emits `TipSlashed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] + #[doc = " The actual cost depends on the implementation of `T::Tippers`."] + #[doc = "# "] + slash_tip { hash: ::subxt::sp_core::H256 }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The reason given is just too big."] + ReasonTooBig, + #[codec(index = 1)] + #[doc = "The tip was already found/started."] + AlreadyKnown, + #[codec(index = 2)] + #[doc = "The tip hash is unknown."] + UnknownTip, + #[codec(index = 3)] + #[doc = "The account attempting to retract the tip is not the finder of the tip."] + NotFinder, + #[codec(index = 4)] + #[doc = "The tip cannot be claimed/closed because there are not enough tippers yet."] + StillOpen, + #[codec(index = 5)] + #[doc = "The tip cannot be claimed/closed because it's still in the countdown period."] + Premature, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new tip suggestion has been opened."] + NewTip { tip_hash: ::subxt::sp_core::H256 }, + #[codec(index = 1)] + #[doc = "A tip suggestion has reached threshold and is closing."] + TipClosing { tip_hash: ::subxt::sp_core::H256 }, + #[codec(index = 2)] + #[doc = "A tip suggestion has been closed."] + TipClosed { + tip_hash: ::subxt::sp_core::H256, + who: ::subxt::sp_core::crypto::AccountId32, + payout: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A tip suggestion has been retracted."] + TipRetracted { tip_hash: ::subxt::sp_core::H256 }, + #[codec(index = 4)] + #[doc = "A tip suggestion has been slashed."] + TipSlashed { + tip_hash: ::subxt::sp_core::H256, + finder: ::subxt::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct OpenTip<_0, _1, _2, _3> { + pub reason: _3, + pub who: _0, + pub finder: _0, + pub deposit: _1, + pub closes: ::core::option::Option<_2>, + pub tips: ::std::vec::Vec<(_0, _1)>, + pub finders_fee: ::core::primitive::bool, + } + } + pub mod pallet_transaction_payment { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ChargeTransactionPayment( + #[codec(compact)] pub ::core::primitive::u128, + ); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1Ancient, + #[codec(index = 1)] + V2, + } + } + pub mod pallet_treasury { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] + #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] + #[doc = "proposal is awarded."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `ProposalCount`, `origin account`"] + #[doc = "- DbWrites: `ProposalCount`, `Proposals`, `origin account`"] + #[doc = "# "] + propose_spend { + #[codec(compact)] + value: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 1)] + #[doc = "Reject a proposed spend. The original deposit will be slashed."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `Proposals`, `rejected proposer account`"] + #[doc = "- DbWrites: `Proposals`, `rejected proposer account`"] + #[doc = "# "] + reject_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)."] + #[doc = "- DbReads: `Proposals`, `Approvals`"] + #[doc = "- DbWrite: `Approvals`"] + #[doc = "# "] + approve_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Proposer's balance is too low."] + InsufficientProposersBalance, + #[codec(index = 1)] + #[doc = "No proposal or bounty at that index."] + InvalidIndex, + #[codec(index = 2)] + #[doc = "Too many approvals in the queue."] + TooManyApprovals, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "New proposal."] + Proposed { + proposal_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "We have ended a spend period and will now allocate funds."] + Spending { + budget_remaining: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Some funds have been allocated."] + Awarded { + proposal_index: ::core::primitive::u32, + award: ::core::primitive::u128, + account: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + #[doc = "A proposal was rejected; funds were slashed."] + Rejected { + proposal_index: ::core::primitive::u32, + slashed: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Some of our funds have been burnt."] + Burnt { + burnt_funds: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + Rollover { + rollover_balance: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Some funds have been deposited."] + Deposit { value: ::core::primitive::u128 }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proposal<_0, _1> { + pub proposer: _0, + pub value: _1, + pub beneficiary: _0, + pub bond: _1, + } + } + pub mod pallet_utility { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + batch { + calls: ::std::vec::Vec, + }, + #[codec(index = 1)] + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + as_derivative { + index: ::core::primitive::u16, + call: ::std::boxed::Box, + }, + #[codec(index = 2)] + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + batch_all { + calls: ::std::vec::Vec, + }, + #[codec(index = 3)] + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] + #[doc = "# "] + dispatch_as { + as_origin: ::std::boxed::Box< + runtime_types::polkadot_runtime::OriginCaller, + >, + call: ::std::boxed::Box, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Too many calls batched."] + TooManyCalls, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + BatchInterrupted { + index: ::core::primitive::u32, + error: runtime_types::sp_runtime::DispatchError, + }, + #[codec(index = 1)] + #[doc = "Batch of dispatches completed fully with no error."] + BatchCompleted, + #[codec(index = 2)] + #[doc = "A single item within a Batch of dispatches has completed with no error."] + ItemCompleted, + #[codec(index = 3)] + #[doc = "A call was dispatched."] + DispatchedAs { + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + } + } + } + pub mod pallet_vesting { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Unlock any vested funds of the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 2 Reads, 2 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = "# "] + vest, + #[codec(index = 1)] + #[doc = "Unlock any vested funds of a `target` account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] + #[doc = "# "] + vest_other { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 2)] + #[doc = "Create a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account receiving the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = "# "] + vested_transfer { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + }, + #[codec(index = 3)] + #[doc = "Force a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `source`: The account whose funds should be transferred."] + #[doc = "- `target`: The account that should be transferred the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 4 Reads, 4 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = "# "] + force_vested_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + }, + #[codec(index = 4)] + #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] + #[doc = "the highest possible start and end blocks. If both schedules have already started the"] + #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] + #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] + #[doc = "unmodified."] + #[doc = ""] + #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] + #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] + #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] + #[doc = "and both will be removed."] + #[doc = ""] + #[doc = "Merged schedule attributes:"] + #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] + #[doc = " current_block)`."] + #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] + #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `schedule1_index`: index of the first schedule to merge."] + #[doc = "- `schedule2_index`: index of the second schedule to merge."] + merge_schedules { + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The account given is not vesting."] + NotVesting, + #[codec(index = 1)] + #[doc = "The account already has `MaxVestingSchedules` count of schedules and thus"] + #[doc = "cannot add another one. Consider merging existing schedules in order to add another."] + AtMaxVestingSchedules, + #[codec(index = 2)] + #[doc = "Amount being transferred is too low to create a vesting schedule."] + AmountLow, + #[codec(index = 3)] + #[doc = "An index was out of bounds of the vesting schedules."] + ScheduleIndexOutOfBounds, + #[codec(index = 4)] + #[doc = "Failed to create a new schedule because some parameter was invalid."] + InvalidScheduleParams, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "The amount vested has been updated. This could indicate a change in funds available."] + #[doc = "The balance given is the amount which is left unvested (and thus locked)."] + VestingUpdated { + account: ::subxt::sp_core::crypto::AccountId32, + unvested: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "An \\[account\\] has become fully vested."] + VestingCompleted { + account: ::subxt::sp_core::crypto::AccountId32, + }, + } + } + pub mod vesting_info { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct VestingInfo<_0, _1> { + pub locked: _0, + pub per_block: _0, + pub starting_block: _1, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V0, + #[codec(index = 1)] + V1, + } + } + pub mod pallet_xcm { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + send { + dest: + ::std::boxed::Box, + message: ::std::boxed::Box, + }, + #[codec(index = 1)] + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] + #[doc = " `dest` side. May not be empty."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + teleport_assets { + dest: + ::std::boxed::Box, + beneficiary: + ::std::boxed::Box, + assets: + ::std::boxed::Box, + fee_asset_item: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] + #[doc = "chain and forward a notification XCM."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] + #[doc = " `dest` side."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + reserve_transfer_assets { + dest: + ::std::boxed::Box, + beneficiary: + ::std::boxed::Box, + assets: + ::std::boxed::Box, + fee_asset_item: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Execute an XCM message from a local, signed, origin."] + #[doc = ""] + #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] + #[doc = "partially."] + #[doc = ""] + #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than the"] + #[doc = "maximum amount of weight that the message could take to be executed, then no execution"] + #[doc = "attempt will be made."] + #[doc = ""] + #[doc = "NOTE: A successful return to this does *not* imply that the `msg` was executed successfully"] + #[doc = "to completion; only that *some* of it was executed."] + execute { + message: ::std::boxed::Box, + max_weight: ::core::primitive::u64, + }, + #[codec(index = 4)] + #[doc = "Extoll that a particular destination can be communicated with through a particular"] + #[doc = "version of XCM."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `location`: The destination that is being described."] + #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] + force_xcm_version { + location: ::std::boxed::Box< + runtime_types::xcm::v1::multilocation::MultiLocation, + >, + xcm_version: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] + #[doc = "version a destination can accept is unknown)."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] + force_default_xcm_version { + maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 6)] + #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] + force_subscribe_version_notify { + location: + ::std::boxed::Box, + }, + #[codec(index = 7)] + #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] + #[doc = "version changes."] + #[doc = ""] + #[doc = "- `origin`: Must be Root."] + #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] + #[doc = " notifications which we no longer desire."] + force_unsubscribe_version_notify { + location: + ::std::boxed::Box, + }, + #[codec(index = 8)] + #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] + #[doc = "chain and forward a notification XCM."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] + #[doc = " `dest` side."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + limited_reserve_transfer_assets { + dest: + ::std::boxed::Box, + beneficiary: + ::std::boxed::Box, + assets: + ::std::boxed::Box, + fee_asset_item: ::core::primitive::u32, + weight_limit: runtime_types::xcm::v2::WeightLimit, + }, + #[codec(index = 9)] + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] + #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] + #[doc = " an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] + #[doc = " `dest` side. May not be empty."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + limited_teleport_assets { + dest: + ::std::boxed::Box, + beneficiary: + ::std::boxed::Box, + assets: + ::std::boxed::Box, + fee_asset_item: ::core::primitive::u32, + weight_limit: runtime_types::xcm::v2::WeightLimit, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The desired destination was unreachable, generally because there is a no way of routing"] + #[doc = "to it."] + Unreachable, + #[codec(index = 1)] + #[doc = "There was some other issue (i.e. not to do with routing) in sending the message. Perhaps"] + #[doc = "a lack of space for buffering the message."] + SendFailure, + #[codec(index = 2)] + #[doc = "The message execution fails the filter."] + Filtered, + #[codec(index = 3)] + #[doc = "The message's weight could not be determined."] + UnweighableMessage, + #[codec(index = 4)] + #[doc = "The destination `MultiLocation` provided cannot be inverted."] + DestinationNotInvertible, + #[codec(index = 5)] + #[doc = "The assets to be sent are empty."] + Empty, + #[codec(index = 6)] + #[doc = "Could not re-anchor the assets to declare the fees for the destination chain."] + CannotReanchor, + #[codec(index = 7)] + #[doc = "Too many assets have been attempted for transfer."] + TooManyAssets, + #[codec(index = 8)] + #[doc = "Origin is invalid for sending."] + InvalidOrigin, + #[codec(index = 9)] + #[doc = "The version of the `Versioned` value used is not able to be interpreted."] + BadVersion, + #[codec(index = 10)] + #[doc = "The given location could not be used (e.g. because it cannot be expressed in the"] + #[doc = "desired version of XCM)."] + BadLocation, + #[codec(index = 11)] + #[doc = "The referenced subscription could not be found."] + NoSubscription, + #[codec(index = 12)] + #[doc = "The location is invalid since it already has a subscription from us."] + AlreadySubscribed, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Execution of an XCM message was attempted."] + #[doc = ""] + #[doc = "\\[ outcome \\]"] + Attempted(runtime_types::xcm::v2::traits::Outcome), + #[codec(index = 1)] + #[doc = "A XCM message was sent."] + #[doc = ""] + #[doc = "\\[ origin, destination, message \\]"] + Sent( + runtime_types::xcm::v1::multilocation::MultiLocation, + runtime_types::xcm::v1::multilocation::MultiLocation, + runtime_types::xcm::v2::Xcm, + ), + #[codec(index = 2)] + #[doc = "Query response received which does not match a registered query. This may be because a"] + #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] + #[doc = "because the query timed out."] + #[doc = ""] + #[doc = "\\[ origin location, id \\]"] + UnexpectedResponse( + runtime_types::xcm::v1::multilocation::MultiLocation, + ::core::primitive::u64, + ), + #[codec(index = 3)] + #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] + #[doc = "no registered notification call."] + #[doc = ""] + #[doc = "\\[ id, response \\]"] + ResponseReady( + ::core::primitive::u64, + runtime_types::xcm::v2::Response, + ), + #[codec(index = 4)] + #[doc = "Query response has been received and query is removed. The registered notification has"] + #[doc = "been dispatched and executed successfully."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index \\]"] + Notified( + ::core::primitive::u64, + ::core::primitive::u8, + ::core::primitive::u8, + ), + #[codec(index = 5)] + #[doc = "Query response has been received and query is removed. The registered notification could"] + #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] + #[doc = "originally budgeted by this runtime for the query result."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index, actual weight, max budgeted weight \\]"] + NotifyOverweight( + ::core::primitive::u64, + ::core::primitive::u8, + ::core::primitive::u8, + ::core::primitive::u64, + ::core::primitive::u64, + ), + #[codec(index = 6)] + #[doc = "Query response has been received and query is removed. There was a general error with"] + #[doc = "dispatching the notification call."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index \\]"] + NotifyDispatchError( + ::core::primitive::u64, + ::core::primitive::u8, + ::core::primitive::u8, + ), + #[codec(index = 7)] + #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] + #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] + #[doc = "is not `(origin, QueryId, Response)`."] + #[doc = ""] + #[doc = "\\[ id, pallet index, call index \\]"] + NotifyDecodeFailed( + ::core::primitive::u64, + ::core::primitive::u8, + ::core::primitive::u8, + ), + #[codec(index = 8)] + #[doc = "Expected query response has been received but the origin location of the response does"] + #[doc = "not match that expected. The query remains registered for a later, valid, response to"] + #[doc = "be received and acted upon."] + #[doc = ""] + #[doc = "\\[ origin location, id, expected location \\]"] + InvalidResponder( + runtime_types::xcm::v1::multilocation::MultiLocation, + ::core::primitive::u64, + ::core::option::Option< + runtime_types::xcm::v1::multilocation::MultiLocation, + >, + ), + #[codec(index = 9)] + #[doc = "Expected query response has been received but the expected origin location placed in"] + #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] + #[doc = ""] + #[doc = "This is unexpected (since a location placed in storage in a previously executing"] + #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] + #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] + #[doc = "needed."] + #[doc = ""] + #[doc = "\\[ origin location, id \\]"] + InvalidResponderVersion( + runtime_types::xcm::v1::multilocation::MultiLocation, + ::core::primitive::u64, + ), + #[codec(index = 10)] + #[doc = "Received query response has been read and removed."] + #[doc = ""] + #[doc = "\\[ id \\]"] + ResponseTaken(::core::primitive::u64), + #[codec(index = 11)] + #[doc = "Some assets have been placed in an asset trap."] + #[doc = ""] + #[doc = "\\[ hash, origin, assets \\]"] + AssetsTrapped( + ::subxt::sp_core::H256, + runtime_types::xcm::v1::multilocation::MultiLocation, + runtime_types::xcm::VersionedMultiAssets, + ), + #[codec(index = 12)] + #[doc = "An XCM version change notification message has been attempted to be sent."] + #[doc = ""] + #[doc = "\\[ destination, result \\]"] + VersionChangeNotified( + runtime_types::xcm::v1::multilocation::MultiLocation, + ::core::primitive::u32, + ), + #[codec(index = 13)] + #[doc = "The supported version of a location has been changed. This might be through an"] + #[doc = "automatic notification or a manual intervention."] + #[doc = ""] + #[doc = "\\[ location, XCM version \\]"] + SupportedVersionChanged( + runtime_types::xcm::v1::multilocation::MultiLocation, + ::core::primitive::u32, + ), + #[codec(index = 14)] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "sending the notification to it."] + #[doc = ""] + #[doc = "\\[ location, query ID, error \\]"] + NotifyTargetSendFail( + runtime_types::xcm::v1::multilocation::MultiLocation, + ::core::primitive::u64, + runtime_types::xcm::v2::traits::Error, + ), + #[codec(index = 15)] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "migrating the location to our new XCM format."] + #[doc = ""] + #[doc = "\\[ location, query ID \\]"] + NotifyTargetMigrationFail( + runtime_types::xcm::VersionedMultiLocation, + ::core::primitive::u64, + ), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Origin { + #[codec(index = 0)] + Xcm(runtime_types::xcm::v1::multilocation::MultiLocation), + #[codec(index = 1)] + Response(runtime_types::xcm::v1::multilocation::MultiLocation), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum QueryStatus<_0> { + #[codec(index = 0)] + Pending { + responder: runtime_types::xcm::VersionedMultiLocation, + maybe_notify: ::core::option::Option<( + ::core::primitive::u8, + ::core::primitive::u8, + )>, + timeout: _0, + }, + #[codec(index = 1)] + VersionNotifier { + origin: runtime_types::xcm::VersionedMultiLocation, + is_active: ::core::primitive::bool, + }, + #[codec(index = 2)] + Ready { + response: runtime_types::xcm::VersionedResponse, + at: _0, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum VersionMigrationStage { + #[codec(index = 0)] + MigrateSupportedVersion, + #[codec(index = 1)] + MigrateVersionNotifiers, + #[codec(index = 2)] + NotifyCurrentTargets( + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ), + #[codec(index = 3)] + MigrateAndNotifyOldTargets, + } + } + } + pub mod polkadot_core_primitives { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CandidateHash(pub ::subxt::sp_core::H256); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct InboundDownwardMessage<_0> { + pub sent_at: _0, + pub msg: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct InboundHrmpMessage<_0> { + pub sent_at: _0, + pub data: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct OutboundHrmpMessage<_0> { + pub recipient: _0, + pub data: ::std::vec::Vec<::core::primitive::u8>, + } + } + pub mod polkadot_parachain { + use super::runtime_types; + pub mod primitives { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct HeadData(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct HrmpChannelId { + pub sender: runtime_types::polkadot_parachain::primitives::Id, + pub recipient: runtime_types::polkadot_parachain::primitives::Id, + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Id(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ValidationCode(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); + } + } + pub mod polkadot_primitives { + use super::runtime_types; + pub mod v2 { + use super::runtime_types; + pub mod assignment_app { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + pub mod collator_app { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + pub mod signed { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > } + } + pub mod validator_app { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct AvailabilityBitfield( + pub ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BackedCandidate<_0> { + pub candidate: + runtime_types::polkadot_primitives::v2::CommittedCandidateReceipt< + _0, + >, + pub validity_votes: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidityAttestation, + >, + pub validator_indices: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CandidateCommitments<_0> { + pub upward_messages: + ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + pub horizontal_messages: ::std::vec::Vec< + runtime_types::polkadot_core_primitives::OutboundHrmpMessage< + runtime_types::polkadot_parachain::primitives::Id, + >, + >, + pub new_validation_code: ::core::option::Option< + runtime_types::polkadot_parachain::primitives::ValidationCode, + >, + pub head_data: + runtime_types::polkadot_parachain::primitives::HeadData, + pub processed_downward_messages: _0, + pub hrmp_watermark: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CandidateDescriptor<_0> { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub relay_parent: _0, + pub collator: + runtime_types::polkadot_primitives::v2::collator_app::Public, + pub persisted_validation_data_hash: _0, + pub pov_hash: _0, + pub erasure_root: _0, + pub signature: + runtime_types::polkadot_primitives::v2::collator_app::Signature, + pub para_head: _0, + pub validation_code_hash: + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CandidateReceipt<_0> { + pub descriptor: + runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, + pub commitments_hash: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CommittedCandidateReceipt<_0> { + pub descriptor: + runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, + pub commitments: + runtime_types::polkadot_primitives::v2::CandidateCommitments< + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct CoreIndex(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum CoreOccupied { + #[codec(index = 0)] + Parathread(runtime_types::polkadot_primitives::v2::ParathreadEntry), + #[codec(index = 1)] + Parachain, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct DisputeState<_0> { + pub validators_for: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub validators_against: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub start: _0, + pub concluded_at: ::core::option::Option<_0>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DisputeStatement { + # [codec (index = 0)] Valid (runtime_types :: polkadot_primitives :: v2 :: ValidDisputeStatementKind ,) , # [codec (index = 1)] Invalid (runtime_types :: polkadot_primitives :: v2 :: InvalidDisputeStatementKind ,) , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct DisputeStatementSet { + pub candidate_hash: + runtime_types::polkadot_core_primitives::CandidateHash, + pub session: ::core::primitive::u32, + pub statements: ::std::vec::Vec<( + runtime_types::polkadot_primitives::v2::DisputeStatement, + runtime_types::polkadot_primitives::v2::ValidatorIndex, + runtime_types::polkadot_primitives::v2::validator_app::Signature, + )>, + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct GroupIndex(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct InherentData<_0> { + pub bitfields: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::signed::UncheckedSigned< + runtime_types::polkadot_primitives::v2::AvailabilityBitfield, + runtime_types::polkadot_primitives::v2::AvailabilityBitfield, + >, + >, + pub backed_candidates: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::BackedCandidate< + ::subxt::sp_core::H256, + >, + >, + pub disputes: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::DisputeStatementSet, + >, + pub parent_header: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum InvalidDisputeStatementKind { + #[codec(index = 0)] + Explicit, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ParathreadClaim( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_primitives::v2::collator_app::Public, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ParathreadEntry { + pub claim: runtime_types::polkadot_primitives::v2::ParathreadClaim, + pub retries: ::core::primitive::u32, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PvfCheckStatement { + pub accept: ::core::primitive::bool, + pub subject: + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub session_index: ::core::primitive::u32, + pub validator_index: + runtime_types::polkadot_primitives::v2::ValidatorIndex, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ScrapedOnChainVotes<_0> { + pub session: ::core::primitive::u32, + pub backing_validators_per_candidate: ::std::vec::Vec<( + runtime_types::polkadot_primitives::v2::CandidateReceipt<_0>, + ::std::vec::Vec<( + runtime_types::polkadot_primitives::v2::ValidatorIndex, + runtime_types::polkadot_primitives::v2::ValidityAttestation, + )>, + )>, + pub disputes: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::DisputeStatementSet, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SessionInfo { + pub active_validator_indices: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, + pub random_seed: [::core::primitive::u8; 32usize], + pub dispute_period: ::core::primitive::u32, + pub validators: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::validator_app::Public, + >, + pub discovery_keys: ::std::vec::Vec< + runtime_types::sp_authority_discovery::app::Public, + >, + pub assignment_keys: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::assignment_app::Public, + >, + pub validator_groups: ::std::vec::Vec< + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, + >, + pub n_cores: ::core::primitive::u32, + pub zeroth_delay_tranche_width: ::core::primitive::u32, + pub relay_vrf_modulo_samples: ::core::primitive::u32, + pub n_delay_tranches: ::core::primitive::u32, + pub no_show_slots: ::core::primitive::u32, + pub needed_approvals: ::core::primitive::u32, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum UpgradeGoAhead { + #[codec(index = 0)] + Abort, + #[codec(index = 1)] + GoAhead, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum UpgradeRestriction { + #[codec(index = 0)] + Present, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ValidDisputeStatementKind { + #[codec(index = 0)] + Explicit, + #[codec(index = 1)] + BackingSeconded(::subxt::sp_core::H256), + #[codec(index = 2)] + BackingValid(::subxt::sp_core::H256), + #[codec(index = 3)] + ApprovalChecking, + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct ValidatorIndex(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ValidityAttestation { + #[codec(index = 1)] + Implicit( + runtime_types::polkadot_primitives::v2::validator_app::Signature, + ), + #[codec(index = 2)] + Explicit( + runtime_types::polkadot_primitives::v2::validator_app::Signature, + ), + } + } + } + pub mod polkadot_runtime { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 ,) , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 ,) , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NposCompactSolution16 { + pub votes1: + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u16)>, + pub votes2: ::std::vec::Vec<( + ::core::primitive::u32, + ( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ), + ::core::primitive::u16, + )>, + pub votes3: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 2usize], + ::core::primitive::u16, + )>, + pub votes4: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 3usize], + ::core::primitive::u16, + )>, + pub votes5: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 4usize], + ::core::primitive::u16, + )>, + pub votes6: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 5usize], + ::core::primitive::u16, + )>, + pub votes7: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 6usize], + ::core::primitive::u16, + )>, + pub votes8: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 7usize], + ::core::primitive::u16, + )>, + pub votes9: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 8usize], + ::core::primitive::u16, + )>, + pub votes10: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 9usize], + ::core::primitive::u16, + )>, + pub votes11: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 10usize], + ::core::primitive::u16, + )>, + pub votes12: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 11usize], + ::core::primitive::u16, + )>, + pub votes13: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 12usize], + ::core::primitive::u16, + )>, + pub votes14: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 13usize], + ::core::primitive::u16, + )>, + pub votes15: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 14usize], + ::core::primitive::u16, + )>, + pub votes16: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 15usize], + ::core::primitive::u16, + )>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum OriginCaller { + #[codec(index = 0)] + system( + runtime_types::frame_support::dispatch::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 15)] + Council( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 16)] + TechnicalCommittee( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 50)] + ParachainsOrigin( + runtime_types::polkadot_runtime_parachains::origin::pallet::Origin, + ), + #[codec(index = 99)] + XcmPallet(runtime_types::pallet_xcm::pallet::Origin), + #[codec(index = 5)] + Void(runtime_types::sp_core::Void), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum ProxyType { + #[codec(index = 0)] + Any, + #[codec(index = 1)] + NonTransfer, + #[codec(index = 2)] + Governance, + #[codec(index = 3)] + Staking, + #[codec(index = 5)] + IdentityJudgement, + #[codec(index = 6)] + CancelProxy, + #[codec(index = 7)] + Auction, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Runtime; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SessionKeys { + pub grandpa: runtime_types::sp_finality_grandpa::app::Public, + pub babe: runtime_types::sp_consensus_babe::app::Public, + pub im_online: + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + pub para_validator: + runtime_types::polkadot_primitives::v2::validator_app::Public, + pub para_assignment: + runtime_types::polkadot_primitives::v2::assignment_app::Public, + pub authority_discovery: + runtime_types::sp_authority_discovery::app::Public, + } + } + pub mod polkadot_runtime_common { + use super::runtime_types; + pub mod auctions { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Create a new auction."] + #[doc = ""] + #[doc = "This can only happen when there isn't already an auction in progress and may only be"] + #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] + #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] + new_auction { + #[codec(compact)] + duration: ::core::primitive::u32, + #[codec(compact)] + lease_period_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] + #[doc = "parachain."] + #[doc = ""] + #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] + #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] + #[doc = ""] + #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] + #[doc = "funded by) the same account."] + #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] + #[doc = "value of `AuctionCounter`."] + #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] + #[doc = "absolute lease period index value, not an auction-specific offset."] + #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] + #[doc = "bid win. This amount is held throughout the range."] + bid { + #[codec(compact)] + para: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + auction_index: ::core::primitive::u32, + #[codec(compact)] + first_slot: ::core::primitive::u32, + #[codec(compact)] + last_slot: ::core::primitive::u32, + #[codec(compact)] + amount: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Cancel an in-progress auction."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + cancel_auction, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "This auction is already in progress."] + AuctionInProgress, + #[codec(index = 1)] + #[doc = "The lease period is in the past."] + LeasePeriodInPast, + #[codec(index = 2)] + #[doc = "Para is not registered"] + ParaNotRegistered, + #[codec(index = 3)] + #[doc = "Not a current auction."] + NotCurrentAuction, + #[codec(index = 4)] + #[doc = "Not an auction."] + NotAuction, + #[codec(index = 5)] + #[doc = "Auction has already ended."] + AuctionEnded, + #[codec(index = 6)] + #[doc = "The para is already leased out for part of this range."] + AlreadyLeasedOut, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[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, + ), + #[codec(index = 1)] + #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] + AuctionClosed(::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, + ), + #[codec(index = 3)] + #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] + Unreserved( + ::subxt::sp_core::crypto::AccountId32, + ::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, + ), + #[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, + ), + #[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), + } + } + } + pub mod claims { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "Make a claim to collect your DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to claim is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)"] # [doc = ""] # [doc = "and `address` matches the `dest` account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , # [codec (index = 1)] # [doc = "Mint a new claim to collect DOTs."] # [doc = ""] # [doc = "The dispatch origin for this call must be _Root_."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `who`: The Ethereum address allowed to collect this claim."] # [doc = "- `value`: The number of DOTs that will be claimed."] # [doc = "- `vesting_schedule`: An optional vesting schedule for these DOTs."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "We assume worst case that both vesting and statement is being inserted."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : :: core :: primitive :: u128 , vesting_schedule : :: core :: option :: Option < (:: core :: primitive :: u128 , :: core :: primitive :: u128 , :: core :: primitive :: u32 ,) > , statement : :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , # [codec (index = 2)] # [doc = "Make a claim to collect your DOTs by signing a statement."] # [doc = ""] # [doc = "The dispatch origin for this call must be _None_."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to `claim_attest` is deemed valid if the signature provided matches"] # [doc = "the expected signed message of:"] # [doc = ""] # [doc = "> Ethereum Signed Message:"] # [doc = "> (configured prefix string)(address)(statement)"] # [doc = ""] # [doc = "and `address` matches the `dest` account; the `statement` must match that which is"] # [doc = "expected according to your purchase arrangement."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `dest`: The destination account to payout the claim."] # [doc = "- `ethereum_signature`: The signature of an ethereum signed message"] # [doc = " matching the format described above."] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to validate unsigned `claim_attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 3)] # [doc = "Attest to a statement, needed to finalize the claims process."] # [doc = ""] # [doc = "WARNING: Insecure unless your chain includes `PrevalidateAttests` as a `SignedExtension`."] # [doc = ""] # [doc = "Unsigned Validation:"] # [doc = "A call to attest is deemed valid if the sender has a `Preclaim` registered"] # [doc = "and provides a `statement` which is expected for the account."] # [doc = ""] # [doc = "Parameters:"] # [doc = "- `statement`: The identity of the statement which is being attested to in the signature."] # [doc = ""] # [doc = ""] # [doc = "The weight of this call is invariant over the input parameters."] # [doc = "Weight includes logic to do pre-validation on `attest` call."] # [doc = ""] # [doc = "Total Complexity: O(1)"] # [doc = ""] attest { statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : :: core :: option :: Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Invalid Ethereum signature."] + InvalidEthereumSignature, + #[codec(index = 1)] + #[doc = "Ethereum address has no claim."] + SignerHasNoClaim, + #[codec(index = 2)] + #[doc = "Account ID sending transaction has no claim."] + SenderHasNoClaim, + #[codec(index = 3)] + #[doc = "There's not enough in the pot to pay out some unvested amount. Generally implies a logic"] + #[doc = "error."] + PotUnderflow, + #[codec(index = 4)] + #[doc = "A needed statement was not included."] + InvalidStatement, + #[codec(index = 5)] + #[doc = "The account already has a vested balance."] + VestedBalanceExists, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 ,) , } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct EcdsaSignature(pub [::core::primitive::u8; 65usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct EthereumAddress(pub [::core::primitive::u8; 20usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PrevalidateAttests; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum StatementKind { + #[codec(index = 0)] + Regular, + #[codec(index = 1)] + Saft, + } + } + pub mod crowdloan { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] + #[doc = ""] + #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] + #[doc = "by the parachain manager."] + create { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + cap: ::core::primitive::u128, + #[codec(compact)] + first_period: ::core::primitive::u32, + #[codec(compact)] + last_period: ::core::primitive::u32, + #[codec(compact)] + end: ::core::primitive::u32, + verifier: ::core::option::Option< + runtime_types::sp_runtime::MultiSigner, + >, + }, + #[codec(index = 1)] + #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] + #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] + contribute { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + value: ::core::primitive::u128, + signature: ::core::option::Option< + runtime_types::sp_runtime::MultiSignature, + >, + }, + #[codec(index = 2)] + #[doc = "Withdraw full balance of a specific contributor."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + #[doc = ""] + #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement, then the retirement"] + #[doc = "flag must be set. For a fund to be ready for retirement, then:"] + #[doc = "- it must not already be in retirement;"] + #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] + #[doc = "- and either:"] + #[doc = " - the block number must be at least `end`; or"] + #[doc = " - the current lease period must be greater than the fund's `last_period`."] + #[doc = ""] + #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current block"] + #[doc = "number."] + #[doc = ""] + #[doc = "- `who`: The account whose contribution should be withdrawn."] + #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] + withdraw { + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + }, + #[codec(index = 3)] + #[doc = "Automatically refund contributors of an ended crowdloan."] + #[doc = "Due to weight restrictions, this function may need to be called multiple"] + #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] + #[doc = ""] + #[doc = "Origin must be signed, but can come from anyone."] + refund { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + }, + #[codec(index = 4)] + #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] + dissolve { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + }, + #[codec(index = 5)] + #[doc = "Edit the configuration for an in-progress crowdloan."] + #[doc = ""] + #[doc = "Can only be called by Root origin."] + edit { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + cap: ::core::primitive::u128, + #[codec(compact)] + first_period: ::core::primitive::u32, + #[codec(compact)] + last_period: ::core::primitive::u32, + #[codec(compact)] + end: ::core::primitive::u32, + verifier: ::core::option::Option< + runtime_types::sp_runtime::MultiSigner, + >, + }, + #[codec(index = 6)] + #[doc = "Add an optional memo to an existing crowdloan contribution."] + #[doc = ""] + #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] + add_memo { + index: runtime_types::polkadot_parachain::primitives::Id, + memo: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 7)] + #[doc = "Poke the fund into `NewRaise`"] + #[doc = ""] + #[doc = "Origin must be Signed, and the fund has non-zero raise."] + poke { + index: runtime_types::polkadot_parachain::primitives::Id, + }, + #[codec(index = 8)] + #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] + #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] + contribute_all { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + signature: ::core::option::Option< + runtime_types::sp_runtime::MultiSignature, + >, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The current lease period is more than the first lease period."] + FirstPeriodInPast, + #[codec(index = 1)] + #[doc = "The first lease period needs to at least be less than 3 `max_value`."] + FirstPeriodTooFarInFuture, + #[codec(index = 2)] + #[doc = "Last lease period must be greater than first lease period."] + LastPeriodBeforeFirstPeriod, + #[codec(index = 3)] + #[doc = "The last lease period cannot be more than 3 periods after the first period."] + LastPeriodTooFarInFuture, + #[codec(index = 4)] + #[doc = "The campaign ends before the current block number. The end must be in the future."] + CannotEndInPast, + #[codec(index = 5)] + #[doc = "The end date for this crowdloan is not sensible."] + EndTooFarInFuture, + #[codec(index = 6)] + #[doc = "There was an overflow."] + Overflow, + #[codec(index = 7)] + #[doc = "The contribution was below the minimum, `MinContribution`."] + ContributionTooSmall, + #[codec(index = 8)] + #[doc = "Invalid fund index."] + InvalidParaId, + #[codec(index = 9)] + #[doc = "Contributions exceed maximum amount."] + CapExceeded, + #[codec(index = 10)] + #[doc = "The contribution period has already ended."] + ContributionPeriodOver, + #[codec(index = 11)] + #[doc = "The origin of this call is invalid."] + InvalidOrigin, + #[codec(index = 12)] + #[doc = "This crowdloan does not correspond to a parachain."] + NotParachain, + #[codec(index = 13)] + #[doc = "This parachain lease is still active and retirement cannot yet begin."] + LeaseActive, + #[codec(index = 14)] + #[doc = "This parachain's bid or lease is still active and withdraw cannot yet begin."] + BidOrLeaseActive, + #[codec(index = 15)] + #[doc = "The crowdloan has not yet ended."] + FundNotEnded, + #[codec(index = 16)] + #[doc = "There are no contributions stored in this crowdloan."] + NoContributions, + #[codec(index = 17)] + #[doc = "The crowdloan is not ready to dissolve. Potentially still has a slot or in retirement period."] + NotReadyToDissolve, + #[codec(index = 18)] + #[doc = "Invalid signature."] + InvalidSignature, + #[codec(index = 19)] + #[doc = "The provided memo is too large."] + MemoTooLarge, + #[codec(index = 20)] + #[doc = "The fund is already in `NewRaise`"] + AlreadyInNewRaise, + #[codec(index = 21)] + #[doc = "No contributions allowed during the VRF delay"] + VrfDelayInProgress, + #[codec(index = 22)] + #[doc = "A lease period has not started yet, due to an offset in the starting block."] + NoLeasePeriod, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] + Created(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, + ), + #[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, + ), + #[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, + ), + #[codec(index = 4)] + #[doc = "All loans in a fund have been refunded. `[fund_index]`"] + AllRefunded(runtime_types::polkadot_parachain::primitives::Id), + #[codec(index = 5)] + #[doc = "Fund is dissolved. `[fund_index]`"] + Dissolved(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< + (), + 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), + #[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>, + ), + #[codec(index = 9)] + #[doc = "A parachain has been moved to `NewRaise`"] + AddedToNewRaise( + runtime_types::polkadot_parachain::primitives::Id, + ), + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : :: core :: option :: Option < runtime_types :: sp_runtime :: MultiSigner > , pub deposit : _1 , pub raised : _1 , pub end : _2 , pub cap : _1 , pub last_contribution : runtime_types :: polkadot_runtime_common :: crowdloan :: LastContribution < _2 > , pub first_period : _2 , pub last_period : _2 , pub fund_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum LastContribution<_0> { + #[codec(index = 0)] + Never, + #[codec(index = 1)] + PreEnding(_0), + #[codec(index = 2)] + Ending(_0), + } + } + pub mod paras_registrar { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin."] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The ID is not registered."] + NotRegistered, + #[codec(index = 1)] + #[doc = "The ID is already registered."] + AlreadyRegistered, + #[codec(index = 2)] + #[doc = "The caller is not the owner of this Id."] + NotOwner, + #[codec(index = 3)] + #[doc = "Invalid para code size."] + CodeTooLarge, + #[codec(index = 4)] + #[doc = "Invalid para head data size."] + HeadDataTooLarge, + #[codec(index = 5)] + #[doc = "Para is not a Parachain."] + NotParachain, + #[codec(index = 6)] + #[doc = "Para is not a Parathread."] + NotParathread, + #[codec(index = 7)] + #[doc = "Cannot deregister para"] + CannotDeregister, + #[codec(index = 8)] + #[doc = "Cannot schedule downgrade of parachain to parathread"] + CannotDowngrade, + #[codec(index = 9)] + #[doc = "Cannot schedule upgrade of parathread to parachain"] + CannotUpgrade, + #[codec(index = 10)] + #[doc = "Para is locked from manipulation by the manager. Must use parachain or relay chain governance."] + ParaLocked, + #[codec(index = 11)] + #[doc = "The ID given for registration has not been reserved."] + NotReserved, + #[codec(index = 12)] + #[doc = "Registering parachain with empty code is not allowed."] + EmptyCode, + #[codec(index = 13)] + #[doc = "Cannot perform a parachain slot / lifecycle swap. Check that the state of both paras are"] + #[doc = "correct for the swap to work."] + CannotSwap, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + Registered( + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 1)] + Deregistered(runtime_types::polkadot_parachain::primitives::Id), + #[codec(index = 2)] + Reserved( + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::sp_core::crypto::AccountId32, + ), + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ParaInfo<_0, _1> { + pub manager: _0, + pub deposit: _1, + pub locked: ::core::primitive::bool, + } + } + pub mod slots { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] + #[doc = "independently of any other on-chain mechanism to use it."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + force_lease { + para: runtime_types::polkadot_parachain::primitives::Id, + leaser: ::subxt::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + period_begin: ::core::primitive::u32, + period_count: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + clear_all_leases { + para: runtime_types::polkadot_parachain::primitives::Id, + }, + #[codec(index = 2)] + #[doc = "Try to onboard a parachain that has a lease for the current lease period."] + #[doc = ""] + #[doc = "This function can be useful if there was some state issue with a para that should"] + #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] + #[doc = "let them onboard from here."] + #[doc = ""] + #[doc = "Origin must be signed, but can be called by anyone."] + trigger_onboard { + para: runtime_types::polkadot_parachain::primitives::Id, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The parachain ID is not onboarding."] + ParaNotOnboarding, + #[codec(index = 1)] + #[doc = "There was an error with the lease."] + LeaseError, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new `[lease_period]` is beginning."] + NewLeasePeriod(::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, + ), + } + } + } + } + pub mod polkadot_runtime_parachains { + use super::runtime_types; + pub mod configuration { + use super::runtime_types; + pub mod migration { + use super::runtime_types; + pub mod v1 { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + )] + pub struct HostConfiguration<_0> { + pub max_code_size: _0, + pub max_head_data_size: _0, + pub max_upward_queue_count: _0, + pub max_upward_queue_size: _0, + pub max_upward_message_size: _0, + pub max_upward_message_num_per_candidate: _0, + pub hrmp_max_message_num_per_candidate: _0, + pub validation_upgrade_frequency: _0, + pub validation_upgrade_delay: _0, + pub max_pov_size: _0, + pub max_downward_message_size: _0, + pub ump_service_total_weight: ::core::primitive::u64, + pub hrmp_max_parachain_outbound_channels: _0, + pub hrmp_max_parathread_outbound_channels: _0, + pub hrmp_sender_deposit: ::core::primitive::u128, + pub hrmp_recipient_deposit: ::core::primitive::u128, + pub hrmp_channel_max_capacity: _0, + pub hrmp_channel_max_total_size: _0, + pub hrmp_max_parachain_inbound_channels: _0, + pub hrmp_max_parathread_inbound_channels: _0, + pub hrmp_channel_max_message_size: _0, + pub code_retention_period: _0, + pub parathread_cores: _0, + pub parathread_retries: _0, + pub group_rotation_frequency: _0, + pub chain_availability_period: _0, + pub thread_availability_period: _0, + pub scheduling_lookahead: _0, + pub max_validators_per_core: ::core::option::Option<_0>, + pub max_validators: ::core::option::Option<_0>, + pub dispute_period: _0, + pub dispute_post_conclusion_acceptance_period: _0, + pub dispute_max_spam_slots: _0, + pub dispute_conclusion_by_time_out_period: _0, + pub no_show_slots: _0, + pub n_delay_tranches: _0, + pub zeroth_delay_tranche_width: _0, + pub needed_approvals: _0, + pub relay_vrf_modulo_samples: _0, + pub ump_max_individual_weight: ::core::primitive::u64, + } + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Set the validation upgrade cooldown."] + set_validation_upgrade_cooldown { new: ::core::primitive::u32 }, + #[codec(index = 1)] + #[doc = "Set the validation upgrade delay."] + set_validation_upgrade_delay { new: ::core::primitive::u32 }, + #[codec(index = 2)] + #[doc = "Set the acceptance period for an included candidate."] + set_code_retention_period { new: ::core::primitive::u32 }, + #[codec(index = 3)] + #[doc = "Set the max validation code size for incoming upgrades."] + set_max_code_size { new: ::core::primitive::u32 }, + #[codec(index = 4)] + #[doc = "Set the max POV block size for incoming upgrades."] + set_max_pov_size { new: ::core::primitive::u32 }, + #[codec(index = 5)] + #[doc = "Set the max head data size for paras."] + set_max_head_data_size { new: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "Set the number of parathread execution cores."] + set_parathread_cores { new: ::core::primitive::u32 }, + #[codec(index = 7)] + #[doc = "Set the number of retries for a particular parathread."] + set_parathread_retries { new: ::core::primitive::u32 }, + #[codec(index = 8)] + #[doc = "Set the parachain validator-group rotation frequency"] + set_group_rotation_frequency { new: ::core::primitive::u32 }, + #[codec(index = 9)] + #[doc = "Set the availability period for parachains."] + set_chain_availability_period { new: ::core::primitive::u32 }, + #[codec(index = 10)] + #[doc = "Set the availability period for parathreads."] + set_thread_availability_period { new: ::core::primitive::u32 }, + #[codec(index = 11)] + #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] + set_scheduling_lookahead { new: ::core::primitive::u32 }, + #[codec(index = 12)] + #[doc = "Set the maximum number of validators to assign to any core."] + set_max_validators_per_core { + new: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 13)] + #[doc = "Set the maximum number of validators to use in parachain consensus."] + set_max_validators { + new: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 14)] + #[doc = "Set the dispute period, in number of sessions to keep for disputes."] + set_dispute_period { new: ::core::primitive::u32 }, + #[codec(index = 15)] + #[doc = "Set the dispute post conclusion acceptance period."] + set_dispute_post_conclusion_acceptance_period { + new: ::core::primitive::u32, + }, + #[codec(index = 16)] + #[doc = "Set the maximum number of dispute spam slots."] + set_dispute_max_spam_slots { new: ::core::primitive::u32 }, + #[codec(index = 17)] + #[doc = "Set the dispute conclusion by time out period."] + set_dispute_conclusion_by_time_out_period { + new: ::core::primitive::u32, + }, + #[codec(index = 18)] + #[doc = "Set the no show slots, in number of number of consensus slots."] + #[doc = "Must be at least 1."] + set_no_show_slots { new: ::core::primitive::u32 }, + #[codec(index = 19)] + #[doc = "Set the total number of delay tranches."] + set_n_delay_tranches { new: ::core::primitive::u32 }, + #[codec(index = 20)] + #[doc = "Set the zeroth delay tranche width."] + set_zeroth_delay_tranche_width { new: ::core::primitive::u32 }, + #[codec(index = 21)] + #[doc = "Set the number of validators needed to approve a block."] + set_needed_approvals { new: ::core::primitive::u32 }, + #[codec(index = 22)] + #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] + set_relay_vrf_modulo_samples { new: ::core::primitive::u32 }, + #[codec(index = 23)] + #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] + set_max_upward_queue_count { new: ::core::primitive::u32 }, + #[codec(index = 24)] + #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] + set_max_upward_queue_size { new: ::core::primitive::u32 }, + #[codec(index = 25)] + #[doc = "Set the critical downward message size."] + set_max_downward_message_size { new: ::core::primitive::u32 }, + #[codec(index = 26)] + #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] + set_ump_service_total_weight { new: ::core::primitive::u64 }, + #[codec(index = 27)] + #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] + set_max_upward_message_size { new: ::core::primitive::u32 }, + #[codec(index = 28)] + #[doc = "Sets the maximum number of messages that a candidate can contain."] + set_max_upward_message_num_per_candidate { + new: ::core::primitive::u32, + }, + #[codec(index = 29)] + #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] + set_hrmp_open_request_ttl { new: ::core::primitive::u32 }, + #[codec(index = 30)] + #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] + set_hrmp_sender_deposit { new: ::core::primitive::u128 }, + #[codec(index = 31)] + #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] + #[doc = "channel."] + set_hrmp_recipient_deposit { new: ::core::primitive::u128 }, + #[codec(index = 32)] + #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] + set_hrmp_channel_max_capacity { new: ::core::primitive::u32 }, + #[codec(index = 33)] + #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] + set_hrmp_channel_max_total_size { new: ::core::primitive::u32 }, + #[codec(index = 34)] + #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] + set_hrmp_max_parachain_inbound_channels { + new: ::core::primitive::u32, + }, + #[codec(index = 35)] + #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] + set_hrmp_max_parathread_inbound_channels { + new: ::core::primitive::u32, + }, + #[codec(index = 36)] + #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] + set_hrmp_channel_max_message_size { new: ::core::primitive::u32 }, + #[codec(index = 37)] + #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] + set_hrmp_max_parachain_outbound_channels { + new: ::core::primitive::u32, + }, + #[codec(index = 38)] + #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] + set_hrmp_max_parathread_outbound_channels { + new: ::core::primitive::u32, + }, + #[codec(index = 39)] + #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] + set_hrmp_max_message_num_per_candidate { + new: ::core::primitive::u32, + }, + #[codec(index = 40)] + #[doc = "Sets the maximum amount of weight any individual upward message may consume."] + set_ump_max_individual_weight { new: ::core::primitive::u64 }, + #[codec(index = 41)] + #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] + set_pvf_checking_enabled { new: ::core::primitive::bool }, + #[codec(index = 42)] + #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] + set_pvf_voting_ttl { new: ::core::primitive::u32 }, + #[codec(index = 43)] + #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] + #[doc = "upgrade taking place."] + #[doc = ""] + #[doc = "See the field documentation for information and constraints for the new value."] + set_minimum_validation_upgrade_delay { + new: ::core::primitive::u32, + }, + #[codec(index = 44)] + #[doc = "Setting this to true will disable consistency checks for the configuration setters."] + #[doc = "Use with caution."] + set_bypass_consistency_check { new: ::core::primitive::bool }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The new value for a configuration parameter is invalid."] + InvalidNewValue, + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct HostConfiguration<_0> { + pub max_code_size: _0, + pub max_head_data_size: _0, + pub max_upward_queue_count: _0, + pub max_upward_queue_size: _0, + pub max_upward_message_size: _0, + pub max_upward_message_num_per_candidate: _0, + pub hrmp_max_message_num_per_candidate: _0, + pub validation_upgrade_cooldown: _0, + pub validation_upgrade_delay: _0, + pub max_pov_size: _0, + pub max_downward_message_size: _0, + pub ump_service_total_weight: ::core::primitive::u64, + pub hrmp_max_parachain_outbound_channels: _0, + pub hrmp_max_parathread_outbound_channels: _0, + pub hrmp_sender_deposit: ::core::primitive::u128, + pub hrmp_recipient_deposit: ::core::primitive::u128, + pub hrmp_channel_max_capacity: _0, + pub hrmp_channel_max_total_size: _0, + pub hrmp_max_parachain_inbound_channels: _0, + pub hrmp_max_parathread_inbound_channels: _0, + pub hrmp_channel_max_message_size: _0, + pub code_retention_period: _0, + pub parathread_cores: _0, + pub parathread_retries: _0, + pub group_rotation_frequency: _0, + pub chain_availability_period: _0, + pub thread_availability_period: _0, + pub scheduling_lookahead: _0, + pub max_validators_per_core: ::core::option::Option<_0>, + pub max_validators: ::core::option::Option<_0>, + pub dispute_period: _0, + pub dispute_post_conclusion_acceptance_period: _0, + pub dispute_max_spam_slots: _0, + pub dispute_conclusion_by_time_out_period: _0, + pub no_show_slots: _0, + pub n_delay_tranches: _0, + pub zeroth_delay_tranche_width: _0, + pub needed_approvals: _0, + pub relay_vrf_modulo_samples: _0, + pub ump_max_individual_weight: ::core::primitive::u64, + pub pvf_checking_enabled: ::core::primitive::bool, + pub pvf_voting_ttl: _0, + pub minimum_validation_upgrade_delay: _0, + } + } + pub mod disputes { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + force_unfreeze, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Duplicate dispute statement sets provided."] + DuplicateDisputeStatementSets, + #[codec(index = 1)] + #[doc = "Ancient dispute statement provided."] + AncientDisputeStatement, + #[codec(index = 2)] + #[doc = "Validator index on statement is out of bounds for session."] + ValidatorIndexOutOfBounds, + #[codec(index = 3)] + #[doc = "Invalid signature on statement."] + InvalidSignature, + #[codec(index = 4)] + #[doc = "Validator vote submitted more than once to dispute."] + DuplicateStatement, + #[codec(index = 5)] + #[doc = "Too many spam slots used by some specific validator."] + PotentialSpam, + #[codec(index = 6)] + #[doc = "A dispute where there are only votes on one side."] + SingleSidedDispute, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] # [doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] DisputeInitiated (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeLocation ,) , # [codec (index = 1)] # [doc = "A dispute has concluded for or against a candidate."] # [doc = "`\\[para id, candidate hash, dispute result\\]`"] DisputeConcluded (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeResult ,) , # [codec (index = 2)] # [doc = "A dispute has timed out due to insufficient participation."] # [doc = "`\\[para id, candidate hash\\]`"] DisputeTimedOut (runtime_types :: polkadot_core_primitives :: CandidateHash ,) , # [codec (index = 3)] # [doc = "A dispute has concluded with supermajority against a candidate."] # [doc = "Block authors should no longer build on top of this head and should"] # [doc = "instead revert the block at the given height. This should be the"] # [doc = "number of the child of the last known valid block in the chain."] Revert (:: core :: primitive :: u32 ,) , } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DisputeLocation { + #[codec(index = 0)] + Local, + #[codec(index = 1)] + Remote, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DisputeResult { + #[codec(index = 0)] + Valid, + #[codec(index = 1)] + Invalid, + } + } + pub mod dmp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call {} + } + } + pub mod hrmp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] # [doc = "a para may have. Normally this happens once per session, but this allows"] # [doc = "you to trigger the cleanup immediately for a specific parachain."] # [doc = ""] # [doc = "Origin must be Root."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data of weighing."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data of weighing."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The sender tried to open a channel to themselves."] + OpenHrmpChannelToSelf, + #[codec(index = 1)] + #[doc = "The recipient is not a valid para."] + OpenHrmpChannelInvalidRecipient, + #[codec(index = 2)] + #[doc = "The requested capacity is zero."] + OpenHrmpChannelZeroCapacity, + #[codec(index = 3)] + #[doc = "The requested capacity exceeds the global limit."] + OpenHrmpChannelCapacityExceedsLimit, + #[codec(index = 4)] + #[doc = "The requested maximum message size is 0."] + OpenHrmpChannelZeroMessageSize, + #[codec(index = 5)] + #[doc = "The open request requested the message size that exceeds the global limit."] + OpenHrmpChannelMessageSizeExceedsLimit, + #[codec(index = 6)] + #[doc = "The channel already exists"] + OpenHrmpChannelAlreadyExists, + #[codec(index = 7)] + #[doc = "There is already a request to open the same channel."] + OpenHrmpChannelAlreadyRequested, + #[codec(index = 8)] + #[doc = "The sender already has the maximum number of allowed outbound channels."] + OpenHrmpChannelLimitExceeded, + #[codec(index = 9)] + #[doc = "The channel from the sender to the origin doesn't exist."] + AcceptHrmpChannelDoesntExist, + #[codec(index = 10)] + #[doc = "The channel is already confirmed."] + AcceptHrmpChannelAlreadyConfirmed, + #[codec(index = 11)] + #[doc = "The recipient already has the maximum number of allowed inbound channels."] + AcceptHrmpChannelLimitExceeded, + #[codec(index = 12)] + #[doc = "The origin tries to close a channel where it is neither the sender nor the recipient."] + CloseHrmpChannelUnauthorized, + #[codec(index = 13)] + #[doc = "The channel to be closed doesn't exist."] + CloseHrmpChannelDoesntExist, + #[codec(index = 14)] + #[doc = "The channel close request is already requested."] + CloseHrmpChannelAlreadyUnderway, + #[codec(index = 15)] + #[doc = "Canceling is requested by neither the sender nor recipient of the open channel request."] + CancelHrmpOpenChannelUnauthorized, + #[codec(index = 16)] + #[doc = "The open request doesn't exist."] + OpenHrmpChannelDoesntExist, + #[codec(index = 17)] + #[doc = "Cannot cancel an HRMP open channel request because it is already confirmed."] + OpenHrmpChannelAlreadyConfirmed, + #[codec(index = 18)] + #[doc = "The provided witness data is wrong."] + WrongWitness, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Open HRMP channel requested."] + #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] + OpenChannelRequested( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + ::core::primitive::u32, + ), + #[codec(index = 1)] + #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] + #[doc = "`[by_parachain, channel_id]`"] + OpenChannelCanceled( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ), + #[codec(index = 2)] + #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] + OpenChannelAccepted( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::Id, + ), + #[codec(index = 3)] + #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] + ChannelClosed( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ), + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct HrmpChannel { + pub max_capacity: ::core::primitive::u32, + pub max_total_size: ::core::primitive::u32, + pub max_message_size: ::core::primitive::u32, + pub msg_count: ::core::primitive::u32, + pub total_size: ::core::primitive::u32, + pub mqc_head: ::core::option::Option<::subxt::sp_core::H256>, + pub sender_deposit: ::core::primitive::u128, + pub recipient_deposit: ::core::primitive::u128, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct HrmpOpenChannelRequest { + pub confirmed: ::core::primitive::bool, + pub _age: ::core::primitive::u32, + pub sender_deposit: ::core::primitive::u128, + pub max_message_size: ::core::primitive::u32, + pub max_capacity: ::core::primitive::u32, + pub max_total_size: ::core::primitive::u32, + } + } + pub mod inclusion { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call {} + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Validator indices are out of order or contains duplicates."] + UnsortedOrDuplicateValidatorIndices, + #[codec(index = 1)] + #[doc = "Dispute statement sets are out of order or contain duplicates."] + UnsortedOrDuplicateDisputeStatementSet, + #[codec(index = 2)] + #[doc = "Backed candidates are out of order (core index) or contain duplicates."] + UnsortedOrDuplicateBackedCandidates, + #[codec(index = 3)] + #[doc = "A different relay parent was provided compared to the on-chain stored one."] + UnexpectedRelayParent, + #[codec(index = 4)] + #[doc = "Availability bitfield has unexpected size."] + WrongBitfieldSize, + #[codec(index = 5)] + #[doc = "Bitfield consists of zeros only."] + BitfieldAllZeros, + #[codec(index = 6)] + #[doc = "Multiple bitfields submitted by same validator or validators out of order by index."] + BitfieldDuplicateOrUnordered, + #[codec(index = 7)] + #[doc = "Validator index out of bounds."] + ValidatorIndexOutOfBounds, + #[codec(index = 8)] + #[doc = "Invalid signature"] + InvalidBitfieldSignature, + #[codec(index = 9)] + #[doc = "Candidate submitted but para not scheduled."] + UnscheduledCandidate, + #[codec(index = 10)] + #[doc = "Candidate scheduled despite pending candidate already existing for the para."] + CandidateScheduledBeforeParaFree, + #[codec(index = 11)] + #[doc = "Candidate included with the wrong collator."] + WrongCollator, + #[codec(index = 12)] + #[doc = "Scheduled cores out of order."] + ScheduledOutOfOrder, + #[codec(index = 13)] + #[doc = "Head data exceeds the configured maximum."] + HeadDataTooLarge, + #[codec(index = 14)] + #[doc = "Code upgrade prematurely."] + PrematureCodeUpgrade, + #[codec(index = 15)] + #[doc = "Output code is too large"] + NewCodeTooLarge, + #[codec(index = 16)] + #[doc = "Candidate not in parent context."] + CandidateNotInParentContext, + #[codec(index = 17)] + #[doc = "Invalid group index in core assignment."] + InvalidGroupIndex, + #[codec(index = 18)] + #[doc = "Insufficient (non-majority) backing."] + InsufficientBacking, + #[codec(index = 19)] + #[doc = "Invalid (bad signature, unknown validator, etc.) backing."] + InvalidBacking, + #[codec(index = 20)] + #[doc = "Collator did not sign PoV."] + NotCollatorSigned, + #[codec(index = 21)] + #[doc = "The validation data hash does not match expected."] + ValidationDataHashMismatch, + #[codec(index = 22)] + #[doc = "The downward message queue is not processed correctly."] + IncorrectDownwardMessageHandling, + #[codec(index = 23)] + #[doc = "At least one upward message sent does not pass the acceptance criteria."] + InvalidUpwardMessages, + #[codec(index = 24)] + #[doc = "The candidate didn't follow the rules of HRMP watermark advancement."] + HrmpWatermarkMishandling, + #[codec(index = 25)] + #[doc = "The HRMP messages sent by the candidate is not valid."] + InvalidOutboundHrmp, + #[codec(index = 26)] + #[doc = "The validation code hash of the candidate is not valid."] + InvalidValidationCodeHash, + #[codec(index = 27)] + #[doc = "The `para_head` hash in the candidate descriptor doesn't match the hash of the actual para head in the"] + #[doc = "commitments."] + ParaHeadMismatch, + #[codec(index = 28)] + #[doc = "A bitfield that references a freed core,"] + #[doc = "either intentionally or as part of a concluded"] + #[doc = "invalid dispute."] + BitfieldReferencesFreedCore, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "A candidate was backed. `[candidate, head_data]`"] + CandidateBacked( + runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::sp_core::H256, + >, + runtime_types::polkadot_parachain::primitives::HeadData, + runtime_types::polkadot_primitives::v2::CoreIndex, + runtime_types::polkadot_primitives::v2::GroupIndex, + ), + #[codec(index = 1)] + #[doc = "A candidate was included. `[candidate, head_data]`"] + CandidateIncluded( + runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::sp_core::H256, + >, + runtime_types::polkadot_parachain::primitives::HeadData, + runtime_types::polkadot_primitives::v2::CoreIndex, + runtime_types::polkadot_primitives::v2::GroupIndex, + ), + #[codec(index = 2)] + #[doc = "A candidate timed out. `[candidate, head_data]`"] + CandidateTimedOut( + runtime_types::polkadot_primitives::v2::CandidateReceipt< + ::subxt::sp_core::H256, + >, + runtime_types::polkadot_parachain::primitives::HeadData, + runtime_types::polkadot_primitives::v2::CoreIndex, + ), + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct AvailabilityBitfieldRecord<_0> { + pub bitfield: + runtime_types::polkadot_primitives::v2::AvailabilityBitfield, + pub submitted_at: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CandidatePendingAvailability<_0, _1> { + pub core: runtime_types::polkadot_primitives::v2::CoreIndex, + pub hash: runtime_types::polkadot_core_primitives::CandidateHash, + pub descriptor: + runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, + pub availability_votes: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub backers: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub relay_parent_number: _1, + pub backed_in_number: _1, + pub backing_group: runtime_types::polkadot_primitives::v2::GroupIndex, + } + } + pub mod initializer { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] + #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] + #[doc = "chain are valid and should be finalized."] + force_approve { up_to: ::core::primitive::u32 }, + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BufferedSessionChange { + pub validators: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::validator_app::Public, + >, + pub queued: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::validator_app::Public, + >, + pub session_index: ::core::primitive::u32, + } + } + pub mod origin { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Origin { + #[codec(index = 0)] + Parachain(runtime_types::polkadot_parachain::primitives::Id), + } + } + } + pub mod paras { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] # [doc = "Set the storage for the parachain validation code immediately."] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Set the storage for the current parachain head data immediately."] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] # [doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Note a new block head for para within the context of the current block."] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] # [doc = "Put a parachain directly into the next session's action queue."] # [doc = "We can't queue it any sooner than this without going into the"] # [doc = "initializer..."] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Adds the validation code to the storage."] # [doc = ""] # [doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] # [doc = "is running for that code, it will be instantly accepted."] # [doc = ""] # [doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] # [doc = "into storage with reference count 0. This is to account the fact that there are no users"] # [doc = "for this code yet. The caller will have to make sure that this code eventually gets"] # [doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] # [doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] # [doc = ""] # [doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] # [doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 6)] # [doc = "Remove the validation code from the storage iff the reference count is 0."] # [doc = ""] # [doc = "This is better than removing the storage directly, because it will not remove the code"] # [doc = "that was suddenly got used by some parachain while this dispatchable was pending"] # [doc = "dispatching."] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] # [doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] # [doc = "enacts the results if that was the last vote before achieving the supermajority."] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v2 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Para is not registered in our system."] + NotRegistered, + #[codec(index = 1)] + #[doc = "Para cannot be onboarded because it is already tracked by our system."] + CannotOnboard, + #[codec(index = 2)] + #[doc = "Para cannot be offboarded at this time."] + CannotOffboard, + #[codec(index = 3)] + #[doc = "Para cannot be upgraded to a parachain."] + CannotUpgrade, + #[codec(index = 4)] + #[doc = "Para cannot be downgraded to a parathread."] + CannotDowngrade, + #[codec(index = 5)] + #[doc = "The statement for PVF pre-checking is stale."] + PvfCheckStatementStale, + #[codec(index = 6)] + #[doc = "The statement for PVF pre-checking is for a future session."] + PvfCheckStatementFuture, + #[codec(index = 7)] + #[doc = "Claimed validator index is out of bounds."] + PvfCheckValidatorIndexOutOfBounds, + #[codec(index = 8)] + #[doc = "The signature for the PVF pre-checking is invalid."] + PvfCheckInvalidSignature, + #[codec(index = 9)] + #[doc = "The given validator already has cast a vote."] + PvfCheckDoubleVote, + #[codec(index = 10)] + #[doc = "The given PVF does not exist at the moment of process a vote."] + PvfCheckSubjectInvalid, + #[codec(index = 11)] + #[doc = "The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism"] + #[doc = "is disabled."] + PvfCheckDisabled, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] # [doc = "Current code has been updated for a Para. `para_id`"] CurrentCodeUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 1)] # [doc = "Current head has been updated for a Para. `para_id`"] CurrentHeadUpdated (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 2)] # [doc = "A code upgrade has been scheduled for a Para. `para_id`"] CodeUpgradeScheduled (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 3)] # [doc = "A new head has been noted for a Para. `para_id`"] NewHeadNoted (runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 4)] # [doc = "A para has been queued to execute pending actions. `para_id`"] ActionQueued (runtime_types :: polkadot_parachain :: primitives :: Id , :: core :: primitive :: u32 ,) , # [codec (index = 5)] # [doc = "The given para either initiated or subscribed to a PVF check for the given validation"] # [doc = "code. `code_hash` `para_id`"] PvfCheckStarted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 6)] # [doc = "The given validation code was accepted by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckAccepted (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , # [codec (index = 7)] # [doc = "The given validation code was rejected by the PVF pre-checking vote."] # [doc = "`code_hash` `para_id`"] PvfCheckRejected (runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , runtime_types :: polkadot_parachain :: primitives :: Id ,) , } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ParaGenesisArgs { + pub genesis_head: + runtime_types::polkadot_parachain::primitives::HeadData, + pub validation_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + pub parachain: ::core::primitive::bool, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ParaLifecycle { + #[codec(index = 0)] + Onboarding, + #[codec(index = 1)] + Parathread, + #[codec(index = 2)] + Parachain, + #[codec(index = 3)] + UpgradingParathread, + #[codec(index = 4)] + DowngradingParachain, + #[codec(index = 5)] + OffboardingParathread, + #[codec(index = 6)] + OffboardingParachain, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ParaPastCodeMeta < _0 > { pub upgrade_times : :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: paras :: ReplacementTimes < _0 > > , pub last_pruned : :: core :: option :: Option < _0 > , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PvfCheckActiveVoteState<_0> { + pub votes_accept: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub votes_reject: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub age: _0, + pub created_at: _0, + pub causes: ::std::vec::Vec< + runtime_types::polkadot_runtime_parachains::paras::PvfCheckCause< + _0, + >, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum PvfCheckCause<_0> { + #[codec(index = 0)] + Onboarding(runtime_types::polkadot_parachain::primitives::Id), + #[codec(index = 1)] + Upgrade { + id: runtime_types::polkadot_parachain::primitives::Id, + relay_parent_number: _0, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ReplacementTimes<_0> { + pub expected_at: _0, + pub activated_at: _0, + } + } + pub mod paras_inherent { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] + enter { + data: runtime_types::polkadot_primitives::v2::InherentData< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "Inclusion inherent called more than once per block."] + TooManyInclusionInherents, + #[codec(index = 1)] + #[doc = "The hash of the submitted parent header doesn't correspond to the saved block hash of"] + #[doc = "the parent."] + InvalidParentHeader, + #[codec(index = 2)] + #[doc = "Disputed candidate that was concluded invalid."] + CandidateConcludedInvalid, + #[codec(index = 3)] + #[doc = "The data given to the inherent will result in an overweight block."] + InherentOverweight, + #[codec(index = 4)] + #[doc = "The ordering of dispute statements was invalid."] + DisputeStatementsUnsortedOrDuplicates, + #[codec(index = 5)] + #[doc = "A dispute statement was invalid."] + DisputeInvalid, + } + } + } + pub mod scheduler { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum AssignmentKind { + #[codec(index = 0)] + Parachain, + #[codec(index = 1)] + Parathread( + runtime_types::polkadot_primitives::v2::collator_app::Public, + ::core::primitive::u32, + ), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v2 :: CoreIndex , pub para_id : runtime_types :: polkadot_parachain :: primitives :: Id , pub kind : runtime_types :: polkadot_runtime_parachains :: scheduler :: AssignmentKind , pub group_idx : runtime_types :: polkadot_primitives :: v2 :: GroupIndex , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ParathreadClaimQueue { pub queue : :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: QueuedParathread > , pub next_core_offset : :: core :: primitive :: u32 , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct QueuedParathread { + pub claim: runtime_types::polkadot_primitives::v2::ParathreadEntry, + pub core_offset: ::core::primitive::u32, + } + } + pub mod shared { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call {} + } + } + pub mod ump { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + #[doc = "Service a single overweight upward message."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] + #[doc = "- `index`: The index of the overweight message to service."] + #[doc = "- `weight_limit`: The amount of weight that message execution may take."] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `UnknownMessageIndex`: Message of `index` is unknown."] + #[doc = "- `WeightOverLimit`: Message execution may use greater than `weight_limit`."] + #[doc = ""] + #[doc = "Events:"] + #[doc = "- `OverweightServiced`: On success."] + service_overweight { + index: ::core::primitive::u64, + weight_limit: ::core::primitive::u64, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + #[doc = "The message index given is unknown."] + UnknownMessageIndex, + #[codec(index = 1)] + #[doc = "The amount of weight given is possibly not enough for executing the message."] + WeightOverLimit, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + #[doc = "Upward message is invalid XCM."] + #[doc = "\\[ id \\]"] + InvalidFormat([::core::primitive::u8; 32usize]), + #[codec(index = 1)] + #[doc = "Upward message is unsupported version of XCM."] + #[doc = "\\[ id \\]"] + UnsupportedVersion([::core::primitive::u8; 32usize]), + #[codec(index = 2)] + #[doc = "Upward message executed with the given outcome."] + #[doc = "\\[ id, outcome \\]"] + ExecutedUpward( + [::core::primitive::u8; 32usize], + runtime_types::xcm::v2::traits::Outcome, + ), + #[codec(index = 3)] + #[doc = "The weight limit for handling upward messages was reached."] + #[doc = "\\[ id, remaining, required \\]"] + WeightExhausted( + [::core::primitive::u8; 32usize], + ::core::primitive::u64, + ::core::primitive::u64, + ), + #[codec(index = 4)] + #[doc = "Some upward messages have been received and will be processed."] + #[doc = "\\[ para, count, size \\]"] + UpwardMessagesReceived( + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + ::core::primitive::u32, + ), + #[codec(index = 5)] + #[doc = "The weight budget was exceeded for an individual upward message."] + #[doc = ""] + #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] + #[doc = "using the assigned `overweight_index`."] + #[doc = ""] + #[doc = "\\[ para, id, overweight_index, required \\]"] + OverweightEnqueued( + runtime_types::polkadot_parachain::primitives::Id, + [::core::primitive::u8; 32usize], + ::core::primitive::u64, + ::core::primitive::u64, + ), + #[codec(index = 6)] + #[doc = "Upward message from the overweight queue was executed with the given actual weight"] + #[doc = "used."] + #[doc = ""] + #[doc = "\\[ overweight_index, used \\]"] + OverweightServiced( + ::core::primitive::u64, + ::core::primitive::u64, + ), + } + } + } + } + pub mod primitive_types { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct H256(pub [::core::primitive::u8; 32usize]); + } + pub mod sp_arithmetic { + use super::runtime_types; + pub mod fixed_point { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct FixedU128(pub ::core::primitive::u128); + } + pub mod per_things { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct PerU16(pub ::core::primitive::u16); + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Perbill(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Percent(pub ::core::primitive::u8); + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Permill(pub ::core::primitive::u32); + } + } + pub mod sp_authority_discovery { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + } + pub mod sp_consensus_babe { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + pub mod digests { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum NextConfigDescriptor { + #[codec(index = 1)] + V1 { + c: (::core::primitive::u64, ::core::primitive::u64), + allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum AllowedSlots { + #[codec(index = 0)] + PrimarySlots, + #[codec(index = 1)] + PrimaryAndSecondaryPlainSlots, + #[codec(index = 2)] + PrimaryAndSecondaryVRFSlots, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BabeEpochConfiguration { + pub c: (::core::primitive::u64, ::core::primitive::u64), + pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + } + } + pub mod sp_consensus_slots { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EquivocationProof<_0, _1> { + pub offender: _1, + pub slot: runtime_types::sp_consensus_slots::Slot, + pub first_header: _0, + pub second_header: _0, + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Slot(pub ::core::primitive::u64); + } + pub mod sp_core { + use super::runtime_types; + pub mod crypto { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct AccountId32(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); + } + pub mod ecdsa { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub [::core::primitive::u8; 33usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub [::core::primitive::u8; 65usize]); + } + pub mod ed25519 { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub [::core::primitive::u8; 64usize]); + } + pub mod offchain { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct OpaqueNetworkState { + pub peer_id: runtime_types::sp_core::OpaquePeerId, + pub external_addresses: ::std::vec::Vec< + runtime_types::sp_core::offchain::OpaqueMultiaddr, + >, + } + } + pub mod sr25519 { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub [::core::primitive::u8; 64usize]); + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Void {} + } + pub mod sp_finality_grandpa { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Public(pub runtime_types::sp_core::ed25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Equivocation<_0, _1> { + #[codec(index = 0)] + Prevote( + runtime_types::finality_grandpa::Equivocation< + runtime_types::sp_finality_grandpa::app::Public, + runtime_types::finality_grandpa::Prevote<_0, _1>, + runtime_types::sp_finality_grandpa::app::Signature, + >, + ), + #[codec(index = 1)] + Precommit( + runtime_types::finality_grandpa::Equivocation< + runtime_types::sp_finality_grandpa::app::Public, + runtime_types::finality_grandpa::Precommit<_0, _1>, + runtime_types::sp_finality_grandpa::app::Signature, + >, + ), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EquivocationProof<_0, _1> { + pub set_id: ::core::primitive::u64, + pub equivocation: + runtime_types::sp_finality_grandpa::Equivocation<_0, _1>, + } + } + pub mod sp_npos_elections { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ElectionScore { + pub minimal_stake: ::core::primitive::u128, + pub sum_stake: ::core::primitive::u128, + pub sum_stake_squared: ::core::primitive::u128, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Support<_0> { + pub total: ::core::primitive::u128, + pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, + } + } + pub mod sp_runtime { + use super::runtime_types; + pub mod generic { + use super::runtime_types; + pub mod digest { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Digest { + pub logs: ::std::vec::Vec< + runtime_types::sp_runtime::generic::digest::DigestItem, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DigestItem { + #[codec(index = 6)] + PreRuntime( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 4)] + Consensus( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 5)] + Seal( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 0)] + Other(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 8)] + RuntimeEnvironmentUpdated, + } + } + pub mod era { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Era { + #[codec(index = 0)] + Immortal, + #[codec(index = 1)] + Mortal1(::core::primitive::u8), + #[codec(index = 2)] + Mortal2(::core::primitive::u8), + #[codec(index = 3)] + Mortal3(::core::primitive::u8), + #[codec(index = 4)] + Mortal4(::core::primitive::u8), + #[codec(index = 5)] + Mortal5(::core::primitive::u8), + #[codec(index = 6)] + Mortal6(::core::primitive::u8), + #[codec(index = 7)] + Mortal7(::core::primitive::u8), + #[codec(index = 8)] + Mortal8(::core::primitive::u8), + #[codec(index = 9)] + Mortal9(::core::primitive::u8), + #[codec(index = 10)] + Mortal10(::core::primitive::u8), + #[codec(index = 11)] + Mortal11(::core::primitive::u8), + #[codec(index = 12)] + Mortal12(::core::primitive::u8), + #[codec(index = 13)] + Mortal13(::core::primitive::u8), + #[codec(index = 14)] + Mortal14(::core::primitive::u8), + #[codec(index = 15)] + Mortal15(::core::primitive::u8), + #[codec(index = 16)] + Mortal16(::core::primitive::u8), + #[codec(index = 17)] + Mortal17(::core::primitive::u8), + #[codec(index = 18)] + Mortal18(::core::primitive::u8), + #[codec(index = 19)] + Mortal19(::core::primitive::u8), + #[codec(index = 20)] + Mortal20(::core::primitive::u8), + #[codec(index = 21)] + Mortal21(::core::primitive::u8), + #[codec(index = 22)] + Mortal22(::core::primitive::u8), + #[codec(index = 23)] + Mortal23(::core::primitive::u8), + #[codec(index = 24)] + Mortal24(::core::primitive::u8), + #[codec(index = 25)] + Mortal25(::core::primitive::u8), + #[codec(index = 26)] + Mortal26(::core::primitive::u8), + #[codec(index = 27)] + Mortal27(::core::primitive::u8), + #[codec(index = 28)] + Mortal28(::core::primitive::u8), + #[codec(index = 29)] + Mortal29(::core::primitive::u8), + #[codec(index = 30)] + Mortal30(::core::primitive::u8), + #[codec(index = 31)] + Mortal31(::core::primitive::u8), + #[codec(index = 32)] + Mortal32(::core::primitive::u8), + #[codec(index = 33)] + Mortal33(::core::primitive::u8), + #[codec(index = 34)] + Mortal34(::core::primitive::u8), + #[codec(index = 35)] + Mortal35(::core::primitive::u8), + #[codec(index = 36)] + Mortal36(::core::primitive::u8), + #[codec(index = 37)] + Mortal37(::core::primitive::u8), + #[codec(index = 38)] + Mortal38(::core::primitive::u8), + #[codec(index = 39)] + Mortal39(::core::primitive::u8), + #[codec(index = 40)] + Mortal40(::core::primitive::u8), + #[codec(index = 41)] + Mortal41(::core::primitive::u8), + #[codec(index = 42)] + Mortal42(::core::primitive::u8), + #[codec(index = 43)] + Mortal43(::core::primitive::u8), + #[codec(index = 44)] + Mortal44(::core::primitive::u8), + #[codec(index = 45)] + Mortal45(::core::primitive::u8), + #[codec(index = 46)] + Mortal46(::core::primitive::u8), + #[codec(index = 47)] + Mortal47(::core::primitive::u8), + #[codec(index = 48)] + Mortal48(::core::primitive::u8), + #[codec(index = 49)] + Mortal49(::core::primitive::u8), + #[codec(index = 50)] + Mortal50(::core::primitive::u8), + #[codec(index = 51)] + Mortal51(::core::primitive::u8), + #[codec(index = 52)] + Mortal52(::core::primitive::u8), + #[codec(index = 53)] + Mortal53(::core::primitive::u8), + #[codec(index = 54)] + Mortal54(::core::primitive::u8), + #[codec(index = 55)] + Mortal55(::core::primitive::u8), + #[codec(index = 56)] + Mortal56(::core::primitive::u8), + #[codec(index = 57)] + Mortal57(::core::primitive::u8), + #[codec(index = 58)] + Mortal58(::core::primitive::u8), + #[codec(index = 59)] + Mortal59(::core::primitive::u8), + #[codec(index = 60)] + Mortal60(::core::primitive::u8), + #[codec(index = 61)] + Mortal61(::core::primitive::u8), + #[codec(index = 62)] + Mortal62(::core::primitive::u8), + #[codec(index = 63)] + Mortal63(::core::primitive::u8), + #[codec(index = 64)] + Mortal64(::core::primitive::u8), + #[codec(index = 65)] + Mortal65(::core::primitive::u8), + #[codec(index = 66)] + Mortal66(::core::primitive::u8), + #[codec(index = 67)] + Mortal67(::core::primitive::u8), + #[codec(index = 68)] + Mortal68(::core::primitive::u8), + #[codec(index = 69)] + Mortal69(::core::primitive::u8), + #[codec(index = 70)] + Mortal70(::core::primitive::u8), + #[codec(index = 71)] + Mortal71(::core::primitive::u8), + #[codec(index = 72)] + Mortal72(::core::primitive::u8), + #[codec(index = 73)] + Mortal73(::core::primitive::u8), + #[codec(index = 74)] + Mortal74(::core::primitive::u8), + #[codec(index = 75)] + Mortal75(::core::primitive::u8), + #[codec(index = 76)] + Mortal76(::core::primitive::u8), + #[codec(index = 77)] + Mortal77(::core::primitive::u8), + #[codec(index = 78)] + Mortal78(::core::primitive::u8), + #[codec(index = 79)] + Mortal79(::core::primitive::u8), + #[codec(index = 80)] + Mortal80(::core::primitive::u8), + #[codec(index = 81)] + Mortal81(::core::primitive::u8), + #[codec(index = 82)] + Mortal82(::core::primitive::u8), + #[codec(index = 83)] + Mortal83(::core::primitive::u8), + #[codec(index = 84)] + Mortal84(::core::primitive::u8), + #[codec(index = 85)] + Mortal85(::core::primitive::u8), + #[codec(index = 86)] + Mortal86(::core::primitive::u8), + #[codec(index = 87)] + Mortal87(::core::primitive::u8), + #[codec(index = 88)] + Mortal88(::core::primitive::u8), + #[codec(index = 89)] + Mortal89(::core::primitive::u8), + #[codec(index = 90)] + Mortal90(::core::primitive::u8), + #[codec(index = 91)] + Mortal91(::core::primitive::u8), + #[codec(index = 92)] + Mortal92(::core::primitive::u8), + #[codec(index = 93)] + Mortal93(::core::primitive::u8), + #[codec(index = 94)] + Mortal94(::core::primitive::u8), + #[codec(index = 95)] + Mortal95(::core::primitive::u8), + #[codec(index = 96)] + Mortal96(::core::primitive::u8), + #[codec(index = 97)] + Mortal97(::core::primitive::u8), + #[codec(index = 98)] + Mortal98(::core::primitive::u8), + #[codec(index = 99)] + Mortal99(::core::primitive::u8), + #[codec(index = 100)] + Mortal100(::core::primitive::u8), + #[codec(index = 101)] + Mortal101(::core::primitive::u8), + #[codec(index = 102)] + Mortal102(::core::primitive::u8), + #[codec(index = 103)] + Mortal103(::core::primitive::u8), + #[codec(index = 104)] + Mortal104(::core::primitive::u8), + #[codec(index = 105)] + Mortal105(::core::primitive::u8), + #[codec(index = 106)] + Mortal106(::core::primitive::u8), + #[codec(index = 107)] + Mortal107(::core::primitive::u8), + #[codec(index = 108)] + Mortal108(::core::primitive::u8), + #[codec(index = 109)] + Mortal109(::core::primitive::u8), + #[codec(index = 110)] + Mortal110(::core::primitive::u8), + #[codec(index = 111)] + Mortal111(::core::primitive::u8), + #[codec(index = 112)] + Mortal112(::core::primitive::u8), + #[codec(index = 113)] + Mortal113(::core::primitive::u8), + #[codec(index = 114)] + Mortal114(::core::primitive::u8), + #[codec(index = 115)] + Mortal115(::core::primitive::u8), + #[codec(index = 116)] + Mortal116(::core::primitive::u8), + #[codec(index = 117)] + Mortal117(::core::primitive::u8), + #[codec(index = 118)] + Mortal118(::core::primitive::u8), + #[codec(index = 119)] + Mortal119(::core::primitive::u8), + #[codec(index = 120)] + Mortal120(::core::primitive::u8), + #[codec(index = 121)] + Mortal121(::core::primitive::u8), + #[codec(index = 122)] + Mortal122(::core::primitive::u8), + #[codec(index = 123)] + Mortal123(::core::primitive::u8), + #[codec(index = 124)] + Mortal124(::core::primitive::u8), + #[codec(index = 125)] + Mortal125(::core::primitive::u8), + #[codec(index = 126)] + Mortal126(::core::primitive::u8), + #[codec(index = 127)] + Mortal127(::core::primitive::u8), + #[codec(index = 128)] + Mortal128(::core::primitive::u8), + #[codec(index = 129)] + Mortal129(::core::primitive::u8), + #[codec(index = 130)] + Mortal130(::core::primitive::u8), + #[codec(index = 131)] + Mortal131(::core::primitive::u8), + #[codec(index = 132)] + Mortal132(::core::primitive::u8), + #[codec(index = 133)] + Mortal133(::core::primitive::u8), + #[codec(index = 134)] + Mortal134(::core::primitive::u8), + #[codec(index = 135)] + Mortal135(::core::primitive::u8), + #[codec(index = 136)] + Mortal136(::core::primitive::u8), + #[codec(index = 137)] + Mortal137(::core::primitive::u8), + #[codec(index = 138)] + Mortal138(::core::primitive::u8), + #[codec(index = 139)] + Mortal139(::core::primitive::u8), + #[codec(index = 140)] + Mortal140(::core::primitive::u8), + #[codec(index = 141)] + Mortal141(::core::primitive::u8), + #[codec(index = 142)] + Mortal142(::core::primitive::u8), + #[codec(index = 143)] + Mortal143(::core::primitive::u8), + #[codec(index = 144)] + Mortal144(::core::primitive::u8), + #[codec(index = 145)] + Mortal145(::core::primitive::u8), + #[codec(index = 146)] + Mortal146(::core::primitive::u8), + #[codec(index = 147)] + Mortal147(::core::primitive::u8), + #[codec(index = 148)] + Mortal148(::core::primitive::u8), + #[codec(index = 149)] + Mortal149(::core::primitive::u8), + #[codec(index = 150)] + Mortal150(::core::primitive::u8), + #[codec(index = 151)] + Mortal151(::core::primitive::u8), + #[codec(index = 152)] + Mortal152(::core::primitive::u8), + #[codec(index = 153)] + Mortal153(::core::primitive::u8), + #[codec(index = 154)] + Mortal154(::core::primitive::u8), + #[codec(index = 155)] + Mortal155(::core::primitive::u8), + #[codec(index = 156)] + Mortal156(::core::primitive::u8), + #[codec(index = 157)] + Mortal157(::core::primitive::u8), + #[codec(index = 158)] + Mortal158(::core::primitive::u8), + #[codec(index = 159)] + Mortal159(::core::primitive::u8), + #[codec(index = 160)] + Mortal160(::core::primitive::u8), + #[codec(index = 161)] + Mortal161(::core::primitive::u8), + #[codec(index = 162)] + Mortal162(::core::primitive::u8), + #[codec(index = 163)] + Mortal163(::core::primitive::u8), + #[codec(index = 164)] + Mortal164(::core::primitive::u8), + #[codec(index = 165)] + Mortal165(::core::primitive::u8), + #[codec(index = 166)] + Mortal166(::core::primitive::u8), + #[codec(index = 167)] + Mortal167(::core::primitive::u8), + #[codec(index = 168)] + Mortal168(::core::primitive::u8), + #[codec(index = 169)] + Mortal169(::core::primitive::u8), + #[codec(index = 170)] + Mortal170(::core::primitive::u8), + #[codec(index = 171)] + Mortal171(::core::primitive::u8), + #[codec(index = 172)] + Mortal172(::core::primitive::u8), + #[codec(index = 173)] + Mortal173(::core::primitive::u8), + #[codec(index = 174)] + Mortal174(::core::primitive::u8), + #[codec(index = 175)] + Mortal175(::core::primitive::u8), + #[codec(index = 176)] + Mortal176(::core::primitive::u8), + #[codec(index = 177)] + Mortal177(::core::primitive::u8), + #[codec(index = 178)] + Mortal178(::core::primitive::u8), + #[codec(index = 179)] + Mortal179(::core::primitive::u8), + #[codec(index = 180)] + Mortal180(::core::primitive::u8), + #[codec(index = 181)] + Mortal181(::core::primitive::u8), + #[codec(index = 182)] + Mortal182(::core::primitive::u8), + #[codec(index = 183)] + Mortal183(::core::primitive::u8), + #[codec(index = 184)] + Mortal184(::core::primitive::u8), + #[codec(index = 185)] + Mortal185(::core::primitive::u8), + #[codec(index = 186)] + Mortal186(::core::primitive::u8), + #[codec(index = 187)] + Mortal187(::core::primitive::u8), + #[codec(index = 188)] + Mortal188(::core::primitive::u8), + #[codec(index = 189)] + Mortal189(::core::primitive::u8), + #[codec(index = 190)] + Mortal190(::core::primitive::u8), + #[codec(index = 191)] + Mortal191(::core::primitive::u8), + #[codec(index = 192)] + Mortal192(::core::primitive::u8), + #[codec(index = 193)] + Mortal193(::core::primitive::u8), + #[codec(index = 194)] + Mortal194(::core::primitive::u8), + #[codec(index = 195)] + Mortal195(::core::primitive::u8), + #[codec(index = 196)] + Mortal196(::core::primitive::u8), + #[codec(index = 197)] + Mortal197(::core::primitive::u8), + #[codec(index = 198)] + Mortal198(::core::primitive::u8), + #[codec(index = 199)] + Mortal199(::core::primitive::u8), + #[codec(index = 200)] + Mortal200(::core::primitive::u8), + #[codec(index = 201)] + Mortal201(::core::primitive::u8), + #[codec(index = 202)] + Mortal202(::core::primitive::u8), + #[codec(index = 203)] + Mortal203(::core::primitive::u8), + #[codec(index = 204)] + Mortal204(::core::primitive::u8), + #[codec(index = 205)] + Mortal205(::core::primitive::u8), + #[codec(index = 206)] + Mortal206(::core::primitive::u8), + #[codec(index = 207)] + Mortal207(::core::primitive::u8), + #[codec(index = 208)] + Mortal208(::core::primitive::u8), + #[codec(index = 209)] + Mortal209(::core::primitive::u8), + #[codec(index = 210)] + Mortal210(::core::primitive::u8), + #[codec(index = 211)] + Mortal211(::core::primitive::u8), + #[codec(index = 212)] + Mortal212(::core::primitive::u8), + #[codec(index = 213)] + Mortal213(::core::primitive::u8), + #[codec(index = 214)] + Mortal214(::core::primitive::u8), + #[codec(index = 215)] + Mortal215(::core::primitive::u8), + #[codec(index = 216)] + Mortal216(::core::primitive::u8), + #[codec(index = 217)] + Mortal217(::core::primitive::u8), + #[codec(index = 218)] + Mortal218(::core::primitive::u8), + #[codec(index = 219)] + Mortal219(::core::primitive::u8), + #[codec(index = 220)] + Mortal220(::core::primitive::u8), + #[codec(index = 221)] + Mortal221(::core::primitive::u8), + #[codec(index = 222)] + Mortal222(::core::primitive::u8), + #[codec(index = 223)] + Mortal223(::core::primitive::u8), + #[codec(index = 224)] + Mortal224(::core::primitive::u8), + #[codec(index = 225)] + Mortal225(::core::primitive::u8), + #[codec(index = 226)] + Mortal226(::core::primitive::u8), + #[codec(index = 227)] + Mortal227(::core::primitive::u8), + #[codec(index = 228)] + Mortal228(::core::primitive::u8), + #[codec(index = 229)] + Mortal229(::core::primitive::u8), + #[codec(index = 230)] + Mortal230(::core::primitive::u8), + #[codec(index = 231)] + Mortal231(::core::primitive::u8), + #[codec(index = 232)] + Mortal232(::core::primitive::u8), + #[codec(index = 233)] + Mortal233(::core::primitive::u8), + #[codec(index = 234)] + Mortal234(::core::primitive::u8), + #[codec(index = 235)] + Mortal235(::core::primitive::u8), + #[codec(index = 236)] + Mortal236(::core::primitive::u8), + #[codec(index = 237)] + Mortal237(::core::primitive::u8), + #[codec(index = 238)] + Mortal238(::core::primitive::u8), + #[codec(index = 239)] + Mortal239(::core::primitive::u8), + #[codec(index = 240)] + Mortal240(::core::primitive::u8), + #[codec(index = 241)] + Mortal241(::core::primitive::u8), + #[codec(index = 242)] + Mortal242(::core::primitive::u8), + #[codec(index = 243)] + Mortal243(::core::primitive::u8), + #[codec(index = 244)] + Mortal244(::core::primitive::u8), + #[codec(index = 245)] + Mortal245(::core::primitive::u8), + #[codec(index = 246)] + Mortal246(::core::primitive::u8), + #[codec(index = 247)] + Mortal247(::core::primitive::u8), + #[codec(index = 248)] + Mortal248(::core::primitive::u8), + #[codec(index = 249)] + Mortal249(::core::primitive::u8), + #[codec(index = 250)] + Mortal250(::core::primitive::u8), + #[codec(index = 251)] + Mortal251(::core::primitive::u8), + #[codec(index = 252)] + Mortal252(::core::primitive::u8), + #[codec(index = 253)] + Mortal253(::core::primitive::u8), + #[codec(index = 254)] + Mortal254(::core::primitive::u8), + #[codec(index = 255)] + Mortal255(::core::primitive::u8), + } + } + pub mod header { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Header<_0, _1> { + pub parent_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub number: _0, + pub state_root: ::subxt::sp_core::H256, + pub extrinsics_root: ::subxt::sp_core::H256, + pub digest: runtime_types::sp_runtime::generic::digest::Digest, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, + } + } + pub mod unchecked_extrinsic { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct UncheckedExtrinsic<_0, _1, _2, _3>( + pub ::std::vec::Vec<::core::primitive::u8>, + #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, + ); + } + } + pub mod multiaddress { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum MultiAddress<_0, _1> { + #[codec(index = 0)] + Id(_0), + #[codec(index = 1)] + Index(#[codec(compact)] _1), + #[codec(index = 2)] + Raw(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 3)] + Address32([::core::primitive::u8; 32usize]), + #[codec(index = 4)] + Address20([::core::primitive::u8; 20usize]), + } + } + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BlakeTwo256; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum ArithmeticError { + #[codec(index = 0)] + Underflow, + #[codec(index = 1)] + Overflow, + #[codec(index = 2)] + DivisionByZero, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum DispatchError { + #[codec(index = 0)] + Other, + #[codec(index = 1)] + CannotLookup, + #[codec(index = 2)] + BadOrigin, + #[codec(index = 3)] + Module(runtime_types::sp_runtime::ModuleError), + #[codec(index = 4)] + ConsumerRemaining, + #[codec(index = 5)] + NoProviders, + #[codec(index = 6)] + TooManyConsumers, + #[codec(index = 7)] + Token(runtime_types::sp_runtime::TokenError), + #[codec(index = 8)] + Arithmetic(runtime_types::sp_runtime::ArithmeticError), + #[codec(index = 9)] + Transactional(runtime_types::sp_runtime::TransactionalError), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ModuleError { + pub index: ::core::primitive::u8, + pub error: [::core::primitive::u8; 4usize], + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum MultiSignature { + #[codec(index = 0)] + Ed25519(runtime_types::sp_core::ed25519::Signature), + #[codec(index = 1)] + Sr25519(runtime_types::sp_core::sr25519::Signature), + #[codec(index = 2)] + Ecdsa(runtime_types::sp_core::ecdsa::Signature), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum MultiSigner { + #[codec(index = 0)] + Ed25519(runtime_types::sp_core::ed25519::Public), + #[codec(index = 1)] + Sr25519(runtime_types::sp_core::sr25519::Public), + #[codec(index = 2)] + Ecdsa(runtime_types::sp_core::ecdsa::Public), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum TokenError { + #[codec(index = 0)] + NoFunds, + #[codec(index = 1)] + WouldDie, + #[codec(index = 2)] + BelowMinimum, + #[codec(index = 3)] + CannotCreate, + #[codec(index = 4)] + UnknownAsset, + #[codec(index = 5)] + Frozen, + #[codec(index = 6)] + Unsupported, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum TransactionalError { + #[codec(index = 0)] + LimitReached, + #[codec(index = 1)] + NoLayer, + } + } + pub mod sp_session { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MembershipProof { + pub session: ::core::primitive::u32, + pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + pub validator_count: ::core::primitive::u32, + } + } + pub mod sp_staking { + use super::runtime_types; + pub mod offence { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct OffenceDetails<_0, _1> { + pub offender: _1, + pub reporters: ::std::vec::Vec<_0>, + } + } + } + pub mod sp_version { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RuntimeVersion { + pub spec_name: ::std::string::String, + pub impl_name: ::std::string::String, + pub authoring_version: ::core::primitive::u32, + pub spec_version: ::core::primitive::u32, + pub impl_version: ::core::primitive::u32, + pub apis: ::std::vec::Vec<( + [::core::primitive::u8; 8usize], + ::core::primitive::u32, + )>, + pub transaction_version: ::core::primitive::u32, + pub state_version: ::core::primitive::u8, + } + } + pub mod xcm { + use super::runtime_types; + pub mod double_encoded { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct DoubleEncoded { + pub encoded: ::std::vec::Vec<::core::primitive::u8>, + } + } + pub mod v0 { + use super::runtime_types; + pub mod junction { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum BodyId { + #[codec(index = 0)] + Unit, + #[codec(index = 1)] + Named(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 2)] + Index(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 3)] + Executive, + #[codec(index = 4)] + Technical, + #[codec(index = 5)] + Legislative, + #[codec(index = 6)] + Judicial, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum BodyPart { + #[codec(index = 0)] + Voice, + #[codec(index = 1)] + Members { + #[codec(compact)] + count: ::core::primitive::u32, + }, + #[codec(index = 2)] + Fraction { + #[codec(compact)] + nom: ::core::primitive::u32, + #[codec(compact)] + denom: ::core::primitive::u32, + }, + #[codec(index = 3)] + AtLeastProportion { + #[codec(compact)] + nom: ::core::primitive::u32, + #[codec(compact)] + denom: ::core::primitive::u32, + }, + #[codec(index = 4)] + MoreThanProportion { + #[codec(compact)] + nom: ::core::primitive::u32, + #[codec(compact)] + denom: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Junction { + #[codec(index = 0)] + Parent, + #[codec(index = 1)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 2)] + AccountId32 { + network: runtime_types::xcm::v0::junction::NetworkId, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 3)] + AccountIndex64 { + network: runtime_types::xcm::v0::junction::NetworkId, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 4)] + AccountKey20 { + network: runtime_types::xcm::v0::junction::NetworkId, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 5)] + PalletInstance(::core::primitive::u8), + #[codec(index = 6)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 7)] + GeneralKey(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 8)] + OnlyChild, + #[codec(index = 9)] + Plurality { + id: runtime_types::xcm::v0::junction::BodyId, + part: runtime_types::xcm::v0::junction::BodyPart, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum NetworkId { + #[codec(index = 0)] + Any, + #[codec(index = 1)] + Named(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 2)] + Polkadot, + #[codec(index = 3)] + Kusama, + } + } + pub mod multi_asset { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum MultiAsset { + #[codec(index = 0)] + None, + #[codec(index = 1)] + All, + #[codec(index = 2)] + AllFungible, + #[codec(index = 3)] + AllNonFungible, + #[codec(index = 4)] + AllAbstractFungible { + id: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 5)] + AllAbstractNonFungible { + class: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 6)] + AllConcreteFungible { + id: runtime_types::xcm::v0::multi_location::MultiLocation, + }, + #[codec(index = 7)] + AllConcreteNonFungible { + class: runtime_types::xcm::v0::multi_location::MultiLocation, + }, + #[codec(index = 8)] + AbstractFungible { + id: ::std::vec::Vec<::core::primitive::u8>, + #[codec(compact)] + amount: ::core::primitive::u128, + }, + #[codec(index = 9)] + AbstractNonFungible { + class: ::std::vec::Vec<::core::primitive::u8>, + instance: runtime_types::xcm::v1::multiasset::AssetInstance, + }, + #[codec(index = 10)] + ConcreteFungible { + id: runtime_types::xcm::v0::multi_location::MultiLocation, + #[codec(compact)] + amount: ::core::primitive::u128, + }, + #[codec(index = 11)] + ConcreteNonFungible { + class: runtime_types::xcm::v0::multi_location::MultiLocation, + instance: runtime_types::xcm::v1::multiasset::AssetInstance, + }, + } + } + pub mod multi_location { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum MultiLocation { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + X1(runtime_types::xcm::v0::junction::Junction), + #[codec(index = 2)] + X2( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + #[codec(index = 3)] + X3( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + #[codec(index = 4)] + X4( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + #[codec(index = 5)] + X5( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + #[codec(index = 6)] + X6( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + #[codec(index = 7)] + X7( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + #[codec(index = 8)] + X8( + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + runtime_types::xcm::v0::junction::Junction, + ), + } + } + pub mod order { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Order { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + DepositAsset { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + dest: runtime_types::xcm::v0::multi_location::MultiLocation, + }, + #[codec(index = 2)] + DepositReserveAsset { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + dest: runtime_types::xcm::v0::multi_location::MultiLocation, + effects: + ::std::vec::Vec, + }, + #[codec(index = 3)] + ExchangeAsset { + give: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + receive: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + }, + #[codec(index = 4)] + InitiateReserveWithdraw { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + reserve: + runtime_types::xcm::v0::multi_location::MultiLocation, + effects: + ::std::vec::Vec, + }, + #[codec(index = 5)] + InitiateTeleport { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + dest: runtime_types::xcm::v0::multi_location::MultiLocation, + effects: + ::std::vec::Vec, + }, + #[codec(index = 6)] + QueryHolding { + #[codec(compact)] + query_id: ::core::primitive::u64, + dest: runtime_types::xcm::v0::multi_location::MultiLocation, + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + }, + #[codec(index = 7)] + BuyExecution { + fees: runtime_types::xcm::v0::multi_asset::MultiAsset, + weight: ::core::primitive::u64, + debt: ::core::primitive::u64, + halt_on_error: ::core::primitive::bool, + xcm: ::std::vec::Vec, + }, + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum OriginKind { + #[codec(index = 0)] + Native, + #[codec(index = 1)] + SovereignAccount, + #[codec(index = 2)] + Superuser, + #[codec(index = 3)] + Xcm, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Response { + #[codec(index = 0)] + Assets( + ::std::vec::Vec, + ), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Xcm { + #[codec(index = 0)] + WithdrawAsset { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + effects: ::std::vec::Vec, + }, + #[codec(index = 1)] + ReserveAssetDeposit { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + effects: ::std::vec::Vec, + }, + #[codec(index = 2)] + TeleportAsset { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + effects: ::std::vec::Vec, + }, + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v0::Response, + }, + #[codec(index = 4)] + TransferAsset { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + dest: runtime_types::xcm::v0::multi_location::MultiLocation, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: ::std::vec::Vec< + runtime_types::xcm::v0::multi_asset::MultiAsset, + >, + dest: runtime_types::xcm::v0::multi_location::MultiLocation, + effects: ::std::vec::Vec, + }, + #[codec(index = 6)] + Transact { + origin_type: runtime_types::xcm::v0::OriginKind, + require_weight_at_most: ::core::primitive::u64, + call: runtime_types::xcm::double_encoded::DoubleEncoded, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + RelayedFrom { + who: runtime_types::xcm::v0::multi_location::MultiLocation, + message: ::std::boxed::Box, + }, + } + } + pub mod v1 { + use super::runtime_types; + pub mod junction { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Junction { + #[codec(index = 0)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 1)] + AccountId32 { + network: runtime_types::xcm::v0::junction::NetworkId, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + AccountIndex64 { + network: runtime_types::xcm::v0::junction::NetworkId, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 3)] + AccountKey20 { + network: runtime_types::xcm::v0::junction::NetworkId, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 4)] + PalletInstance(::core::primitive::u8), + #[codec(index = 5)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 6)] + GeneralKey(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 7)] + OnlyChild, + #[codec(index = 8)] + Plurality { + id: runtime_types::xcm::v0::junction::BodyId, + part: runtime_types::xcm::v0::junction::BodyPart, + }, + } + } + pub mod multiasset { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum AssetId { + #[codec(index = 0)] + Concrete(runtime_types::xcm::v1::multilocation::MultiLocation), + #[codec(index = 1)] + Abstract(::std::vec::Vec<::core::primitive::u8>), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum AssetInstance { + #[codec(index = 0)] + Undefined, + #[codec(index = 1)] + Index(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 2)] + Array4([::core::primitive::u8; 4usize]), + #[codec(index = 3)] + Array8([::core::primitive::u8; 8usize]), + #[codec(index = 4)] + Array16([::core::primitive::u8; 16usize]), + #[codec(index = 5)] + Array32([::core::primitive::u8; 32usize]), + #[codec(index = 6)] + Blob(::std::vec::Vec<::core::primitive::u8>), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Fungibility { + #[codec(index = 0)] + Fungible(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 1)] + NonFungible(runtime_types::xcm::v1::multiasset::AssetInstance), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct MultiAsset { + pub id: runtime_types::xcm::v1::multiasset::AssetId, + pub fun: runtime_types::xcm::v1::multiasset::Fungibility, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum MultiAssetFilter { + #[codec(index = 0)] + Definite(runtime_types::xcm::v1::multiasset::MultiAssets), + #[codec(index = 1)] + Wild(runtime_types::xcm::v1::multiasset::WildMultiAsset), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct MultiAssets( + pub ::std::vec::Vec< + runtime_types::xcm::v1::multiasset::MultiAsset, + >, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum WildFungibility { + #[codec(index = 0)] + Fungible, + #[codec(index = 1)] + NonFungible, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum WildMultiAsset { + #[codec(index = 0)] + All, + #[codec(index = 1)] + AllOf { + id: runtime_types::xcm::v1::multiasset::AssetId, + fun: runtime_types::xcm::v1::multiasset::WildFungibility, + }, + } + } + pub mod multilocation { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Junctions { + #[codec(index = 0)] + Here, + #[codec(index = 1)] + X1(runtime_types::xcm::v1::junction::Junction), + #[codec(index = 2)] + X2( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + #[codec(index = 3)] + X3( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + #[codec(index = 4)] + X4( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + #[codec(index = 5)] + X5( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + #[codec(index = 6)] + X6( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + #[codec(index = 7)] + X7( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + #[codec(index = 8)] + X8( + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + runtime_types::xcm::v1::junction::Junction, + ), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct MultiLocation { + pub parents: ::core::primitive::u8, + pub interior: runtime_types::xcm::v1::multilocation::Junctions, + } + } + pub mod order { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Order { + #[codec(index = 0)] + Noop, + #[codec(index = 1)] + DepositAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + max_assets: ::core::primitive::u32, + beneficiary: + runtime_types::xcm::v1::multilocation::MultiLocation, + }, + #[codec(index = 2)] + DepositReserveAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + max_assets: ::core::primitive::u32, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + effects: + ::std::vec::Vec, + }, + #[codec(index = 3)] + ExchangeAsset { + give: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + receive: runtime_types::xcm::v1::multiasset::MultiAssets, + }, + #[codec(index = 4)] + InitiateReserveWithdraw { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + reserve: runtime_types::xcm::v1::multilocation::MultiLocation, + effects: + ::std::vec::Vec, + }, + #[codec(index = 5)] + InitiateTeleport { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + effects: + ::std::vec::Vec, + }, + #[codec(index = 6)] + QueryHolding { + #[codec(compact)] + query_id: ::core::primitive::u64, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + }, + #[codec(index = 7)] + BuyExecution { + fees: runtime_types::xcm::v1::multiasset::MultiAsset, + weight: ::core::primitive::u64, + debt: ::core::primitive::u64, + halt_on_error: ::core::primitive::bool, + instructions: ::std::vec::Vec, + }, + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Response { + #[codec(index = 0)] + Assets(runtime_types::xcm::v1::multiasset::MultiAssets), + #[codec(index = 1)] + Version(::core::primitive::u32), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Xcm { + #[codec(index = 0)] + WithdrawAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + effects: ::std::vec::Vec, + }, + #[codec(index = 1)] + ReserveAssetDeposited { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + effects: ::std::vec::Vec, + }, + #[codec(index = 2)] + ReceiveTeleportedAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + effects: ::std::vec::Vec, + }, + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v1::Response, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + effects: ::std::vec::Vec, + }, + #[codec(index = 6)] + Transact { + origin_type: runtime_types::xcm::v0::OriginKind, + require_weight_at_most: ::core::primitive::u64, + call: runtime_types::xcm::double_encoded::DoubleEncoded, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + RelayedFrom { + who: runtime_types::xcm::v1::multilocation::Junctions, + message: ::std::boxed::Box, + }, + #[codec(index = 11)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 12)] + UnsubscribeVersion, + } + } + pub mod v2 { + use super::runtime_types; + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + Overflow, + #[codec(index = 1)] + Unimplemented, + #[codec(index = 2)] + UntrustedReserveLocation, + #[codec(index = 3)] + UntrustedTeleportLocation, + #[codec(index = 4)] + MultiLocationFull, + #[codec(index = 5)] + MultiLocationNotInvertible, + #[codec(index = 6)] + BadOrigin, + #[codec(index = 7)] + InvalidLocation, + #[codec(index = 8)] + AssetNotFound, + #[codec(index = 9)] + FailedToTransactAsset, + #[codec(index = 10)] + NotWithdrawable, + #[codec(index = 11)] + LocationCannotHold, + #[codec(index = 12)] + ExceedsMaxMessageSize, + #[codec(index = 13)] + DestinationUnsupported, + #[codec(index = 14)] + Transport, + #[codec(index = 15)] + Unroutable, + #[codec(index = 16)] + UnknownClaim, + #[codec(index = 17)] + FailedToDecode, + #[codec(index = 18)] + MaxWeightInvalid, + #[codec(index = 19)] + NotHoldingFees, + #[codec(index = 20)] + TooExpensive, + #[codec(index = 21)] + Trap(::core::primitive::u64), + #[codec(index = 22)] + UnhandledXcmVersion, + #[codec(index = 23)] + WeightLimitReached(::core::primitive::u64), + #[codec(index = 24)] + Barrier, + #[codec(index = 25)] + WeightNotComputable, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Outcome { + #[codec(index = 0)] + Complete(::core::primitive::u64), + #[codec(index = 1)] + Incomplete( + ::core::primitive::u64, + runtime_types::xcm::v2::traits::Error, + ), + #[codec(index = 2)] + Error(runtime_types::xcm::v2::traits::Error), + } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Instruction { + #[codec(index = 0)] + WithdrawAsset(runtime_types::xcm::v1::multiasset::MultiAssets), + #[codec(index = 1)] + ReserveAssetDeposited( + runtime_types::xcm::v1::multiasset::MultiAssets, + ), + #[codec(index = 2)] + ReceiveTeleportedAsset( + runtime_types::xcm::v1::multiasset::MultiAssets, + ), + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v2::Response, + #[codec(compact)] + max_weight: ::core::primitive::u64, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 6)] + Transact { + origin_type: runtime_types::xcm::v0::OriginKind, + #[codec(compact)] + require_weight_at_most: ::core::primitive::u64, + call: runtime_types::xcm::double_encoded::DoubleEncoded, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + ClearOrigin, + #[codec(index = 11)] + DescendOrigin(runtime_types::xcm::v1::multilocation::Junctions), + #[codec(index = 12)] + ReportError { + #[codec(compact)] + query_id: ::core::primitive::u64, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 13)] + DepositAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + #[codec(compact)] + max_assets: ::core::primitive::u32, + beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, + }, + #[codec(index = 14)] + DepositReserveAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + #[codec(compact)] + max_assets: ::core::primitive::u32, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 15)] + ExchangeAsset { + give: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + receive: runtime_types::xcm::v1::multiasset::MultiAssets, + }, + #[codec(index = 16)] + InitiateReserveWithdraw { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + reserve: runtime_types::xcm::v1::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 17)] + InitiateTeleport { + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 18)] + QueryHolding { + #[codec(compact)] + query_id: ::core::primitive::u64, + dest: runtime_types::xcm::v1::multilocation::MultiLocation, + assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 19)] + BuyExecution { + fees: runtime_types::xcm::v1::multiasset::MultiAsset, + weight_limit: runtime_types::xcm::v2::WeightLimit, + }, + #[codec(index = 20)] + RefundSurplus, + #[codec(index = 21)] + SetErrorHandler(runtime_types::xcm::v2::Xcm), + #[codec(index = 22)] + SetAppendix(runtime_types::xcm::v2::Xcm), + #[codec(index = 23)] + ClearError, + #[codec(index = 24)] + ClaimAsset { + assets: runtime_types::xcm::v1::multiasset::MultiAssets, + ticket: runtime_types::xcm::v1::multilocation::MultiLocation, + }, + #[codec(index = 25)] + Trap(#[codec(compact)] ::core::primitive::u64), + #[codec(index = 26)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 27)] + UnsubscribeVersion, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Response { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + Assets(runtime_types::xcm::v1::multiasset::MultiAssets), + #[codec(index = 2)] + ExecutionResult( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v2::traits::Error, + )>, + ), + #[codec(index = 3)] + Version(::core::primitive::u32), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum WeightLimit { + #[codec(index = 0)] + Unlimited, + #[codec(index = 1)] + Limited(#[codec(compact)] ::core::primitive::u64), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Xcm(pub ::std::vec::Vec); + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum VersionedMultiAssets { + #[codec(index = 0)] + V0(::std::vec::Vec), + #[codec(index = 1)] + V1(runtime_types::xcm::v1::multiasset::MultiAssets), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum VersionedMultiLocation { + #[codec(index = 0)] + V0(runtime_types::xcm::v0::multi_location::MultiLocation), + #[codec(index = 1)] + V1(runtime_types::xcm::v1::multilocation::MultiLocation), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum VersionedResponse { + #[codec(index = 0)] + V0(runtime_types::xcm::v0::Response), + #[codec(index = 1)] + V1(runtime_types::xcm::v1::Response), + #[codec(index = 2)] + V2(runtime_types::xcm::v2::Response), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum VersionedXcm { + #[codec(index = 0)] + V0(runtime_types::xcm::v0::Xcm), + #[codec(index = 1)] + V1(runtime_types::xcm::v1::Xcm), + #[codec(index = 2)] + V2(runtime_types::xcm::v2::Xcm), + } + } + } + #[doc = r" The default error type returned when there is a runtime issue."] + pub type DispatchError = runtime_types::sp_runtime::DispatchError; + impl ::subxt::HasModuleError for runtime_types::sp_runtime::DispatchError { + fn module_error_data(&self) -> Option<::subxt::ModuleErrorData> { + if let Self::Module(module_error) = self { + Some(::subxt::ModuleErrorData { + pallet_index: module_error.index, + error: module_error.error, + }) + } else { + None + } + } + } + pub struct RuntimeApi { + pub client: ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl ::core::convert::From<::subxt::Client> for RuntimeApi + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + fn from(client: ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + } + impl<'a, T, X> RuntimeApi + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn validate_metadata(&'a self) -> Result<(), ::subxt::MetadataError> { + if self.client.metadata().metadata_hash(&PALLETS) + != [ + 222u8, 70u8, 96u8, 67u8, 220u8, 49u8, 147u8, 114u8, 199u8, 254u8, + 88u8, 102u8, 188u8, 14u8, 180u8, 163u8, 55u8, 109u8, 43u8, 71u8, + 135u8, 161u8, 80u8, 151u8, 66u8, 252u8, 126u8, 104u8, 59u8, 80u8, + 140u8, 193u8, + ] + { + Err(::subxt::MetadataError::IncompatibleMetadata) + } else { + Ok(()) + } + } + pub fn constants(&'a self) -> ConstantsApi<'a, T> { + ConstantsApi { + client: &self.client, + } + } + pub fn storage(&'a self) -> StorageApi<'a, T> { + StorageApi { + client: &self.client, + } + } + pub fn tx(&'a self) -> TransactionApi<'a, T, X> { + TransactionApi { + client: &self.client, + marker: ::core::marker::PhantomData, + } + } + pub fn events(&'a self) -> EventsApi<'a, T> { + EventsApi { + client: &self.client, + } + } + } + pub struct EventsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> EventsApi<'a, T> { + pub async fn at( + &self, + block_hash: T::Hash, + ) -> Result<::subxt::events::Events<'a, T, Event>, ::subxt::BasicError> { + ::subxt::events::at::(self.client, block_hash).await + } + pub async fn subscribe( + &self, + ) -> Result< + ::subxt::events::EventSubscription< + 'a, + ::subxt::events::EventSub, + T, + Event, + >, + ::subxt::BasicError, + > { + ::subxt::events::subscribe::(self.client).await + } + pub async fn subscribe_finalized( + &self, + ) -> Result< + ::subxt::events::EventSubscription< + 'a, + ::subxt::events::FinalizedEventSub<'a, T::Header>, + T, + Event, + >, + ::subxt::BasicError, + > { + ::subxt::events::subscribe_finalized::(self.client).await + } + } + pub struct ConstantsApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { + pub fn system(&self) -> system::constants::ConstantsApi<'a, T> { + system::constants::ConstantsApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::constants::ConstantsApi<'a, T> { + scheduler::constants::ConstantsApi::new(self.client) + } + pub fn babe(&self) -> babe::constants::ConstantsApi<'a, T> { + babe::constants::ConstantsApi::new(self.client) + } + pub fn timestamp(&self) -> timestamp::constants::ConstantsApi<'a, T> { + timestamp::constants::ConstantsApi::new(self.client) + } + pub fn indices(&self) -> indices::constants::ConstantsApi<'a, T> { + indices::constants::ConstantsApi::new(self.client) + } + pub fn balances(&self) -> balances::constants::ConstantsApi<'a, T> { + balances::constants::ConstantsApi::new(self.client) + } + pub fn transaction_payment( + &self, + ) -> transaction_payment::constants::ConstantsApi<'a, T> { + transaction_payment::constants::ConstantsApi::new(self.client) + } + pub fn authorship(&self) -> authorship::constants::ConstantsApi<'a, T> { + authorship::constants::ConstantsApi::new(self.client) + } + pub fn staking(&self) -> staking::constants::ConstantsApi<'a, T> { + staking::constants::ConstantsApi::new(self.client) + } + pub fn grandpa(&self) -> grandpa::constants::ConstantsApi<'a, T> { + grandpa::constants::ConstantsApi::new(self.client) + } + pub fn im_online(&self) -> im_online::constants::ConstantsApi<'a, T> { + im_online::constants::ConstantsApi::new(self.client) + } + pub fn democracy(&self) -> democracy::constants::ConstantsApi<'a, T> { + democracy::constants::ConstantsApi::new(self.client) + } + pub fn phragmen_election( + &self, + ) -> phragmen_election::constants::ConstantsApi<'a, T> { + phragmen_election::constants::ConstantsApi::new(self.client) + } + pub fn treasury(&self) -> treasury::constants::ConstantsApi<'a, T> { + treasury::constants::ConstantsApi::new(self.client) + } + pub fn claims(&self) -> claims::constants::ConstantsApi<'a, T> { + claims::constants::ConstantsApi::new(self.client) + } + pub fn vesting(&self) -> vesting::constants::ConstantsApi<'a, T> { + vesting::constants::ConstantsApi::new(self.client) + } + pub fn utility(&self) -> utility::constants::ConstantsApi<'a, T> { + utility::constants::ConstantsApi::new(self.client) + } + pub fn identity(&self) -> identity::constants::ConstantsApi<'a, T> { + identity::constants::ConstantsApi::new(self.client) + } + pub fn proxy(&self) -> proxy::constants::ConstantsApi<'a, T> { + proxy::constants::ConstantsApi::new(self.client) + } + pub fn multisig(&self) -> multisig::constants::ConstantsApi<'a, T> { + multisig::constants::ConstantsApi::new(self.client) + } + pub fn bounties(&self) -> bounties::constants::ConstantsApi<'a, T> { + bounties::constants::ConstantsApi::new(self.client) + } + pub fn child_bounties(&self) -> child_bounties::constants::ConstantsApi<'a, T> { + child_bounties::constants::ConstantsApi::new(self.client) + } + pub fn tips(&self) -> tips::constants::ConstantsApi<'a, T> { + tips::constants::ConstantsApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> 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 paras(&self) -> paras::constants::ConstantsApi<'a, T> { + paras::constants::ConstantsApi::new(self.client) + } + pub fn registrar(&self) -> registrar::constants::ConstantsApi<'a, T> { + registrar::constants::ConstantsApi::new(self.client) + } + pub fn slots(&self) -> slots::constants::ConstantsApi<'a, T> { + slots::constants::ConstantsApi::new(self.client) + } + pub fn auctions(&self) -> auctions::constants::ConstantsApi<'a, T> { + auctions::constants::ConstantsApi::new(self.client) + } + pub fn crowdloan(&self) -> crowdloan::constants::ConstantsApi<'a, T> { + crowdloan::constants::ConstantsApi::new(self.client) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T> StorageApi<'a, T> + where + T: ::subxt::Config, + { + pub fn system(&self) -> system::storage::StorageApi<'a, T> { + system::storage::StorageApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { + scheduler::storage::StorageApi::new(self.client) + } + pub fn preimage(&self) -> preimage::storage::StorageApi<'a, T> { + preimage::storage::StorageApi::new(self.client) + } + pub fn babe(&self) -> babe::storage::StorageApi<'a, T> { + babe::storage::StorageApi::new(self.client) + } + pub fn timestamp(&self) -> timestamp::storage::StorageApi<'a, T> { + timestamp::storage::StorageApi::new(self.client) + } + pub fn indices(&self) -> indices::storage::StorageApi<'a, T> { + indices::storage::StorageApi::new(self.client) + } + pub fn balances(&self) -> balances::storage::StorageApi<'a, T> { + balances::storage::StorageApi::new(self.client) + } + pub fn transaction_payment( + &self, + ) -> transaction_payment::storage::StorageApi<'a, T> { + transaction_payment::storage::StorageApi::new(self.client) + } + pub fn authorship(&self) -> authorship::storage::StorageApi<'a, T> { + authorship::storage::StorageApi::new(self.client) + } + pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { + staking::storage::StorageApi::new(self.client) + } + pub fn offences(&self) -> offences::storage::StorageApi<'a, T> { + offences::storage::StorageApi::new(self.client) + } + pub fn session(&self) -> session::storage::StorageApi<'a, T> { + session::storage::StorageApi::new(self.client) + } + pub fn grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { + grandpa::storage::StorageApi::new(self.client) + } + pub fn im_online(&self) -> im_online::storage::StorageApi<'a, T> { + im_online::storage::StorageApi::new(self.client) + } + pub fn democracy(&self) -> democracy::storage::StorageApi<'a, T> { + democracy::storage::StorageApi::new(self.client) + } + pub fn council(&self) -> council::storage::StorageApi<'a, T> { + council::storage::StorageApi::new(self.client) + } + pub fn technical_committee( + &self, + ) -> technical_committee::storage::StorageApi<'a, T> { + technical_committee::storage::StorageApi::new(self.client) + } + pub fn phragmen_election(&self) -> phragmen_election::storage::StorageApi<'a, T> { + phragmen_election::storage::StorageApi::new(self.client) + } + pub fn technical_membership( + &self, + ) -> technical_membership::storage::StorageApi<'a, T> { + technical_membership::storage::StorageApi::new(self.client) + } + pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { + treasury::storage::StorageApi::new(self.client) + } + pub fn claims(&self) -> claims::storage::StorageApi<'a, T> { + claims::storage::StorageApi::new(self.client) + } + pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { + vesting::storage::StorageApi::new(self.client) + } + pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { + identity::storage::StorageApi::new(self.client) + } + pub fn proxy(&self) -> proxy::storage::StorageApi<'a, T> { + proxy::storage::StorageApi::new(self.client) + } + pub fn multisig(&self) -> multisig::storage::StorageApi<'a, T> { + multisig::storage::StorageApi::new(self.client) + } + pub fn bounties(&self) -> bounties::storage::StorageApi<'a, T> { + bounties::storage::StorageApi::new(self.client) + } + pub fn child_bounties(&self) -> child_bounties::storage::StorageApi<'a, T> { + child_bounties::storage::StorageApi::new(self.client) + } + pub fn tips(&self) -> tips::storage::StorageApi<'a, T> { + tips::storage::StorageApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> 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 configuration(&self) -> configuration::storage::StorageApi<'a, T> { + configuration::storage::StorageApi::new(self.client) + } + pub fn paras_shared(&self) -> paras_shared::storage::StorageApi<'a, T> { + paras_shared::storage::StorageApi::new(self.client) + } + pub fn para_inclusion(&self) -> para_inclusion::storage::StorageApi<'a, T> { + para_inclusion::storage::StorageApi::new(self.client) + } + pub fn para_inherent(&self) -> para_inherent::storage::StorageApi<'a, T> { + para_inherent::storage::StorageApi::new(self.client) + } + pub fn para_scheduler(&self) -> para_scheduler::storage::StorageApi<'a, T> { + para_scheduler::storage::StorageApi::new(self.client) + } + pub fn paras(&self) -> paras::storage::StorageApi<'a, T> { + paras::storage::StorageApi::new(self.client) + } + pub fn initializer(&self) -> initializer::storage::StorageApi<'a, T> { + initializer::storage::StorageApi::new(self.client) + } + pub fn dmp(&self) -> dmp::storage::StorageApi<'a, T> { + dmp::storage::StorageApi::new(self.client) + } + pub fn ump(&self) -> ump::storage::StorageApi<'a, T> { + ump::storage::StorageApi::new(self.client) + } + pub fn hrmp(&self) -> hrmp::storage::StorageApi<'a, T> { + hrmp::storage::StorageApi::new(self.client) + } + pub fn para_session_info(&self) -> para_session_info::storage::StorageApi<'a, T> { + para_session_info::storage::StorageApi::new(self.client) + } + pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi<'a, T> { + paras_disputes::storage::StorageApi::new(self.client) + } + pub fn registrar(&self) -> registrar::storage::StorageApi<'a, T> { + registrar::storage::StorageApi::new(self.client) + } + pub fn slots(&self) -> slots::storage::StorageApi<'a, T> { + slots::storage::StorageApi::new(self.client) + } + pub fn auctions(&self) -> auctions::storage::StorageApi<'a, T> { + auctions::storage::StorageApi::new(self.client) + } + pub fn crowdloan(&self) -> crowdloan::storage::StorageApi<'a, T> { + crowdloan::storage::StorageApi::new(self.client) + } + pub fn xcm_pallet(&self) -> xcm_pallet::storage::StorageApi<'a, T> { + xcm_pallet::storage::StorageApi::new(self.client) + } + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn system(&self) -> system::calls::TransactionApi<'a, T, X> { + system::calls::TransactionApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T, X> { + scheduler::calls::TransactionApi::new(self.client) + } + pub fn preimage(&self) -> preimage::calls::TransactionApi<'a, T, X> { + preimage::calls::TransactionApi::new(self.client) + } + pub fn babe(&self) -> babe::calls::TransactionApi<'a, T, X> { + babe::calls::TransactionApi::new(self.client) + } + pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T, X> { + timestamp::calls::TransactionApi::new(self.client) + } + pub fn indices(&self) -> indices::calls::TransactionApi<'a, T, X> { + indices::calls::TransactionApi::new(self.client) + } + pub fn balances(&self) -> balances::calls::TransactionApi<'a, T, X> { + balances::calls::TransactionApi::new(self.client) + } + pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T, X> { + authorship::calls::TransactionApi::new(self.client) + } + pub fn staking(&self) -> staking::calls::TransactionApi<'a, T, X> { + staking::calls::TransactionApi::new(self.client) + } + pub fn session(&self) -> session::calls::TransactionApi<'a, T, X> { + session::calls::TransactionApi::new(self.client) + } + pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T, X> { + grandpa::calls::TransactionApi::new(self.client) + } + pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T, X> { + im_online::calls::TransactionApi::new(self.client) + } + pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T, X> { + democracy::calls::TransactionApi::new(self.client) + } + pub fn council(&self) -> council::calls::TransactionApi<'a, T, X> { + council::calls::TransactionApi::new(self.client) + } + pub fn technical_committee( + &self, + ) -> technical_committee::calls::TransactionApi<'a, T, X> { + technical_committee::calls::TransactionApi::new(self.client) + } + pub fn phragmen_election( + &self, + ) -> phragmen_election::calls::TransactionApi<'a, T, X> { + phragmen_election::calls::TransactionApi::new(self.client) + } + pub fn technical_membership( + &self, + ) -> technical_membership::calls::TransactionApi<'a, T, X> { + technical_membership::calls::TransactionApi::new(self.client) + } + pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T, X> { + treasury::calls::TransactionApi::new(self.client) + } + pub fn claims(&self) -> claims::calls::TransactionApi<'a, T, X> { + claims::calls::TransactionApi::new(self.client) + } + pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T, X> { + vesting::calls::TransactionApi::new(self.client) + } + pub fn utility(&self) -> utility::calls::TransactionApi<'a, T, X> { + utility::calls::TransactionApi::new(self.client) + } + pub fn identity(&self) -> identity::calls::TransactionApi<'a, T, X> { + identity::calls::TransactionApi::new(self.client) + } + pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T, X> { + proxy::calls::TransactionApi::new(self.client) + } + pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T, X> { + multisig::calls::TransactionApi::new(self.client) + } + pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T, X> { + bounties::calls::TransactionApi::new(self.client) + } + pub fn child_bounties(&self) -> child_bounties::calls::TransactionApi<'a, T, X> { + child_bounties::calls::TransactionApi::new(self.client) + } + pub fn tips(&self) -> tips::calls::TransactionApi<'a, T, X> { + tips::calls::TransactionApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::calls::TransactionApi<'a, T, X> { + election_provider_multi_phase::calls::TransactionApi::new(self.client) + } + pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T, X> { + bags_list::calls::TransactionApi::new(self.client) + } + pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T, X> { + configuration::calls::TransactionApi::new(self.client) + } + pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T, X> { + paras_shared::calls::TransactionApi::new(self.client) + } + pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T, X> { + para_inclusion::calls::TransactionApi::new(self.client) + } + pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T, X> { + para_inherent::calls::TransactionApi::new(self.client) + } + pub fn paras(&self) -> paras::calls::TransactionApi<'a, T, X> { + paras::calls::TransactionApi::new(self.client) + } + pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T, X> { + initializer::calls::TransactionApi::new(self.client) + } + pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T, X> { + dmp::calls::TransactionApi::new(self.client) + } + pub fn ump(&self) -> ump::calls::TransactionApi<'a, T, X> { + ump::calls::TransactionApi::new(self.client) + } + pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T, X> { + hrmp::calls::TransactionApi::new(self.client) + } + pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi<'a, T, X> { + paras_disputes::calls::TransactionApi::new(self.client) + } + pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T, X> { + registrar::calls::TransactionApi::new(self.client) + } + pub fn slots(&self) -> slots::calls::TransactionApi<'a, T, X> { + slots::calls::TransactionApi::new(self.client) + } + pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T, X> { + auctions::calls::TransactionApi::new(self.client) + } + pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T, X> { + crowdloan::calls::TransactionApi::new(self.client) + } + pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi<'a, T, X> { + xcm_pallet::calls::TransactionApi::new(self.client) + } + } +} diff --git a/integration-tests/tests/integration/events.rs b/integration-tests/tests/integration/events.rs new file mode 100644 index 0000000000..937a4faf91 --- /dev/null +++ b/integration-tests/tests/integration/events.rs @@ -0,0 +1,230 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + node_runtime::{ + balances, + system, + }, + pair_signer, + test_context, +}; +use futures::StreamExt; +use sp_keyring::AccountKeyring; + +// Check that we can subscribe to non-finalized block events. +#[tokio::test] +async fn non_finalized_block_subscription() -> Result<(), subxt::BasicError> { + env_logger::try_init().ok(); + let ctx = test_context().await; + + let mut event_sub = ctx.api.events().subscribe().await?; + + // Wait for the next set of events, and check that the + // associated block hash is not finalized yet. + let events = event_sub.next().await.unwrap()?; + let event_block_hash = events.block_hash(); + let current_block_hash = ctx.api.client.rpc().block_hash(None).await?.unwrap(); + + assert_eq!(event_block_hash, current_block_hash); + Ok(()) +} + +// Check that we can subscribe to finalized block events. +#[tokio::test] +async fn finalized_block_subscription() -> Result<(), subxt::BasicError> { + env_logger::try_init().ok(); + let ctx = test_context().await; + + let mut event_sub = ctx.api.events().subscribe_finalized().await?; + + // Wait for the next set of events, and check that the + // associated block hash is the one we just finalized. + // (this can be a bit slow as we have to wait for finalization) + let events = event_sub.next().await.unwrap()?; + let event_block_hash = events.block_hash(); + let finalized_hash = ctx.api.client.rpc().finalized_head().await?; + + assert_eq!(event_block_hash, finalized_hash); + Ok(()) +} + +// Check that our subscription actually keeps producing events for +// a few blocks. +#[tokio::test] +async fn subscription_produces_events_each_block() -> Result<(), subxt::BasicError> { + env_logger::try_init().ok(); + let ctx = test_context().await; + + let mut event_sub = ctx.api.events().subscribe().await?; + + for i in 0..3 { + let events = event_sub + .next() + .await + .expect("events expected each block")?; + let success_event = events + .find_first::() + .expect("decode error"); + // Every now and then I get no bytes back for the first block events; + // I assume that this might be the case for the genesis block, so don't + // worry if no event found (but we should have no decode errors etc either way). + if i > 0 && success_event.is_none() { + let n = events.len(); + panic!("Expected an extrinsic success event on iteration {i} (saw {n} other events)") + } + } + + Ok(()) +} + +// Check that our subscription receives events, and we can filter them based on +// it's Stream impl, and ultimately see the event we expect. +#[tokio::test] +async fn balance_transfer_subscription() -> Result<(), subxt::BasicError> { + env_logger::try_init().ok(); + let ctx = test_context().await; + + // Subscribe to balance transfer events, ignoring all else. + let event_sub = ctx + .api + .events() + .subscribe() + .await? + .filter_events::<(balances::events::Transfer,)>(); + + // Calling `.next()` on the above borrows it, and the `filter_map` + // means it's no longer `Unpin`, so we pin it on the stack: + futures::pin_mut!(event_sub); + + // Make a transfer: + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id(); + ctx.api + .tx() + .balances() + .transfer(bob.clone().into(), 10_000)? + .sign_and_submit_then_watch_default(&alice) + .await?; + + // Wait for the next balance transfer event in our subscription stream + // and check that it lines up: + let event = event_sub.next().await.unwrap().unwrap().event; + assert_eq!( + event, + balances::events::Transfer { + from: alice.account_id().clone(), + to: bob.clone(), + amount: 10_000 + } + ); + + Ok(()) +} + +#[tokio::test] +async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::BasicError> { + // This function is not publically available to use, but contains + // the key logic for filling in missing blocks, so we want to test it. + // This is used in `subscribe_finalized` to ensure no block headers are + // missed. + use subxt::events::subscribe_to_block_headers_filling_in_gaps; + + let ctx = test_context().await; + + // Manually subscribe to the next 6 finalized block headers, but deliberately + // filter out some in the middle so we get back b _ _ b _ b. This guarantees + // that there will be some gaps, even if there aren't any from the subscription. + let some_finalized_blocks = ctx + .api + .client + .rpc() + .subscribe_finalized_blocks() + .await? + .enumerate() + .take(6) + .filter(|(n, _)| { + let n = *n; + async move { n == 0 || n == 3 || n == 5 } + }) + .map(|(_, h)| h); + + // This should spot any gaps in the middle and fill them back in. + let all_finalized_blocks = subscribe_to_block_headers_filling_in_gaps( + &ctx.api.client, + None, + some_finalized_blocks, + ); + futures::pin_mut!(all_finalized_blocks); + + // Iterate the block headers, making sure we get them all in order. + let mut last_block_number = None; + while let Some(header) = all_finalized_blocks.next().await { + let header = header?; + + use sp_runtime::traits::Header; + let block_number: u128 = (*header.number()).into(); + + if let Some(last) = last_block_number { + assert_eq!(last + 1, block_number); + } + last_block_number = Some(block_number); + } + + Ok(()) +} + +// This is just a compile-time check that we can subscribe to events in +// a context that requires the event subscription/filtering to be Send-able. +// We test a typical use of EventSubscription and FilterEvents. We don't need +// to run this code; just check that it compiles. +#[allow(unused)] +async fn check_events_are_sendable() { + // check that EventSubscription can be used across await points. + tokio::task::spawn(async { + let ctx = test_context().await; + + let mut event_sub = ctx.api.events().subscribe().await?; + + while let Some(ev) = event_sub.next().await { + // if `event_sub` doesn't implement Send, we can't hold + // it across an await point inside of a tokio::spawn, which + // requires Send. This will lead to a compile error. + } + + Ok::<_, subxt::BasicError>(()) + }); + + // Check that FilterEvents can be used across await points. + tokio::task::spawn(async { + let ctx = test_context().await; + + let mut event_sub = ctx + .api + .events() + .subscribe() + .await? + .filter_events::<(balances::events::Transfer,)>(); + + while let Some(ev) = event_sub.next().await { + // if `event_sub` doesn't implement Send, we can't hold + // it across an await point inside of a tokio::spawn, which + // requires Send; This will lead to a compile error. + } + + Ok::<_, subxt::BasicError>(()) + }); +} diff --git a/integration-tests/tests/integration/frame/balances.rs b/integration-tests/tests/integration/frame/balances.rs new file mode 100644 index 0000000000..b977eee427 --- /dev/null +++ b/integration-tests/tests/integration/frame/balances.rs @@ -0,0 +1,280 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + node_runtime::{ + balances, + runtime_types, + system, + DispatchError, + }, + pair_signer, + test_context, +}; +use codec::Decode; +use sp_core::{ + sr25519::Pair, + Pair as _, +}; +use sp_keyring::AccountKeyring; +use sp_runtime::{ + AccountId32, + MultiAddress, +}; +use subxt::Error; + +#[tokio::test] +async fn tx_basic_transfer() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); + let bob_address = bob.account_id().clone().into(); + let cxt = test_context().await; + let api = &cxt.api; + + let alice_pre = api + .storage() + .system() + .account(alice.account_id(), None) + .await?; + let bob_pre = api + .storage() + .system() + .account(bob.account_id(), None) + .await?; + + let events = api + .tx() + .balances() + .transfer(bob_address, 10_000)? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await?; + let event = events + .find_first::() + .expect("Failed to decode balances::events::Transfer") + .expect("Failed to find balances::events::Transfer"); + let _extrinsic_success = events + .find_first::() + .expect("Failed to decode ExtrinisicSuccess") + .expect("Failed to find ExtrinisicSuccess"); + + let expected_event = balances::events::Transfer { + from: alice.account_id().clone(), + to: bob.account_id().clone(), + amount: 10_000, + }; + assert_eq!(event, expected_event); + + let alice_post = api + .storage() + .system() + .account(alice.account_id(), None) + .await?; + let bob_post = api + .storage() + .system() + .account(bob.account_id(), None) + .await?; + + assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); + assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); + Ok(()) +} + +#[tokio::test] +async fn multiple_transfers_work_nonce_incremented( +) -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); + let bob_address: MultiAddress = bob.account_id().clone().into(); + let cxt = test_context().await; + let api = &cxt.api; + + let bob_pre = api + .storage() + .system() + .account(bob.account_id(), None) + .await?; + + for _ in 0..3 { + api + .tx() + .balances() + .transfer(bob_address.clone(), 10_000)? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_in_block() // Don't need to wait for finalization; this is quicker. + .await? + .wait_for_success() + .await?; + } + + let bob_post = api + .storage() + .system() + .account(bob.account_id(), None) + .await?; + + assert_eq!(bob_pre.data.free + 30_000, bob_post.data.free); + Ok(()) +} + +#[tokio::test] +async fn storage_total_issuance() { + let cxt = test_context().await; + let total_issuance = cxt + .api + .storage() + .balances() + .total_issuance(None) + .await + .unwrap(); + assert_ne!(total_issuance, 0); +} + +#[tokio::test] +async fn storage_balance_lock() -> Result<(), subxt::Error> { + let bob = pair_signer(AccountKeyring::Bob.pair()); + let charlie = AccountKeyring::Charlie.to_account_id(); + let cxt = test_context().await; + + cxt.api + .tx() + .staking() + .bond( + charlie.into(), + 100_000_000_000_000, + runtime_types::pallet_staking::RewardDestination::Stash, + )? + .sign_and_submit_then_watch_default(&bob) + .await? + .wait_for_finalized_success() + .await? + .find_first::()? + .expect("No ExtrinsicSuccess Event found"); + + let locked_account = AccountKeyring::Bob.to_account_id(); + let locks = cxt + .api + .storage() + .balances() + .locks(&locked_account, None) + .await?; + + assert_eq!( + locks.0, + vec![runtime_types::pallet_balances::BalanceLock { + id: *b"staking ", + amount: 100_000_000_000_000, + reasons: runtime_types::pallet_balances::Reasons::All, + }] + ); + + Ok(()) +} + +#[tokio::test] +async fn transfer_error() { + env_logger::try_init().ok(); + let alice = pair_signer(AccountKeyring::Alice.pair()); + let alice_addr = alice.account_id().clone().into(); + let hans = pair_signer(Pair::generate().0); + let hans_address = hans.account_id().clone().into(); + let ctx = test_context().await; + + ctx.api + .tx() + .balances() + .transfer(hans_address, 100_000_000_000_000_000) + .unwrap() + .sign_and_submit_then_watch_default(&alice) + .await + .unwrap() + .wait_for_finalized_success() + .await + .unwrap(); + + let res = ctx + .api + .tx() + .balances() + .transfer(alice_addr, 100_000_000_000_000_000) + .unwrap() + .sign_and_submit_then_watch_default(&hans) + .await + .unwrap() + .wait_for_finalized_success() + .await; + + if let Err(Error::Module(err)) = res { + assert_eq!(err.pallet, "Balances"); + assert_eq!(err.error, "InsufficientBalance"); + } else { + panic!("expected a runtime module error"); + } +} + +#[tokio::test] +async fn transfer_implicit_subscription() { + env_logger::try_init().ok(); + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id(); + let bob_addr = bob.clone().into(); + let cxt = test_context().await; + + let event = cxt + .api + .tx() + .balances() + .transfer(bob_addr, 10_000) + .unwrap() + .sign_and_submit_then_watch_default(&alice) + .await + .unwrap() + .wait_for_finalized_success() + .await + .unwrap() + .find_first::() + .expect("Can decode events") + .expect("Can find balance transfer event"); + + assert_eq!( + event, + balances::events::Transfer { + from: alice.account_id().clone(), + to: bob.clone(), + amount: 10_000 + } + ); +} + +#[tokio::test] +async fn constant_existential_deposit() { + let cxt = test_context().await; + let balances_metadata = cxt.client().metadata().pallet("Balances").unwrap(); + let constant_metadata = balances_metadata.constant("ExistentialDeposit").unwrap(); + let existential_deposit = u128::decode(&mut &constant_metadata.value[..]).unwrap(); + assert_eq!(existential_deposit, 100_000_000_000_000); + assert_eq!( + existential_deposit, + cxt.api + .constants() + .balances() + .existential_deposit() + .unwrap() + ); +} diff --git a/integration-tests/tests/integration/frame/contracts.rs b/integration-tests/tests/integration/frame/contracts.rs new file mode 100644 index 0000000000..944d33779b --- /dev/null +++ b/integration-tests/tests/integration/frame/contracts.rs @@ -0,0 +1,227 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use sp_keyring::AccountKeyring; + +use crate::{ + node_runtime::{ + self, + contracts::{ + calls::TransactionApi, + events, + storage, + }, + system, + DispatchError, + }, + test_context, + NodeRuntimeParams, + TestContext, +}; +use sp_core::sr25519::Pair; +use sp_runtime::MultiAddress; +use subxt::{ + Client, + Config, + DefaultConfig, + Error, + PairSigner, + TransactionProgress, +}; + +struct ContractsTestContext { + cxt: TestContext, + signer: PairSigner, +} + +type Hash = ::Hash; +type AccountId = ::AccountId; + +impl ContractsTestContext { + async fn init() -> Self { + let cxt = test_context().await; + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + + Self { cxt, signer } + } + + fn client(&self) -> &Client { + self.cxt.client() + } + + fn contracts_tx(&self) -> TransactionApi { + self.cxt.api.tx().contracts() + } + + async fn instantiate_with_code( + &self, + ) -> Result<(Hash, AccountId), Error> { + log::info!("instantiate_with_code:"); + const CONTRACT: &str = r#" + (module + (func (export "call")) + (func (export "deploy")) + ) + "#; + let code = wabt::wat2wasm(CONTRACT).expect("invalid wabt"); + + let events = self + .cxt + .api + .tx() + .contracts() + .instantiate_with_code( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + None, // storage_deposit_limit + code, + vec![], // data + vec![], // salt + )? + .sign_and_submit_then_watch_default(&self.signer) + .await? + .wait_for_finalized_success() + .await?; + + let code_stored = events + .find_first::()? + .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; + let instantiated = events + .find_first::()? + .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; + let _extrinsic_success = events + .find_first::()? + .ok_or_else(|| { + Error::Other("Failed to find a ExtrinsicSuccess event".into()) + })?; + + log::info!(" Block hash: {:?}", events.block_hash()); + log::info!(" Code hash: {:?}", code_stored.code_hash); + log::info!(" Contract address: {:?}", instantiated.contract); + Ok((code_stored.code_hash, instantiated.contract)) + } + + async fn instantiate( + &self, + code_hash: Hash, + data: Vec, + salt: Vec, + ) -> Result> { + // call instantiate extrinsic + let result = self + .contracts_tx() + .instantiate( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + None, // storage_deposit_limit + code_hash, + data, + salt, + )? + .sign_and_submit_then_watch_default(&self.signer) + .await? + .wait_for_finalized_success() + .await?; + + log::info!("Instantiate result: {:?}", result); + let instantiated = result + .find_first::()? + .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; + + Ok(instantiated.contract) + } + + async fn call( + &self, + contract: AccountId, + input_data: Vec, + ) -> Result< + TransactionProgress<'_, DefaultConfig, DispatchError, node_runtime::Event>, + Error, + > { + log::info!("call: {:?}", contract); + let result = self + .contracts_tx() + .call( + MultiAddress::Id(contract), + 0, // value + 500_000_000, // gas_limit + None, // storage_deposit_limit + input_data, + )? + .sign_and_submit_then_watch_default(&self.signer) + .await?; + + log::info!("Call result: {:?}", result); + Ok(result) + } +} + +#[tokio::test] +async fn tx_instantiate_with_code() { + let ctx = ContractsTestContext::init().await; + let result = ctx.instantiate_with_code().await; + + assert!( + result.is_ok(), + "Error calling instantiate_with_code and receiving CodeStored and Instantiated Events: {:?}", + result + ); +} + +#[tokio::test] +async fn tx_instantiate() { + let ctx = ContractsTestContext::init().await; + let (code_hash, _) = ctx.instantiate_with_code().await.unwrap(); + + let instantiated = ctx.instantiate(code_hash, vec![], vec![1u8]).await; + + assert!( + instantiated.is_ok(), + "Error instantiating contract: {:?}", + instantiated + ); +} + +#[tokio::test] +async fn tx_call() { + let cxt = ContractsTestContext::init().await; + let (_, contract) = cxt.instantiate_with_code().await.unwrap(); + + let contract_info = cxt + .cxt + .api + .storage() + .contracts() + .contract_info_of(&contract, None) + .await; + assert!(contract_info.is_ok()); + + let keys = cxt + .client() + .storage() + .fetch_keys::(5, None, None) + .await + .unwrap() + .iter() + .map(|key| hex::encode(&key.0)) + .collect::>(); + println!("keys post: {:?}", keys); + + let executed = cxt.call(contract, vec![]).await; + + assert!(executed.is_ok(), "Error calling contract: {:?}", executed); +} diff --git a/integration-tests/tests/integration/frame/mod.rs b/integration-tests/tests/integration/frame/mod.rs new file mode 100644 index 0000000000..a4dc4dfaa0 --- /dev/null +++ b/integration-tests/tests/integration/frame/mod.rs @@ -0,0 +1,24 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +//! Test interactions with some built-in FRAME pallets. + +mod balances; +mod contracts; +mod staking; +mod sudo; +mod system; +mod timestamp; diff --git a/integration-tests/tests/integration/frame/staking.rs b/integration-tests/tests/integration/frame/staking.rs new file mode 100644 index 0000000000..e5a9ddd1aa --- /dev/null +++ b/integration-tests/tests/integration/frame/staking.rs @@ -0,0 +1,262 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + node_runtime::{ + runtime_types::pallet_staking::{ + RewardDestination, + ValidatorPrefs, + }, + staking, + DispatchError, + }, + pair_signer, + test_context, +}; +use assert_matches::assert_matches; +use sp_core::{ + sr25519, + Pair, +}; +use sp_keyring::AccountKeyring; +use subxt::Error; + +/// Helper function to generate a crypto pair from seed +fn get_from_seed(seed: &str) -> sr25519::Pair { + sr25519::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed") +} + +fn default_validator_prefs() -> ValidatorPrefs { + ValidatorPrefs { + commission: sp_runtime::Perbill::default(), + blocked: false, + } +} + +#[tokio::test] +async fn validate_with_controller_account() { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let ctx = test_context().await; + ctx.api + .tx() + .staking() + .validate(default_validator_prefs()) + .unwrap() + .sign_and_submit_then_watch_default(&alice) + .await + .unwrap() + .wait_for_finalized_success() + .await + .expect("should be successful"); +} + +#[tokio::test] +async fn validate_not_possible_for_stash_account() -> Result<(), Error> { + let alice_stash = pair_signer(get_from_seed("Alice//stash")); + let ctx = test_context().await; + let announce_validator = ctx + .api + .tx() + .staking() + .validate(default_validator_prefs())? + .sign_and_submit_then_watch_default(&alice_stash) + .await? + .wait_for_finalized_success() + .await; + assert_matches!(announce_validator, Err(Error::Module(err)) => { + assert_eq!(err.pallet, "Staking"); + assert_eq!(err.error, "NotController"); + }); + Ok(()) +} + +#[tokio::test] +async fn nominate_with_controller_account() { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); + let ctx = test_context().await; + + ctx.api + .tx() + .staking() + .nominate(vec![bob.account_id().clone().into()]) + .unwrap() + .sign_and_submit_then_watch_default(&alice) + .await + .unwrap() + .wait_for_finalized_success() + .await + .expect("should be successful"); +} + +#[tokio::test] +async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { + let alice_stash = pair_signer(get_from_seed("Alice//stash")); + let bob = pair_signer(AccountKeyring::Bob.pair()); + let ctx = test_context().await; + + let nomination = ctx + .api + .tx() + .staking() + .nominate(vec![bob.account_id().clone().into()])? + .sign_and_submit_then_watch_default(&alice_stash) + .await? + .wait_for_finalized_success() + .await; + + assert_matches!(nomination, Err(Error::Module(err)) => { + assert_eq!(err.pallet, "Staking"); + assert_eq!(err.error, "NotController"); + }); + Ok(()) +} + +#[tokio::test] +async fn chill_works_for_controller_only() -> Result<(), Error> { + let alice_stash = pair_signer(get_from_seed("Alice//stash")); + let bob_stash = pair_signer(get_from_seed("Bob//stash")); + let alice = pair_signer(AccountKeyring::Alice.pair()); + let ctx = test_context().await; + + // this will fail the second time, which is why this is one test, not two + ctx.api + .tx() + .staking() + .nominate(vec![bob_stash.account_id().clone().into()])? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await?; + + let ledger = ctx + .api + .storage() + .staking() + .ledger(alice.account_id(), None) + .await? + .unwrap(); + assert_eq!(alice_stash.account_id(), &ledger.stash); + + let chill = ctx + .api + .tx() + .staking() + .chill()? + .sign_and_submit_then_watch_default(&alice_stash) + .await? + .wait_for_finalized_success() + .await; + + assert_matches!(chill, Err(Error::Module(err)) => { + assert_eq!(err.pallet, "Staking"); + assert_eq!(err.error, "NotController"); + }); + + let is_chilled = ctx + .api + .tx() + .staking() + .chill()? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await? + .has::()?; + assert!(is_chilled); + + Ok(()) +} + +#[tokio::test] +async fn tx_bond() -> Result<(), Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let ctx = test_context().await; + + let bond = ctx + .api + .tx() + .staking() + .bond( + AccountKeyring::Bob.to_account_id().into(), + 100_000_000_000_000, + RewardDestination::Stash, + ) + .unwrap() + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await; + + assert!(bond.is_ok()); + + let bond_again = ctx + .api + .tx() + .staking() + .bond( + AccountKeyring::Bob.to_account_id().into(), + 100_000_000_000_000, + RewardDestination::Stash, + ) + .unwrap() + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await; + + assert_matches!(bond_again, Err(Error::Module(err)) => { + assert_eq!(err.pallet, "Staking"); + assert_eq!(err.error, "AlreadyBonded"); + }); + Ok(()) +} + +#[tokio::test] +async fn storage_history_depth() -> Result<(), Error> { + let ctx = test_context().await; + let history_depth = ctx.api.storage().staking().history_depth(None).await?; + assert_eq!(history_depth, 84); + Ok(()) +} + +#[tokio::test] +async fn storage_current_era() -> Result<(), Error> { + let ctx = test_context().await; + let _current_era = ctx + .api + .storage() + .staking() + .current_era(None) + .await? + .expect("current era always exists"); + Ok(()) +} + +#[tokio::test] +async fn storage_era_reward_points() -> Result<(), Error> { + let cxt = test_context().await; + let current_era_result = cxt + .api + .storage() + .staking() + .eras_reward_points(&0, None) + .await; + assert!(current_era_result.is_ok()); + + Ok(()) +} diff --git a/integration-tests/tests/integration/frame/sudo.rs b/integration-tests/tests/integration/frame/sudo.rs new file mode 100644 index 0000000000..501320d44b --- /dev/null +++ b/integration-tests/tests/integration/frame/sudo.rs @@ -0,0 +1,81 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + node_runtime::{ + runtime_types, + sudo, + DispatchError, + }, + pair_signer, + test_context, +}; +use sp_keyring::AccountKeyring; + +type Call = runtime_types::node_runtime::Call; +type BalancesCall = runtime_types::pallet_balances::pallet::Call; + +#[tokio::test] +async fn test_sudo() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id().into(); + let cxt = test_context().await; + + let call = Call::Balances(BalancesCall::transfer { + dest: bob, + value: 10_000, + }); + + let found_event = cxt + .api + .tx() + .sudo() + .sudo(call)? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await? + .has::()?; + + assert!(found_event); + Ok(()) +} + +#[tokio::test] +async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id().into(); + let cxt = test_context().await; + + let call = Call::Balances(BalancesCall::transfer { + dest: bob, + value: 10_000, + }); + + let found_event = cxt + .api + .tx() + .sudo() + .sudo_unchecked_weight(call, 0)? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await? + .has::()?; + + assert!(found_event); + Ok(()) +} diff --git a/integration-tests/tests/integration/frame/system.rs b/integration-tests/tests/integration/frame/system.rs new file mode 100644 index 0000000000..ff7e9a9c01 --- /dev/null +++ b/integration-tests/tests/integration/frame/system.rs @@ -0,0 +1,62 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + node_runtime::{ + system, + DispatchError, + }, + pair_signer, + test_context, +}; +use assert_matches::assert_matches; +use sp_keyring::AccountKeyring; + +#[tokio::test] +async fn storage_account() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + + let cxt = test_context().await; + let account_info = cxt + .api + .storage() + .system() + .account(alice.account_id(), None) + .await; + + assert_matches!(account_info, Ok(_)); + Ok(()) +} + +#[tokio::test] +async fn tx_remark_with_event() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let cxt = test_context().await; + + let found_event = cxt + .api + .tx() + .system() + .remark_with_event(b"remarkable".to_vec())? + .sign_and_submit_then_watch_default(&alice) + .await? + .wait_for_finalized_success() + .await? + .has::()?; + + assert!(found_event); + Ok(()) +} diff --git a/integration-tests/tests/integration/frame/timestamp.rs b/integration-tests/tests/integration/frame/timestamp.rs new file mode 100644 index 0000000000..fa819071b0 --- /dev/null +++ b/integration-tests/tests/integration/frame/timestamp.rs @@ -0,0 +1,26 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::test_context; + +#[tokio::test] +async fn storage_get_current_timestamp() { + let cxt = test_context().await; + + let timestamp = cxt.api.storage().timestamp().now(None).await; + + assert!(timestamp.is_ok()) +} diff --git a/integration-tests/tests/integration/main.rs b/integration-tests/tests/integration/main.rs new file mode 100644 index 0000000000..85060588a9 --- /dev/null +++ b/integration-tests/tests/integration/main.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +mod codegen; +mod utils; + +#[cfg(test)] +mod client; +#[cfg(test)] +mod events; +#[cfg(test)] +mod frame; +#[cfg(test)] +mod metadata; +#[cfg(test)] +mod storage; + +use test_runtime::node_runtime; +use utils::*; diff --git a/integration-tests/tests/integration/metadata/mod.rs b/integration-tests/tests/integration/metadata/mod.rs new file mode 100644 index 0000000000..3217f6bbfe --- /dev/null +++ b/integration-tests/tests/integration/metadata/mod.rs @@ -0,0 +1,17 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +mod validation; diff --git a/integration-tests/tests/integration/metadata/validation.rs b/integration-tests/tests/integration/metadata/validation.rs new file mode 100644 index 0000000000..fa8db37738 --- /dev/null +++ b/integration-tests/tests/integration/metadata/validation.rs @@ -0,0 +1,334 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + test_context, + TestContext, +}; +use frame_metadata::{ + ExtrinsicMetadata, + PalletCallMetadata, + PalletMetadata, + PalletStorageMetadata, + RuntimeMetadataPrefixed, + RuntimeMetadataV14, + StorageEntryMetadata, + StorageEntryModifier, + StorageEntryType, +}; +use scale_info::{ + build::{ + Fields, + Variants, + }, + meta_type, + Path, + Type, + TypeInfo, +}; +use subxt::{ + ClientBuilder, + DefaultConfig, + Metadata, + SubstrateExtrinsicParams, +}; + +use crate::utils::node_runtime; + +type RuntimeApi = + node_runtime::RuntimeApi>; + +async fn metadata_to_api(metadata: RuntimeMetadataV14, cxt: &TestContext) -> RuntimeApi { + let prefixed = RuntimeMetadataPrefixed::from(metadata); + let metadata = Metadata::try_from(prefixed).unwrap(); + + ClientBuilder::new() + .set_url(cxt.node_proc.ws_url().to_string()) + .set_metadata(metadata) + .build() + .await + .unwrap() + .to_runtime_api::, + >>() +} + +#[tokio::test] +async fn full_metadata_check() { + let cxt = test_context().await; + let api = &cxt.api; + + // Runtime metadata is identical to the metadata used during API generation. + assert!(api.validate_metadata().is_ok()); + + // Modify the metadata. + let mut metadata: RuntimeMetadataV14 = + api.client.metadata().runtime_metadata().clone(); + metadata.pallets[0].name = "NewPallet".to_string(); + + let new_api = metadata_to_api(metadata, &cxt).await; + assert_eq!( + new_api + .validate_metadata() + .err() + .expect("Validation should fail for incompatible metadata"), + ::subxt::MetadataError::IncompatibleMetadata + ); +} + +#[tokio::test] +async fn constants_check() { + let cxt = test_context().await; + let api = &cxt.api; + + // Ensure that `ExistentialDeposit` is compatible before altering the metadata. + assert!(cxt.api.constants().balances().existential_deposit().is_ok()); + + // Modify the metadata. + let mut metadata: RuntimeMetadataV14 = + api.client.metadata().runtime_metadata().clone(); + + let mut existential = metadata + .pallets + .iter_mut() + .find(|pallet| pallet.name == "Balances") + .expect("Metadata must contain Balances pallet") + .constants + .iter_mut() + .find(|constant| constant.name == "ExistentialDeposit") + .expect("ExistentialDeposit constant must be present"); + existential.value = vec![0u8; 32]; + + let new_api = metadata_to_api(metadata, &cxt).await; + + assert!(new_api.validate_metadata().is_err()); + assert!(new_api + .constants() + .balances() + .existential_deposit() + .is_err()); + + // Other constant validation should not be impacted. + assert!(new_api.constants().balances().max_locks().is_ok()); +} + +fn default_pallet() -> PalletMetadata { + PalletMetadata { + name: "Test", + storage: None, + calls: None, + event: None, + constants: vec![], + error: None, + index: 0, + } +} + +fn pallets_to_metadata(pallets: Vec) -> RuntimeMetadataV14 { + RuntimeMetadataV14::new( + pallets, + ExtrinsicMetadata { + ty: meta_type::<()>(), + version: 0, + signed_extensions: vec![], + }, + meta_type::<()>(), + ) +} + +#[tokio::test] +async fn calls_check() { + let cxt = test_context().await; + + // Ensure that `Unbond` and `WinthdrawUnbonded` calls are compatible before altering the metadata. + assert!(cxt.api.tx().staking().unbond(123_456_789_012_345).is_ok()); + assert!(cxt.api.tx().staking().withdraw_unbonded(10).is_ok()); + + // Reconstruct the `Staking` call as is. + struct CallRec; + impl TypeInfo for CallRec { + type Identity = Self; + fn type_info() -> Type { + Type::builder() + .path(Path::new("Call", "pallet_staking::pallet::pallet")) + .variant( + Variants::new() + .variant("unbond", |v| { + v.index(0).fields(Fields::named().field(|f| { + f.compact::() + .name("value") + .type_name("BalanceOf") + })) + }) + .variant("withdraw_unbonded", |v| { + v.index(1).fields(Fields::named().field(|f| { + f.ty::().name("num_slashing_spans").type_name("u32") + })) + }), + ) + } + } + let pallet = PalletMetadata { + name: "Staking", + calls: Some(PalletCallMetadata { + ty: meta_type::(), + }), + ..default_pallet() + }; + let metadata = pallets_to_metadata(vec![pallet]); + let new_api = metadata_to_api(metadata, &cxt).await; + assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_ok()); + assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); + + // Change `Unbond` call but leave the rest as is. + struct CallRecSecond; + impl TypeInfo for CallRecSecond { + type Identity = Self; + fn type_info() -> Type { + Type::builder() + .path(Path::new("Call", "pallet_staking::pallet::pallet")) + .variant( + Variants::new() + .variant("unbond", |v| { + v.index(0).fields(Fields::named().field(|f| { + // Is of type u32 instead of u128. + f.compact::().name("value").type_name("BalanceOf") + })) + }) + .variant("withdraw_unbonded", |v| { + v.index(1).fields(Fields::named().field(|f| { + f.ty::().name("num_slashing_spans").type_name("u32") + })) + }), + ) + } + } + let pallet = PalletMetadata { + name: "Staking", + calls: Some(PalletCallMetadata { + ty: meta_type::(), + }), + ..default_pallet() + }; + let metadata = pallets_to_metadata(vec![pallet]); + let new_api = metadata_to_api(metadata, &cxt).await; + // Unbond call should fail, while withdraw_unbonded remains compatible. + assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_err()); + assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); +} + +#[tokio::test] +async fn storage_check() { + let cxt = test_context().await; + + // Ensure that `ExtrinsicCount` and `EventCount` storages are compatible before altering the metadata. + assert!(cxt + .api + .storage() + .system() + .extrinsic_count(None) + .await + .is_ok()); + assert!(cxt + .api + .storage() + .system() + .all_extrinsics_len(None) + .await + .is_ok()); + + // Reconstruct the storage. + let storage = PalletStorageMetadata { + prefix: "System", + entries: vec![ + StorageEntryMetadata { + name: "ExtrinsicCount", + modifier: StorageEntryModifier::Optional, + ty: StorageEntryType::Plain(meta_type::()), + default: vec![0], + docs: vec![], + }, + StorageEntryMetadata { + name: "AllExtrinsicsLen", + modifier: StorageEntryModifier::Optional, + ty: StorageEntryType::Plain(meta_type::()), + default: vec![0], + docs: vec![], + }, + ], + }; + let pallet = PalletMetadata { + name: "System", + storage: Some(storage), + ..default_pallet() + }; + let metadata = pallets_to_metadata(vec![pallet]); + let new_api = metadata_to_api(metadata, &cxt).await; + assert!(new_api + .storage() + .system() + .extrinsic_count(None) + .await + .is_ok()); + assert!(new_api + .storage() + .system() + .all_extrinsics_len(None) + .await + .is_ok()); + + // Reconstruct the storage while modifying ExtrinsicCount. + let storage = PalletStorageMetadata { + prefix: "System", + entries: vec![ + StorageEntryMetadata { + name: "ExtrinsicCount", + modifier: StorageEntryModifier::Optional, + // Previously was u32. + ty: StorageEntryType::Plain(meta_type::()), + default: vec![0], + docs: vec![], + }, + StorageEntryMetadata { + name: "AllExtrinsicsLen", + modifier: StorageEntryModifier::Optional, + ty: StorageEntryType::Plain(meta_type::()), + default: vec![0], + docs: vec![], + }, + ], + }; + let pallet = PalletMetadata { + name: "System", + storage: Some(storage), + ..default_pallet() + }; + let metadata = pallets_to_metadata(vec![pallet]); + let new_api = metadata_to_api(metadata, &cxt).await; + assert!(new_api + .storage() + .system() + .extrinsic_count(None) + .await + .is_err()); + assert!(new_api + .storage() + .system() + .all_extrinsics_len(None) + .await + .is_ok()); +} diff --git a/integration-tests/tests/integration/storage.rs b/integration-tests/tests/integration/storage.rs new file mode 100644 index 0000000000..552a06278f --- /dev/null +++ b/integration-tests/tests/integration/storage.rs @@ -0,0 +1,139 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + node_runtime::{ + self, + DispatchError, + }, + pair_signer, + test_context, +}; +use sp_keyring::AccountKeyring; + +#[tokio::test] +async fn storage_plain_lookup() -> Result<(), subxt::Error> { + let ctx = test_context().await; + + // Look up a plain value. Wait long enough that we don't get the genesis block data, + // because it may have no storage associated with it. + tokio::time::sleep(std::time::Duration::from_secs(6)).await; + let entry = ctx.api.storage().timestamp().now(None).await?; + assert!(entry > 0); + + Ok(()) +} + +#[tokio::test] +async fn storage_map_lookup() -> Result<(), subxt::Error> { + let ctx = test_context().await; + + let signer = pair_signer(AccountKeyring::Alice.pair()); + let alice = AccountKeyring::Alice.to_account_id(); + + // Do some transaction to bump the Alice nonce to 1: + ctx.api + .tx() + .system() + .remark(vec![1, 2, 3, 4, 5])? + .sign_and_submit_then_watch_default(&signer) + .await? + .wait_for_finalized_success() + .await?; + + // Look up the nonce for the user (we expect it to be 1). + let entry = ctx.api.storage().system().account(&alice, None).await?; + assert_eq!(entry.nonce, 1); + + Ok(()) +} + +// This fails until the fix in https://github.com/paritytech/subxt/pull/458 is introduced. +// Here we create a key that looks a bit like a StorageNMap key, but should in fact be +// treated as a StorageKey (ie we should hash both values together with one hasher, rather +// than hash both values separately, or ignore the second value). +#[tokio::test] +async fn storage_n_mapish_key_is_properly_created( +) -> Result<(), subxt::Error> { + use codec::Encode; + use node_runtime::{ + runtime_types::sp_core::crypto::KeyTypeId, + session::storage::KeyOwner, + }; + use subxt::{ + storage::StorageKeyPrefix, + StorageEntry, + }; + + // This is what the generated code hashes a `session().key_owner(..)` key into: + let actual_key_bytes = KeyOwner(&KeyTypeId([1, 2, 3, 4]), &[5u8, 6, 7, 8]) + .key() + .final_key(StorageKeyPrefix::new::()) + .0; + + // Let's manually hash to what we assume it should be and compare: + let expected_key_bytes = { + // Hash the prefix to the storage entry: + let mut bytes = sp_core::twox_128("Session".as_bytes()).to_vec(); + bytes.extend(&sp_core::twox_128("KeyOwner".as_bytes())[..]); + // twox64_concat a *tuple* of the args expected: + let suffix = (KeyTypeId([1, 2, 3, 4]), vec![5u8, 6, 7, 8]).encode(); + bytes.extend(&sp_core::twox_64(&suffix)); + bytes.extend(&suffix); + bytes + }; + + assert_eq!(actual_key_bytes, expected_key_bytes); + Ok(()) +} + +#[tokio::test] +async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> { + let ctx = test_context().await; + + // Boilerplate; we create a new asset class with ID 99, and then + // we "approveTransfer" of some of this asset class. This gives us an + // entry in the `Approvals` StorageNMap that we can try to look up. + let signer = pair_signer(AccountKeyring::Alice.pair()); + let alice = AccountKeyring::Alice.to_account_id(); + let bob = AccountKeyring::Bob.to_account_id(); + ctx.api + .tx() + .assets() + .create(99, alice.clone().into(), 1)? + .sign_and_submit_then_watch_default(&signer) + .await? + .wait_for_finalized_success() + .await?; + ctx.api + .tx() + .assets() + .approve_transfer(99, bob.clone().into(), 123)? + .sign_and_submit_then_watch_default(&signer) + .await? + .wait_for_finalized_success() + .await?; + + // The actual test; look up this approval in storage: + let entry = ctx + .api + .storage() + .assets() + .approvals(&99, &alice, &bob, None) + .await?; + assert_eq!(entry.map(|a| a.amount), Some(123)); + Ok(()) +} diff --git a/integration-tests/tests/integration/utils/context.rs b/integration-tests/tests/integration/utils/context.rs new file mode 100644 index 0000000000..b1e85d102b --- /dev/null +++ b/integration-tests/tests/integration/utils/context.rs @@ -0,0 +1,78 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +pub(crate) use crate::{ + node_runtime, + TestNodeProcess, +}; + +use sp_core::sr25519::Pair; +use sp_keyring::AccountKeyring; +use subxt::{ + Client, + DefaultConfig, + PairSigner, + SubstrateExtrinsicParams, +}; + +/// substrate node should be installed on the $PATH +const SUBSTRATE_NODE_PATH: &str = "substrate"; + +pub type NodeRuntimeParams = SubstrateExtrinsicParams; + +pub async fn test_node_process_with( + key: AccountKeyring, +) -> TestNodeProcess { + let path = std::env::var("SUBSTRATE_NODE_PATH").unwrap_or_else(|_| { + if which::which(SUBSTRATE_NODE_PATH).is_err() { + panic!("A substrate binary should be installed on your path for integration tests. \ + See https://github.com/paritytech/subxt/tree/master#integration-testing") + } + SUBSTRATE_NODE_PATH.to_string() + }); + + let proc = TestNodeProcess::::build(path.as_str()) + .with_authority(key) + .spawn::() + .await; + proc.unwrap() +} + +pub async fn test_node_process() -> TestNodeProcess { + test_node_process_with(AccountKeyring::Alice).await +} + +pub struct TestContext { + pub node_proc: TestNodeProcess, + pub api: node_runtime::RuntimeApi, +} + +impl TestContext { + pub fn client(&self) -> &Client { + &self.api.client + } +} + +pub async fn test_context() -> TestContext { + env_logger::try_init().ok(); + let node_proc = test_node_process_with(AccountKeyring::Alice).await; + let api = node_proc.client().clone().to_runtime_api(); + TestContext { node_proc, api } +} + +pub fn pair_signer(pair: Pair) -> PairSigner { + PairSigner::new(pair) +} diff --git a/integration-tests/tests/integration/utils/mod.rs b/integration-tests/tests/integration/utils/mod.rs new file mode 100644 index 0000000000..d2041160d6 --- /dev/null +++ b/integration-tests/tests/integration/utils/mod.rs @@ -0,0 +1,21 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +mod context; +mod node_proc; + +pub use context::*; +pub use node_proc::TestNodeProcess; diff --git a/integration-tests/tests/integration/utils/node_proc.rs b/integration-tests/tests/integration/utils/node_proc.rs new file mode 100644 index 0000000000..16e5d8887f --- /dev/null +++ b/integration-tests/tests/integration/utils/node_proc.rs @@ -0,0 +1,191 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use sp_keyring::AccountKeyring; +use std::{ + ffi::{ + OsStr, + OsString, + }, + io::{ + BufRead, + BufReader, + Read, + }, + process, +}; +use subxt::{ + Client, + ClientBuilder, + Config, +}; + +/// Spawn a local substrate node for testing subxt. +pub struct TestNodeProcess { + proc: process::Child, + client: Client, + ws_url: String, +} + +impl Drop for TestNodeProcess +where + R: Config, +{ + fn drop(&mut self) { + let _ = self.kill(); + } +} + +impl TestNodeProcess +where + R: Config, +{ + /// Construct a builder for spawning a test node process. + pub fn build(program: S) -> TestNodeProcessBuilder + where + S: AsRef + Clone, + { + TestNodeProcessBuilder::new(program) + } + + /// Attempt to kill the running substrate process. + pub fn kill(&mut self) -> Result<(), String> { + log::info!("Killing node process {}", self.proc.id()); + if let Err(err) = self.proc.kill() { + let err = format!("Error killing node process {}: {}", self.proc.id(), err); + log::error!("{}", err); + return Err(err) + } + Ok(()) + } + + /// Returns the subxt client connected to the running node. + pub fn client(&self) -> &Client { + &self.client + } + + /// Returns the address to which the client is connected. + pub fn ws_url(&self) -> &str { + &self.ws_url + } +} + +/// Construct a test node process. +pub struct TestNodeProcessBuilder { + node_path: OsString, + authority: Option, +} + +impl TestNodeProcessBuilder { + pub fn new

(node_path: P) -> TestNodeProcessBuilder + where + P: AsRef, + { + Self { + node_path: node_path.as_ref().into(), + authority: None, + } + } + + /// Set the authority dev account for a node in validator mode e.g. --alice. + pub fn with_authority(&mut self, account: AccountKeyring) -> &mut Self { + self.authority = Some(account); + self + } + + /// Spawn the substrate node at the given path, and wait for rpc to be initialized. + pub async fn spawn(&self) -> Result, String> + where + R: Config, + { + let mut cmd = process::Command::new(&self.node_path); + cmd.env("RUST_LOG", "info") + .arg("--dev") + .arg("--tmp") + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .arg("--port=0") + .arg("--rpc-port=0") + .arg("--ws-port=0"); + + if let Some(authority) = self.authority { + let authority = format!("{:?}", authority); + let arg = format!("--{}", authority.as_str().to_lowercase()); + cmd.arg(arg); + } + + let mut proc = cmd.spawn().map_err(|e| { + format!( + "Error spawning substrate node '{}': {}", + self.node_path.to_string_lossy(), + e + ) + })?; + + // Wait for RPC port to be logged (it's logged to stderr): + let stderr = proc.stderr.take().unwrap(); + let ws_port = find_substrate_port_from_output(stderr); + let ws_url = format!("ws://127.0.0.1:{}", ws_port); + + // Connect to the node with a subxt client: + let client = ClientBuilder::new().set_url(ws_url.clone()).build().await; + match client { + Ok(client) => { + Ok(TestNodeProcess { + proc, + client, + ws_url, + }) + } + Err(err) => { + let err = format!("Failed to connect to node rpc at {}: {}", ws_url, err); + log::error!("{}", err); + proc.kill().map_err(|e| { + format!("Error killing substrate process '{}': {}", proc.id(), e) + })?; + Err(err) + } + } + } +} + +// Consume a stderr reader from a spawned substrate command and +// locate the port number that is logged out to it. +fn find_substrate_port_from_output(r: impl Read + Send + 'static) -> u16 { + BufReader::new(r) + .lines() + .find_map(|line| { + let line = line + .expect("failed to obtain next line from stdout for port discovery"); + + // does the line contain our port (we expect this specific output from substrate). + let line_end = match line.rsplit_once("Listening for new connections on 127.0.0.1:") { + None => return None, + Some((_, after)) => after + }; + + // trim non-numeric chars from the end of the port part of the line. + let port_str = line_end.trim_end_matches(|b| !('0'..='9').contains(&b)); + + // expect to have a number here (the chars after '127.0.0.1:') and parse them into a u16. + let port_num = port_str + .parse() + .unwrap_or_else(|_| panic!("valid port expected on 'Listening for new connections' line, got '{port_str}'")); + + Some(port_num) + }) + .expect("We should find a port before the reader ends") +} From 77818e0377c9a54903543b821d6cfee99ca57f1d Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:09:28 +0300 Subject: [PATCH 28/37] subxt: Remove `test-runtime` dependency Signed-off-by: Alexandru Vasile --- subxt/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index ffc982dcbd..7b2c5dd654 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -47,5 +47,4 @@ env_logger = "0.9.0" tempdir = "0.3.7" wabt = "0.10.0" which = "4.0.2" -test-runtime = { path = "../test-runtime" } sp-keyring = "6.0.0" From 8c1c681907089c36e76cd8cdde152a94417ff202 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:13:46 +0300 Subject: [PATCH 29/37] subxt: Add comment for feature flags Signed-off-by: Alexandru Vasile --- subxt/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 7b2c5dd654..74211c6ad3 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -13,6 +13,7 @@ description = "Submit extrinsics (transactions) to a substrate node via RPC" keywords = ["parity", "substrate", "blockchain"] [features] +# Feature flag is active when running integration-tests from the dedicated crate. integration-tests = [] [dependencies] From cd91831507eb93fd189841b02aebe7f5665e03e7 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:21:24 +0300 Subject: [PATCH 30/37] integration-tests: Trim dependencies Signed-off-by: Alexandru Vasile --- integration-tests/Cargo.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 7de2cc075b..d37c75786a 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -22,21 +22,16 @@ futures = "0.3.13" hex = "0.4.3" log = "0.4.14" -subxt-macro = { version = "0.20.0", path = "../macro" } -subxt-metadata = { version = "0.20.0", path = "../metadata" } subxt = { version = "0.20.0", path = "../subxt" } sp-core = { version = "6.0.0", default-features = false } sp-runtime = "6.0.0" frame-metadata = "15.0.0" -derivative = "2.2.0" -sp-arithmetic = { version = "5.0.0", default-features = false } assert_matches = "1.5.0" tokio = { version = "1.8", features = ["macros", "time"] } env_logger = "0.9.0" -tempdir = "0.3.7" wabt = "0.10.0" which = "4.0.2" test-runtime = { path = "../test-runtime" } From bc0f7192d24708a25a1df2aab0b28873c8be2844 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:22:26 +0300 Subject: [PATCH 31/37] integration-tests: Move dependencies under dev Signed-off-by: Alexandru Vasile --- integration-tests/Cargo.toml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index d37c75786a..3ae9303eed 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -14,25 +14,21 @@ description = "Subxt integration tests that rely on the Substrate binary" [features] default = ["subxt/integration-tests"] -[dependencies] +[dev-dependencies] +assert_matches = "1.5.0" async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } -scale-info = { version = "2.0.0", features = ["bit-vec"] } +env_logger = "0.9.0" +frame-metadata = "15.0.0" futures = "0.3.13" hex = "0.4.3" log = "0.4.14" - -subxt = { version = "0.20.0", path = "../subxt" } - +scale-info = { version = "2.0.0", features = ["bit-vec"] } sp-core = { version = "6.0.0", default-features = false } +sp-keyring = "6.0.0" sp-runtime = "6.0.0" - -frame-metadata = "15.0.0" - -assert_matches = "1.5.0" +subxt = { version = "0.20.0", path = "../subxt" } +test-runtime = { path = "../test-runtime" } tokio = { version = "1.8", features = ["macros", "time"] } -env_logger = "0.9.0" wabt = "0.10.0" which = "4.0.2" -test-runtime = { path = "../test-runtime" } -sp-keyring = "6.0.0" From bce05623d2189bfa3cb646b25ab27f8fa8e98c97 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:23:25 +0300 Subject: [PATCH 32/37] Revert "CI: Use `integration-tests` feature to run all tests" This reverts commit 8e5f38ba8c633ac40420fadf58700ac402f762d4. --- .github/workflows/nightly.yml | 2 +- .github/workflows/rust.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bdf68986fb..8062a677dc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -40,7 +40,7 @@ jobs: uses: actions-rs/cargo@v1.0.3 with: command: test - args: --features integration-tests --all-targets --workspace + args: --all-targets --workspace # If the previous step fails, create a new Github issue # to nofity us about it. diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e910ca7d1d..73078643f0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -127,7 +127,7 @@ jobs: uses: actions-rs/cargo@v1.0.3 with: command: test - args: --features integration-tests --all-targets --workspace + args: --all-targets --workspace clippy: name: Cargo clippy @@ -158,4 +158,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --features integration-tests --all-targets -- -D warnings + args: --all-targets -- -D warnings From bfba931a59e5b68f30f2532909d0b84402640146 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:50:20 +0300 Subject: [PATCH 33/37] codegen: Move documentation test to integration crate Signed-off-by: Alexandru Vasile --- codegen/Cargo.toml | 2 -- codegen/src/api/mod.rs | 2 -- integration-tests/Cargo.toml | 3 +++ .../tests/codegen_documentation.rs | 20 ++----------------- 4 files changed, 5 insertions(+), 22 deletions(-) rename codegen/src/api/tests.rs => integration-tests/tests/codegen_documentation.rs (82%) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 990556ac6f..36f1f12ff8 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -28,5 +28,3 @@ subxt-metadata = { version = "0.20.0", path = "../metadata" } [dev-dependencies] bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } pretty_assertions = "1.0.0" -test-runtime = { path = "../test-runtime" } -regex = "1.5" diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index c1341dbfa4..a437f610c8 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -21,8 +21,6 @@ mod constants; mod errors; mod events; mod storage; -#[cfg(test)] -mod tests; use subxt_metadata::get_metadata_per_pallet_hash; diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 3ae9303eed..2e8ed86134 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -23,11 +23,14 @@ frame-metadata = "15.0.0" futures = "0.3.13" hex = "0.4.3" log = "0.4.14" +regex = "1.5" scale-info = { version = "2.0.0", features = ["bit-vec"] } sp-core = { version = "6.0.0", default-features = false } sp-keyring = "6.0.0" sp-runtime = "6.0.0" subxt = { version = "0.20.0", path = "../subxt" } +subxt-codegen = { version = "0.20.0", path = "../codegen" } +syn = "1.0.58" test-runtime = { path = "../test-runtime" } tokio = { version = "1.8", features = ["macros", "time"] } wabt = "0.10.0" diff --git a/codegen/src/api/tests.rs b/integration-tests/tests/codegen_documentation.rs similarity index 82% rename from codegen/src/api/tests.rs rename to integration-tests/tests/codegen_documentation.rs index a1d6d9dc88..4e57749405 100644 --- a/codegen/src/api/tests.rs +++ b/integration-tests/tests/codegen_documentation.rs @@ -1,21 +1,5 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use super::*; use regex::Regex; +use subxt_codegen::{DerivesRegistry, RuntimeGenerator}; fn metadata_docs() -> Vec { // Load the runtime metadata downloaded from a node via `test-runtime`. @@ -62,7 +46,7 @@ fn generate_runtime_interface() -> String { let item_mod = syn::parse_quote!( pub mod api {} ); - let derives = GeneratedTypeDerives::default(); + let derives = DerivesRegistry::default(); generator.generate_runtime(item_mod, derives).to_string() } From c1f4979b8efb5d3dc07df2a2eb1db73c847f5c33 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 28 Apr 2022 17:54:47 +0300 Subject: [PATCH 34/37] codegen_documentation: Add license + fmt Signed-off-by: Alexandru Vasile --- .../tests/codegen_documentation.rs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/integration-tests/tests/codegen_documentation.rs b/integration-tests/tests/codegen_documentation.rs index 4e57749405..0968a32b84 100644 --- a/integration-tests/tests/codegen_documentation.rs +++ b/integration-tests/tests/codegen_documentation.rs @@ -1,5 +1,24 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + use regex::Regex; -use subxt_codegen::{DerivesRegistry, RuntimeGenerator}; +use subxt_codegen::{ + DerivesRegistry, + RuntimeGenerator, +}; fn metadata_docs() -> Vec { // Load the runtime metadata downloaded from a node via `test-runtime`. From efbd0c522c074efac780435016aacd8badef92fe Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Tue, 14 Jun 2022 17:39:11 +0300 Subject: [PATCH 35/37] Update `polkadot.rs` Signed-off-by: Alexandru Vasile --- integration-tests/src/codegen/polkadot.rs | 22391 +++++++++++--------- 1 file changed, 12468 insertions(+), 9923 deletions(-) diff --git a/integration-tests/src/codegen/polkadot.rs b/integration-tests/src/codegen/polkadot.rs index 7f88b25bd0..65ee8bf8f5 100644 --- a/integration-tests/src/codegen/polkadot.rs +++ b/integration-tests/src/codegen/polkadot.rs @@ -813,349 +813,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."] @@ -1165,66 +1246,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 + == [ + 24u8, 94u8, 199u8, 134u8, 204u8, 113u8, 27u8, 51u8, + 125u8, 171u8, 8u8, 105u8, 56u8, 194u8, 166u8, 4u8, 15u8, + 164u8, 67u8, 235u8, 12u8, 130u8, 72u8, 90u8, 164u8, + 136u8, 208u8, 227u8, 184u8, 233u8, 61u8, 44u8, + ] + { + 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"] @@ -1237,34 +1330,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"] @@ -1277,142 +1375,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()) + } } } } @@ -1437,10 +1573,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, + 182u8, 121u8, 36u8, 165u8, 209u8, 176u8, 108u8, 255u8, 145u8, + 169u8, 176u8, 84u8, 251u8, 222u8, 119u8, 92u8, 93u8, 101u8, + 216u8, 246u8, 17u8, 102u8, 103u8, 59u8, 1u8, 67u8, 64u8, + 137u8, 236u8, 126u8, 213u8, 13u8, ] { let pallet = metadata.pallet("System")?; @@ -1738,10 +1874,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, + 21u8, 84u8, 24u8, 110u8, 244u8, 12u8, 103u8, 203u8, 111u8, + 180u8, 157u8, 239u8, 93u8, 170u8, 14u8, 149u8, 228u8, 143u8, + 33u8, 117u8, 191u8, 75u8, 251u8, 88u8, 254u8, 203u8, 37u8, + 228u8, 151u8, 224u8, 40u8, 80u8, ] { let call = Schedule { @@ -1822,10 +1958,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, + 119u8, 201u8, 76u8, 175u8, 142u8, 180u8, 60u8, 196u8, 96u8, + 235u8, 140u8, 188u8, 15u8, 82u8, 191u8, 46u8, 28u8, 159u8, + 223u8, 103u8, 145u8, 50u8, 251u8, 155u8, 107u8, 78u8, 4u8, + 156u8, 224u8, 189u8, 59u8, 234u8, ] { let call = ScheduleNamed { @@ -1909,10 +2045,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, + 34u8, 208u8, 34u8, 192u8, 3u8, 90u8, 234u8, 239u8, 58u8, + 198u8, 125u8, 167u8, 209u8, 54u8, 161u8, 52u8, 93u8, 236u8, + 18u8, 158u8, 74u8, 208u8, 215u8, 181u8, 44u8, 251u8, 16u8, + 63u8, 132u8, 228u8, 223u8, 108u8, ] { let call = ScheduleAfter { @@ -1962,10 +2098,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, + 124u8, 251u8, 99u8, 15u8, 99u8, 114u8, 94u8, 98u8, 106u8, + 202u8, 229u8, 131u8, 93u8, 27u8, 24u8, 20u8, 106u8, 124u8, + 207u8, 170u8, 118u8, 193u8, 171u8, 250u8, 244u8, 80u8, 205u8, + 61u8, 146u8, 0u8, 231u8, 51u8, ] { let call = ScheduleNamedAfter { @@ -2075,110 +2211,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 + == [ + 120u8, 52u8, 58u8, 144u8, 243u8, 57u8, 104u8, 108u8, + 181u8, 185u8, 58u8, 171u8, 125u8, 222u8, 92u8, 234u8, + 82u8, 51u8, 88u8, 9u8, 239u8, 11u8, 188u8, 55u8, 169u8, + 138u8, 109u8, 185u8, 37u8, 96u8, 124u8, 86u8, + ] + { + let entry = Agenda(_0); + client.storage().fetch_or_default(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[doc = " Items to be executed, indexed by the block number that they should be executed on."] - pub 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 + == [ + 120u8, 52u8, 58u8, 144u8, 243u8, 57u8, 104u8, 108u8, + 181u8, 185u8, 58u8, 171u8, 125u8, 222u8, 92u8, 234u8, + 82u8, 51u8, 88u8, 9u8, 239u8, 11u8, 188u8, 55u8, 169u8, + 138u8, 109u8, 185u8, 37u8, 96u8, 124u8, 86u8, + ] + { + 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()) + } } } } @@ -2522,120 +2685,138 @@ 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( - &self, - _0: &::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, - >, - >, - ::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()) + #[doc = " The preimages stored by this pallet."] pub fn preimage_for (& self , _0 : & 'a :: subxt :: sp_core :: H256 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < :: core :: option :: Option < runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > > , :: subxt :: BasicError > > + 'a{ + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = client.metadata(); + let metadata = locked_metadata.read(); + match metadata.storage_hash::() { + Ok(hash) => hash, + Err(e) => return Err(e.into()), + } + }; + if runtime_storage_hash + == [ + 153u8, 48u8, 185u8, 144u8, 57u8, 68u8, 133u8, 92u8, + 225u8, 172u8, 36u8, 62u8, 152u8, 162u8, 15u8, 139u8, + 140u8, 82u8, 118u8, 63u8, 31u8, 158u8, 197u8, 26u8, + 141u8, 210u8, 150u8, 82u8, 109u8, 100u8, 144u8, 56u8, + ] + { + let entry = PreimageFor(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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()) + } } } } @@ -3003,115 +3184,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 :: frame_support :: storage :: 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."] @@ -3124,115 +3325,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 :: frame_support :: storage :: 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."] @@ -3244,155 +3455,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::frame_support::storage::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"] @@ -3400,33 +3644,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."] @@ -3434,91 +3683,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()) + } } } } @@ -3728,59 +4000,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()) + } } } } @@ -4239,61 +4525,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()) + } } } } @@ -4928,31 +5230,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."] @@ -4979,34 +5288,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."] @@ -5033,174 +5349,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 :: frame_support :: storage :: 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::frame_support::storage::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()) + } } } } @@ -5322,62 +5675,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()) + } } } } @@ -5623,94 +5986,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()) + } } } } @@ -7899,488 +8282,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"] @@ -8399,31 +8902,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"] @@ -8442,206 +8955,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."] @@ -8650,38 +9220,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."] @@ -8690,29 +9265,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."] @@ -8726,38 +9309,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."] @@ -8771,29 +9359,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."] @@ -8801,35 +9397,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."] @@ -8837,681 +9438,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()) - } - } - #[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( - &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()) + 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 fn slash_reward_fraction( + &self, + block_hash: ::core::option::Option, + ) -> 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"] @@ -9523,97 +10287,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()) + } } } } @@ -9869,126 +10654,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."] @@ -9997,34 +10811,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."] @@ -10033,29 +10852,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()) + } } } } @@ -10312,124 +11139,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."] @@ -10437,142 +11288,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()) + } } } } @@ -10880,210 +11770,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()) + } } } } @@ -11331,173 +12275,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 :: frame_support :: storage :: 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()) + } } } } @@ -13304,581 +14274,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()) + } + #[doc = " Those who have locked a deposit."] + #[doc = ""] + #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] + pub fn deposit_of_iter( + &self, + block_hash: ::core::option::Option, + ) -> impl ::core::future::Future< + Output = ::core::result::Result< + ::subxt::KeyIter<'a, T, DepositOf<'a>>, + ::subxt::BasicError, + >, + > + 'a { + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = client.metadata(); + let metadata = locked_metadata.read(); + match metadata.storage_hash::() { + Ok(hash) => hash, + Err(e) => return Err(e.into()), + } + }; + if runtime_storage_hash + == [ + 116u8, 57u8, 200u8, 96u8, 150u8, 62u8, 162u8, 169u8, + 28u8, 18u8, 134u8, 161u8, 210u8, 217u8, 80u8, 225u8, + 22u8, 185u8, 177u8, 166u8, 243u8, 232u8, 193u8, 64u8, + 170u8, 89u8, 216u8, 198u8, 43u8, 102u8, 178u8, 55u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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()) + } } } } @@ -14367,10 +15466,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, + 83u8, 140u8, 69u8, 29u8, 199u8, 175u8, 140u8, 126u8, 121u8, + 251u8, 152u8, 76u8, 89u8, 16u8, 123u8, 120u8, 84u8, 112u8, + 108u8, 242u8, 152u8, 252u8, 167u8, 164u8, 197u8, 122u8, + 255u8, 196u8, 168u8, 252u8, 205u8, 181u8, ] { let call = Execute { @@ -14432,10 +15531,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, + 162u8, 169u8, 39u8, 84u8, 159u8, 254u8, 249u8, 29u8, 153u8, + 140u8, 19u8, 42u8, 204u8, 68u8, 3u8, 7u8, 98u8, 237u8, 83u8, + 188u8, 162u8, 201u8, 178u8, 156u8, 22u8, 129u8, 230u8, 47u8, + 28u8, 1u8, 31u8, 83u8, ] { let call = Propose { @@ -14783,233 +15882,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::frame_support::storage::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 + == [ + 158u8, 48u8, 95u8, 229u8, 4u8, 244u8, 59u8, 225u8, 168u8, + 75u8, 91u8, 246u8, 98u8, 100u8, 121u8, 64u8, 198u8, 11u8, + 255u8, 75u8, 171u8, 9u8, 201u8, 60u8, 236u8, 48u8, 129u8, + 34u8, 74u8, 42u8, 135u8, 58u8, + ] + { + 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 + == [ + 158u8, 48u8, 95u8, 229u8, 4u8, 244u8, 59u8, 225u8, 168u8, + 75u8, 91u8, 246u8, 98u8, 100u8, 121u8, 64u8, 198u8, 11u8, + 255u8, 75u8, 171u8, 9u8, 201u8, 60u8, 236u8, 48u8, 129u8, + 34u8, 74u8, 42u8, 135u8, 58u8, + ] + { + 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()) + } } } } @@ -15211,10 +16367,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, + 83u8, 140u8, 69u8, 29u8, 199u8, 175u8, 140u8, 126u8, 121u8, + 251u8, 152u8, 76u8, 89u8, 16u8, 123u8, 120u8, 84u8, 112u8, + 108u8, 242u8, 152u8, 252u8, 167u8, 164u8, 197u8, 122u8, + 255u8, 196u8, 168u8, 252u8, 205u8, 181u8, ] { let call = Execute { @@ -15276,10 +16432,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, + 162u8, 169u8, 39u8, 84u8, 159u8, 254u8, 249u8, 29u8, 153u8, + 140u8, 19u8, 42u8, 204u8, 68u8, 3u8, 7u8, 98u8, 237u8, 83u8, + 188u8, 162u8, 201u8, 178u8, 156u8, 22u8, 129u8, 230u8, 47u8, + 28u8, 1u8, 31u8, 83u8, ] { let call = Propose { @@ -15627,233 +16783,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::frame_support::storage::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 + == [ + 158u8, 48u8, 95u8, 229u8, 4u8, 244u8, 59u8, 225u8, 168u8, + 75u8, 91u8, 246u8, 98u8, 100u8, 121u8, 64u8, 198u8, 11u8, + 255u8, 75u8, 171u8, 9u8, 201u8, 60u8, 236u8, 48u8, 129u8, + 34u8, 74u8, 42u8, 135u8, 58u8, + ] + { + 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 + == [ + 158u8, 48u8, 95u8, 229u8, 4u8, 244u8, 59u8, 225u8, 168u8, + 75u8, 91u8, 246u8, 98u8, 100u8, 121u8, 64u8, 198u8, 11u8, + 255u8, 75u8, 171u8, 9u8, 201u8, 60u8, 236u8, 48u8, 129u8, + 34u8, 74u8, 42u8, 135u8, 58u8, + ] + { + 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()) + } } } } @@ -16390,76 +17603,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"] @@ -16468,128 +17691,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()) + } } } } @@ -17197,60 +18445,73 @@ 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< + ::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 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()) + } } } } @@ -17646,122 +18907,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::frame_support::storage::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()) + } } } } @@ -18327,12 +19616,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"; @@ -18416,259 +19706,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()) + } } } } @@ -19137,97 +20486,101 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - #[doc = " Information regarding the vesting of a given account."] - pub async fn vesting( - &self, - _0: &::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, - >, - >, - >, - ::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()) + #[doc = " Information regarding the vesting of a given account."] pub fn vesting (& self , _0 : & 'a :: subxt :: sp_core :: crypto :: AccountId32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: 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 > > > , :: subxt :: BasicError > > + 'a{ + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } } @@ -19401,10 +20754,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, + 96u8, 220u8, 198u8, 162u8, 128u8, 145u8, 82u8, 103u8, 90u8, + 159u8, 59u8, 38u8, 41u8, 165u8, 27u8, 171u8, 84u8, 90u8, + 111u8, 149u8, 97u8, 172u8, 194u8, 120u8, 29u8, 137u8, 217u8, + 196u8, 100u8, 173u8, 249u8, 112u8, ] { let call = Batch { calls }; @@ -19448,10 +20801,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, + 137u8, 143u8, 249u8, 220u8, 161u8, 81u8, 157u8, 182u8, 180u8, + 230u8, 79u8, 241u8, 151u8, 121u8, 92u8, 236u8, 151u8, 156u8, + 107u8, 64u8, 217u8, 6u8, 85u8, 47u8, 169u8, 103u8, 254u8, + 3u8, 119u8, 160u8, 93u8, 160u8, ] { let call = AsDerivative { @@ -19498,10 +20851,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, + 186u8, 170u8, 159u8, 28u8, 59u8, 46u8, 156u8, 115u8, 43u8, + 223u8, 49u8, 82u8, 127u8, 171u8, 14u8, 168u8, 222u8, 12u8, + 177u8, 3u8, 217u8, 3u8, 35u8, 74u8, 205u8, 126u8, 41u8, + 179u8, 43u8, 92u8, 41u8, 246u8, ] { let call = BatchAll { calls }; @@ -19542,10 +20895,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, + 164u8, 214u8, 87u8, 119u8, 129u8, 210u8, 4u8, 212u8, 88u8, + 178u8, 202u8, 235u8, 22u8, 146u8, 228u8, 84u8, 27u8, 255u8, + 91u8, 121u8, 220u8, 93u8, 215u8, 9u8, 176u8, 86u8, 165u8, + 195u8, 84u8, 119u8, 202u8, 60u8, ] { let call = DispatchAs { @@ -19592,10 +20945,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, + 228u8, 194u8, 143u8, 13u8, 10u8, 138u8, 18u8, 167u8, 246u8, + 27u8, 121u8, 230u8, 7u8, 242u8, 174u8, 207u8, 47u8, 41u8, + 198u8, 114u8, 18u8, 159u8, 229u8, 112u8, 217u8, 53u8, 46u8, + 130u8, 122u8, 108u8, 40u8, 184u8, ] { let call = ForceBatch { calls }; @@ -20819,162 +22172,184 @@ 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."] #[doc = ""] #[doc = " The first item is the deposit, the second is a vector of the accounts."] #[doc = ""] - #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub async fn subs_of( - &self, - _0: &::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()) + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn subs_of (& self , _0 : & 'a :: subxt :: sp_core :: crypto :: AccountId32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: core :: result :: Result < (:: core :: primitive :: u128 , runtime_types :: frame_support :: storage :: 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."] @@ -20982,69 +22357,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::frame_support::storage::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()) + } } } } @@ -21376,10 +22764,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, + 34u8, 146u8, 24u8, 78u8, 15u8, 255u8, 100u8, 225u8, 16u8, + 165u8, 147u8, 145u8, 68u8, 166u8, 249u8, 152u8, 96u8, 89u8, + 142u8, 200u8, 234u8, 137u8, 106u8, 107u8, 223u8, 59u8, 32u8, + 235u8, 8u8, 154u8, 165u8, 5u8, ] { let call = Proxy { @@ -21862,10 +23250,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, 19u8, 80u8, 126u8, 166u8, 73u8, 159u8, 182u8, 41u8, + 126u8, 173u8, 226u8, 96u8, 199u8, 108u8, 137u8, 246u8, 105u8, + 237u8, 25u8, 5u8, 71u8, 215u8, 141u8, 253u8, 221u8, 55u8, + 232u8, 136u8, 19u8, 33u8, 97u8, ] { let call = ProxyAnnounced { @@ -21996,137 +23384,125 @@ pub mod api { Self { client } } #[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( - &self, - _0: &::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, - >, - >, - ::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()) + #[doc = " which are being delegated to, together with the amount held on deposit."] pub fn proxies (& self , _0 : & 'a :: subxt :: sp_core :: crypto :: AccountId32 , block_hash : :: core :: option :: Option < T :: Hash > ,) -> impl :: core :: future :: Future < Output = :: 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 > > , :: 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( - &self, - _0: &::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, - >, - >, - ::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()) + #[doc = " The announcements made by the proxy (key)."] pub fn announcements (& 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 :: frame_support :: storage :: 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 > > + 'a{ + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = 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()) + } } } } @@ -22422,10 +23798,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, + 234u8, 18u8, 215u8, 21u8, 178u8, 197u8, 149u8, 249u8, 172u8, + 155u8, 96u8, 5u8, 99u8, 116u8, 206u8, 22u8, 38u8, 69u8, + 221u8, 252u8, 219u8, 133u8, 89u8, 22u8, 174u8, 50u8, 14u8, + 28u8, 220u8, 112u8, 191u8, 66u8, ] { let call = AsMultiThreshold1 { @@ -22514,10 +23890,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, + 156u8, 134u8, 252u8, 98u8, 76u8, 7u8, 5u8, 70u8, 20u8, 111u8, + 185u8, 52u8, 227u8, 202u8, 231u8, 222u8, 76u8, 58u8, 71u8, + 224u8, 41u8, 46u8, 157u8, 187u8, 132u8, 135u8, 147u8, 171u8, + 88u8, 166u8, 220u8, 2u8, ] { let call = AsMulti { @@ -22796,120 +24172,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 + == [ + 132u8, 21u8, 107u8, 172u8, 108u8, 16u8, 164u8, 145u8, + 91u8, 249u8, 151u8, 196u8, 102u8, 27u8, 209u8, 150u8, + 8u8, 64u8, 126u8, 68u8, 119u8, 204u8, 14u8, 127u8, 226u8, + 145u8, 147u8, 39u8, 101u8, 53u8, 41u8, 54u8, + ] + { + 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 + == [ + 132u8, 21u8, 107u8, 172u8, 108u8, 16u8, 164u8, 145u8, + 91u8, 249u8, 151u8, 196u8, 102u8, 27u8, 209u8, 150u8, + 8u8, 64u8, 126u8, 68u8, 119u8, 204u8, 14u8, 127u8, 226u8, + 145u8, 147u8, 39u8, 101u8, 53u8, 41u8, 54u8, + ] + { + client.storage().iter(block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } } @@ -23689,181 +25099,211 @@ 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( - &self, - _0: &::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, - >, - >, - ::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()) + #[doc = " The description of each bounty."] pub fn bounty_descriptions (& 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 :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > > , :: subxt :: BasicError > > + 'a{ + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = client.metadata(); + let metadata = locked_metadata.read(); + match metadata.storage_hash::() { + Ok(hash) => hash, + Err(e) => return Err(e.into()), + } + }; + if runtime_storage_hash + == [ + 41u8, 78u8, 19u8, 48u8, 241u8, 95u8, 175u8, 69u8, 236u8, + 54u8, 84u8, 58u8, 69u8, 28u8, 20u8, 20u8, 214u8, 138u8, + 163u8, 252u8, 239u8, 116u8, 171u8, 136u8, 0u8, 159u8, + 192u8, 51u8, 191u8, 160u8, 131u8, 123u8, + ] + { + let entry = BountyDescriptions(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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::frame_support::storage::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()) + } } } } @@ -24770,262 +26210,317 @@ 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( - &self, - _0: &::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, - >, - >, - ::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()) + #[doc = " The description of each child-bounty."] pub fn child_bounty_descriptions (& 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 :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > > , :: subxt :: BasicError > > + 'a{ + let client = self.client; + async move { + let runtime_storage_hash = { + let locked_metadata = client.metadata(); + let metadata = locked_metadata.read(); + match metadata.storage_hash::() { + Ok(hash) => hash, + Err(e) => return Err(e.into()), + } + }; + if runtime_storage_hash + == [ + 20u8, 134u8, 50u8, 207u8, 242u8, 159u8, 242u8, 22u8, + 76u8, 80u8, 193u8, 247u8, 73u8, 51u8, 113u8, 241u8, + 186u8, 26u8, 227u8, 44u8, 122u8, 189u8, 171u8, 137u8, + 31u8, 103u8, 184u8, 129u8, 31u8, 98u8, 19u8, 60u8, + ] + { + let entry = ChildBountyDescriptions(_0); + client.storage().fetch(&entry, block_hash).await + } else { + Err(::subxt::MetadataError::IncompatibleMetadata.into()) + } } } #[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()) + } } } } @@ -25588,122 +27083,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()) + } } } } @@ -25957,10 +27484,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 { @@ -26088,10 +27615,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 { @@ -26341,156 +27868,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."] @@ -26502,31 +28067,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"] @@ -26534,27 +28106,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 :: frame_support :: storage :: 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."] @@ -26563,24 +28138,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."] @@ -26590,61 +28171,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()) + } } } } @@ -26817,34 +28414,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"] @@ -26878,7 +28447,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> @@ -26888,10 +28459,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, + 171u8, 227u8, 51u8, 2u8, 122u8, 0u8, 152u8, 105u8, 139u8, + 207u8, 197u8, 18u8, 200u8, 234u8, 28u8, 175u8, 222u8, 195u8, + 76u8, 21u8, 241u8, 148u8, 146u8, 114u8, 73u8, 43u8, 188u8, + 64u8, 3u8, 154u8, 109u8, 135u8, ] { let pallet = metadata.pallet("ElectionProviderMultiPhase")?; @@ -27080,34 +28651,6 @@ 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()) - } - } } } } @@ -27299,145 +28842,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 + == [ + 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); + 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 + == [ + 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, + ] + { + 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()) + } } } } @@ -29698,27 +31284,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."] @@ -29727,56 +31316,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()) + } } } } @@ -29852,97 +31451,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()) + } } } } @@ -30077,154 +31693,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()) + } } } } @@ -30346,59 +32010,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()) + } } } } @@ -30489,63 +32171,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"] @@ -30556,70 +32246,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."] @@ -30628,31 +32330,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."] @@ -30660,27 +32369,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()) + } } } } @@ -31451,415 +33163,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."] @@ -31868,154 +33623,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."] @@ -32027,33 +33807,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."] @@ -32065,29 +33853,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"] @@ -32099,33 +33895,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"] @@ -32137,326 +33941,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()) + } } } } @@ -32609,28 +34491,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."] @@ -32639,27 +34531,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()) + } } } } @@ -32735,65 +34630,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."] @@ -32803,32 +34697,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."] @@ -32838,29 +34739,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()) + } } } } @@ -33125,34 +35034,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."] @@ -33161,29 +35075,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`."] @@ -33197,34 +35119,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`."] @@ -33238,29 +35165,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."] @@ -33268,33 +35203,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"] @@ -33302,122 +35244,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()) + } } } } @@ -34051,24 +36024,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."] @@ -34077,178 +36056,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"] @@ -34258,29 +36284,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"] @@ -34290,178 +36326,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."] @@ -34477,34 +36559,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."] @@ -34520,147 +36609,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"] @@ -34669,39 +36794,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"] @@ -34710,29 +36840,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()) + } } } } @@ -34777,6 +36915,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, } @@ -34786,124 +36936,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()) + } } } } @@ -35113,146 +37352,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"] @@ -35260,31 +37539,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"] @@ -35292,62 +37579,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()) + } } } } @@ -35709,27 +38009,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"; @@ -35786,154 +38086,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()) + } } } } @@ -36190,7 +38512,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"; @@ -36199,15 +38523,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"; @@ -36257,39 +38580,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."] @@ -36308,29 +38636,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()) + } } } } @@ -36601,12 +38937,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"; @@ -36617,30 +38952,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"; @@ -36648,37 +38985,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"; @@ -36743,31 +39077,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."] @@ -36775,154 +39116,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()) + } } } } @@ -37554,91 +39935,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"; @@ -37701,151 +40091,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()) + } } } } @@ -38922,413 +41349,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::frame_support::storage::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()) + } } } } @@ -46730,52 +49264,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, + }, } } } @@ -46819,7 +49354,7 @@ pub mod api { )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { - # [codec (index = 0)] # [doc = "Someone claimed some DOTs. `[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, @@ -47049,58 +49584,66 @@ pub mod api { #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] - #[doc = "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( @@ -47184,17 +49727,19 @@ pub mod api { #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { #[codec(index = 0)] - Registered( - 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( @@ -47265,20 +49810,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, + }, } } } @@ -50358,10 +52904,9 @@ 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, + 138u8, 44u8, 241u8, 81u8, 66u8, 22u8, 38u8, 18u8, 78u8, 99u8, 77u8, + 111u8, 182u8, 63u8, 127u8, 77u8, 179u8, 115u8, 6u8, 86u8, 45u8, 66u8, + 251u8, 170u8, 67u8, 68u8, 3u8, 131u8, 135u8, 252u8, 187u8, 168u8, ] { Err(::subxt::MetadataError::IncompatibleMetadata) From 57321c9451223ad92960245c8e5df60da07f1559 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 17 Jun 2022 18:09:11 +0300 Subject: [PATCH 36/37] Move test under `testing` folder Signed-off-by: Alexandru Vasile --- integration-tests/Cargo.toml | 36 -- integration-tests/src/client/mod.rs | 133 ------- integration-tests/src/lib.rs | 38 -- integration-tests/src/metadata/validation.rs | 340 ------------------ testing/integration-tests/Cargo.toml | 3 + .../src/codegen/codegen_documentation.rs | 0 6 files changed, 3 insertions(+), 547 deletions(-) delete mode 100644 integration-tests/Cargo.toml delete mode 100644 integration-tests/src/client/mod.rs delete mode 100644 integration-tests/src/lib.rs delete mode 100644 integration-tests/src/metadata/validation.rs rename {integration-tests => testing/integration-tests}/src/codegen/codegen_documentation.rs (100%) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml deleted file mode 100644 index 6cb4910215..0000000000 --- a/integration-tests/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "subxt-integration" -version = "0.21.0" -authors = ["Parity Technologies "] -edition = "2021" - -license = "GPL-3.0" -readme = "../README.md" -repository = "https://github.com/paritytech/subxt" -documentation = "https://docs.rs/subxt" -homepage = "https://www.parity.io/" -description = "Subxt integration tests that rely on the Substrate binary" - -[features] -default = ["subxt/integration-tests"] - -[dev-dependencies] -assert_matches = "1.5.0" -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } -frame-metadata = "15.0.0" -futures = "0.3.13" -hex = "0.4.3" -regex = "1.5" -scale-info = { version = "2.0.0", features = ["bit-vec"] } -sp-core = { version = "6.0.0", default-features = false } -sp-keyring = "6.0.0" -sp-runtime = "6.0.0" -subxt = { version = "0.21.0", path = "../subxt" } -subxt-codegen = { version = "0.21.0", path = "../codegen" } -syn = "1.0.58" -test-runtime = { path = "../test-runtime" } -tokio = { version = "1.8", features = ["macros", "time"] } -tracing = "0.1.34" -tracing-subscriber = "0.3.11" -wabt = "0.10.0" -which = "4.0.2" diff --git a/integration-tests/src/client/mod.rs b/integration-tests/src/client/mod.rs deleted file mode 100644 index 050ef2e32b..0000000000 --- a/integration-tests/src/client/mod.rs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - test_node_process, - test_node_process_with, - utils::node_runtime::system, -}; - -use sp_core::storage::{ - well_known_keys, - StorageKey, -}; -use sp_keyring::AccountKeyring; - -#[tokio::test] -async fn insert_key() { - let test_node_process = test_node_process_with(AccountKeyring::Bob).await; - let client = test_node_process.client(); - let public = AccountKeyring::Alice.public().as_array_ref().to_vec(); - client - .rpc() - .insert_key( - "aura".to_string(), - "//Alice".to_string(), - public.clone().into(), - ) - .await - .unwrap(); - assert!(client - .rpc() - .has_key(public.clone().into(), "aura".to_string()) - .await - .unwrap()); -} - -#[tokio::test] -async fn fetch_block_hash() { - let node_process = test_node_process().await; - node_process.client().rpc().block_hash(None).await.unwrap(); -} - -#[tokio::test] -async fn fetch_block() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client.rpc().block(block_hash).await.unwrap(); -} - -#[tokio::test] -async fn fetch_read_proof() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.rpc().block_hash(None).await.unwrap(); - client - .rpc() - .read_proof( - vec![ - StorageKey(well_known_keys::HEAP_PAGES.to_vec()), - StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), - ], - block_hash, - ) - .await - .unwrap(); -} - -#[tokio::test] -async fn chain_subscribe_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_blocks().await.unwrap(); - blocks.next().await.unwrap().unwrap(); -} - -#[tokio::test] -async fn chain_subscribe_finalized_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.rpc().subscribe_finalized_blocks().await.unwrap(); - blocks.next().await.unwrap().unwrap(); -} - -#[tokio::test] -async fn fetch_keys() { - let node_process = test_node_process().await; - let client = node_process.client(); - let keys = client - .storage() - .fetch_keys::(4, None, None) - .await - .unwrap(); - assert_eq!(keys.len(), 4) -} - -#[tokio::test] -async fn test_iter() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut iter = client - .storage() - .iter::(None) - .await - .unwrap(); - let mut i = 0; - while iter.next().await.unwrap().is_some() { - i += 1; - } - assert_eq!(i, 13); -} - -#[tokio::test] -async fn fetch_system_info() { - let node_process = test_node_process().await; - let client = node_process.client(); - assert_eq!(client.rpc().system_chain().await.unwrap(), "Development"); - assert_eq!(client.rpc().system_name().await.unwrap(), "Substrate Node"); - assert!(!client.rpc().system_version().await.unwrap().is_empty()); -} diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs deleted file mode 100644 index 64c30c83eb..0000000000 --- a/integration-tests/src/lib.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -#![deny(unused_crate_dependencies)] - -#[cfg(test)] -mod codegen; -#[cfg(test)] -mod utils; - -#[cfg(test)] -mod client; -#[cfg(test)] -mod events; -#[cfg(test)] -mod frame; -#[cfg(test)] -mod metadata; -#[cfg(test)] -mod storage; - -#[cfg(test)] -use test_runtime::node_runtime; -#[cfg(test)] -use utils::*; diff --git a/integration-tests/src/metadata/validation.rs b/integration-tests/src/metadata/validation.rs deleted file mode 100644 index 47a2eb034c..0000000000 --- a/integration-tests/src/metadata/validation.rs +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - test_context, - TestContext, -}; -use frame_metadata::{ - ExtrinsicMetadata, - PalletCallMetadata, - PalletMetadata, - PalletStorageMetadata, - RuntimeMetadataPrefixed, - RuntimeMetadataV14, - StorageEntryMetadata, - StorageEntryModifier, - StorageEntryType, -}; -use scale_info::{ - build::{ - Fields, - Variants, - }, - meta_type, - Path, - Type, - TypeInfo, -}; -use subxt::{ - ClientBuilder, - DefaultConfig, - Metadata, - SubstrateExtrinsicParams, -}; - -use crate::utils::node_runtime; - -type RuntimeApi = - node_runtime::RuntimeApi>; - -async fn metadata_to_api(metadata: RuntimeMetadataV14, cxt: &TestContext) -> RuntimeApi { - let prefixed = RuntimeMetadataPrefixed::from(metadata); - let metadata = Metadata::try_from(prefixed).unwrap(); - - ClientBuilder::new() - .set_url(cxt.node_proc.ws_url().to_string()) - .set_metadata(metadata) - .build() - .await - .unwrap() - .to_runtime_api::, - >>() -} - -#[tokio::test] -async fn full_metadata_check() { - let cxt = test_context().await; - let api = &cxt.api; - - // Runtime metadata is identical to the metadata used during API generation. - assert!(api.validate_metadata().is_ok()); - - // Modify the metadata. - let mut metadata: RuntimeMetadataV14 = { - let locked_client_metadata = api.client.metadata(); - let client_metadata = locked_client_metadata.read(); - client_metadata.runtime_metadata().clone() - }; - metadata.pallets[0].name = "NewPallet".to_string(); - - let new_api = metadata_to_api(metadata, &cxt).await; - assert_eq!( - new_api - .validate_metadata() - .err() - .expect("Validation should fail for incompatible metadata"), - ::subxt::MetadataError::IncompatibleMetadata - ); -} - -#[tokio::test] -async fn constants_check() { - let cxt = test_context().await; - let api = &cxt.api; - - // Ensure that `ExistentialDeposit` is compatible before altering the metadata. - assert!(cxt.api.constants().balances().existential_deposit().is_ok()); - - // Modify the metadata. - let mut metadata: RuntimeMetadataV14 = { - let locked_client_metadata = api.client.metadata(); - let client_metadata = locked_client_metadata.read(); - client_metadata.runtime_metadata().clone() - }; - - let mut existential = metadata - .pallets - .iter_mut() - .find(|pallet| pallet.name == "Balances") - .expect("Metadata must contain Balances pallet") - .constants - .iter_mut() - .find(|constant| constant.name == "ExistentialDeposit") - .expect("ExistentialDeposit constant must be present"); - existential.value = vec![0u8; 32]; - - let new_api = metadata_to_api(metadata, &cxt).await; - - assert!(new_api.validate_metadata().is_err()); - assert!(new_api - .constants() - .balances() - .existential_deposit() - .is_err()); - - // Other constant validation should not be impacted. - assert!(new_api.constants().balances().max_locks().is_ok()); -} - -fn default_pallet() -> PalletMetadata { - PalletMetadata { - name: "Test", - storage: None, - calls: None, - event: None, - constants: vec![], - error: None, - index: 0, - } -} - -fn pallets_to_metadata(pallets: Vec) -> RuntimeMetadataV14 { - RuntimeMetadataV14::new( - pallets, - ExtrinsicMetadata { - ty: meta_type::<()>(), - version: 0, - signed_extensions: vec![], - }, - meta_type::<()>(), - ) -} - -#[tokio::test] -async fn calls_check() { - let cxt = test_context().await; - - // Ensure that `Unbond` and `WinthdrawUnbonded` calls are compatible before altering the metadata. - assert!(cxt.api.tx().staking().unbond(123_456_789_012_345).is_ok()); - assert!(cxt.api.tx().staking().withdraw_unbonded(10).is_ok()); - - // Reconstruct the `Staking` call as is. - struct CallRec; - impl TypeInfo for CallRec { - type Identity = Self; - fn type_info() -> Type { - Type::builder() - .path(Path::new("Call", "pallet_staking::pallet::pallet")) - .variant( - Variants::new() - .variant("unbond", |v| { - v.index(0).fields(Fields::named().field(|f| { - f.compact::() - .name("value") - .type_name("BalanceOf") - })) - }) - .variant("withdraw_unbonded", |v| { - v.index(1).fields(Fields::named().field(|f| { - f.ty::().name("num_slashing_spans").type_name("u32") - })) - }), - ) - } - } - let pallet = PalletMetadata { - name: "Staking", - calls: Some(PalletCallMetadata { - ty: meta_type::(), - }), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_ok()); - assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); - - // Change `Unbond` call but leave the rest as is. - struct CallRecSecond; - impl TypeInfo for CallRecSecond { - type Identity = Self; - fn type_info() -> Type { - Type::builder() - .path(Path::new("Call", "pallet_staking::pallet::pallet")) - .variant( - Variants::new() - .variant("unbond", |v| { - v.index(0).fields(Fields::named().field(|f| { - // Is of type u32 instead of u128. - f.compact::().name("value").type_name("BalanceOf") - })) - }) - .variant("withdraw_unbonded", |v| { - v.index(1).fields(Fields::named().field(|f| { - f.ty::().name("num_slashing_spans").type_name("u32") - })) - }), - ) - } - } - let pallet = PalletMetadata { - name: "Staking", - calls: Some(PalletCallMetadata { - ty: meta_type::(), - }), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - // Unbond call should fail, while withdraw_unbonded remains compatible. - assert!(new_api.tx().staking().unbond(123_456_789_012_345).is_err()); - assert!(new_api.tx().staking().withdraw_unbonded(10).is_ok()); -} - -#[tokio::test] -async fn storage_check() { - let cxt = test_context().await; - - // Ensure that `ExtrinsicCount` and `EventCount` storages are compatible before altering the metadata. - assert!(cxt - .api - .storage() - .system() - .extrinsic_count(None) - .await - .is_ok()); - assert!(cxt - .api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); - - // Reconstruct the storage. - let storage = PalletStorageMetadata { - prefix: "System", - entries: vec![ - StorageEntryMetadata { - name: "ExtrinsicCount", - modifier: StorageEntryModifier::Optional, - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - StorageEntryMetadata { - name: "AllExtrinsicsLen", - modifier: StorageEntryModifier::Optional, - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - ], - }; - let pallet = PalletMetadata { - name: "System", - storage: Some(storage), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api - .storage() - .system() - .extrinsic_count(None) - .await - .is_ok()); - assert!(new_api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); - - // Reconstruct the storage while modifying ExtrinsicCount. - let storage = PalletStorageMetadata { - prefix: "System", - entries: vec![ - StorageEntryMetadata { - name: "ExtrinsicCount", - modifier: StorageEntryModifier::Optional, - // Previously was u32. - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - StorageEntryMetadata { - name: "AllExtrinsicsLen", - modifier: StorageEntryModifier::Optional, - ty: StorageEntryType::Plain(meta_type::()), - default: vec![0], - docs: vec![], - }, - ], - }; - let pallet = PalletMetadata { - name: "System", - storage: Some(storage), - ..default_pallet() - }; - let metadata = pallets_to_metadata(vec![pallet]); - let new_api = metadata_to_api(metadata, &cxt).await; - assert!(new_api - .storage() - .system() - .extrinsic_count(None) - .await - .is_err()); - assert!(new_api - .storage() - .system() - .all_extrinsics_len(None) - .await - .is_ok()); -} diff --git a/testing/integration-tests/Cargo.toml b/testing/integration-tests/Cargo.toml index e17299c889..fc02698fcb 100644 --- a/testing/integration-tests/Cargo.toml +++ b/testing/integration-tests/Cargo.toml @@ -20,11 +20,14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = frame-metadata = "15.0.0" futures = "0.3.13" hex = "0.4.3" +regex = "1.5.0" scale-info = { version = "2.0.0", features = ["bit-vec"] } sp-core = { version = "6.0.0", default-features = false } sp-keyring = "6.0.0" sp-runtime = "6.0.0" +syn = "1.0.0" subxt = { version = "0.21.0", path = "../../subxt" } +subxt-codegen = { version = "0.21.0", path = "../../codegen" } test-runtime = { path = "../test-runtime" } tokio = { version = "1.8", features = ["macros", "time"] } tracing = "0.1.34" diff --git a/integration-tests/src/codegen/codegen_documentation.rs b/testing/integration-tests/src/codegen/codegen_documentation.rs similarity index 100% rename from integration-tests/src/codegen/codegen_documentation.rs rename to testing/integration-tests/src/codegen/codegen_documentation.rs From 293a90a9a9a4a4b8e53e958c418ec4e42620d361 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Fri, 17 Jun 2022 20:03:46 +0300 Subject: [PATCH 37/37] Update testing/integration-tests/src/codegen/codegen_documentation.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> --- testing/integration-tests/src/codegen/codegen_documentation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/integration-tests/src/codegen/codegen_documentation.rs b/testing/integration-tests/src/codegen/codegen_documentation.rs index 0968a32b84..e64104607a 100644 --- a/testing/integration-tests/src/codegen/codegen_documentation.rs +++ b/testing/integration-tests/src/codegen/codegen_documentation.rs @@ -60,7 +60,7 @@ fn generate_runtime_interface() -> String { let metadata: frame_metadata::RuntimeMetadataPrefixed = codec::Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata"); - // Generate a runtime interface form the provided metadata. + // Generate a runtime interface from the provided metadata. let generator = RuntimeGenerator::new(metadata); let item_mod = syn::parse_quote!( pub mod api {}